var xmlhttp;
var xml_error;

var LanDir="ltr";

var lx;
var ly
var fx;
var fy;
var last_xml;
var zlevel;
zlevel=100;

var last_scroll;
var menushowid;
menushowid=-1;
var calinanswer=0;
var slidespeed=5;

// FLAGS
var flgOpenslidebar=0;
var xpostdata;
/*********************************************************************************************************************************/
function xdoPrint(title,divid){
    try{ 
        var oIframe = document.getElementById('ifrmPrint');
        var oContent = document.getElementById(divid).innerHTML;
        
        //var oDoc = (oIframe.contentWindow || oIframe.contentDocument);
        try
        	{
	        var oDoc=window.open("Globex Print");
	       	}
	    catch(err)
	    	{
	    	var oDoc = (oIframe.contentWindow || oIframe.contentDocument);
	    	}
	    	
        if (oDoc.document) oDoc = oDoc.document;        
		oDoc.write("<html><head><title>Globex-Ship.com : "+title+"</title>");
		oDoc.write("<link href='"+xCSS+"' rel='stylesheet' type='text/css'>");
		oDoc.write("<style>body         { background-color: #FFFFFF }</style>");
		oDoc.write("</head><body onload='this.focus(); this.print();'>");
		oDoc.write("<img src='images/logoprint.gif'>");		
		oDoc.write("<hr>");
		oDoc.write(oContent + "<hr>");	    
		oDoc.write("<font face='arial' style='font-size:11px'>Globex Express Freight Logistics , www.globex-ship.com , "+title);		
		oDoc.write("</body></html>");
		oDoc.close(); 	    
    }
    catch(e){
	  //  self.print();
    }
}

/*********************************************************************************************************************************/
function showtacking(countryName,desc,desc2,destinationX,destinationY,currentX,currentY,homeX,homeY)
{
//	TrackingPlacement


flashvars='myname='+countryName+'&desc='+desc+'&desc2='+desc2
+'&destinationX='+destinationX
+'&destinationY='+destinationY
+'&currentX='+currentX
+'&currentY='+currentY
+'&homeX='+homeX
+'&homeY='+homeY

X=""
X=X+'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="447" height="193">'
X=X+'  <param name="movie" value="mapMarker.swf" />'
X=X+'  <param name="wmode" value="transparent">'
X=X+'  <param name="quality" value="high" />'
X=X+'  <param name="FlashVars" value="'+flashvars+'" />'
X=X+'  <embed src="mapMarker.swf" wmode="transparent" quality="high" FlashVars="'+flashvars+'" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="447" height="193"></embed>'
X=X+'</object>'

TrackingPlacement.innerHTML=X;
/*	
	var countryName = 'Package';
var desc = 'Package Statuse : Arival , London International Airport';
var desc2 = 'Current Country : United Kindom';
var destinationX = 45;
var destinationY = 63;
var currentX = 148;
var currentY = 38;
var homeX = 183;
var homeY = 67;
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','447','height','193','src','mapMarker','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','mapMarker','salign', '','FlashVars','myname='+countryName+'&desc='+desc+'&desc2='+desc2
+'&destinationX='+destinationX
+'&destinationY='+destinationY
+'&currentX='+currentX
+'&currentY='+currentY
+'&homeX='+homeX
+'&homeY='+homeY

 ); //end AC code
 */
}


/*********************************************************************************************************************************/



var Url = {

	// public method for url encoding
	encode : function (string) {
		return escape(this._utf8_encode(string));
	},

	// public method for url decoding
	decode : function (string) {
		return this._utf8_decode(unescape(string));
	},

	// private method for UTF-8 encoding
	_utf8_encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";

		for (var n = 0; n < string.length; n++) {

			var c = string.charCodeAt(n);

			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}

		}

		return utftext;
	},

	// private method for UTF-8 decoding
	_utf8_decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;

		while ( i < utftext.length ) {

			c = utftext.charCodeAt(i);

			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}

		}

		return string;
	}

}

/*********************************************************************************************************************************/
// Change DIV Opacity all browser


function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    //object.filter = "alpha(opacity=" + opacity + ")"; 
} 

/*********************************************************************************************************************************/

function resize()
{
setslideleft(slide1);
}
/*********************************************************************************************************************************/

function getAbsoluteLeft(objectId) {
	// Get an object left position from the upper left viewport corner
	// Tested with relative and nested objects
	//o = document.getElementById(objectId)
	o=objectId;
	oLeft = o.offsetLeft            // Get left position from the parent object
	while(o.offsetParent!=null) {   // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent    // Get parent object reference
		oLeft += oParent.offsetLeft // Add parent left position
		o = oParent
	}
	// Return left postion
	oLeft=oLeft*1
	return oLeft
}

function getAbsoluteTop(objectId) {
	// Get an object top position from the upper left viewport corner
	// Tested with relative and nested objects
	//o = document.getElementById(objectId)
	o=objectId
	oTop = o.offsetTop            // Get top position from the parent object
	while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent  // Get parent object reference
		oTop += oParent.offsetTop // Add parent top position
		o = oParent
	}
	// Return top position
	oTop=oTop*1
	return oTop
}
/*********************************************************************************************************************************/

