// JavaScript Document
windowsize = function() {
	var w = 0;
	var h = 0;
	var sl = 0;
	var st = 0;

	//IE
	if(!window.innerWidth)
	{
		//strict mode
		if(!(document.documentElement.clientWidth == 0))
		{
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}
		//quirks mode
		else
		{
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
	}
	//w3c
	else
	{
		w = window.innerWidth;
		h = window.innerHeight;
	}
	
	
	
	if (!document.documentElement.scrollTop) {
		sl = document.body.scrollLeft;
		st = document.body.scrollTop;
	} else {
		sl = document.documentElement.scrollLeft;
		st = document.documentElement.scrollTop;
	} 
	
	return {width:w,height:h,scrollLeft:sl,scrollTop:st};
}

function IsNumeric(sText)

{
var ValidChars = "0123456789.";
var IsNumber=true;
var Char;


for (var i = 0; i < sText.length && IsNumber == true; i++) 
  { 
  Char = sText.charAt(i); 
  if (ValidChars.indexOf(Char) == -1) 
     {
     IsNumber = false;
     }
  }
return IsNumber;

}

function positionPopup(id) {
	if(windowsize().width > 613) {
		document.getElementById(id).style.left = (windowsize().width - 613)/2 + 'px';
	} else {
		document.getElementById(id).style.left = 0 + 'px';
	}
	if(windowsize().height > 350) {
		document.getElementById(id).style.top = ((windowsize().height - 300)/2) + document.body.scrollTop + 'px';
		//document.getElementById(id).style.top = (windowsize().scrollTop + 100) + 'px';
	} else {
		document.getElementById(id).style.top = 0;
	}
	
	
	return true;
}
