function goTo(word,to)
{
 var where_to= confirm("Do you really want to "+ word +"?");
 if (where_to== true)
 {
   window.location=to;
 }
 else
 {
   
  }
} 
 
function ask(question,def,res)
{
var name=prompt(question,def);
if (name!=null && name!="")
  {
	  window.location.href=res + name; 
  }
} 

 function getItem(id,divx) {
    var xmlHttp=null;
    try
    { xmlHttp=new XMLHttpRequest(); } 
	catch (e)
    { try
		{  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");	} 
		catch (e)
 		{	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");  }
    }
	
	xmlHttp.onreadystatechange= function(){
	   document.getElementById(divx).innerHTML = "Please wait...";
	   if (xmlHttp.readyState==4)  
       {
           var resultValue = xmlHttp.responseText;  
		   if(resultValue == ",") {
		     document.getElementById(divx).innerHTML = "not found !!"; 
		   } else { 
		     document.getElementById(divx).innerHTML = resultValue;
		   }
       } else {
	     document.getElementById(divx).innerHTML = "Please wait..."; 
	   } 
	};
    xmlHttp.open("GET","admin.invoice.php?getpromo="+id,true);
    xmlHttp.send(null);
 }
 
 
 function checkUname(uname,divalert) {
    var xmlHttp=null;
    try
    { xmlHttp=new XMLHttpRequest(); } 
	catch (e)
    { try
		{  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");	} 
		catch (e)
 		{	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");  }
    }
	
	xmlHttp.onreadystatechange= function(){
	   document.getElementById(divalert).innerHTML = "checking availability..";
	   if (xmlHttp.readyState==4)  
       {
           var resultValue = xmlHttp.responseText;  
		   var insert=null;
		   if(resultValue == ",") {
		     document.getElementById(divalert).innerHTML = "<font color=\"green\">Available</font>"; 
		   } else { 
				if(resultValue=="Available"){
					 document.getElementById(divalert).innerHTML = '<font color="green"><small><strong>' + uname + '</strong> is available</small></font><input type="hidden" id="cek" name="cek" value="no">';
					  document.getElementById('tombol_a').style.display="block";
					    document.getElementById('tombol_b').style.display="none";
				}else{
					 document.getElementById(divalert).innerHTML = '<font color="red"><small><strong>' + uname + '</strong> is not available</small></font>';
					document.getElementById('tombol_a').style.display="none";
					document.getElementById('tombol_b').style.display="block";
				}
		   }
       } else {
	     document.getElementById(divalert).innerHTML = "Please wait..."; 
	   } 
	};
    xmlHttp.open("GET","signup.php?check="+uname,true);
    xmlHttp.send(null);
 }
 
 
  
<!--
/****************************************************
popup
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// --> 
 
 
 
