// ## contactUs.js
// 	Supplies the code that controls the location, size, and visibility of each drop down menu layer that appears below the selected menu item.

// FUNCTION LIST:
// 	positionLayers();
// 	checkLayer();
// 	clearLayers();

// TEMPLATE(S) USED:
// 	contact.html

// Sets the x and y coordinates of each layer depending on the user's browser.
function positionLayers() {
	if ((is.ns) && (is.mac)) { yPosition = 508; }
	else if ((is.ns5) && (is.pc)) { yPosition = 523; }
	else if	((is.ns) && (is.pc)) { yPosition = 508; }
	else if ((is.ie) && (is.mac)) { yPosition = 513; }
	else if ((is.ie) && (is.pc)) { yPosition = 538; }
	
	inquiry.moveTo(291,yPosition);
	dealer.moveTo(291,yPosition);
	vehicle.moveTo(291,yPosition);
	other.moveTo(291,yPosition);
	//sample.moveTo(291, yPosition +220)
}

// Sets the visibility of each layer depending on the selected option from the dropdown menu.
function checkLayer(inq) {
	// Retrieve the value of the current selected value of the drpTopic select box.
	var layerValue = document.frmTopic.drpTopic.selectedIndex;
	clearLayers();
	
			
	// Check the index value of the select box to determine which layer to show
	switch (layerValue) {
		case 0 : {break;}
		case 1 : {inquiry.show(); break;}
		case 2 : {dealer.show();break;}
		case 3 : {vehicle.show();break;}
		case 4 : {other.show();break;}
		default : {break;}
	}

	//sample.show();
}

// Hides all layers.
function clearLayers(){
	inquiry.hide();
	dealer.hide();
	vehicle.hide();
	other.hide();
	sample.hide();
}

function adderror()
{
	var txt='';
//	var y = 220 + 550;
	var y = 0;
txt='<table width="419" cellspacing="0" cellpadding="0" >';
txt += '<tr><td width="10"></td><td colspan="2" width="408" class="onerror"><b>Please complete the fields labeled in red<b></td></tr>';
txt += '</table>';
	sample.write(txt);
	sample.moveTo(281, y);
	sample.show();

}






