function switch_details()
{
	var cart = document.getElementById('cart_detail');
	var _cur_state = cart.style.display;
	if (_cur_state == 'none')
		cart.style.display = "block";
	else
		cart.style.display = "none";
}


function save_state()
{
	var cart = document.getElementById('cart_detail');
	var cookiename = 'detail_state';
	var cookievalue = cart.style.display;
	document.cookie = cookiename+"="+cookievalue;
}


function load_state()
{
	var cart = document.getElementById('cart_detail');
	var search = 'detail_state' + "=";
	var returnvalue = "";
	if (document.cookie.length > 0);
	{
		offset = document.cookie.indexOf(search);
		if (offset != -1)
		{
			offset += search.length;
			end = document.cookie.indexOf(";", offset);
			if (end == -1) end = document.cookie.length;
			returnvalue=unescape(document.cookie.substring(offset, end));
		}
	}

	if (returnvalue != 'none') returnvalue = 'block';
	cart.style.display=returnvalue;
}


function iecompattest()
{
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat") ? document.documentElement : document.body;
}




function validateSearch()
{
	f = document.frmSearch;
	if (f.year.selectedIndex==0)
	{
		alert ("Please Select a Year");
		f.year.focus();
		return false;
	}	
	if (f.make.selectedIndex==0)
	{
		alert ("Please Select the Make of your Vehicle");
		f.make.focus();
		return false;
	}	

	if (f.models.selectedIndex==0)
	{
		alert ("Please Select your Vehicle Model type");
		f.models.focus();
		return false;
	}

}


function validateRRSvc()
{
	f = document.frmSearch;
	if (f.year.selectedIndex==0)
	{
		alert ("Please Select a Year");
		f.year.focus();
		return false;
	}	
	if (f.make.selectedIndex==0)
	{
		alert ("Please Select the Make of your Vehicle");
		f.make.focus();
		return false;
	}	

	if (f.models.selectedIndex==0)
	{
		alert ("Please Select your Vehicle Model type");
		f.models.focus();
		return false;
	}

	if (f.engine.selectedIndex==0)
	{
		alert ("Please Select your Vehicle Engine type");
		f.engine.focus();
		return false;
	}


	if (f.transmission.selectedIndex==0)
	{
		alert ("Please Select your Vehicle Transmission");
		f.transmission.focus();
		return false;
	}

}


function rrwin(){
	rrwindow=window.open("http://www.goecm.com/rnrsvc.php","rrwindow","status=no,resize=no,toolbar=no,scrollbars=no,top=0,left=0,width=400,height=600,maximize=null")
}

function calcHeight()
{
var the_height=document.getElementById('disp').contentWindow.document.body.scrollHeight;
//find the height of the internal page
//var the_width=document.getElementById('disp').contentWindow.document.body.scrollWidth;
//find the width of the internal page
//document.getElementById('disp').style.width=document.body.clientWidth;
document.getElementById('disp').style.height=the_height;
//change the height of the iframe
//document.getElementById('disp').style.width=the_width;
//change the width of the iframe
}


function VINGuide()
{

OpenWin = this.open("http://www.goecm.com/vin.php", "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=660,height=400");
}

function SecCode()
{

OpenWin = this.open("http://www.goecm.com/ccv.php", "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=300,height=380");
}

function helpwindow(vname, pmTitle)
{
	 var path = "http://www.goecm.com/opthelp.php?vname="+vname+"&title="+pmTitle;
	window.open(path,"GoECM","height=275,width=300,dependent=no,resizable=no,scrollbars=yes,alwaysraised=no,left=50,top=50");	
}





function showall()
{
	var category = document.getElementById('all_category');
	category.style.left = startX;
	category.style.top = startY;
	var _cur_state = category.style.display;
	if (_cur_state == 'none')
		category.style.display = "block";
	else
		category.style.display = "none";
}

var ie5=document.all&&document.getElementById;
var ns6=document.getElementById&&!document.all;
var startX=ns6 ? ((window.innerWidth-750) / 2 + 250)+"px" : ((iecompattest().clientWidth-750) / 2 + 250)+"px";
var startY=ns6 ? "48px" : "55px";

window.onload = load_state;
window.onunload = save_state;
