
var browser = navigator.appName;
if (navigator.userAgent.toLowerCase().indexOf("opera")>=0) browser = "Opera";
var platform = "pc";
var whichStyle = "pc_ie";
is = new BrowserCheck();
function BrowserCheck() {
if (navigator.appVersion.toLowerCase().indexOf('mac')>=0) {
platform = "mac";
this.mac = true;
}
else this.pc = true;
this.platform = platform;
var vers = parseInt(navigator.appVersion);
this.vers = vers;
this.browser = browser;
switch (browser) {
case "Microsoft Internet Explorer":
this.ie = true;
browser_base = "ie";
browser_family = "ie3";
whichStyle = "pc_ie";
if (vers <= 3) {
browser_vers = "ie3.0";
this.ie3 = true;
}
if (vers >= 4)	{
browser_family = "ie5";
browser_vers = "ie5.0";
if (navigator.userAgent.toLowerCase().indexOf('msie 4')>=0) {
this.ie4 = true;
browser_vers = "ie4.0";
}
if (navigator.userAgent.toLowerCase().indexOf('msie 5.0')>=0) {
this.ie5 = true;
this.vers = 5;
browser_vers = "ie5.0";
}
if (navigator.userAgent.toLowerCase().indexOf('msie 5.5')>=0) {
this.ie5 = true;
this.vers = 5;
browser_vers = "ie5.5";
}
if (navigator.userAgent.toLowerCase().indexOf('msie 6')>=0) {
this.ie5 = true;
this.vers = 5;
this.ie6 = true;
browser_vers = "ie6.0";
}
browser_family = browser_vers.substr(0,3);
}
break;
case "Netscape":
this.ns = true;
browser_base = "ns";
whichStyle = "pc_ns";
if (vers <= 3)	{
this.ns3 = true;
browser_family = "ns3";
browser_vers = "ns3.0";
}
if (vers == 4)	{
this.ns4 = true;
browser_vers = "ns4.0";
browser_family = "ns4";
if (navigator.userAgent.toLowerCase().indexOf('mozilla/4')>=0) browser_vers = "ns4.0";
if (navigator.userAgent.toLowerCase().indexOf('mozilla/4.7')>=0) browser_vers = "ns4.7";
}
if (vers >= 5)	{
this.ns5 = true;
this.ns6 = true;
browser_vers = "ns6.0";
browser_family = "ns6";
whichStyle = "pc_ie";
if (navigator.userAgent.toLowerCase().indexOf('netscape6')>=0) browser_vers = "ns6.0";
if (navigator.userAgent.toLowerCase().indexOf('netscape6/6.1')>=0) browser_vers = "ns6.1";
if (navigator.userAgent.toLowerCase().indexOf('netscape6/6.2')>=0) browser_vers = "ns6.2";
}
break;
case "Opera":
this.op = true;
if (navigator.userAgent.toLowerCase().indexOf("opera/5")>=0) {
browser_base = "op";
browser_family = "op5";
browser_vers = "op5.0";
whichStyle = "pc_ns";
}
else {
browser_base = "op";
browser_family = "op6";
browser_vers = "op6.0";
whichStyle = "pc_ie";
}
break;
default:
browser_base = "uk";
browser_vers = "uk5";
whichStyle = "pc_ie";
break;
}
}
if (platform == "mac") {
if (browser_family == "ns6") whichStyle="mac_ns";
else whichStyle="mac_ie";
}
if (document.location.href.indexOf("/travel/home/")==-1)
document.write('<link rel=\"stylesheet\" href=\"css/'+whichStyle+'.css\" type=\"text/css\" />');
else
document.write('<link rel=\"stylesheet\" href=\"css/home_'+whichStyle+'.css\" type=\"text/css\" />');
function openWindow( url, width, height, options) {
if ( ! width ) width = 640;
if ( ! height ) height = 420;
if ( ! options ) options = "scrollbars=no,menubar=no,toolbar=no,location=no,status=no,resizable=yes";
var newWin = window.open( url, name, "width=" + width + ",height=" + height + "," + options );
}
function stopError() {
return true;
}
if (window.location.hostname.indexOf('www.')==0)
{
window.onerror = stopError;
}
function urlrewrite(idname, protocolType)
{
var protocol=document.nav_form.protocol.value;;
if(protocolType=="https") protocol=protocolType;
var lurl=protocol+"://"+document.nav_form.hostname.value;
var audience;
if (document.nav_form.audience!=null)
audience=document.nav_form.audience.value;
else
audience="travel";
if (audience !=null && audience>"") {lurl+="/"+audience;}
if (idname !=null && idname>"") {lurl+="/"+idname.toLowerCase();}
var logintype = document.nav_form.logintype.value;
if (logintype !=null && logintype>"") {lurl+="/"+logintype;}
var langadded=false;
var lang=document.nav_form.language.value;
if (lang!=null && lang>""){
var underscore=lang.indexOf("_");
if (underscore != -1)
{lang=lang.substring(0, underscore);}
langadded=true;
lurl+="/"+lang +"_";
}
var country = document.nav_form.country.value;
if (country!=null && country>""){
if (langadded == false){
lurl+="/";
}
lurl+=country;
}
var cv=document.nav_form.scheme.value;
if (cv!=null && cv>"") lurl+="/"+cv;
if (arguments.length > 2)
{
var urlextension=arguments[2];
lurl+="/"+urlextension;
}
return lurl;
}
function newloc(pageid)
{
var newLocation;
if (arguments.length==1)
newLocation=urlrewrite(pageid);
else if (arguments.length==2)
{
var urlextension=arguments[1];
newLocation=urlrewrite(pageid,null,urlextension);
}
else if (arguments.length==3)
{
var urlprotocol=arguments[1];
var urlextension=arguments[2];
newLocation=urlrewrite(pageid,urlprotocol,urlextension);
}
document.location=newLocation;
}
function ukushome(){
newloc('HOME');
}
function openNewWindow(url) {
externalWin = window.open(url, 'extWindow', 'width=600,height=550,top=100,left=50,toolbar=yes,scrollbars=yes,resizable=yes,menubar=yes,status=yes,location=yes')
externalWin.focus();
}
function clearloginform(){
var form = document.loginform;
var mmbform = document.mmbform
if (form) {
if (form.membershipNumber) form.membershipNumber.value = "";
if (form.password) form.password.value = "";
}
if (mmbform) {
if (mmbform.lastname) mmbform.lastname.value = "";
if (mmbform.bookingRef) mmbform.bookingRef.value = "";
}
}
function popUpScrolling(url,w,h){
if (typeof w=='undefined' || w==''){w='450'}
if (typeof h=='undefined' || h==''){h='350'}
window.name = "BA_Main";
var toolbar = "toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,width="+w+",height="+h;
var myPopup = window.open(url,"BA_Popup",toolbar);
myPopup.focus();
}
function functionalPageLoad() {}
function loadHandler() {}
function pageload() {
if (platform=="mac")
{
if (typeof macinitialload=="undefined") macinitialload=false;
if (macinitialload==false)
{
macinitialload=true;
writeVerneNav('menu',strmac);
}
}
loadHandler();
clearloginform();
if (window.init) init();
}
function getcountry()
{
return window.document.nav_form.country.value.toUpperCase();
}
function selectbaholscountry()
{
document.location = "http://www.baholidays.com/home.jsp?chosenCountry=" + getcountry();
}
function openNewBahWindow(url,option) {
var bahcountry = getcountry();
var adref1 = "&ADREF=BA_";
var adref2 = "_LHN";
if (bahcountry != null && bahcountry != "")
{
url = url + bahcountry + adref1 + bahcountry + adref2;
if (option != "")
{
url = url + "_" + option;
}
}
else
{
url += "GB";
}
externalWin = window.open(url, 'extWindow', 'width=600,height=550,top=100,left=50,toolbar=yes,scrollbars=yes,resizable=yes,menubar=yes,status=yes,location=yes')
externalWin.focus();
}
function getElm(id){
if (document.layers) return document.layers[id];
else if (document.all) return document.all[id];
else return document.getElementById(id);
}
var px = (browser_family=="ns4" || browser_family=="op5") ? "" : "px";
function printpage()
{
tradeurl=this.location.href;
tradeurl=tradeurl.replace('trade','trade/ba6.jsp');
newwindow=window.open(tradeurl,"trade","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=460,height=500");
newwindow.focus();
setTimeout('printAfterDelay()',1000);
}
function printAfterDelay()
{
newwindow.print();
}
function sendemail()
{
var pagelink="/webmail/sendemail?link=";
pagelink += document.location.href;
window.open(pagelink,"sendmail", "width=250, height=369, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes");
}
function checkLogin(){
if (!notNull(document.loginform.membershipNumber.value)) return false;
if (!notNull(document.loginform.password.value)) return false;
return true;
}
function writeCurrentCountry(chosen) {
if (chosen == "") return("Pick your country");
for (i=0; i<arr.length; i++) {
var cv = arr[i];
var code = cv.substring(0,2);
var country = cv.substring(3, cv.length);
if (chosen==code)
{
return(country);
break;
}
}
}
function clickButton(text,linkurl)
{
divChoice = (document.all && document.getElementById && !document.body.uniqueID) ? "vsubmit3" : "vsubmit";
document.write('<div class='+divChoice+'>');
document.write('<div class="vsubmit2">');
document.write('<a style="color:#FFFFFF; text-decoration:none;" title="'+text+'" href="'+linkurl+'">'+text+"&nbsp;");
document.write('<img src="http://media.corporate-ir.net/media_files/irol/69/69499/images/icons/icon_white_triangle.gif" border="0" width="15" alt="'+text+'"></a></div></div>');
}
function MmbForm()
{
form_ok=true;
if (document.mmbform.lastname.value == null || document.mmbform.lastname.value == ""){
form_ok=false;
}
if (form_ok==true)document.mmbform.submit();
}
function checkMmbLogin(){
if (!notNull(document.mmbform.bookingRef.value)) return false;
if (!notNull(document.mmbform.lastname.value)) return false;
return true;
}
var HEADING=1;
var HEADINGLINK=2;
var SUBHEADING=3;
var LINK=4;
var TERTLINK=5;
var FINALARRAYELEMENT=6;
var LOGINBOX=7;
var button_delay;
var browser=navigator.appName;
var j=0;
var retrieve_count=0;
var lhcount=0;
var lhmenu=new Array(0);
var qstring_arr=new Array(0);
var forceclick="no";
var heading_link;
var subheading_link;
var highlight_subheading;
var headinglink_link;
var selected_array_pos;
var selected_pos_text;
var highlight_selected_pos;
var elmt_selected=-1;
var item_selected=-1;
var linkfound=false;
var queryfound=false;
var nav_space=177;
var iframewrite=true;
var macinitialload=false;
var strmac;
if (browser_vers=="ie5.0" || browser_vers=="op6.0") iframewrite=false;
document.write('<div id="menu2" style="z-index: 999; visibility: visible; position: absolute; left: 160px; top: 161px;"></div>');
if (iframewrite) document.write('<iframe id="DivTert" src="/cms/s.gif" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; display:none; z-index:997;"></iframe>');
function menuItem(type,parid,id,text,link)
{
if (type==FINALARRAYELEMENT) return;
var item=new Item(type,parid,id,text,link);
lhmenu[lhcount]=item;
if (lhmenu[lhcount].id==document.nav_form.pageid.value && linkfound==false)
{ var prim="prim";
var sec="sec";
getQueryValue(prim);
qstring_arr[0]=string_arr[i].toUpperCase();
getQueryValue(sec);
if (string_arr[i]!="not found") qstring_arr[1]=string_arr[i].toUpperCase();
var exitloop=false;
selected_array_pos=lhcount;
highlight_selected_pos=selected_array_pos;
selected_pos_text=lhmenu[highlight_selected_pos].text;
var menutype=lhmenu[lhcount].type;
if (queryfound==true)
{	if (menutype==LINK) find_secondary();
if (menutype==TERTLINK)
{	find_tertiary();
find_secondary();
}
if (menutype==HEADINGLINK) find_headinglink(menutype);
}
else no_querylink(menutype);
}
lhcount+=1;
return;
}
function find_secondary()
{
if (lhmenu[lhcount].parid==qstring_arr[0] || lhmenu[retrieve_count].type==SUBHEADING)
{ if (lhmenu[lhcount].parid==qstring_arr[0]) retrieve_count=lhcount;
for (retrieve_count=retrieve_count; retrieve_count>=0; retrieve_count--)
{ if (lhmenu[retrieve_count].type==HEADING)
{	elmt_selected=retrieve_count;
heading_link=lhmenu[retrieve_count].text;
linkfound=true;
break;
}
}
}
}
function find_tertiary()
{
if (lhmenu[lhcount].parid==qstring_arr[1])
{
for (retrieve_count=lhcount; retrieve_count>=0; retrieve_count--)
{	if (lhmenu[retrieve_count].type==SUBHEADING)
{	subheading_link=lhmenu[retrieve_count].text;
highlight_subheading=subheading_link;
break;
}
}
}
}
function find_headinglink(menutype)
{	if (menutype==HEADINGLINK && lhmenu[lhcount].parid==qstring_arr[0])
{	headinglink_link=lhmenu[lhcount].text;
linkfound=true;
}
}
function no_querylink(menutype)
{	for (retrieve_count=lhcount; retrieve_count>=0; retrieve_count--)
{
if (menutype==LINK && lhmenu[retrieve_count].type==HEADING)
{ elmt_selected=retrieve_count;
heading_link=lhmenu[retrieve_count].text;
linkfound=true;
break;
}
if (menutype==TERTLINK && lhmenu[retrieve_count].type==SUBHEADING)
{	subheading_link=lhmenu[retrieve_count].text;
highlight_subheading=subheading_link;
for (retrieve_count=retrieve_count; retrieve_count>=0; retrieve_count--)
{	if (lhmenu[retrieve_count].type==HEADING)
{	elmt_selected=retrieve_count;
heading_link=lhmenu[retrieve_count].text;
linkfound=true;
exitloop=true;
break;
}
}
if (exitloop==true) break;
}
if (menutype==HEADINGLINK && lhmenu[retrieve_count].type==HEADINGLINK)
{	headinglink_link=lhmenu[retrieve_count].text;
linkfound=true;
break;
}
}
}
function Item(type,parid,id,text,link)
{	this.type=type;
this.parid=parid;
this.id=id;
this.text=text;
this.link=link;
}
function writeVerneNav(layerName, str)
{
if (typeof getElm(layerName) == "undefined") return;
if (document.getElementById||document.all)
{
if (typeof getElm(layerName) != "undefined") getElm(layerName).innerHTML=str;
if (browser_vers=="op6.0") document.getElementById(layerName).innerHTML=str;
}
else if (document.layers)
{	getElm(layerName).document.open();
getElm(layerName).document.writeln(str);
getElm(layerName).document.close();
}
var DivMenu=document.getElementById('menu2');
if (iframewrite) var IfrMenu=document.getElementById('DivTert');
if (navigator.appName=="Netscape")
{	if (DivMenu.style.display=="none") DivMenu.style.display="block";
else if (DivMenu.style.display=="block") DivMenu.style.display="none";
}
else
{	if (document.getElementById("menu2").style.display=="none")
{	DivMenu.style.display="block";
if (iframewrite)
{	IfrMenu.style.width=DivMenu.offsetWidth;
IfrMenu.style.height=DivMenu.offsetHeight;
IfrMenu.style.top=DivMenu.style.top;
IfrMenu.style.left=DivMenu.style.left;
IfrMenu.style.zIndex=DivMenu.style.zIndex - 1;
IfrMenu.style.display="block";
}
}
else
{	DivMenu.style.display="none";
if (iframewrite) IfrMenu.style.display="none";
}
}
}
function createMenu()
{	if (browser=="Netscape")
{	nav_space=182;
str='<table width="160" cellpadding="0" cellspacing="0" height="5" valign="top" bgcolor="#FFFFFF" ><tr><td colspan="2"><img src="http://media.corporate-ir.net/media_files/irol/69/69499/images/icons/topbar.gif" width="160" height="5" border="0" alt="Top bar"></td></tr></table>';
str+='<table width="160" cellpadding="0" cellspacing="0" height="307" valign="top" bgcolor="#666699" >';
}
else str='<table width="160" cellpadding="0" cellspacing="0" height="307" valign="top" bgcolor="#666699" >';
menulen=lhmenu.length;
str+='<tr><td valign="top"><table cellpadding="0" cellspacing="0" valign="top" border="0">';
showItems=false;
subMenu=false;
prevHeading=false;
ypos=0;
for (lhcount=0; lhcount<menulen; lhcount++)
{
if ((lhmenu[lhcount].type==HEADING) || (lhmenu[lhcount].type==HEADING && lhmenu[lhcount].text==heading_link))
{
if ((lhcount==elmt_selected) || (lhmenu[lhcount].text==heading_link))
{	arrow="d";
menulink="Close";
showItems=true;
}
else
{	arrow="r";
menulink="Open";
showItems=false;
}
submenu=false;
cssClass="menu_primary";
hreflink='<a href="javascript:void(0);" class="menu_primary_text" onClick="javascript:menu'+menulink+'('+lhcount+');return false;">';
str+='<tr class='+cssClass+' onmouseover="this.className=\'menu_primary_hover\'" onmouseout="this.className=\''+cssClass+'\'"><td width="88%">&nbsp;'+hreflink+lhmenu[lhcount].text+'</td><td width="12%">'+hreflink+'<img src="http://media.corporate-ir.net/media_files/irol/69/69499/images/icons/'+arrow+'arrow.gif" width="20" height="24" border="0" alt="Arrow"></td></tr>';
ypos=ypos+24;
prevHeading=true;
}
else if ((lhmenu[lhcount].type==HEADINGLINK) || (lhmenu[lhcount].type==HEADINGLINK && lhmenu[lhcount].text==headinglink_link))
{
if ((lhcount==item_selected) || (lhmenu[lhcount].text==headinglink_link)) cssClass="menu_primary_hover";
else cssClass="menu_primary";
hreflink='<a href="javascript:findlink('+lhcount+')" class="menu_primary_text" onClick="linkto('+lhcount+')">';
str+='<tr class="'+cssClass+'" onmouseover="this.className=\'menu_primary_hover\'" onmouseout="this.className=\''+cssClass+'\'"><td width="88%">&nbsp;'+hreflink+lhmenu[lhcount].text+'</td></a><td width="12%">'+hreflink+'<img src="http://media.corporate-ir.net/media_files/irol/69/69499/images/icons/rarrow.gif" width="20" height="24" border="0" alt="Arrow"></td></tr></a>';
ypos=ypos+24;
prevHeading=true;
}
if (showItems)
{	prevHeading=false;
if ((lhcount==item_selected) || (lhcount==selected_array_pos)) cssClass="menu_selected";
else cssClass = "menu_item";
if (lhmenu[lhcount].type==SUBHEADING)
{	if (lhmenu[lhcount].text==highlight_subheading) cssClass="menu_selected2";
thelink='"javascript:menuPopup('+(lhcount+1)+','+ypos+');"';
hreflink='<a href='+thelink+' class="menu_text" onMouseOver=use_timer('+thelink+');>';
str+='<tr class="'+cssClass+'" onmouseover="this.className=\'menu_item_hover\'"; onmouseout="this.className=\''+cssClass+'\';button_off();"><td width="88%">&nbsp;'+hreflink+lhmenu[lhcount].text+'</a></td><td width="12%">'+hreflink+'<img src="images/icons/rarrow2.gif" border="0" width="20" height="20" alt="Arrow"></a></td></tr>';
if (lhmenu[lhcount].text==subheading_link)
{	forceclick="yes";
var ypos2=ypos;
var lhstore=lhcount+1;
}
subMenu=true;
ypos=ypos+15;
}
else
{ if (lhmenu[lhcount].type==LINK && !submenu)
{	if (lhcount==highlight_selected_pos) cssClass="menu_selected2";
hreflink='<a href="javascript:findlink('+lhcount+')" class="menu_text" onClick="linkto('+lhcount+')">';
str+='<tr class="'+cssClass+'" onmouseover="this.className=\'menu_item_hover\'" onmouseout="this.className=\''+cssClass+'\'"><td width="100%" colspan="2" height="20">&nbsp;'+hreflink+lhmenu[lhcount].text+'</td></tr></a>';
ypos=ypos+15;
}
}
}
}
if (prevHeading) str+='<tr><td colspan="2"></td></tr>';
str+='<tr class="menu_primary"><td colspan="2">&nbsp;</td></tr>';
str+='</table>';
if (platform == "mac")
{
str+='</tr></table>&nbsp;\n';
strmac=str;
}
else str+='</tr></table>';
if (platform!="mac" || browser_vers!="ie5.0" || macinitialload==true)
writeVerneNav('menu',str);
if (forceclick=="yes") menuPopup(lhstore,ypos2);
selected_array_pos="";
}
function menuClose()
{	heading_link="";
subheading_link="";
selected_array_pos="";
j=0;
item_selected=-1;
elmt_selected=-1;
Clear_tert_menu(-25,0);
createMenu();
}
function menuOpen(menu_num)
{	heading_link="";
subheading_link="";
selected_array_pos="";
item_selected=-1;
elmt_selected=menu_num;
Clear_tert_menu(-25,0);
createMenu();
}
function popUpNonScrolling(url,w,h)
{
if (typeof w=='undefined' || w==''){w='450'}
if (typeof h=='undefined' || h==''){h='350'}
window.name = "BA_Main";
var toolbar = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,width="+w+",height="+h;
var myPopup = window.open(url,"BA_Popup",toolbar);
myPopup.focus();
}
function menuPopup(menu_num,ypos)
{	forceclick="no";
if (menu_num!=j)
{	j=menu_num;
menulen=lhmenu.length;
}
if (menu_num<0 || menu_num>=menulen) str="";
else
{	str='<table id=tertiary width="160" border="0" cellpadding="0" cellspacing="0" onmouseout="close_table(event);">';
str+='<tr><td colspan="2"><img src="http://media.corporate-ir.net/media_files/irol/69/69499/images/icons/tert_topbar.gif" width="100%" height="5" border="0" alt="Top bar"></td></tr>';
for (lhcount=menu_num; lhcount<menulen; lhcount++)
{	if (lhmenu[lhcount].type!=TERTLINK) break;
else
{	if ((lhcount==item_selected) || (lhcount==selected_array_pos)) cssClass="menu_selected";
else cssClass="menu_item";
if (lhcount == highlight_selected_pos) cssClass="menu_selected2";
hreflink='<a href="javascript:findlink('+lhcount+')" class="menu_text" onClick="popLinkto('+menu_num+','+lhcount+')";>';
str+='<tr class="'+cssClass+'" onmouseover="this.className=\'menu_item_hover\'" onmouseout="this.className=\''+cssClass+'\'"><td width="3%"><img src="http://media.corporate-ir.net/media_files/irol/69/69499/images/icons/transparent.gif" border="0" width="6" height="20" alt=""></td><td width="97%">'+hreflink+lhmenu[lhcount].text+'</td></tr>';
}
}
str+='<tr><td colspan="2"><img src="http://media.corporate-ir.net/media_files/irol/69/69499/images/icons/botbar.gif" width="100%" height="5  border="0" alt="Bottom bar"></td></tr>';
		if (platform=="mac") str+='</table>\n';
		else str+='</table>';
	}
	if (selected_array_pos=="")
		{	if (ypos>-1) 
			 {	 getElm("menu2").style.top=(nav_space)+(ypos);
				 document.getElementById("menu2").style.display="none"
				 writeVerneNav('menu2',str);//write out the menu
			 }
		}
	selected_array_pos="";
}
function Clear_tert_menu(menu_num,ypos)//deletes any tertiary menus currently open
{	menulen=lhmenu.length;
	str="";
	if (ypos>-1) getElm("menu2").style.top=(nav_space)+(ypos);
	writeVerneNav('menu2',str);
}
function linkto(link_num)
{	item_selected=link_num;
	cssClass="menu_selected";
}
//if the item contains a link this function is called.  If the item contains a page id use that, if not use the specified link.  We also need to build the querystring to enable our breadcrumb functionality
function findlink(lhcount)
{	var querylhnav="";
	var prim_par_id="";
	var sec_par_id="";
	var pagelink;
	
	//secondary or primary menu with a link
	if ((lhmenu[lhcount].type==LINK) || (lhmenu[lhcount].type==HEADINGLINK)) prim_par_id=lhmenu[lhcount].parid;
	
	else //we have a tertiary menu
	{	sec_par_id=lhmenu[lhcount].parid;
		//loop backwards to obtain the primary menu parent id
		for (retrieve_count=lhcount; retrieve_count>=0; retrieve_count--)
					{	if (lhmenu[retrieve_count].parid!=sec_par_id)
				  			{	prim_par_id=lhmenu[retrieve_count].parid;
				   		 		 break;
				  			}	
				 	}
	}	
	
	querylhnav="?prim="+prim_par_id.toLowerCase();

	if (lhmenu[lhcount].link!="")//if we have a page id use it
	{   pagelink=lhmenu[lhcount].link;
		window.location=pagelink;
	}
	else //we have page id
	{	pagelink=lhmenu[lhcount].id;
		
		if (sec_par_id=="")
		{	pagelink=buildVerneUrl(pagelink);
	      	pagelink+=querylhnav;
		  	window.location=pagelink;
		}
		else
		{	querylhnav=querylhnav+"&sec="+sec_par_id.toLowerCase();
		  	pagelink=buildVerneUrl(pagelink);
		 	pagelink+=querylhnav;
		  	window.location=pagelink;
		}  
	}
}
function buildVerneUrl(pageid)//build the url from the given pageid
{	var newLocation;
	if (arguments.length==1) newLocation=urlrewrite(pageid);
	
	else if (arguments.length==2) //add in content classifications and other parameters
	{   var urlextension=arguments[1];
		newLocation=urlrewrite(pageid,null,urlextension);
	}
	else if (arguments.length==3) //add in content classifications and other parameters
	{   var urlprotocol=arguments[1];
		var urlextension=arguments[2];
		newLocation=urlrewrite(pageid,urlprotocol,urlextension);
	}
	return(newLocation);
}
function popLinkto(menu_num,link_num)
{	heading_link="";
	subheading_link="";
	selected_array_pos="";
	item_selected=link_num;
}
function use_timer(thelink) //used to delay the appearance of the tertiary menu 
{	button_delay=setTimeout(thelink,500);
}
function button_off()
{	clearTimeout(button_delay);
}
function hide_table() //hides the tertiary menu
{	j=0;
	writeVerneNav('menu2',str);
}
function close_table(evnt)
{	var menucontent=document.getElementById("tertiary")

	if(document.all)
	{    if(!menucontent.contains(evnt.toElement))//IE
			setTimeout("hide_table()",300);
	}
	else
	{   if(evnt.currentTarget!= evnt.relatedTarget && !contains_ns6(menucontent, evnt.relatedTarget))//NS
			setTimeout("hide_table()",300);
	}
}
function contains_ns6(menucont, reltar)
{	while (reltar.parentNode)
	if ((reltar=reltar.parentNode)==menucont)
	return true;
	return false;	
}
function getQueryValue(fieldname)
{	querylhnav=this.location.href; //get the url string
	querylhnav=querylhnav.substring((querylhnav.indexOf('?')) + 1); //split the url so we get the query string
	string_arr=querylhnav.split('&'); //make an array of all the different name value pairs
	for (i=0; i< string_arr.length; i++) //for each pair....
		{ 	if ((string_arr[i].indexOf(fieldname)>-1) && (this.location.href.indexOf('?') > 0)) //search the string for our name
			{//split the string so we get RHS of = 
				string_arr[i]=string_arr[i].substring((string_arr[i].indexOf('=')) + 1);
				queryfound=true;
				return string_arr[i];
			}	
		}
	string_arr[i]="not found";
	return (string_arr[i]);
}
function loadHandler() {
	if (browser_family=="ns4" || browser_base=="op") {
		origHeight = this.innerHeight;
		origWidth  = this.innerWidth;
		if (browser_base=="op") { resizeHandler(); }
	}
}
function resizeHandler() {
    if (this.innerWidth != origWidth || this.innerHeight != origHeight) { location.reload(); }
    if (browser_base=="op") { setTimeout('resizeHandler()',500); }
}
      
if (browser_family=="ns4") { onresize = resizeHandler; } 
//-->
function selectctc()
{
var pageid = "CTCLIST";
var aboutcountry = "About_Country=" + window.document.nav_form.country.value.toUpperCase();
newloc(pageid,aboutcountry);
}

function showbox(elmnt)
{
if (elmnt == "execlogin")
{
getElm("mmblogin").style.display="none";
getElm("execlogin").style.display="block";
}
else
{
getElm("execlogin").style.display="none";
getElm("mmblogin").style.display="block";
}
}
function showlogoutbox(elmnt)
{
if (elmnt == "execlogout")
{
getElm("mmblogin").style.display="none";
getElm("execlogout").style.display="block";
}
else
{
getElm("execlogout").style.display="none";
getElm("mmblogin").style.display="block";
}
}