rodiv = new Array();
rodiv[0]="block-views-ec_rollover-block_1";
rodiv[1]="block-views-re_rollover-block_1";
rodiv[2]="block-views-c_rollover-block_1";
rodiv[3]="block-views-t_rollover-block_1";
rodiv[4]="block-views-ts_rollover-block_1";
rodiv[5]="block-views-s_rollover-block_1";
rodiv[6]="block-views-pl_rollover-block_1";

menudiv = new Array();
menudiv[0]="electricalconstruction";
menudiv[1]="renewableenergy";
menudiv[2]="communications";
menudiv[3]="transportation";
menudiv[4]="technicalservices";
menudiv[5]="substation";
menudiv[6]="powerline";

posit = new Array();
posit[0]="40px";
posit[1]="106px";
posit[2]="172px";
posit[3]="238px";
posit[4]="304px";
posit[5]="370px";
posit[6]="436px";

arrowTop = new Array();
arrowTop[0]="62px";
arrowTop[1]="130px";
arrowTop[2]="193px";
arrowTop[3]="262px";
arrowTop[4]="325px";
arrowTop[5]="284px";
arrowTop[6]="350px";

leftLink = new Array();
leftLink[0]="<a href='/services/electrical-construction' class='leftLink'></a>";
leftLink[1]="";
leftLink[2]="<a href='/services/communications' class='leftLink'></a>";
leftLink[3]="";
leftLink[4]="<a href='/services/technical-services' class='leftLink'></a>";
leftLink[5]="<a href='/services/substation' class='leftLink'></a>";
leftLink[6]="<a href='/services/power-line' class='leftLink'></a>";

function rollover(div) {
	document.getElementById("ondummy").style.display="none";
	for (i = 0; i <= 6; i++) {
		if (document.getElementById(rodiv[i]).style.display=="block") {
			document.getElementById(rodiv[i]).style.display="none";
		}
		document.getElementById(menudiv[i]).style.fontSize="19px";
		document.getElementById(menudiv[i]).style.color="#8b4c70";
		if (div == rodiv[i]) {
			var idx = i;
		}
	}
	document.getElementById(menudiv[idx]).style.fontSize="22px";
	document.getElementById(menudiv[idx]).style.color="#640f43";
	document.getElementById(div).style.display="block";
	document.getElementById("ondummy").style.top=posit[idx];
	document.getElementById("ondummy").style.display="block";
	document.getElementById("ondummy").innerHTML = leftLink[idx];
	if ((idx != 1) && (idx != 3)) {
		document.getElementById("rollover_arrow").style.display="block";
		document.getElementById("rollover_arrow").style.top=arrowTop[idx];
	} else {
		document.getElementById("rollover_arrow").style.display="none";
	}
}


function contactShow() {
	$('#contactbox').slideDown('fast');
}

function contactHide() {
	$('#contactbox').slideUp('fast');
}

function openDSG() {
	$("#dimmer").height('100%');
	$("#dimmer").width('100%');
	$('#dsg_popup').slideDown('5000');
	if (ie6 == 'no') {
		$("#services_h1").addClass("shadow");
	}
}

function closeDSG() {
	$('#dsg_popup').fadeOut('slow',function(){
		$("#dimmer").height(0);
		$("#dimmer").width(0);
		}
	);
	$("a.dsglinks").removeClass("active");
	$("#services_h1").removeClass("shadow");
}

function showID(ID) {
	openDSG();
	$("div.eachid").addClass("off");
	$("a.dsglinks").removeClass("active");
	$("#"+ID).removeClass("off");
	$("#dsglink_"+ID).addClass("active");
	
	// create array for next and previous and set current ID
	
	i=0;
	links=new Array();
	$('div.eachid').each(function(){
		links[i]=this.id;
		if (this.id == ID) curridx = i;
		i++;
	});
	limit = (links.length);
	if (curridx + 1 >= links.length) {
		nextID = links[0];
	} else {
		nextID = links[(curridx + 1)];
	}
	
	if (curridx - 1 < 0) {
		prevID = links[(links.length-1)];
	} else {
		prevID = links[(curridx - 1)];
	}
}

function slides(ID) {
	
	/*$("#dimmer").fadeIn('slow',function(){
			$("#carousel").css("visibility","visible");
		}
	);*/
	$("#carousel").css("visibility","visible");
	$("#dimmer").height('100%');
	$("#dimmer").width('100%');
	fdprow('',ID,'');
	myCarousel.scroll(ID,true);
	$("#projects_h1").fadeIn('2000');

}

function closeslides() {
	$("#dimmer").height(0);
	$("#dimmer").width(0);
	$("#carousel").css("visibility","hidden");
	$("a.fdplinks").removeClass("active");
	$("#projects_h1").fadeOut('2000');
}

function fdprow(carousel,index,direction) {
	$("a.fdplinks").removeClass("active");
	if (index!= 0) {
		$("#fdp_"+index).addClass("active");
	}
	bgcolor(index);
}

function bgcolor(id) {
	$("div.node-carousel-item").removeClass("current");
	$("li.jcarousel-item-" + id + " div.node-carousel-item").addClass("current");
}

function imgSwitch(imgNum,path,imgID) {
	$("a.nc_img_a").removeClass("sel");
	$("a#nc_img_" + imgID + "_" + imgNum).addClass("sel");
	$("#img_" + imgID).attr("src",path);
}		

function projDets(projID) {
	if (document.getElementById('details_' + projID).style.display=="block") {
		$('#details_' + projID).slideUp('slow');
		$("#dets_link_"+projID).removeClass("on");
		
	} else {
		$('div.proj_dets').slideUp('fast');
		$('#details_' + projID).slideDown('slow');
		$('a').removeClass("on");
		$("#dets_link_"+projID).addClass("on");
	}
}

/* $("a.teaser").focus(function() {
	alert("attached");
}); */