function setslideleft(obj)
{


	zobj=document.getElementById("tableMain")
	
	if (LanDir!="RTL")
		{
			document.getElementById(obj.id+"_container").innerHTML="";
			x=getAbsoluteLeft(zobj)+(zobj.width*1);
			document.getElementById(obj.id+"_container").style.left=x;
			document.getElementById(obj.id+"_container").style.width=1;
			obj.style.left=x-32;
			obj.style.width=32;	
		}
		else
		{
			document.getElementById(obj.id+"_container").innerHTML="";
			x=getAbsoluteLeft(zobj)	//+(table1.width*1);
			document.getElementById(obj.id+"_container").style.left=x+1;
			document.getElementById(obj.id+"_container").style.width=1;
			obj.style.left=x-3;
			obj.style.width=32;	
		
		}

}
/*********************************************************************************************************************************/

function openslide(url,obj,width,img)
{
	if (flgOpenslidebar==1) return 0;
	if (obj.clientWidth<40)
		{
			
			src=img.src
			src=src.toString();
			src=src.replace('_plus','_minus');
			img.src=src;
			
			xleft=getAbsoluteLeft(obj);
			
			xtop=getAbsoluteTop(obj);
			xwidth=img.width
			slidestart=xwidth;
			slideend=width;
			obj.style.position='absolute';
			
			obj.style.zIndex=5;
			document.getElementById(obj.id+"_container").style.zIndex=6;
			slideobject=obj
			xurl=url;
			window.setTimeout('rollslide(xurl,'+obj.id+',slidestart,slideend,xleft,xwidth);',10); 
		}
		else
		{
			src=img.src
			src=src.toString();
			src=src.replace('_minus','_plus');
			img.src=src;
		
			setslideleft(obj);
		}
}

function hideslide(url,obj,width,img)
{			if (flgOpenslidebar==1) return 0;
			
			
			
			src=img.src
			
			src=src.toString();
			src=src.replace('_minus','_plus');
			
			img.src=src;

		
			setslideleft(obj);
			
}
/*********************************************************************************************************************************/

function rollslide(url,obj,slidestart,slideend,xleft,xwidth)
{

	xurl=url;
	spd=(slideend-slidestart)/8
	if (spd<2) spd=2
	
	if (slidestart>=slideend)
		{
			slidestart=slideend
			openslidebar(url,obj.id+"_container");
			
		}
		else
		{
			slidestart=slidestart+spd
			window.setTimeout('rollslide(xurl,'+obj.id+','+slidestart+',slideend,xleft,xwidth);',40);
		}
		if (LanDir!="RTL")
		{
		obj.style.width=slidestart
		obj.style.left=xleft-(slidestart)+xwidth
		
		document.getElementById(obj.id+"_container").style.width=slidestart-xwidth+5+"px";
		document.getElementById(obj.id+"_container").style.left=xleft-(slidestart)+(xwidth*2)-2;
		}
		else
		{
		obj.style.width=slidestart
		document.getElementById(obj.id+"_container").style.width=slidestart-xwidth-5+"px";

		}
		
}
/*********************************************************************************************************************************/

function openwipe(url,objname)
{


	obj=document.getElementById(objname);
	hh=obj.clientHeight;
	ww=obj.clientWidth;
		loadstr="<div style='filter:alpha(opacity:70); opacity:0.7; position: absolute;  width: "+ww+"; height: "+hh+"; background-color: #F6F6F6' ><img border='0' src='images/loading3.gif' ></div>";

	obj.innerHTML=loadstr +obj.innerHTML;


	window.setTimeout("gethtml3('"+url+"','"+objname+"');",500);

}


function openwipepost(url,postdata,objname)
{


	obj=document.getElementById(objname);
	hh=obj.clientHeight;
	ww=obj.clientWidth;
		loadstr="<div style='filter:alpha(opacity:70); opacity:0.7; position: absolute;  width: "+ww+"; height: "+hh+"; background-color: #F6F6F6' ><img border='0' src='images/loading3.gif' ></div>";

	obj.innerHTML=loadstr +obj.innerHTML;


	window.setTimeout("gethtmlpost('"+url+"','"+postdata+"','"+objname+"');",500);

}

function openwipepage(url,objname)
{


	obj=document.getElementById(objname);
	hh=obj.clientHeight;
	ww=obj.clientWidth;
		loadstr="<div style='filter:alpha(opacity:70); opacity:0.7; position: absolute;  width: "+ww+"; height: "+hh+"; background-color: #F6F6F6' ><img border='0' src='images/loading3.gif' ></div>";

	obj.innerHTML=loadstr +obj.innerHTML;


	window.setTimeout("gethtml3('insidepage.asp?id="+url+"','"+objname+"');",500);

}
function openwipeflash(url,objname)
{


	obj=document.getElementById(objname);
	hh=obj.clientHeight;
	ww=obj.clientWidth;
		loadstr="<div style='filter:alpha(opacity:70); opacity:0.7; position: absolute;  width: "+ww+"; height: "+hh+"; background-color: #F6F6F6' ><img border='0' src='images/loading3.gif' ></div>";

	obj.innerHTML=loadstr +obj.innerHTML;


	window.setTimeout("gethtml3('insideflash.asp?id="+url+"','"+objname+"');",500);

}
/*********************************************************************************************************************************/




