                                                                                                                                   
            function winpopcenter(w,h,u,n){
		
                function winWid(){ return ( (ns4||ns6) ? window.innerWidth:document.body.clientWidth ); }
                function winHei(){ return (ns4||ns6) ? window.innerHeight:document.body.clientHeight; }
                function centerX(){ return (ns4||ns6) ? parseInt((screen.width/2)-(width/2)):parseInt((screen.availWidth/2)-(width/2)); }
                function centerY(){ return (ns4||ns6) ? parseInt((screen.height/2)-(height/2)):parseInt((screen.availHeight/2)-(height/2)); }
                var ns4 = (document.layers) ? 1 : 0;
                var ie4 = (document.all) ? 1 : 0;
                var ns6 = (document.getElementById && !document.all) ? 1 : 0;
                var width=winWid();
                var height=winHei();
                var difx=w-winWid();
                var dify=h-winHei();
                width+=(difx);
                height+=(dify);
               window.open(u,"_blank","HEIGHT="+h+",WIDTH="+w+",dependent=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,menubar=no,left="+centerX()+",top="+centerY());
            }

function putAlp1(){
		document.formheader.Alp.value = 1;
		document.formheader.submit();
}


function confirm_p(message){

//used to as confirmation popup
		
		ok=confirm(message);
		if(ok==true){
				return true;
			 }
			else{
				return false;
			}

}

//dummy function
function dummy() { }

//this is used in  popups to pop up pages
//e.g <a  href="javascript:dummy();" onclick="javascript:winpop(850,600,'http://80.120.147.30/TOOLS/MAPSERVER_CATALOG/index.php?set_id=4&savemap=1')"  onMouseover="window.status='Run GIS MAP/SERVER'; return true">Run</a>

function winpop(w,h,u){
//input width,height,url
//output : popup window

		var winref = window.open(u,"_blank","HEIGHT="+h+",WIDTH="+w+",toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,menubar=no,left=0,top=0");
		winref.focus();
		}


		

imgl="/GIF/button_l.gif";
imgr="/GIF/button_r.gif";
imgbg='/GIF/button_c.gif';
width="10";
height="20";


function createbutton(name,action,width,height){
//function used to create a button
//input: button text,action
//output :button	
//example of use
//<!--#include virtual="/SCRIPTS/button.js"-->
//<SCRIPT LANGUAGE=JAVASCRIPT>createbutton('back','javascript:window.close();',10,20);<//SCRIPT> 

	
button="<table height='20' border='0' cellspacing='0' cellpadding='0'>" +
			"<tr>" +
				"<td>" +
					"<img src='"+imgl +"'  width='"+width +"' height='"+height +"' border='0'><br>" +
				"<td style='background-image=url(" +imgbg +")' background='"+imgbg +"' >" +
					"<a href=\""+ action +"\"  onMouseover=\"window.status='"+ name +"'; return true\" >"+ name+"</a><br>" +
				"<td>" +
					"<img src='"+imgr +"'  width='"+ width +"' height='"+ height +"' border='0'><br>" +
			 
"</table>";

//write the button
document.write(button);

		
}