var popups = new Array();
$(function(){
	$(".IE6 #gnav li, .IE6 #lnav li").hover(function(){$(this).addClass('hover');}, function(){$(this).removeClass('hover');});
	$('#gnav li, #lnav li').css('cursor','pointer').click(function(e){e.stopPropagation(); if(this.firstChild.href)window.location=this.firstChild.href;});

	$("a[rel=external]").live("click", function(){this.target="_blank"});
	$(".IE .head-image img:first-child").addClass("first-child");
	$(".IE .head-image img:last-child").addClass("last-child");
	$(".IE6 #foot a, .IE7 #foot a").each(function(){$(this).css("color",$(this).parent().css("color"));});

	$("a[rel=popup]").each(function(){ popups.push(new Image());popups[popups.length-1].src=this.href;}).live("click", function(){
		pic1= new Image();pic1.src=this.href;
		try{popup.close();} catch(e){}
		popup = window.open("","popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width="+pic1.width+", height="+pic1.height);
		$(popup.document.body).html("<img src='"+this.href+"' alt=''/>").css("margin",0);
		return false;
	});
	
	$('a[rel=lightbox]').lightBox();

});

function validatecontactform(){
	var output = true;
	$("p.required :input").each(function(){if(this.value==""){ window.alert("You Must Fill out the filed titled '"+$(this).prev().text()+"'");output=false;}});
	return output;
}
