var is_mainpage = true;
Tb=0;
var fb=0;

//--- Kirill Melsitov 09.11.2006 --- start ---
function f(id){return document.getElementById(id);}
function OnBlink()
{
	if(f('w_both').value.length == 5 && Tb == 0 && f('s2').value == 0)
	{
		f('s2').style.backgroundColor="#79D672";fb=0;
		Tb = setInterval('bl()', 500);//alert('ok');
	}
	if(f('w_both').value.length != 5 && Tb != 0){clearTimeout(Tb);Tb=0; f('s2').style.backgroundColor = "white";}
}
function bl()
{
	if(fb){f('s2').style.backgroundColor="#79D672";fb=0;}
	else{f('s2').style.backgroundColor="white";fb=1;}
}
function StopBlink()
{
	if(Tb!=0){clearTimeout(Tb);Tb=0;}// f('s2').style.backgroundColor = "white";}//f('s2').focus();}
}

/*-- Zip-code --*/
function clickZip(obj)
{
	if(Tb!=0){clearTimeout(Tb);Tb=0; f('s2').style.backgroundColor = "white";}
	if(obj.value=='Enter origin Zip Code!')
	{
		obj.value='';
//		obj.focus();
		obj.select();
	}
/*	else if(obj.value=="Skip this selection. Self-deliver to a terminal.")
	{
//		f('w_both').value = "If PICKUP then enter your ZIP Code";
		obj.style.backgroundColor = "white";
		obj.value='';
		obj.select();
	}
	f('sdvig').selectedIndex = "0";
	f('sdvig').options[f('sdvig').selectedIndex].text = "Skip this selection. Pickup service selected";
//		f('sdvig').disabled = true;
	f('sdvig').style.backgroundColor = "#dfdfdf";*/
}

function blurZip(obj)
{
	if(obj.value.length == 5)
	{
		f('param1').name = 'zipcode';
		f('param1').value = obj.value;
		//f('sdvig').selectedIndex = "0";
		if(f('param2').value != 0){document.form1.submit( );return;}
	}
	else
	{
		f('param1').value = 0;
		if(obj.style.backgroundColor == "#dfdfdf")obj.style.backgroundColor = "white";
		obj.value='Enter origin Zip Code!';
/*		if(f('sdvig').style.backgroundColor == "#dfdfdf")//f('sdvig').disabled == true)
		{
			f('sdvig').options[f('sdvig').selectedIndex].text = "If Self-deliver then select a Shipping Terminal";
//			f('sdvig').disabled = false;
			f('sdvig').style.backgroundColor = "white";
		}*/
	}
//	StopBlink();------------------------------------------------------------------------------------
}

/*-- Origin Country --*/
/*
function clickOC(obj)
{
	if(Tb!=0){clearTimeout(Tb);Tb=0; f('s2').style.backgroundColor = "white";}
	if(f('param1').value != 0){f('param1').value =0;}

	if(obj.style.backgroundColor == "#dfdfdf")//f('sdvig').disabled == true)
	{
		obj.options[obj.selectedIndex].text = "If Self-deliver then select a Shipping Terminal";
//			f('sdvig').disabled = false;
		obj.style.backgroundColor = "white";
	}
}*/
function changeOC(obj)
{
//	OnBlink();
//	f('w_both').value = "Skip this selection. Self-deliver to a terminal.";
	f('w_both').style.backgroundColor = "#dfdfdf";

	f('param1').name = 'origin_city';
	f('param1').value = obj.value;
//			blurDC();
	if(f('param2').value != 0){document.form1.submit( );return;}
	
	if(obj.value == 0)
	{
		blurZip(f('w_both'));
	}//zip reset
	else if(Tb == 0 && f('s2').value == 0)
	{
		f('s2').style.backgroundColor="#79D672";fb=0;
		Tb = setInterval('bl()', 500);//alert('ok');
	}
}
function blurOC(obj)
{
	if(obj.value == 0)// "If PICKUP then enter your ZIP Code";
	{
		blurZip(f('w_both'));if(Tb!=0){clearTimeout(Tb);Tb=0;f('s2').style.backgroundColor="white";}
	}
//	else{StopBlink();}--------------------------------------------------------------------------
		
//	f('w_both').style.backgroundColor = "white";
}

/*-- Dest Country --*/
function changeDC(val)
{
	f('param2').value = val;
//		alert("param1="+document.getElementById('param1').value+" param2="+document.getElementById('param2').value);
	if(f('param1').value != 0){document.form1.submit( );return;}
/*	else
	{
		if(f('w_both').value.length == 5)
		{
			f('param1').name = 'zipcode';
			f('param1').value = f('w_both').value;
			document.form1.submit( );
		}
	}*/	
}
//--- Kirill Melsitov 09.11.2006 --- end --- 
/*
var toolTipVis = true;

EventUtil.addEventHandler(window, "load", pageLoad);

function pageLoad()
{
	r_top = getObj("read_top");
	toolTip = getObj("tooltip");
	
	// Adding Event For Header
	EventUtil.addEventHandler(r_top, "mouseover", toolTipOver );
	EventUtil.addEventHandler(r_top, "mouseout", hideTooltip);
		
	// Adding Event for ToolTip
	EventUtil.addEventHandler(toolTip, "mouseover", toolTipOver);
	EventUtil.addEventHandler(toolTip, "mouseout", hideTooltip);
}


function hideTooltip()
{
    toolTipVis = false;
	setTimeout(function () { setVisObj("tooltip", toolTipVis) }, 1000);
}
function toolTipOver()
{
	r_top = getObj("read_top");
	toolTip = getObj("tooltip");
	toolTipVis = true;
	setVisObj("tooltip", toolTipVis);
	
}
*/