function openslidebar(url,objname)
{

	obj=document.getElementById(objname);
	
	flgOpenslidebar=1;
	hh=obj.clientHeight;
	ww=obj.clientWidth;
	ll=getAbsoluteLeft(obj);
	tt=getAbsoluteTop(obj);

	ll=0;
	tt=0;
	//obj.innerHTML="";


	loadingstr="<div  id='"+objname+"_loading' style='  zopacity:0.8; position: absolute; left:0; top:0;  width: "+ww+"px; height: "+hh+"px; zbackground-color: #D9D9D9; background-image:url(images//pattern.gif)' ><table height='100%' width='100%'><tr><td align=center><img border='0' src='images/loadingt.gif' ></td></tr></table></div>";	


	obj.innerHTML =	loadingstr +obj.innerHTML

	
	
	//changeOpac(70,objname+"_loading");
	
	window.setTimeout("gethtml2('"+url+"','"+objname+"');",500); 


}

/*********************************************************************************************************************************/

function gethtml(url,objname)
{
var xmlhttp;
xmlhttp=null;

last_xml="";
obj=document.getElementById(objname);

// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
if (xmlhttp!=null)
  {
  	  
	  xmlhttp.open("GET",url,false)
	  xmlhttp.send(null)
	  if (xmlhttp.status==200)
	  	{
	  	  //	alert(obj.id);
		  obj.innerHTML = xmlhttp.responseText;
		  return false;
	    }
	    else
	    {
	    //alert(xmlhttp.responseText);
	    }
  }
}
/*********************************************************************************************************************************/

function gethtml2(url,objname)
{
var xmlhttp;
xmlhttp=null;

last_xml="";
obj=document.getElementById(objname);

// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
if (xmlhttp!=null)
  {
  	  
	  xmlhttp.open("GET",url,false)
	  xmlhttp.send(null)
	  flgOpenslidebar=0;

	  if (xmlhttp.status==200)
	  	{
	  	  //	alert(obj.id);
	  	  xhtm = xmlhttp.responseText;
	  	  xhtm="<table width='100%' cellspacing=2><tr><td>"+xhtm+"</td></tr></table>"
		  obj.innerHTML = xhtm;
		  return xhtm;
	    }
	    else
	    {
	    obj.innerHTML="<font face='Tahoma' size='1'>Error Loading Data!</font>";	
	    obj.innerHTML=xmlhttp.responseText;
	    }
	    
  }
}
/*********************************************************************************************************************************/

