// JavaScript Document


var xmlHttp


function startAjax()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
}
 

function showDealers(str)
{ 

startAjax()

var url="results.asp?state="+ str
xmlHttp.onreadystatechange=stateChange
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChange() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("dealer_results").innerHTML=xmlHttp.responseText 
} 
} 




function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}


function init(){

var prod_main = document.getElementById("prod_main")
var prod_main_hardware = document.getElementById("prod_main_hardware")
var prod_enlarge = document.getElementById("prod_enlarge")
var prod_enlarge_hardware = document.getElementById("prod_enlarge_hardware")
var prod_features = document.getElementById("prod_features")
var tech_specs = document.getElementById("tech_specs")
var main_img = document.getElementById("tech_main_pop")
var prod_main_img = document.getElementById("main_img")
var main_src
var size_chart_link = document.getElementById("size_chart_link")
var size_chart = document.getElementById("size_chart")

if(prod_main_img != null){
	prod_main_img.onclick = function(){
			prod_enlarge.style.display = "block"
			prod_features.style.display = "none"
		}
		
	prod_enlarge.onclick = function(){	
			prod_enlarge.style.display = "none"
			prod_features.style.display = "block"
		}
}

if(prod_main_hardware != null){
	prod_main_hardware.onclick = function(){
		
		if(prod_enlarge_hardware.style.display != "block"){
			prod_enlarge_hardware.style.display = "block"
			prod_features.style.display = "none"
		}else{
			prod_enlarge_hardware.style.display = "none"
			prod_features.style.display = "block"
		}
	}
}


if(tech_specs != null){
	
	var tech_pop = tech_specs.getElementsByTagName("IMG")
	
	for(i=0;i<tech_pop.length;i++){
		main_src = main_img.src
		tech_pop[i].onclick = function(){
			main_img.innerHTML = '<img src="/images/technology/tech_' + this.id + '_popover.gif" id="tech_popover" />'
			main_img.style.cursor = 'pointer'
		}
	}
	
	main_img.onclick = function(){
			main_img.innerHTML = ''	
			main_img.style.cursor = 'arrow'
		}
}


if(size_chart_link != null){
	
	size_chart_link.onclick = function(){
			size_chart.style.display = "block"
	}
	
	size_chart.onclick = function(){
			size_chart.style.display = "none"
	}
	
}
	
}