function fctMouse(obj)
{
	if(obj.className == "actionlink")
		obj.className = "actionlinkhover";
	else
		obj.className = "actionlink";
		
	var link = obj.src;
	
	if(link.indexOf("up") > 1)
	{
		obj.src = link.replace("up","over")
	}
	else if (link.indexOf("over") > 1)
	{
		obj.src = link.replace("over","up")
	}
}

function fctImage(obj)
{
	var classname = obj.className;
	if(classname.indexOf("bus") > -1)
	{
		if(obj.style.borderColor == "#033d53" || obj.style.borderColor == "")
		{
			obj.style.borderColor="Gray";
		}
		else
		{
			obj.style.borderColor="#033d53"
		}
	}
	else
	{
		if(obj.style.borderColor == "#840000" || obj.style.borderColor == "")
		{
			obj.style.borderColor="Yellow";
		}
		else
		{
			obj.style.borderColor="#840000"
		}
	}
}

function fctSpecSheet(ref)
{
	document.getElementById("ResultDiv").style.display = "none";
	document.getElementById("DetailDiv").style.display = "";
	document.getElementById("tbRef").value = ref;
	document.getElementById("btnLoadDetail").click();
}

function fctHideDetail()
{
	document.getElementById("ResultDiv").style.display = "";
	document.getElementById("DetailDiv").style.display = "none";
	document.getElementById("DetailDiv").innerHTML="";
}

function fctInquire(ref, model, branch, type)
{	
	window.showModalDialog("webform/inquire.aspx?ref=" + ref + "&model=" + model + "&branch=" + branch + "&type=" + type,"","dialogwidth:600px;dialogheight:290px");
	/*if(branch == 'WPI')
		var mail='webinfowpi@westernpeterbilt.com'
	else
		var mail='webinfowtpe@wtpe.com'
		
	var subject = 'Inquiry for stock# ' + ref + ', ' + model;
	var inputMessage='';
	location='mailto:'+mail+'?subject='+subject+'&message='+inputMessage;*/
}

function fctSentToFriend(ref, model, branch, type)
{	
	//window.showModalDialog("webform/emailtofriend.aspx?ref=" + ref + "&model=" + model + "&branch=" + branch + "&type=" + type,"","dialogwidth:450px;dialogheight:300px");
}

function fctPrintVehicle(ref, branch, type)
{
	window.open("webform/Vehicledetail.aspx?StockNo=" + ref + "&Branch=" + branch + "&Type=" + type + "&Print=yes")
}

function showpicture(obj)
{
	container = document.getElementById("largepic")
	container.src = obj.src;
}