function gethtml3(url,objname)
{





var xmlhttp;
xmlhttp=null;


last_xml="";
obj=document.getElementById(objname);

// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
if (xmlhttp!=null)
  {
  	  
  	  oh=obj.offsetHeight;
  	  if (document.getElementById(obj.id+"_top"))
  	  	{
	  	  document.getElementById(obj.id+"_top").style.height=oh
  	  	}
  	  
	  xmlhttp.open("GET",url,false)
	  xmlhttp.send(null)

	  if (xmlhttp.status==200)
	  	{
	  	  //	alert(obj.id);
	  	  xhtm = xmlhttp.responseText;
	  //	  if (obj.filters!=null)
	  	  {

		  	//  obj.filters(0).apply();
			  obj.style.visibility="hidden";
			  obj.innerHTML = xhtm;
			  	sc=gettag(xhtm,'script')
			  	if (sc)
			  	{
			  	eval(sc);
			  	}			  
			  	

				if(objname=='htmlplace')
					{
					document.getElementById("htmlplace").style.overflow="auto";
					document.getElementById('tblheader').style.height='0px';
					document.getElementById('tblheader').style.visibility='hidden';
					document.getElementById('tblheader').style.position='absolute';				
					xheader=""					
					xfooter=""
					document.getElementById("htmlfooterplace").innerHTML=""
					if (url=='insidepage.asp?id='+StartPageH)
						{
						obj.style.background="";			
						obj.style.padding=0;
						}
						else
						{
						xtitle=gettag(xhtm,'title');
							xheader="<table height='30px' border='0px' cellspacing='0' cellpadding='0' width='100%' bgcolor='#333333' ><tr><td ><font color='#F5F5F5' face='Arial' style='font-size: 12px'>&nbsp;&nbsp;<b>"+xtitle+"</b></font></td><td valign=top></td></tr></table>"
						document.getElementById('tblheader').style.height='25px'
						document.getElementById('tblheader').style.visibility='';
						document.getElementById('tblheader').style.position='';
						obj.style.padding=5;
						obj.style.background="#FFFFFF";


						xonclick="openwipe('"+url+"','"+objname+"');"
						ft=document.getElementById("htmlfooter").innerHTML;
						ft=ft.replace('xonclick',xonclick);						
						document.getElementById("htmlfooterplace").innerHTML=ft
						//ft=document.getElementById("htmlfooter").innerHTML;
						ft=ft.replace('xtitle',xtitle);
						document.getElementById("htmlfooterplace").innerHTML=ft
						}

						document.getElementById('tblheader').innerHTML=xheader;
					  	obj.innerHTML = obj.innerHTML 						
					  	
					}
			    
				//	xfooter="<div style='position:absolute; left=0;top:0;'><a href='javascript:openwipe(\""+url+"\",\""+objname+"\")'><img border=0 src='images\\refresh.gif'></a></div>"


			  obj.style.visibility="";
			 
			  

			  //obj.filters(0).play();			  
		  }
		//  else
		  {
  		//	 changeOpac(0,obj.id);
		//	 obj.innerHTML = xhtm;
	//		 obj.innerHTML = obj.innerHTML+"<br><img src='images\\refresh.gif'>"
	//		 opacity(obj.id,0,100,1500);			  
		  }
		  
		dh=obj.offsetHeight;

		if(obj.id=='htmlplace')
			{

				if (obj.scrollHeight>dh) 
					{

					dh=obj.scrollHeight;
					obj.style.height=dh
					obj.style.offsetHeight=dh
					}
			}
		//

		if (dh<30) dh=30;
		if (document.getElementById(obj.id+"_top"))
		{
			if (oh<dh)	wipevertp(obj,oh,dh);
			if (oh>dh)	wipevertm(obj,oh,dh);
		
		}	
		//document.getElementById("flashplace").style.height=h;
		
		  
		  return xhtm;
	    }
	    else
	    {
	    obj.innerHTML="<div align=center><font face='Tahoma' size='1'>Error Loading Data ... <a href='javascript:openwipe(\""+url+"\",\""+objname+"\")'>click to retry</a></font></div>";	
		obj.innerHTML=obj.innerHTML+"<div  style='border: 1px solid #C0C0C0; background-color: #FFFFFF'>"+xmlhttp.responseText+"</div>"
	    }
  }
}
/*********************************************************************************************************************************/
function gethtmlpost(url,postdata,objname)
{





var xmlhttp;
xmlhttp=null;


last_xml="";
obj=document.getElementById(objname);

// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
if (xmlhttp!=null)
  {
  	  
  	  oh=obj.offsetHeight;
  	  if (document.getElementById(obj.id+"_top"))
  	  	{
	  	  document.getElementById(obj.id+"_top").style.height=oh
  	  	}
  	  
  	  
	  xmlhttp.open("POST",url,false)
	  xmlhttp.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
	  xmlhttp.send(postdata)

	  if (xmlhttp.status==200)
	  	{
	  	  //	alert(obj.id);
	  	  xhtm = xmlhttp.responseText;
	  	//  if (obj.filters!=null)
	  	  {

		  	//  obj.filters(0).apply();
			  obj.style.visibility="hidden";
			  obj.innerHTML = xhtm;
			  	sc=gettag(xhtm,'script')
			  	if (sc)
			  	{
			  	eval(sc);
			  	}

				if(objname=='htmlplace')
					{
						document.getElementById('tblheader').style.height='0px';
						document.getElementById('tblheader').style.visibility='hidden';
						document.getElementById('tblheader').style.position='absolute';				
						xheader=""				
						document.getElementById("htmlfooterplace").innerHTML=""
					if (url=='insidepage.asp?id='+StartPageH)
						{
						obj.style.background="";			
						obj.style.padding=0;
						}
						else
						{
						xtitle=gettag(xhtm,'title');
							xheader="<table height='30' border='0' cellspacing='0' cellpadding='0' width='100%' bgcolor='#333333' ><tr><td><font color='#F5F5F5' face='Arial' style='font-size: 12px'>&nbsp;&nbsp;<b>"+xtitle+"</b></font></td><td align=right><img  src='images/nodeend.gif'></td></tr></table>"
						document.getElementById('tblheader').style.height='25px'
						document.getElementById('tblheader').style.visibility='';
						document.getElementById('tblheader').style.position='';
						obj.style.padding=10;
						obj.style.background="#FFFFFF";						

						xonclick="openwipepost('"+url+"','"+postdata+"','"+objname+"');"
						ft=document.getElementById("htmlfooter").innerHTML;
						ft=ft.replace('xonclick',xonclick);						

						ft=ft.replace('xtitle',xtitle);
						document.getElementById("htmlfooterplace").innerHTML=ft

						}
						document.getElementById('tblheader').innerHTML=xheader;
					  	obj.innerHTML = obj.innerHTML +xfooter

						
					}
			    
				//	xfooter="<div style='position:absolute; left=0;top:0;'><a href='javascript:openwipe(\""+url+"\",\""+objname+"\")'><img border=0 src='images\\refresh.gif'></a></div>"

			  obj.style.visibility="";
			  //obj.filters(0).play();			  
		  }
		//  else
		  {
  		//	 changeOpac(0,obj.id);
		//	 obj.innerHTML = xhtm;
		//	 obj.innerHTML = obj.innerHTML+"<br><img src='images\\refresh.gif'>"
		//	 opacity(obj.id,0,100,1500);			  
		  }
		  
		dh=obj.offsetHeight;
		if(obj.id=='htmlplace')
			{
				if (obj.scrollHeight>dh) 
					{
					dh=obj.scrollHeight;
					obj.style.height=dh
					}
			}

		if (dh<30) dh=30;
		if (document.getElementById(obj.id+"_top"))
		{
			if (oh<dh)	wipevertp(obj,oh,dh);
			if (oh>dh)	wipevertm(obj,oh,dh);
		
		}	
		//document.getElementById("flashplace").style.height=h;
		
		  
		  return xhtm;
	    }
	    else
	    {
	    obj.innerHTML="<div align=center><font face='Tahoma' size='1'>Error Loading Data ... <a href='javascript:openwipe(\""+url+"\",\""+objname+"\")'>click to retry</a></font></div>";	
		obj.innerHTML=obj.innerHTML+"<div  style='border: 1px solid #C0C0C0; background-color: #FFFFFF'>"+xmlhttp.responseText+"</div>"
	    }
  }
}

