var cons = false;
var ind = true;
var bus = true;
window.onload = function(){
	$$('div.Accordion').each(function(el){
		var accordionInit = new Accordion(el.getElements('div.acc_td'), el.getElements('div.stretcher'));
	});
	var t=setTimeout("startAccordion()", 700);
};
	
function startAccordion(){
document.getElementById('Accordion').style.visibility="visible";
}
	
function findPosX(obj) {
var curleft = 0;
if(obj.offsetParent != null)
	while(1)
	{
	  curleft += obj.offsetLeft;
	  if(!obj.offsetParent)
		break;
	  obj = obj.offsetParent;
	}
else if(obj.x)
	curleft += obj.x;
return curleft;
}

function findPosY(obj) {
var curtop = 0;
if(obj.offsetParent != null)
	while(1)
	{
	  curtop += obj.offsetTop;
	  if(!obj.offsetParent)
		break;
	  obj = obj.offsetParent;
	}
else if(obj.x)
	curtop += obj.x;
return curtop;
}

function placeDropdowns(){
	document.getElementById('accnav_drop_televisions').style.left = findPosX(document.getElementById('televisions')) - 193 + "px";
	document.getElementById('accnav_drop_televisions').style.top = (findPosY(document.getElementById('televisions'))) +"px";
	document.getElementById('accnav_drop_video').style.left = findPosX(document.getElementById('video')) - 193 + "px";
	document.getElementById('accnav_drop_video').style.top = (findPosY(document.getElementById('video'))) +"px";
	document.getElementById('accnav_drop_audio').style.left = findPosX(document.getElementById('audio')) - 193 + "px";
	document.getElementById('accnav_drop_audio').style.top = (findPosY(document.getElementById('audio'))) +"px";
	document.getElementById('accnav_drop_cameras').style.left = findPosX(document.getElementById('cameras')) - 193 +"px";
	document.getElementById('accnav_drop_cameras').style.top = (findPosY(document.getElementById('cameras'))) +"px";
	document.getElementById('accnav_drop_phones').style.left = findPosX(document.getElementById('phones')) - 193 + "px";
	document.getElementById('accnav_drop_phones').style.top = (findPosY(document.getElementById('phones'))) +"px";
	document.getElementById('accnav_drop_computers').style.left = findPosX(document.getElementById('computers')) - 193 + "px";
	document.getElementById('accnav_drop_computers').style.top = (findPosY(document.getElementById('computers'))) +"px";
	document.getElementById('accnav_drop_appliances').style.left = findPosX(document.getElementById('appliances')) - 193 + "px";
	document.getElementById('accnav_drop_appliances').style.top = (findPosY(document.getElementById('appliances'))) +"px";
	document.getElementById('accnav_drop_building').style.left = findPosX(document.getElementById('building')) - 193 + "px";
	document.getElementById('accnav_drop_building').style.top = (findPosY(document.getElementById('building'))) +"px";
	document.getElementById('accnav_drop_personal').style.left = findPosX(document.getElementById('personal')) - 193 + "px";
	document.getElementById('accnav_drop_personal').style.top = (findPosY(document.getElementById('personal'))) +"px";
	document.getElementById('accnav_drop_bus_building').style.left = findPosX(document.getElementById('bus_building')) - 193 + "px";
	document.getElementById('accnav_drop_bus_building').style.top = (findPosY(document.getElementById('bus_building'))) +"px";
	document.getElementById('accnav_drop_hospitality').style.left = findPosX(document.getElementById('hospitality')) - 193 + "px";
	document.getElementById('accnav_drop_hospitality').style.top = (findPosY(document.getElementById('hospitality'))) +"px";
	document.getElementById('accnav_drop_medical_video').style.left = findPosX(document.getElementById('medical_video')) - 193 + "px";
	document.getElementById('accnav_drop_medical_video').style.top = (findPosY(document.getElementById('medical_video'))) +"px";
	document.getElementById('accnav_drop_office').style.left = findPosX(document.getElementById('office')) - 193 + "px";
	document.getElementById('accnav_drop_office').style.top = (findPosY(document.getElementById('office'))) +"px";
	document.getElementById('accnav_drop_professional_vid').style.left = findPosX(document.getElementById('professional_vid')) - 193 + "px";
	document.getElementById('accnav_drop_professional_vid').style.top = (findPosY(document.getElementById('professional_vid'))) +"px";
	document.getElementById('accnav_drop_security').style.left = findPosX(document.getElementById('security')) - 193 + "px";
	document.getElementById('accnav_drop_security').style.top = (findPosY(document.getElementById('security'))) +"px";
	document.getElementById('accnav_drop_systems_int').style.left = findPosX(document.getElementById('systems_int')) - 193 + "px";
	document.getElementById('accnav_drop_systems_int').style.top = (findPosY(document.getElementById('systems_int'))) +"px";
	document.getElementById('accnav_drop_appliance_parts_motors').style.left = findPosX(document.getElementById('appliance_parts_motors')) - 193 + "px";
	document.getElementById('accnav_drop_appliance_parts_motors').style.top = (findPosY(document.getElementById('appliance_parts_motors'))) +"px";
	document.getElementById('accnav_drop_batteries_OEM').style.left = findPosX(document.getElementById('batteries_OEM')) - 193 + "px";
	document.getElementById('accnav_drop_batteries_OEM').style.top = (findPosY(document.getElementById('batteries_OEM'))) +"px";
	document.getElementById('accnav_drop_electrical_comp').style.left = findPosX(document.getElementById('electrical_comp')) - 193 + "px";
	document.getElementById('accnav_drop_electrical_comp').style.top = (findPosY(document.getElementById('electrical_comp'))) +"px";
	document.getElementById('accnav_drop_other_OEM').style.left = findPosX(document.getElementById('other_OEM')) - 193 + "px";
	document.getElementById('accnav_drop_other_OEM').style.top = (findPosY(document.getElementById('other_OEM'))) +"px";
}
function stay_on(cat) {
	if(cat == "menu_cons")
	{
		document.getElementById(cat).src = "images/accordian/acc-cons-on.gif";
		document.getElementById('menu_ind').src = "images/accordian/acc-ind.gif";
		document.getElementById('menu_bus').src = "images/accordian/acc-bus.gif";
		cons = false;
		ind = true;
		bus = true;
		document.getElementById('stretch1').style.border = "solid 1px #CFD0CB";
		document.getElementById('stretch3').style.border = 0;
		document.getElementById('stretch2').style.border = 0;
	}
	else if(cat == "menu_bus")
	{
		document.getElementById(cat).src = "images/accordian/acc-bus-on.gif";
		document.getElementById('menu_ind').src = "images/accordian/acc-ind.gif";
		document.getElementById('menu_cons').src = "images/accordian/acc-cons.gif";
		cons = true;
		ind = true;
		bus = false;
		document.getElementById('stretch1').style.border = 0;
		document.getElementById('stretch3').style.border = 0;
		document.getElementById('stretch2').style.border = "solid 1px #CFD0CB";
	}
	else if(cat == "menu_ind")
	{
		document.getElementById(cat).src = "images/accordian/acc-ind-on.gif";
		document.getElementById('menu_cons').src = "images/accordian/acc-cons.gif";
		document.getElementById('menu_bus').src = "images/accordian/acc-bus.gif";
		
		cons = true;
		ind = false;
		bus = true;
		document.getElementById('stretch1').style.border = 0;
		document.getElementById('stretch3').style.border = "solid 1px #CFD0CB";
		document.getElementById('stretch2').style.border = 0;
	}
}



