//*********************//
//AJAX fns for order_form
//*********************//
//var xmlHttp

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	catch (e)
	{
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
}
return xmlHttp;
}



//***********//
//screen desc
//**********//
function _geo_ip()
{	
	

	//fl_1 = document.getElementById("fl_1")
		var fl = document.getElementById("f")
		//fl.style.visibility="hidden"
		
	xmlHttp_s_d=GetXmlHttpObject()
	
	if (xmlHttp_s_d==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	var url="geoip_intl.php"
	
	//url=url+"?item="+it
	xmlHttp_s_d.onreadystatechange=stateChanged_screen_desc
	xmlHttp_s_d.open("GET",url,true)
	xmlHttp_s_d.send(null)
}

function stateChanged_screen_desc() 
{ 
	if (xmlHttp_s_d.readyState==4 || xmlHttp_s_d.readyState=="complete")
	{ 	
		c = document.getElementById("intl_ship")
		
		c.style.visibility="visible"
		var newdiv = document.createElement('div');
		newdiv.setAttribute('id', '1');
		newdiv.style.background = "white";
		newdiv.style.opacity=".70";
		newdiv.style.filter = "alpha(opacity=70); -moz-opacity: 0.5;border:1px solid black;";
		//newdiv.style.filter="alpha(opacity=70)";
		newdiv.style.width = document.body.clientWidth;
		newdiv.style.height = document.body.scrollHeight;
		newdiv.style.position = "absolute";
		newdiv.style.left = 0;
		newdiv.style.top = 0;
		c.appendChild(newdiv);
		var newdiv1 = document.createElement('div');
		newdiv1.setAttribute('id', '2');
		newdiv1.style.paddingTop=0+"px";
		newdiv1.style.padding="0 20px 0 8px";
		
		newdiv1.style.width =(document.body.clientWidth/1.7);
		newdiv1.style.height = (document.body.clientHeight/1);
		newdiv1.style.position = "absolute";
		newdiv1.style.zIndex = 900;
		
		newdiv1.style.left = (document.body.clientWidth/6)+230+"px";
		newdiv1.style.top = (document.body.clientWidth/6)-100+"px";
		newdiv1.style.backgroundImage="url(images/TPS_index_shipping1.png)";
		newdiv1.style.backgroundRepeat="no-repeat";
		
		newdiv1.innerHTML = xmlHttp_s_d.responseText;
		c.appendChild(newdiv1);
	
	} 
		
}

function setPreferedCurrencySplash()
{

//	var con = document.frm.countrySplash.options[document.frm.countrySplash.selectedIndex].text;
	var con1 = document.getElementById("countrySplash");
	con = con1.options[con1.selectedIndex].text;
//	alert(con)
	var whereToWrite = 'PreferedCurrencySplash';   
	var strVariables = 'action=PreferedCurrency&type=Splash&country='+con;
	makeRequest('ajax_function.php?'+strVariables, whereToWrite);
}

function validateSplash(frm)
{
	var con = document.getElementById("countrySplash").value;
	if(con=='0')
	{
		alert('Please select the Shipping Country');
		return false;
	}
//	var con = document.getElementById("currSplash").value;
	var con1 = frm.curr.value;
	if(con1=='0')
	{
		alert('Select your preferred currency');
		return false;
	}
	return true;
}


function _show_msg_demo()
{
		c = document.getElementById("intl_ship")
		c.style.visibility="visible"
		var newdiv = document.createElement('div');
		newdiv.setAttribute('id', '1');
		newdiv.style.filter="alpha(opacity="+50;

		newdiv.style.width = document.body.clientWidth;
		newdiv.style.height = document.body.clientHeight+600;
		newdiv.style.position = "absolute";
		newdiv.style.left = 0;
		newdiv.style.top = 0;
		newdiv.style.background = "black";


		
		c.appendChild(newdiv);

		///new div for text
		var newdiv1 = document.createElement('div');
		newdiv1.setAttribute('id', '2');
		//newdiv1.style.paddingTop=80+"px";
		//newdiv1.style.paddingLeft="50px";
		newdiv1.style.width =(document.body.clientWidth/2);
		newdiv1.style.height = (document.body.clientHeight+1000);
		newdiv1.style.position = "absolute";
		newdiv1.style.left = (document.body.clientWidth/3.5);
		newdiv1.style.top = (document.body.clientWidth/4.5);
		//newdiv1.style.border = "4px solid #000";
		newdiv1.style.backgroundImage="url(images/btn_bg.png)";
		newdiv1.style.backgroundRepeat="no-repeat";
		//txt = step_txt;
		newdiv1.innerHTML = "<div style=padding-top:100px;padding-left:40px align=left><img src=images/order_more_screen.gif onclick=_show_msg_demo_rem()><a href = shoppingcart.php><img src=images/checkout.gif border=0></div>";
		c.appendChild(newdiv1);
		//new div for text
}

function _form_val()
{
	a = document.getElementById("curr")
		if (a.value == 'Select Preferred Currency')
		{
			alert('Select Your Preferred Currency')
				return false
		}
			else
		{
			return true
		}
}

function _rem_splash()
{
		c9 = document.getElementById("intl_ship")
		///c9.style.visibility="hidden"
		/*var olddiv = document.getElementById("1");
		c9.removeChild(olddiv);

		var olddiv = document.getElementById("2");
		c9.removeChild(olddiv);*/
		c9.innerHTML="";
		c9.style.visibility="hidden"
}
//************//
//preloader
//***********//
