// print
function printWindow(){
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
}

// 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=yes,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}

// go to new page
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

// ajax call

var var_ship_new = ""

function call_ajax(process,params){
	if(window.XMLHttpRequest){
		oRequest = new XMLHttpRequest();
	}
	else if(window.ActiveXObject){
		oRequest = new ActiveXObject("Microsoft.XMLHTTP");
	}

	oRequest.open("POST", "ajax.asp", true);
	oRequest.onreadystatechange = Notifyuser;

	oRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	oRequest.send("process=" + process + params);
}

// notify user

function Notifyuser(){
	if(oRequest.readyState == 4){
		if(oRequest.status == 200){
			if(oRequest.responseText.substr(0, 1)!="|") {
				document.getElementById("ajax_msg").innerHTML = oRequest.responseText + "<br>"
			}
			else{
				var amsg = Split(oRequest.responseText,"|")
				document.getElementById("ajax_msg_" + amsg[1]).innerHTML = amsg[2] + "<br>"
			}
		}
		else{
			document.getElementById("ajax_msg").innerHTML = oRequest.responseText//"Asychronous Error";
		}
		document.getElementById("ajax_msg").style.display=""
	}
} 