/*********************************************************************************************************************************/
function wipevertp(obj,from,to)
{	

	  xobj=obj;
	  xfrom=from;
	  xto=to;
 	  if (document.getElementById(obj.id+"_top"))
  	  	{
  	  		if (from<to)
  	  			{
  	  	  		document.getElementById(obj.id+"_top").style.height=from

  	  	  		from=from+10

  	  	  		xfrom=from
  	  	  		window.setTimeout('wipevertp(xobj,xfrom,xto);',25);
  	  	  		}
  	  	}
}
/*********************************************************************************************************************************/
function wipevertm(obj,from,to)
{
	  xobj=obj;
	  xfrom=from;
	  xto=to;

 	  if (document.getElementById(obj.id+"_top"))
  	  	{
  	  		if (from>to)
  	  			{
  	  	  		document.getElementById(obj.id+"_top").style.height=from

  	  	  		from=from-10

  	  	  		xfrom=from
//  	  	  		window.setTimeout('wipevertm(xobj,xfrom,xto);',25);
  	  	  		}
  	  	}
}
/*********************************************************************************************************************************/

function changestyle(frmname)
{
	var x;
	var i;
	var part;
	var args;
	args="";

if (document.getElementById(frmname)!=null)
	{
		var x=document.getElementById(frmname);
		alert(x.length)
		for (var i=0;i<x.length;i++)
		  {
		
				
				part=""
				
				tag_type=x.elements[i].tagName;
				alert(tag_type);
		  }	
	}
}		
/*********************************************************************************************************************************/

function xmlsubmit(frmname,frame)
{
	var x;
	var i;
	var part;
	var args;
	args="";
	if (document.getElementById(frmname)!=null)
	{
		x=	document.getElementById(frmname)

		var x=document.getElementById(frmname);
		for (var i=0;i<x.length;i++)
		  {
		
				
				part=""
				
				tag_type=x.elements[i].tagName;
				//vl=urlencode(x.elements[i].value);
				v=Url.encode((x.elements[i].value))
				if (tag_type=="INPUT")
					{
				
						
						if (x.elements[i].type=="" || x.elements[i].type=="text") part=x.elements[i].name + "=" +(v) + "&";
						
						if (x.elements[i].type=="" || x.elements[i].type=="text") part=x.elements[i].name + "=" +(v) + "&";
						
						if (x.elements[i].type=="checkbox")
							{
								if (x.elements[i].checked==true)
									{
										part=x.elements[i].name + "=" +v + "&";
									}
							}
							
						if (x.elements[i].type=="hidden")
							{
								part=x.elements[i].name + "=" +(v) + "&";
							}							
							
						if (x.elements[i].type=="password")
							{
								part=x.elements[i].name + "=" +(v) + "&";
							}	
							
						if (x.elements[i].type=="radio")
							{
								if (x.elements[i].checked==true)
									{
										part=x.elements[i].name + "=" +v + "&";
									}
							}
	
					}
				
				if (tag_type=="TEXTAREA")
					{
					

					 part=x.elements[i].name + "=" +(v) + "&";
					}
	
				if (tag_type=="SELECT")
					{
						xv=x.elements[i].value	
						//xv=x.elements[i].options(x.elements[i].selectedIndex).value;						
						if (xv=="") xv=x.elements[i].options(x.elements[i].selectedIndex).text;
						part=x.elements[i].name + "=" +xv + "&";
					}
					
	
				
				
				if (part!="")
					args=args+part;				

	
			}
			
			//u=document.all(frmname).action+"?"+args;
		    	

		    if (frame=='document' || frame=='')
		    	{
		    		u=document.getElementById(frmname).action+"?"+args;
		    		location=u;
		    	}
		    	else
		    	{
		    		u=document.getElementById(frmname).action;
		    		openwipepost(u,args,frame);
		    	}
		    //alert(u);
			//open(u);




	
	}
	else
	{
		alert("Error sending form data , form '"+frmname+"' not present.")
	}

}

