<!--
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_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}
function clearme(fe,txt){
		// check to see that the form element is the default text
		if (fe.value == txt){
			// clear the default text
			fe.value = "";
		} 
		$(fe).blur(function(e){
			if(fe.value == ""){
				fe.value = txt;
			}
		});
		return;
	}
	
function showresults(correctanswer, mypath, showpath ,elsepath, clearall,altcorrectanswer){
	if (clearall == 'true'){
			MM_changeProp('hideit1','','className','hideit','DIV')
			MM_changeProp('hideit2','','className','hideit','DIV')
			MM_changeProp('hideit2_1','','className','hideit','DIV')
			MM_changeProp('hideit2_2','','className','hideit','DIV')
			MM_changeProp('hideit3_1','','className','hideit','DIV')
			MM_changeProp('hideit6','','className','hideit','DIV')
			MM_changeProp('hideit7','','className','hideit','DIV')
			MM_changeProp('hideit8','','className','hideit','DIV')
			MM_changeProp('popFranchisedDealer','','className','hideit','DIV')
            MM_changeProp('popDealer','','className','hideit','DIV') 
            MM_changeProp('popPrivately','','className','hideit','DIV')  
            MM_changeProp('popNSOther','','className','hideit','DIV')
            MM_changeProp('popBonusCover','','className','hideit','DIV')
		}
	if (clearall == 'true1'){
			MM_changeProp('hideit2_1','','className','hideit','DIV')
			MM_changeProp('hideit2_2','','className','hideit','DIV')
			MM_changeProp('hideit3_1','','className','hideit','DIV')
			MM_changeProp('hideit6','','className','hideit','DIV')
			MM_changeProp('hideit7','','className','hideit','DIV')
			MM_changeProp('hideit8','','className','hideit','DIV')
			MM_changeProp('popBonusCover','','className','hideit','DIV')
		}

    if (((showpath == 'hideit7') || (showpath == 'hideit8')) && (correctanswer=='franchised_dealer'))
                {
                MM_changeProp('popFranchisedDealer','','className','hideit','DIV')
                MM_changeProp('popDealer','','className','hideit','DIV') 
                MM_changeProp('popPrivately','','className','hideit','DIV')  
                MM_changeProp('popNSOther','','className','hideit','DIV')  
                
                if (mypath=='franchised_dealer') MM_changeProp('popFranchisedDealer','','className','showit','DIV')
                if (mypath=='dealer_not_franchised') MM_changeProp('popDealer','','className','showit','DIV')
                if (mypath=='privately') MM_changeProp('popPrivately','','className','showit','DIV')
                if ((mypath=='not_sure') || (mypath == 'other')) MM_changeProp('popNSOther','','className','showit','DIV')
                }
    if ((showpath == 'hideit2_1') && (correctanswer=='Y'))
                {    
                MM_changeProp('popBonusCover','','className','hideit','DIV')
                if (mypath=='Y') MM_changeProp('popBonusCover','','className','showit','DIV')
                }


	if (mypath == 'error'){
		MM_changeProp(showpath,'','className','hideit','DIV')
		MM_changeProp(elsepath,'','className','hideit','DIV')        
	}
	else {
		if ((mypath == correctanswer) || (mypath == altcorrectanswer)){
			MM_changeProp(showpath,'','className','showit','DIV')
			MM_changeProp(elsepath,'','className','hideit','DIV')			
		}
		else {
			MM_changeProp(elsepath,'','className','showit','DIV')
			MM_changeProp(showpath,'','className','hideit','DIV')
		}
	}
	
	if ((showpath == 'hideit3_1') || (elsepath == 'hideit3_1')){
                MM_changeProp('bonusCoverMsg','','className','hideit','DIV')
                }
    if ((showpath == 'hideit7') || (elsepath == 'hideit7')){
                window.document.stupidform.monthsofwarranty.selectedIndex=0;
                }
    if ((showpath == 'hideit2') || (elsepath == 'hideit2')){
                window.document.stupidform.extendingwarranty.selectedIndex=0;
                }
    if ((showpath == 'hideit2_1') || (elsepath == 'hideit2_1')){
                window.document.stupidform.whoprovided.selectedIndex=0;
                }
    if ((showpath == 'hideit6') || (elsepath == 'hideit6')){
                window.document.stupidform.wherewillyoubuy.selectedIndex=0;
                MM_changeProp('popFranchisedDealer','','className','hideit','DIV')
                MM_changeProp('popDealer','','className','hideit','DIV') 
                MM_changeProp('popPrivately','','className','hideit','DIV')  
                MM_changeProp('popNSOther','','className','hideit','DIV')
                }
}

function titleit(){

sel = document.checkoutform.RQtitle.selectedIndex; 
val = document.checkoutform.RQtitle.options[sel].value; 
len = document.checkoutform.RQtitle.length;



if (val == "Other") { 
	var newtitle = prompt("Please enter your title." , ""); 
	if (newtitle == null) { return; } 
	document.checkoutform.RQtitle.options[sel].text = newtitle; 
	document.checkoutform.RQtitle.options[sel].value = newtitle;
	document.checkoutform.RQtitle.length = len +1; 
	document.checkoutform.RQtitle.options[len].text = "Other"; 
	document.checkoutform.RQtitle.options[len].value = "Other";
}

}

function swapit(id1,id2) {

	if (document.getElementById(id1).style.visibility=='visible') {
		showit(id2);
		hideit(id1);
	} else {
		showit(id1);
		hideit(id2);
	}

}

function swapit_q2() {

	if (document.getElementById('own1').style.visibility=='visible') {
		hideit('own1');
		showit('own2');
		showit('buy1');
		hideit('who1');
		hideit('who2');
		// setting default values of select fields after swap
		document.getElementById('ownsel').value=0;
		document.getElementById('buysel').value=1;
	} else {
		hideit('own2');
		showit('own1');
		showit('who1');
		hideit('buy1');
		hideit('buy2');
		// setting default values of select fields after swap
		document.getElementById('ownsel').value=1;
		document.getElementById('whosel').value=1;
	}

}



function showit(id) {
	document.getElementById(id).style.visibility = 'visible';
	document.getElementById(id).style.position = 'static';
}

function hideit(id) {
		document.getElementById(id).style.visibility = 'hidden';
		document.getElementById(id).style.position = 'absolute';
}

function popitup(url) {
	newwindow=window.open(url,'name','height=600,width=350');
	if (window.focus) {newwindow.focus()}
	return false;
}
//-->
