/*
	Copyright David Trewern Design         :: www.dtdesign.com ::
	Unauthorised modification / use is a criminal offence, and
	will be prosecuted to the fullest extent permitted by law.
	All Rights Reserved
*/

NAVarr = new Array("home", "arbv", "consumeradvice", "architects", "awards", "ape", "registration", "contactus", "links", "sitemap", "privacypolicy", "dtdcog", "cpd");
if (document.images) {
	for (var NAVitem in NAVarr) { 
		 for (var NAVicount=0; NAVicount < 2; NAVicount++) { 
				eval("b" + NAVarr[NAVitem] + NAVicount + " = new Image()");
				eval("b" + NAVarr[NAVitem] + NAVicount + ".src = 'assets/swap_" + NAVarr[NAVitem] + "_" + NAVicount + ".gif'");
		 } 
	} 
}

function BturnOn(imageName) {
	if (document.images) { document [imageName].src = eval("b" +imageName + "1.src");   }
}

function BturnOff(imageName) {
	if (document.images) { document [imageName].src = eval("b" + imageName + "0.src");   }
}

function imgPopup(path) {
	if (path) {
		window.open("utils_imagepopup.aspx?path=" + path, "popup", "width=400, height=300, toolbar=no, status=no, scrollbars=yes, resizable=yes");
	}
}
function changeBGColor(what, state) {
	var offColor = "#FFAE69";
	var onColor = "#FF9E4B";
	
	eval("what.style.backgroundColor = " + state + "Color");
}


$(document).ready(function(){

	//$(".dd_menu").css("display", "visible");
	
	$(".table_nav a").hover(function(){
									 
		$(".dd_menu").slideUp(200);
		
		var $ctnID = "#" + $(this).attr("id") + "Container";
		
		var position = $(this).children("img").offset();

		
		//alert(position.left);
		
		$($ctnID).css({
			'position' : 'absolute', 
			'top' : (position.top + 17) +'px',
			'left' : position.left+'px'
		}).slideDown(200);
		
	}, function(){
		
		var $ctnID = "#" + $(this).attr("id") + "Container";
		
		//$($ctnID).slideUp();
		
	});
	
	$(".dd_menu").hover(function(){
											  
		//alert("hi");
									 
		$(this).css("display", "block");
		
	}, function(){
				
		$(this).slideUp(200);
		
	});

});