/*********************************************************************************************************************************/


function checkhistory(obj)
{


	x=obj.contentWindow.document.body.innerHTML;	

	if (x!="")
	{

		if (gettag(x,"result")=="OK")
		{
			if (gettag(x,"ptitle")) 
				{
					document.title=gettag(x,"ptitle")+" : "+"Globex-Ship.com";
					location="#"+gettag(x,"ptitle");
					

					openwipe('insidepage.asp?id='+gettag(x,"toppage"),'flashplace');
					if (gettag(x,"mainpage")!=-1)
						{
							openwipe('insidepage.asp?id='+gettag(x,"mainpage"),'htmlplace');						
						}
						else
						{							
							if (gettag(x,"mainasp")!=-1)
								{
									openwipe(gettag(x,"mainasp"),'htmlplace')
								}
						}
					
				}
				
		}
		else
		{
		//alert('Cannot open requested page');
		}
	
	}
/*	if (x.search("OK") >=0 )
		{
			
			z=x.substring(3,x.length)
			z=z.toString();


			while (z.search("_and_")!=-1)
			{
			 z=z.replace('_and_','&');
			}			
			
			//openpage_xml(z);		
			alert(z);
		}
		else
		{
			//alert("Cannot open page , some server problem !");
		}
*/
}
/*********************************************************************************************************************************/

function navigatepage(url)
{
	var xurl;
	xurl=url.toString();
	//xurl=codestring(xurl);
//	location="#"+xurl
	
		urlx=xurl;
		
		while (urlx.search('&')!=-1)
		{
		 urlx=urlx.replace('&','_and_');
		}
	
	historyframe.document.location="history.asp?url="+urlx
	
	
}

/*********************************************************************************************************************************/
function convertcurrency()
{

	from=document.getElementById("currencyvalue").value;
	if (isNaN(from)==false)
			{
				
				f1=document.getElementById("fromcurrency").value;
				f2=document.getElementById("tocurrency").value;
				i=document.getElementById("tocurrency").selectedIndex;
				
				c=document.getElementById("tocurrency").options[i].text;
	
	
		
				z=f1/f2
				to=from*z

		
	
				xmsg=FormatNumber(to,1,true,false,true)+" <small>"+c;
				//xmsg=to
			}
			else
			{
				xmsg="Error, Not valid value";
			}
		document.getElementById("convertto1").innerHTML="<large>"+xmsg+"</large>"
	
}
/*********************************************************************************************************************************/
function addcalc(i)
{
if (i>='0' && i<='9')
	{
		if (calinanswer==1) document.getElementById("calctext").value=""
	}
document.getElementById("calctext").value=document.getElementById("calctext").value+i
calinanswer=0
}
/*********************************************************************************************************************************/
function clearcalc()
{

document.getElementById("calctext").value=""
}
/*********************************************************************************************************************************/
function docalc()
{
	calinanswer=1
	z=document.getElementById("calctext").value

	// Check for Alphabetic 
	blk=0
	for (i=0;i<z.length;i++)
	{
		c=z.substr(i,1)
		c=c.toLowerCase()
		if (c>='a' && c<='z') blk=1
	}

	if (blk==0)
	{
		document.getElementById("calctext").value=eval(z)
	}
	else
	{
		document.getElementById("calctext").value="Invalid Statement!"
	}
}
/*********************************************************************************************************************************/
function setconvertcombo()
{
	f1=document.getElementById("convertunitcombo").value;

	gethtml(f1+"&id=measurconv1&s=0",'convertunitdiv1');
	gethtml(f1+"&id=measurconv2&s=1",'convertunitdiv2');
	document.getElementById("convertfrom").value=0;
	convertunit();
}

/*********************************************************************************************************************************/

function convertunit()
{

	from=document.getElementById("convertfrom").value;

	if (isNaN(from)==false)
		{
			
			f1=document.getElementById("measurconv1").value;
			f2=document.getElementById("measurconv2").value;
			i=document.getElementById("measurconv2").selectedIndex;
			
			c=document.getElementById("measurconv2").options[i].text;


	
			z=f1/f2
			to=from*z
	

			xmsg=FormatNumber(to,2,true,false,true)+"  <small>"+c;
			//xmsg=to
		}
		else
		{
			xmsg="Error, Not valid value";
		}
	document.getElementById("convertto").innerHTML="<large>"+xmsg+"</large>"
}

/*********************************************************************************************************************************/


