function popUp(picPath,picWidth,picHeight){
	var winLeft = screen.availWidth;
	winLeft=(winLeft/2)-(picWidth/2);
	window.open("/pic.asp?picPath=" + picPath,"Informations","width=" + picWidth + ",height=" + picHeight + ",left=" + winLeft + ",top=0,menubar=0,location=0,toolbar=0,personalbar=0,status=0,resizable=1,scrollbars=0");
}

function put_pic(src,w,img){
	img.src = src;
}	

function openWin(url){
	var winWidth = 780;
	var winHeight = 433;
	var winLeft = screen.availWidth;
	winLeft=(winLeft/2)-(winWidth/2)-16;
	window.open(url,"HomeInProgress","width=" + winWidth + ",height=" + winHeight + ",left=" + winLeft + ",top=150,menubar=0,location=0,toolbar=0,personalbar=0,status=0,resizable=1,scrollbars=0");
}

function openTool(url){
	var winWidth = 440;
	var winHeight = 350;
	var winLeft = screen.availWidth;
	winLeft=(winLeft/2)-(winWidth/2)-16;
	window.open(url,"Tools","width=" + winWidth + ",height=" + winHeight + ",left=" + winLeft + ",top=0,menubar=0,location=0,toolbar=0,personalbar=0,status=0,resizable=1,scrollbars=0");
}
		
function addBookmark(title,url) {
	if (window.sidebar) { 
		window.sidebar.addPanel(title, url,""); 
	}else if( document.all ) {
		window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
		return true;
	}
}	

function trim(strText) { 
	// this will get rid of leading spaces 
	while (strText.substring(0,1) == ' ') 
		strText = strText.substring(1, strText.length);
	
	// this will get rid of trailing spaces 
	while (strText.substring(strText.length-1,strText.length) == ' ')
		strText = strText.substring(0, strText.length-1);
	
	return strText;
}

function isNum(txt){
	if (isNaN(txt.value)){                
		alert('Numbers only!');
		txt.focus();
		txt.select();
		}
}	

String.prototype.right = function (numOf) { 
	var tmp = "";
	for (i=this.length-numOf; i<this.length; i++) {
		tmp += this.charAt(i);
	}
	return tmp;
};

function validDOC(docSrc){
	var isValid=false;

	for(x=0;x<validExt.length;x++){
		if(docSrc.right(validExt[x].length)==validExt[x]){
			isValid=true;
			break;
		}
	}
	
	return isValid;
}

function swfValidDOC(docSrc){
	var isValid=false;

	for(x=0;x<swfValidExt.length;x++){
		if(docSrc.right(swfValidExt[x].length)==swfValidExt[x]){
			isValid=true;
			break;
		}
	}
	
	return isValid;
}

function submitenter(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
   myfield.form.submit();
   return false;
   }
else
   return true;
}

function showhidediv(divlayer) {
	tmp = document.getElementById(divlayer);
	if (tmp.style.display=='none')
		tmp.style.display='inline';
	else
		tmp.style.display='none';
}

function hidediv(divlayer) {
	tmp = document.getElementById(divlayer);
		tmp.style.display='none';
}

function showdiv(divlayer) {
	tmp = document.getElementById(divlayer);
		tmp.style.display='inline';
}
