if (top != self) {
	top.location.href="index.php";
}

var n4, ie, n6;
var doc,doc2,doc3,sty;
var oncolor = "#e8e8e8";
var offcolor = "#ffffff";
var active_submenu1 = null;
var active_topelem = null;
var menu_close_timeout = 0;
var delay = 500;

if (document.layers) {
  doc = "document.";
  doc2 = ".document.";
  doc3 = "";
  sty = "";
  n4 = true;
} else if (document.all) {
  doc = "document.all.";
  doc2 = "";
  doc3 = "";
  sty = ".style";
  ie = true;
} else if (document.getElementById) {
  doc = "document.getElementById('";
  doc2 ="')";
  doc3 ="')";
  sty = "').style";
  n6 = "true";
} 
 
top_home_off = new Image;
top_home_off.src = "button_home_off.png";
top_home_on = new Image;
top_home_on.src = "button_home_on.png";

top_history_off = new Image;
top_history_off.src = "button_history_off.png";
top_history_on = new Image;
top_history_on.src = "button_history_on.png";

top_news_off = new Image;
top_news_off.src = "button_news_off.png";
top_news_on = new Image;
top_news_on.src = "button_news_on.png";

top_services_off = new Image;
top_services_off.src = "button_services_off.png";
top_services_on = new Image;
top_services_on.src = "button_services_on.png";

top_projects_off = new Image;
top_projects_off.src = "button_projects_off.png";
top_projects_on = new Image;
top_projects_on.src = "button_projects_on.png";

top_green_off = new Image;
top_green_off.src = "button_green_off.png";
top_green_on = new Image;
top_green_on.src = "button_green_on.png";

top_areamap_off = new Image;
top_areamap_off.src = "button_map_off.png";
top_areamap_on = new Image;
top_areamap_on.src = "button_map_on.png";

top_testimonials_off = new Image;
top_testimonials_off.src = "button_testimonials_off.png";
top_testimonials_on = new Image;
top_testimonials_on.src = "button_testimonials_on.png";

top_employment_off = new Image;
top_employment_off.src = "button_employment_off.png";
top_employment_on = new Image;
top_employment_on.src = "button_employment_on.png";

top_email_off = new Image;
top_email_off.src = "button_contact_off.png";
top_email_on = new Image;
top_email_on.src = "button_contact_on.png";

function onoff (elemparent,elem,state) {
	newstate = eval(elem+"_"+state);
	if (n4) {
		menuObj = eval (doc + elemparent + doc2 + elem);
	} else if (ie || n6) {
		menuObj = eval (doc + elem + doc2);
	}
	menuObj.src = newstate.src;
}

function changecolor(divname,colorname) {
	stopall();
	if (!n4) {
		menuObj = eval(doc + divname + sty);
		menuObj.backgroundColor = colorname;
  	}
}

function showhide(divname,state) {
	if (n4) {
		divObj = eval (doc + divname);
	} else {
		divObj = eval (doc + divname + sty);
	}
	divObj.visibility = state;
}

function closeallmenus() {
	if (active_submenu1 != null) {
		showhide(active_submenu1,'hidden');
	}
	if (active_topelem != null) {
		onoff('mainmenu',active_topelem,'off');
	}
}

function closeall() {
	menu_close_timeout = setTimeout('closeallmenus()',delay);
}

function stopall() {
	clearTimeout(menu_close_timeout);
}

function csubmenu(submenu1,topelem) {
	stopall();
	closeallmenus();
	if (submenu1 != null) {
  		showhide(submenu1,'visible');
  		active_submenu1 = submenu1;
	}
	if (topelem != null) {
		onoff('mainmenu',topelem,'on');
		active_topelem = topelem;
	}
}

function hideMenu(idToHide){
	if (document.childNodes) {
		document.getElementById(idToHide).style.display="none";
	}
}

function unhideMenu(idToHide){
	if (document.childNodes) {
		document.getElementById(idToHide).style.display="block";
	}
}
function chgiframe(wi,wn) {
	document.prtpro.prtproname.value=wn;
	parent.wproject.location.href=wi + ".php";
}

function chgiframe2(wi,wn) {
	document.wmap.prtwmap.value=wn;
	parent.wloc.location.href=wi + ".php"
}