function FormatNumber(num,decimalNum,bolLeadingZero,bolParens,bolCommas)
/**********************************************************************
	IN:
		NUM - the number to format
		decimalNum - the number of decimal places to format the number to
		bolLeadingZero - true / false - display a leading zero for
										numbers between -1 and 1
		bolParens - true / false - use parenthesis around negative numbers
		bolCommas - put commas as number separators.
 
	RETVAL:
		The formatted number!
 **********************************************************************/
{ 
if (isNaN(parseInt(num))) return "NaN";

	var tmpNum = num;
	var iSign = num < 0 ? -1 : 1;		// Get sign of number
	
	// Adjust number so only the specified number of numbers after
	// the decimal point are shown.
	tmpNum *= Math.pow(10,decimalNum);
	tmpNum = Math.round(Math.abs(tmpNum))
	tmpNum /= Math.pow(10,decimalNum);
	tmpNum *= iSign;					// Readjust for sign
	
	
	// Create a string object to do our formatting on
	var tmpNumStr = new String(tmpNum);

	// See if we need to strip out the leading zero or not.
	if (!bolLeadingZero && num < 1 && num > -1 && num != 0)
		if (num > 0)
			tmpNumStr = tmpNumStr.substring(1,tmpNumStr.length);
		else
			tmpNumStr = "-" + tmpNumStr.substring(2,tmpNumStr.length);
		
	// See if we need to put in the commas
	if (bolCommas && (num >= 1000 || num <= -1000)) {
		var iStart = tmpNumStr.indexOf(".");
		if (iStart < 0)
			iStart = tmpNumStr.length;

		iStart -= 3;
		while (iStart >= 1) {
			tmpNumStr = tmpNumStr.substring(0,iStart) + "," + tmpNumStr.substring(iStart,tmpNumStr.length)
			iStart -= 3;
		}		
	}

	// See if we need to use parenthesis
	if (bolParens && num < 0)
		tmpNumStr = "(" + tmpNumStr.substring(1,tmpNumStr.length) + ")";

	return tmpNumStr;		// Return our formatted string!
}
/************************************************************************************************************************************/
function godic()
	{
		openslidebar ( 'slide1.asp?tab=3&word='+document.getElementById('dictionaryword').value,'slide1_container');
	}
/************************************************************************************************************************************/
function onenter(obj,xevent)
{
	
	if (window.event==null)
	{	
		x=xevent.which;
	}
	else
	{
		x=window.event.keyCode;
	}
	
	if (x==13 ) {
	             eval (obj);
	             window.event.keyCode=0;
	 		   }	
}
/************************************************************************************************************************************/
function gettag(st,tag)
{
	var tagin;
	var tagout;
	var zin;
	var zout;
	
	
	tagin="<"+tag+">";
	tagout="</"+tag+">";
	
	zin=st.search(tagin.toUpperCase());
	if (zin==-1) zin=st.search(tagin.toLowerCase());
	
	zout=st.search(tagout.toUpperCase());
	if (zout==-1) zout=st.search(tagout.toLowerCase());
	

	if ((zin!=-1) &&(zout!=-1))
		{
			st=st.substring(zin+tagin.length,zout);

			return st;
		}
}



/*********************************************************/
function dosearch2()
{
			xTxt=document.getElementById('searchtxt').value
		        if (xTxt!="")
 		        {
		  		
		  	openwipe("search.asp?searchtxt="+xTxt,"htmlplace");
			}
}
function dosearch()
	{

		if (document.getElementById('searchtxt2'))
			{
				document.getElementById('searchtxt').value=document.getElementById('searchtxt2').value
			}
		xTxt=document.getElementById('searchtxt').value
		xOnw=document.getElementById('onw').checked

		xObj=document.getElementById('optbl');
		if (xObj.checked==true)
		{
			openwipe("search.asp?searchtxt="+xTxt,"htmlplace");
		}

		xObj=document.getElementById('optgoogle');
		if (xObj.checked==true)
		{
			if (xOnw==true)	 window.open("http://www.google.com/search?hl=en&q="+xTxt+" site:globex-ship.com");
			if (xOnw==false) location= "http://www.google.com/search?hl=en&q="+xTxt+" site:globex-ship.com";
			
		}
				
		xObj=document.getElementById('optwww');
		if (xObj.checked==true)
		{
			if (xOnw==true) window.open("http://www.google.com/search?hl=en&q="+xTxt);
			if (xOnw==false) location="http://www.google.com/search?hl=en&q="+xTxt
		}

		
	}
function validforgetpass()
{
var  permition;
permition=0;
forgetpass.Xemail.style.backgroundColor="";
forgetpass.Xemail2.style.backgroundColor="";
if  (forgetpass.Xemail.value == "" )permition=7;
         if (forgetpass.Xemail.value.indexOf("@") == -1 || forgetpass.Xemail.value.indexOf(".") == -1 || forgetpass.Xemail.value.length < 8 )
			 {
				 permition=7;
			 }
if  (forgetpass.Xemail2.value == "" )permition=8;
         if (forgetpass.Xemail2.value.indexOf("@") == -1 || forgetpass.Xemail2.value.indexOf(".") == -1 || forgetpass.Xemail2.value.length < 8 )
			 {
				 permition=8;
			 }
if  (forgetpass.Xemail.value != forgetpass.Xemail2.value )permition=9;			 
	if  (permition == 0 )
  		 {
			xmlsubmit('forgetpass','Htmlplace');			
  		 }
	else
       {
	      if  (permition == 7 )  {	alert("Enter email address") ; forgetpass.Xemail.style.backgroundColor="#FFFF00"; }
	      if  (permition == 8 )  {	alert("Enter confirm email address") ; forgetpass.Xemail2.style.backgroundColor="#FFFF00"; }
   	      if  (permition == 9 )  
   	      	 {	
   	      	 		alert("Invalid email address!") ;
   	      	 		forgetpass.Xemail.style.backgroundColor="#FFFF00";
   	      	 		forgetpass.Xemail2.style.backgroundColor="#FFFF00";
   	      	 }	      
		}
}	
	
