/********************\
 )		subnav		(
\********************/
function toggleOn(id) {	
	//safe function to show an element with a specified id
	var x=document.getElementById(id + 'DD')
	
	if (document.getElementById) { // DOM3 = IE5, NS6
		x.style.display = 'block';
	} else {
		if (document.layers) { // Netscape 4
		alertID(id);
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
	navRO(id + 'Lnk', '#F9C6A7', "/images/bg_navRO.jpg");
}
function toggleOff(id) {
	var x=document.getElementById(id + 'DD')
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		x.style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
	navRO(id + 'Lnk', '#FFFFFF', "/images/bg_nav.jpg");
}

function toggleOnParts(id) {	
//	//safe function to show an element with a specified id
//	var x=document.getElementById(id + 'DD')
//	
//	if (document.getElementById) { // DOM3 = IE5, NS6
//		x.style.display = 'block';
//	} else {
//		if (document.layers) { // Netscape 4
//		alertID(id);
//			document.id.display = 'block';
//		}
//		else { // IE 4
//			document.all.id.style.display = 'block';
//		}
//	}
	navRO(id + 'Lnk', '#999999', "/images/parts/bg_navRO.jpg");
}
function toggleOffParts(id) {
//	var x=document.getElementById(id + 'DD')
//	//safe function to hide an element with a specified id
//	if (document.getElementById) { // DOM3 = IE5, NS6
//		x.style.display = 'none';
//	}
//	else {
//		if (document.layers) { // Netscape 4
//			document.id.display = 'none';
//		}
//		else { // IE 4
//			document.all.id.style.display = 'none';
//		}
//	}
	navRO(id + 'Lnk', '#FFFFFF', "/images/parts/bg_nav.jpg");
}

//rollover state of the original button (ex: this is background-color change)
function navRO(x, color, image) {
    document.getElementById(x).style.color = color;
	document.getElementById(x).style.backgroundImage = "url(" + image + ")";
}

function rentalRO(x) {
	if(x.src.indexOf("_RO") > -1){
		x.src = x.src.replace("_RO","");	
	} else {
		x.src = x.src.substring(0, x.src.lastIndexOf(".")) + "_RO" + x.src.substring(x.src.lastIndexOf("."))
	}
}

function bigpicRO(x){
    document.getElementById("largepicRO").src = x.src;
    //x.style.borderColor = "#EE7023";
}

function searchnow(){
    if(document.getElementById("search")&&document.getElementById("criteria")){
        
        var term = document.getElementById("search").value;
        var ddbox = document.getElementById("criteria");
        var criteria = ddbox.options[ddbox.selectedIndex].value;
        
        if (term == 'search inventory') { alert('Please enter your search term.'); return;}
        if (criteria == ''){ alert('Please select a search criteria from the drop down.'); return;}
        
        var url = "/search.aspx?term=" + term + "&criteria=" + criteria;
        window.location=url;
    }
}

function subscribenow(){
    if(document.getElementById("newsletter")){
        var email = document.getElementById("newsletter").value;
       
       
       if (email == ''){ alert('Please enter your email address.'); }
       else if (email == 'newsletter signup'){ alert('Please enter your email address.'); }
       else {
            var url = "/subscribe.asp?email=" + email ;
            window.location=url;
        }
    }
}
