
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function Nav(ProdStartRow, ProdNavDir, CurrPos, CurrPage, Orderfield, Orderdir )
{
  document.frm_Nav.ProdStartRow.value=ProdStartRow ;
  document.frm_Nav.ProdNavDir.value=ProdNavDir ;
  document.frm_Nav.CurrPos.value=CurrPos ;
  document.frm_Nav.CurrPage.value=CurrPage ;
  document.frm_Nav.Orderfield.value=Orderfield ;
  document.frm_Nav.Orderdir.value=Orderdir ;
  document.frm_Nav.submit() ;
}

function GeneralPopupWin(pURL,pTitle,pAttributes){
	New_GenWin=window.open(pURL,pTitle,' '+pAttributes+' ')
}


function openWindow(strURL){
	var strURL;
	strURL = "http://<cfoutput>#DomainName#/#Company.Directory#/webpages/selectcar.cfm#ID_String#</cfoutput>";
	if(! window.focus)return;
	var myWin=window.open(strURL,"","top=100,height=200,width=600,dependent=yes,resizable=yes");
	myWin.focus();
}
function FitWindowDisplay(carid, prodid, w){
	var strURL;
	strURL = "http://www.cartoys.com/cartoy/webpages/fit_info_popup_"+w+".cfm?" 
	
	
	strURL = strURL + "&carid=" + carid;
	strURL = strURL + "&product_id=" + prodid;
	if(! window.focus)return;
	var myWin=window.open(strURL,"","top=100,height=225,width=600,dependent=yes,resizable=yes,scrollbars=yes");
	myWin.focus();	
}
function PopUpStore(id){
	var strURL;
	strURL = "http://www.cartoys.com/cartoy/webpages/popup_store.cfm?storecode="+id;
	if(! window.focus)return;
	var StoreWin=window.open(strURL,"","top=100,height=300,width=520,dependent=yes,resizable=yes, scrollbars=yes");
	StoreWin.focus();
}
function trim(dirtystring){
	var cleanstring = dirtystring;
	while( cleanstring.charAt(0) == ' ') {cleanstring = cleanstring.substring(1, cleanstring.length);}
	return cleanstring;
}
// This script looks at each image, and if it is broken, reloads it
function reloadBrokenImages(){
	if (!document.all) return;
	imageslength = document.images.length
	for (var i=0; i< imageslength; i++){
		if(!document.images[i].complete){
			document.images[i].src = document.images[i].src;
		}
	}
}

function getDOM(ObjectName){
	if (navigator.appName == "Netscape"){
		return document.getElementById(ObjectName)
	} else{
		return document.all[ObjectName];
	}
}

/*function toggleDisplay(ObjectName){
	buttonName = ObjectName.replace('ul', 'plus');
	if (getDOM(ObjectName).style.display == ''){ 
		getDOM(ObjectName).style.display = "none";
		eval( 'document.' + buttonName + 		'.src="http://cartoys.com/cartoy/images/+.gif"' );
	} else { 
		getDOM(ObjectName).style.display = "";
		eval( 'document.' + buttonName + '.src="http://cartoys.com/cartoy/images/-.gif"' );
	}
}
*/