function savecustomer()
{
  
 var  permition;
     
	customerform.XLastname.style.backgroundColor="";
	customerform.XFirstname.style.backgroundColor="";
	
	customerform.Xcompanyname.style.backgroundColor="";
	customerform.Xaddress.style.backgroundColor="";
	customerform.Xcity.style.backgroundColor="";
	customerform.Xcountryname.style.backgroundColor="";
		
					
	customerform.Xbusinesstel.style.backgroundColor="";
	customerform.Xbusinessfax.style.backgroundColor="";
	customerform.Xemail.style.backgroundColor="";
	customerform.XUsername.style.backgroundColor="";				
	customerform.XPassword.style.backgroundColor="";	     
	customerform.XPassword1.style.backgroundColor="";	
	customerform.Ximagepass.style.backgroundColor="";
    permition=0;
   if  (customerform.Xemail.value == "" )permition=7;
         if (customerform.Xemail.value.indexOf("@") == -1 || customerform.Xemail.value.indexOf(".") == -1 || customerform.Xemail.value.length < 8 )
			 {
				 permition=7;
			 }
	if  (customerform.Xaddress.value == "" )permition=12;			 
	if  (customerform.XPassword.value == "" )permition=11;
	if  (customerform.XPassword1.value == "" )permition=11;
	if  ((customerform.XPassword.value!=customerform.XPassword1.value) && permition==0)
	    {
	    permition=13;
	    }
    if  (customerform.XUsername.value == "" )permition=10;			 
	if  (customerform.Xbusinessfax.value == "" )permition=9;
    if  (customerform.Xbusinesstel.value == "" )permition=8;
    if  (customerform.Xcity.value == "" )permition=6;
 
    if  (customerform.Xcountryname.value == "" ) permition=4;    
    if  (customerform.Xcompanyname.value == "" ) permition=3;
    if  (customerform.XLastname.value == "" ) permition=2;    
    if  (customerform.XFirstname.value == "" ) permition=1;
    //===========================================================
    if (permition==0)
	{
	pw=customerform.Ximagepass.value;

	if (window.XMLHttpRequest)
	  {
	  xmlhttp=new XMLHttpRequest()
	  }
	// code for IE
	else if (window.ActiveXObject)
	  {
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	  }
	if (xmlhttp!=null)
	  {
	  	
	  	  url="checkpassclinet.asp?password="+pw
	  	  
		  xmlhttp.open("GET",url,false)
		  xmlhttp.send(null)

		  if (xmlhttp.status==200)
		  	{
		  	  //	alert(obj.id);

		  	  
		  	  if (xmlhttp.responseText!="OK") 
		  	  	{
		  	  		customerform.Ximagepass.style.backgroundColor="#FFFF00";
			  	  	alert("Type the code shown")
		  	  		permition=-1
		  	  	}
		  	  	
		    }
	  }
	}

    //=============================================================
    if  (permition == 0 )
  		 {
			xmlsubmit('customerform','Htmlplace');			
  		 }
	else
       {
	      if  (permition == 1 )  {	alert("Enter First Name") ; customerform.XFirstname.style.backgroundColor="#FFFF00"; }
		  if  (permition == 2 )  {	alert("Enter Last Name") ; customerform.XLastname.style.backgroundColor="#FFFF00"; }		
		  if  (permition == 3 )  {	alert("Enter Company Name") ; customerform.Xcompanyname.style.backgroundColor="#FFFF00"; }
		  if  (permition == 4 )  {	alert("Enter Country Name") ; customerform.Xcountryname.style.backgroundColor="#FFFF00"; }		  

  		  if  (permition == 6 )  {	alert("Enter City Name") ; customerform.Xcity.style.backgroundColor="#FFFF00"; }		  
  		  if  (permition == 7 )  {	alert("Enter Email Address") ; customerform.Xemail.style.backgroundColor="#FFFF00"; }		  		    
		  if  (permition == 8 )  {	alert("Enter Business Tel") ; customerform.Xbusinesstel.style.backgroundColor="#FFFF00"; }
		  if  (permition == 9 )  {	alert("Enter Business Fax") ; customerform.Xbusinessfax.style.backgroundColor="#FFFF00"; }
		  if  (permition == 10 )  {	alert("Enter Username") ; customerform.XUsername.style.backgroundColor="#FFFF00"; }
		  if  (permition == 11 )  {	alert("Enter Password") ; customerform.XPassword.style.backgroundColor="#FFFF00"; }
		  if  (permition == 12 )  {	alert("Enter Address ") ; customerform.Xaddress.style.backgroundColor="#FFFF00"; }		  
		  if  (permition == 13 )  {	alert("Enter Password ") ; customerform.XPassword1.style.backgroundColor="#FFFF00"; }
	   } 
}
