// contents for menu 1
var company='HTML/AU_The_Company.php?random='+(new Date()).getTime();
var team='HTML/AU_The_Team.php?random='+(new Date()).getTime();
var testimonial='HTML/AU_testimonial.php?random='+(new Date()).getTime();
var quality='HTML/AU_Quality_Assurance.php?random='+(new Date()).getTime();
var environment='HTML/AU_Environment.php?random='+(new Date()).getTime();
var news='HTML/NE_News.php?random='+(new Date()).getTime();
var events='HTML/NE_Events.php?random='+(new Date()).getTime();
var press='HTML/NE_Press.php?random='+(new Date()).getTime();
var helpsupport='HTML/SU_Help_And_Support.php?random='+(new Date()).getTime();
var maintenance='HTML/SU_Maintenance.php?random='+(new Date()).getTime();
var wholelife='HTML/SU_Wholelife.php?random='+(new Date()).getTime();
var project='HTML/SU_Project_Management.php?random='+(new Date()).getTime();
var community='HTML/AU_Cavendish_Community.php?random='+(new Date()).getTime();
var company_img = 'images/banners/the-company.png';
var testimonial_img = 'images/banners/client-testimonials.png';
var community_img = 'images/banners/community.png';
var environment_img = 'images/banners/environment.png';
var quality_img = 'images/banners/quality-assurance.png';
var news_img = 'images/banners/news.png';
var events_img = 'images/banners/events.png';
var maintenance_img = 'images/banners/maintenance.png';
var press_img = 'images/banners/press-releases.png';
var career_img = 'images/banners/Careers.png';
var help_img = 'images/banners/here-to-help.png';
var project_img = 'images/banners/project-management.png';
var wholelife_img = 'images/banners/whole-life-support.png';

function clickEvent(content, image){
	refreshContent(content);
	refreshImage(image);
}


var menu1=new Array();
menu1[0]='<div class="dropdown"><a href="index.php?sourcecode=site_company&dh_notetype=main&dh_typeid=the-company" class="dropdown" title="The Company">The Company</a></div>';
menu1[2]='<div class="dropdown"><a href="index.php?sourcecode=site_testimonial&dh_notetype=main&dh_typeid=client-testimonials" class="dropdown" title="Client Testimonials"">Client Testimonials</a></div>';
menu1[3]='<div class="dropdown"><a href="index.php?sourcecode=site_community&dh_notetype=main&dh_typeid=community" class="dropdown" title="Cavendish in the Community"">Cavendish in the Community</a></div>';
menu1[4]='<div class="dropdown"><a href="index.php?sourcecode=site_environment&dh_notetype=main&dh_typeid=environment" class="dropdown" title="Cavendish and the Environment"">Cavendish and the Environment</a></div>';
menu1[5]='<div class="dropdown"><a href="index.php?sourcecode=site_assurance&dh_notetype=main&dh_typeid=quality-assurance" class="dropdown" title="Quality Assurance"">Quality Assurance</a></div>';

var menu2=new Array(0);
menu2[0]='<div class="dropdown"><a href="index.php?sourcecode=site_news&dh_notetype=main&dh_typeid=news" class="dropdown" title="News">News</a></div>';
menu2[1]='<div class="dropdown"><a href="index.php?sourcecode=site_events&dh_notetype=main&dh_typeid=events" class="dropdown" title="Events">Events</a></div>';
menu2[2]='<div class="dropdown"><a href="index.php?sourcecode=site_press&dh_notetype=main&dh_typeid=press-releases" class="dropdown" title="Press Releases"">Press Releases</a></div>';

