// JavaScript Document
	function addLoadEvent(func) 
	{ 
		var oldonload = window.onload; 
		if (typeof window.onload != 'function') 
		{ 
			window.onload = func; 
		} 
		else 
		{ 
			window.onload = function() { oldonload(); func; } 
		} 
	}

//open pop-up
function OpenWindow(url, w, h)
	{
		window.showModalDialog(url, this, 'center:yes; help:no; resizable:yes; status:no; dialogHeight:' + h + 'px; dialogWidth:' + w + 'px;');
	}
	
//check numeric
function IsNumeric(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;   
   }
	 
function RemoveBad(strTemp) { 
    strTemp = strTemp.replace(/\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-/g,""); 
    return strTemp;
} 	 

// http://kevin.vanzonneveld.net
// +   original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
// +   improved by: Waldo Malqui Silva
// +   bugfixed by: Onno Marsman
// +   improved by: Robin
// *     example 1: ucwords('kevin van zonneveld');
// *     returns 1: 'Kevin Van Zonneveld'
// *     example 2: ucwords('HELLO WORLD');
// *     returns 2: 'HELLO WORLD'
function ucwords_good(str) {
    return (str + '').replace(/^(.)|\s(.)/g, function ($1) {
        return $1.toUpperCase();
    });
}

function wWidth()
{
	if (window.innerWidth)
		return window.innerWidth;
	else if (document.body.clientWidth)
		return document.body.clientWidth;
	else if (document.documentElement && document.documentElement.clientWidth)
		return document.documentElement.clientWidth;
	else
		return screen.width;
}
function hHeight()
{
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
		winW = window.innerWidth-16;
		winH = window.innerHeight-16;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
		winW = document.body.offsetWidth-20;
		winH = document.body.offsetHeight-20;
	 }
	}
	return winH;
}

function sizeVideo()
{
	var m=wWidth();
	var s=document.getElementById("sidebar1");
	var x=document.getElementById("vtbl");
	var y=document.getElementById("vdiv");
	var w=((m-s.offsetWidth)-20)+"px";
	try{x.style.width=w;}catch(e){}
//side
	try{y.style.width=(s.offsetWidth-10)+"px";}catch(e){}
	try{y.style.height=760+"px";}catch(e){}
	
}

function maxWindow()
{
//window.moveTo(0,0);
if (document.all)
{
	if(screen.availWidth >= 1024){
  	  //top.window.resizeTo(1024,900);
	top.window.resizeTo(1024,screen.availHeight);
	}
}

else if (document.layers||document.getElementById)
{
	if(screen.availWidth >= 1024)
	{
	  if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
	  {
			//top.window.outerHeight = 900;
			//top.window.outerWidth = 1024;
			top.window.outerHeight = screen.availHeight;
			top.window.outerWidth = 1024;
	  }
	}
}
}

	
	
