// JavaScript Document

String.prototype.trim=function(){
  var x=this;
  x=x.replace(/^\s*(.*)/,"$1");
  x=x.replace(/(.*?)\s*$/,"$1");
  return x;
}

function openWindow(filename,WindowName,w,h,strFeatures) { 		
	var sw=screen.width/2;
	var sh=(screen.height/2)-50;
	window.open(filename,WindowName,'top='+(sh-(h/2))+',left='+(sw-(w/2))+',location=0,status=0,scrollbars=0,width='+w+',height='+h+','+strFeatures+' ');
}

function play(clip){
	window.open("popups/play.php?clip="+clip,"iPlay","width=450,height=350,status = no ,toolbar = no ,resizable = no");
}

function ShowBanner(myDivName,myWidth,myHeight,myHeader,myBanner,RefX,RefY) {
	var wres = (screen.width - myWidth)/2;
	var hres = (screen.height - myHeight)/2;
	document.getElementById('idInformationDataHeader')
	document.getElementById('idInformationDataHeader').innerHTML = '<b>'+myHeader+'</b>';
	document.getElementById('idInformationData').innerHTML='<img src="'+myBanner+'" width="'+myWidth+'" height="'+myHeight+'" border="0">';
	document.getElementById(myDivName).style.display=''; 
	document.getElementById(myDivName).style.left = document.body.scrollLeft + wres;
	document.getElementById(myDivName).style.top= document.body.scrollTop + hres - 100;
	//document.getElementById(myDivName).style.left = document.body.scrollLeft + window.event.clientX + RefX;	
	//document.getElementById(myDivName).style.top= document.body.scrollTop+ window.event.clientY + RefY;
}

function closeAd(){
	document.getElementById('divBannerWindow').style.display='none'; 	
}

function checkNumber(e) {
	if(navigator.userAgent.indexOf("Firefox")==-1){ //for IE
		e_k=event.keyCode
		if (e_k != 13 && (e_k < 48) || (e_k > 57)) {
			if(e_k==46){ return true; }
			event.returnValue = false;
		}
	}else{ 
		keyPressed = e.which;
		if (keyPressed != 13 && (keyPressed < 48) || (keyPressed > 57)) {
			if(keyPressed==46){ return true; }
				return false;
		}
	}
}