// JavaScript Document
if (document.images) {

// main menu rollover images //
	img2off = new Image();
	img2off.src = "/images/bttn_about_us_off.jpg";
	img2on = new Image();
	img2on.src = "/images/bttn_about_us_on.jpg";
	img3off = new Image();
	img3off.src = "/images/bttn_presidents_message_off.jpg";
	img3on = new Image();
	img3on.src = "/images/bttn_presidents_message_on.jpg";
	img4off = new Image();
	img4off.src = "/images/bttn_links_off.jpg";
	img4on = new Image();
	img4on.src = "/images/bttn_links_on.jpg";
	img5off = new Image();
	img5off.src = "/images/bttn_contact_us_off.jpg";
	img5on = new Image();
	img5on.src = "/images/bttn_contact_us_on.jpg";
	img6off = new Image();
	img6off.src = "/images/bttn_job_centre_off.jpg";
	img6on = new Image();
	img6on.src = "/images/bttn_job_centre_on.jpg";
	img7off = new Image();
	img7off.src = "/images/bttn_business_list_off.jpg";
	img7on = new Image();
	img7on.src = "/images/bttn_business_list_on.jpg";
	img8off = new Image();
	img8off.src = "/images/bttn_resource_centre_off.jpg";
	img8on = new Image();
	img8on.src = "/images/bttn_resource_centre_on.jpg";
	img22off = new Image();
	img22off.src = "/images/bttn_subsidiaries_off.jpg";
	img22on = new Image();
	img22on.src = "/images/bttn_subsidiaries_on.jpg";
// end main menu rollover images //
	imgLogoutoff = new Image();
	imgLogoutoff.src = "/images/menu/bttn_logout_off.gif";
	imgLogouton = new Image();
	imgLogouton.src = "/images/menu/bttn_logout_on.gif";
}

function img_toggle(imgName,state) {
	if (document.images) {
		document[imgName].src = eval(imgName + state + ".src");
	}
}

function action_confirm(msg,url) {
	if (confirm(msg)) {
		document.location.href=url;
	}
}

function toggle_mapmenu(id,li,a) {
	if(document.getElementById) {
		var el = document.getElementById(id);
		el.style.display = (el.style.display == 'none') ? 'block' : 'none';
		var el = document.getElementById(li);
		el.className = (el.className == "sitemap_sub_menu") ? "sitemap_sub_open" : "sitemap_sub_menu";
		var el = document.getElementById(a);
		el.className = (el.className == "sitemap_sub") ? "sitemap_sub_sel" : "sitemap_sub";
	}
}

function toggle_section(id,image) {
	if (document.getElementById) {
		var el = document.getElementById(id);
		el.style.display = (el.style.display == 'none') ? 'block' : 'none';
		img_state = (el.style.display == "none") ? "off" : "on";
		img_toggle(image,img_state);
	}
}

function toggle_credit_form(state) {
	if (document.getElementById) {
		el = document.getElementById('credit_form');
		el.style.display = state;
	}
}

function winOpen(addy,w,h) {
	LeftPosition = (screen.width) ? (screen.width - w)/2 : 0;
	TopPosition = (screen.height) ? ((screen.height - h)/2)-50 : 0;
	settings = 'width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+",status=yes,scrollbars=yes";
	mwin = window.open(addy,'win1',settings);
}

function check_searchbox(form,element,text) {
	searchbox = document.forms[form].elements[element];
	if (searchbox.value == "") {
		searchbox.value = text;
	}
	else if (searchbox.value == text) {
		searchbox.value = "";
	}
}

function write_mailto(domain, user, display_name) {
	document.write("<a href='mailto:" + user + "@" + domain + "'>");
	if (display_name)
		document.write(display_name);
	else
		document.write(user + "@" + domain);
		document.write("</a>");
}