var menu3=new Array();
menu3[0]='<div class="dropdown"><a href="index.php?sourcecode=site_help&dh_notetype=main&dh_typeid=here-to-help" class="dropdown" title="Here To Help">Here To Help</a></div>';
menu3[1]='<div class="dropdown"><a href="index.php?sourcecode=site_support&dh_notetype=main&dh_typeid=whole-life-support" class="dropdown" title="Whole Life Support">Whole Life Support</a></div>';
menu3[2]='<div class="dropdown"><a href="index.php?sourcecode=site_maintenance&dh_notetype=main&dh_typeid=maintenance" class="dropdown" title="Maintenance">Maintenance</a></div>';
menu3[3]='<div class="dropdown"><a href="index.php?sourcecode=site_management&dh_notetype=main&dh_typeid=project-management" class="dropdown" title="Project Management">Project Management</a></div>';
menu3[4]='<div class="dropdown"><a href="index.php?sourcecode=site_training&dh_notetype=video&dh_typeid=here-to-help" class="dropdown" title="Training Videos">Training Videos</a></div>';
menu3[5]='<div class="dropdown"><a href="index.php?sourcecode=site_cavitsupport&dh_notetype=main&dh_typeid=here-to-help" class="dropdown" title="Cavit Support">IT Remote Support</a></div>';

// global menu settings
var menuwidth='100px';     //default menu width
var menubgcolor='ffffff';     //menu bgcolor
var disappeardelay=250;     //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes";    //hide menu when user clicks within menu?

/////No further editing needed

var ie4=document.all;
var ns6=document.getElementById&&!document.all;

if (ie4 || ns6)
	document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype)
{
var totaloffset;
var parentEl;

if (offsettype=="left")
	 totaloffset = what.offsetLeft;
else
	totaloffset =  what.offsetTop;

parentEl=what.offsetParent;

while (parentEl != null)
{
	if (offsettype=="left")	
		totaloffset= totaloffset+parentEl.offsetLeft;
	else
	 	totaloffset = totaloffset+parentEl.offsetTop;

	parentEl=parentEl.offsetParent;
}
if (offsettype == "top")
	return totaloffset+5;
else
	return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth)
{
if (ie4 || ns6)
	dropmenuobj.style.left=dropmenuobj.style.top=-500;

if (menuwidth != "")
{
	dropmenuobj.widthobj=dropmenuobj.style;
	dropmenuobj.widthobj.width=menuwidth;
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
	obj.visibility=visible;
else if (e.type=="click")
	obj.visibility=hidden;
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function populatemenu(what)
{
	if (ie4 || ns6)
		dropmenuobj.innerHTML=what.join("");
}


function dropdownmenu(obj, e, menucontents, menuwidth)
{
	if (window.event)
		event.cancelBubble=true;
	else if (e.stopPropagation)
		e.stopPropagation();

	clearhidemenu();
	if (document.getElementById)
		dropmenuobj=document.getElementById("dropmenudiv");
	else
		dropmenuobj = dropmenudiv;

	populatemenu(menucontents);

	if (ie4 || ns6)
	{
		showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth);
		dropmenuobj.x=getposOffset(obj, "left");
		dropmenuobj.y=getposOffset(obj, "top");
		dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px";
		dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px";
	}
	return clickreturnvalue();
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

function InfoWind(id)
{
var win = "info.php?id=" + id;
	window.open(win,"info", "height=500,width=500,toolbar=no,menubar=no,scrollbars=yes,top=20,left=20,resizable=yes");

}
function OpenWind(wind)
{

	window.open(wind,"terms", "height=500,width=500,toolbar=no,menubar=no,scrollbars=yes,top=20,left=20,resizable=yes");

}
function validate_email(email) 
{ 

	ans = true;
	if(-1 == email.indexOf("@")) 
		ans = false;
	else if (-1 != email.indexOf(",")) 
		ans = false;
	else if (-1 != email.indexOf(";")) 
		ans = false;
	else if (-1 != email.indexOf("#"))
		ans = false;
	else if (-1 != email.indexOf("!")) 
		ans = false;
	else if (-1 != email.indexOf(" ")) 
		ans = false;
	else if (email.length == (email.indexOf("@")+1) ) 
		ans = false;
	return ans; 
} 
function validate_address(addr) 
{ 

	ans = true;
	if(-1 != addr.indexOf("'")) 
		ans = false;
	else if (-1 != addr.indexOf('"')) 
		ans = false;
	return ans; 
} 