
//loading the on images and the image rollover function

bimgarray = new Array(10);
bimgarray[0] = new Image()
bimgarray[0].src = "images/but_about_on.gif";
bimgarray[1] = new Image();
bimgarray[1].src = "images/but_network_on.gif";
bimgarray[2] = new Image();
bimgarray[2].src = "images/but_press_on.gif";
bimgarray[3] = new Image();
bimgarray[3].src = "images/but_traffic_on.gif";
bimgarray[4] = new Image();
bimgarray[4].src = "images/but_data_on.gif";
bimgarray[5] = new Image();
bimgarray[5].src = "images/but_media_on.gif";
bimgarray[6] = new Image();
bimgarray[6].src = "images/but_ad_on.gif";
bimgarray[7] = new Image();
bimgarray[7].src = "images/but_contact_on.gif";
bimgarray[8] = new Image();
bimgarray[8].src = "images/but_policy_on.gif";
bimgarray[9] = new Image();
bimgarray[9].src = "images/but_survey_on.gif";

function swapImages(imgname,arrindex) {

imgpath = eval("document." + imgname + ".src");
eval("document." + imgname + ".src = '" + bimgarray[arrindex].src + "'");
bimgarray[arrindex].src = imgpath;
}

//end of loading of on images

//loading sub nav images and the swaping method

simgarray = new Array(2);
simgarray[0] = new Image()
simgarray[0].src = "images/subnav-v2off.gif";
simgarray[1] = new Image();
simgarray[1].src = "images/subnav-v3off.gif";

himgarray = new Array(3);
himgarray[0] = new Image()
himgarray[0].src = "images/subnav-h1off.gif";
himgarray[1] = new Image();
himgarray[1].src = "images/subnav-h2off.gif";
himgarray[2] = new Image();
himgarray[2].src = "images/subnav-h3off.gif";



//end of loading sub nav images

//loading subnavonimages

oimgarray = new Array(25);
oimgarray[0] = new Image()
oimgarray[0].src = "images/subnav-v1a.gif";
oimgarray[1] = new Image()
oimgarray[1].src = "images/subnav-v1b.gif";
oimgarray[2] = new Image()
oimgarray[2].src = "images/subnav-v1c.gif";
oimgarray[3] = new Image()
oimgarray[3].src = "images/subnav-v1d.gif";
oimgarray[4] = new Image()
oimgarray[4].src = "images/subnav-v2a.gif";
oimgarray[5] = new Image()
oimgarray[5].src = "images/subnav-v2b.gif";
oimgarray[6] = new Image()
oimgarray[6].src = "images/subnav-v2c.gif";
oimgarray[7] = new Image()
oimgarray[7].src = "images/subnav-v2d.gif";
oimgarray[8] = new Image()
oimgarray[8].src = "images/subnav-v3a.gif";
oimgarray[9] = new Image()
oimgarray[9].src = "images/subnav-v3b.gif";
oimgarray[10] = new Image()
oimgarray[10].src = "images/subnav-v3c.gif";
oimgarray[11] = new Image()
oimgarray[11].src = "images/subnav-v3d.gif";
oimgarray[12] = new Image()
oimgarray[12].src = "images/subnav-v3e.gif";



oimgarray[13] = new Image()
oimgarray[13].src = "images/subnav-h1a.gif";
oimgarray[14] = new Image()
oimgarray[14].src = "images/subnav-h1b.gif";
oimgarray[15] = new Image()
oimgarray[15].src = "images/subnav-h1c.gif";
oimgarray[16] = new Image()
oimgarray[16].src = "images/subnav-h1d.gif";
oimgarray[17] = new Image()
oimgarray[17].src = "images/subnav-h2a.gif";
oimgarray[18] = new Image()
oimgarray[18].src = "images/subnav-h2b.gif";
oimgarray[19] = new Image()
oimgarray[19].src = "images/subnav-h2c.gif";
oimgarray[20] = new Image()
oimgarray[20].src = "images/subnav-h2d.gif";
oimgarray[21] = new Image()
oimgarray[21].src = "images/subnav-h3a.gif";
oimgarray[22] = new Image()
oimgarray[22].src = "images/subnav-h3b.gif";
oimgarray[23] = new Image()
oimgarray[23].src = "images/subnav-h3c.gif";
oimgarray[24] = new Image()
oimgarray[24].src = "images/subnav-h3d.gif";

//end of loading subnavonimages



function changeLocation() {

window.location.href=document.frmLocation.sellocation.options[document.frmLocation.sellocation.selectedIndex].value;

}



var gotlayers = 1;

NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
ver4 = (NS4 || IE4) ? 1 : 0;


function positionSubnav() {

if (gotlayers) {
		if (NS4) {
			document.layers['subnav1'].left = 184;
			document.layers['subnav1'].top = 123;
			document.layers['subnav2'].left = 184;
			document.layers['subnav2'].top = 123;
			document.layers['subnav3'].left = 184;
			document.layers['subnav3'].top = 123;
			document.layers['subnavh1'].left = 185;
			document.layers['subnavh1'].top = 101;
			document.layers['subnavh2'].left = 205;
			document.layers['subnavh2'].top = 101;
			document.layers['subnavh3'].left = 195;
			document.layers['subnavh3'].top = 101;

			if(defsubnav!="") {
			document.layers[defsubnav].visibility = "show";
			}
	} else {
			document.all['subnav1'].style.pixelLeft = 184;
			document.all['subnav1'].style.pixelTop = 123;
			document.all['subnav2'].style.pixelLeft = 184;
			document.all['subnav2'].style.pixelTop = 123;
			document.all['subnav3'].style.pixelLeft = 184;
			document.all['subnav3'].style.pixelTop = 123;
			document.all['subnavh1'].style.pixelLeft = 195;
			document.all['subnavh1'].style.pixelTop = 101;
			document.all['subnavh2'].style.pixelLeft = 195;
			document.all['subnavh2'].style.pixelTop = 101;
			document.all['subnavh3'].style.pixelLeft = 195;
			document.all['subnavh3'].style.pixelTop = 101;
			if(defsubnav!="") {
			document.all[defsubnav].style.visibility = "visible";
			}
               }
             }

}


function showSubnav(layerid,on) {

if(pagedefault=="V") {

	if (on) {

			if (NS4) {
				document.layers[cursubnav].visibility = "hide";
				document.layers[layerid].visibility = "show";
			} else {
				document.all[cursubnav].style.visibility = "hidden";
				document.all[layerid].style.visibility = "visible";

			}
               cursubnav = layerid;
		} else {
			if (NS4) {
				document.layers[layerid].visibility = "hide";
			        document.layers[cursubnav].visibility = "show";
			} else {
				document.all[layerid].style.visibility = "hidden";
				document.all[cursubnav].style.visibility = "visible";
			}
               cursubnav = layerid;
		}

	} else if(pagedefault=="H") {

	if (on) {

			if (NS4) {
				document.layers[layerid].visibility = "show";
			} else {
				document.all[layerid].style.visibility = "visible";
			}
               cursubnav = layerid;
		} else {
			if (NS4) {
				document.layers[layerid].visibility = "hide";
				} else {
				document.all[layerid].style.visibility = "hidden";
				}
               cursubnav = layerid;
		}


	} else {

		
		if (on) {

			if (NS4) {
				document.layers[layerid].visibility = "show";
			} else {
				document.all[layerid].style.visibility = "visible";
			}
               curnav = layerid;
		} else {
			if (NS4) {
				document.layers[layerid].visibility = "hide";
				} else {
				document.all[layerid].style.visibility = "hidden";
				}
               curnav = layerid;
		}
		




		}


}




function showhSubnav(layerid,on) {

if(pagedefault=="V") {

	if (on) {

			if (NS4) {
				document.layers[layerid].visibility = "show";
			} else {
				document.all[layerid].style.visibility = "visible";
			}
               curhsubnav = layerid;
		} else {
			if (NS4) {
				document.layers[layerid].visibility = "hide";
				} else {
				document.all[layerid].style.visibility = "hidden";
				}
               curhsubnav = layerid;
		}


} else if(pagedefault=="H") {


if (on) {

			if (NS4) {
				document.layers[curhsubnav].visibility = "hide";
				document.layers[layerid].visibility = "show";
			} else {
				document.all[curhsubnav].style.visibility = "hidden";
				document.all[layerid].style.visibility = "visible";

			}
               curhsubnav = layerid;
		} else {
			if (NS4) {
				document.layers[layerid].visibility = "hide";
			       document.layers[curhsubnav].visibility = "show";
			} else {
				document.all[layerid].style.visibility = "hidden";
			        document.all[curhsubnav].style.visibility = "visible";
			}
               curhsubnav = layerid;
		}



} else {

		
		if (on) {

			if (NS4) {
				document.layers[layerid].visibility = "show";
			} else {
				document.all[layerid].style.visibility = "visible";
			}
               curnav = layerid;
		} else {
			if (NS4) {
				document.layers[layerid].visibility = "hide";
				} else {
				document.all[layerid].style.visibility = "hidden";
				}
               curnav = layerid;
		}
		




		}



}




function restoreDefault() {

if(pagedefault=="V") {

if(cursubnav!=defsubnav) {
	if (NS4) {
				document.layers[cursubnav].visibility = "hide";
				document.layers[defsubnav].visibility = "show";
			} else {
				document.all[defsubnav].style.visibility = "visible";
				document.all[cursubnav].style.visibility = "hidden";
			}
               cursubnav = defsubnav;
} 

} else if(pagedefault=="H") {

if(curhsubnav!=defsubnav) {

		if (NS4) {
				
				document.layers[curhsubnav].visibility = "hide";
				document.layers[defsubnav].visibility = "show";
				} else {
				document.all[defsubnav].style.visibility = "visible";
				document.all[curhsubnav].style.visibility = "hidden";
			}
               curhsubnav = defsubnav;


}


}


}


function clearMenu() {


if(pagedefault=="H") {

if(cursubnav!="") {
//alert(cursubnav);
if (NS4) {
				document.layers[cursubnav].visibility = "hide";
			} else {
				document.all[cursubnav].style.visibility = "hidden";
			}
               cursubnav = "";

}

} else if(pagedefault=="V") {

if(curhsubnav!="") {

		if (NS4) {
				document.layers[curhsubnav].visibility = "hide";
				} else {
				document.all[curhsubnav].style.visibility = "hidden";
			}
               //curhsubnav = "";


}


} else {


if(curnav!="") {

		if (NS4) {
				document.layers[curnav].visibility = "hide";
				} else {
				document.all[curnav].style.visibility = "hidden";
			}
               curnav = "";


}





	}

}

function showSubnavon(imgname,layername,arrindex) {
if(NS4) {
imgpath = eval("document.layers['" + layername + "'].document." + imgname + ".src");
eval("document.layers['" + layername + "'].document." + imgname + ".src = '" + oimgarray[arrindex].src + "'");

 } else {

imgpath = eval("document." + imgname + ".src");
eval("document." + imgname + ".src = '" + oimgarray[arrindex].src + "'");
}
oimgarray[arrindex].src = imgpath;

}


if(NS4) {
document.captureEvents(Event.MOUSEMOVE)
}
	document.onmousemove = checkIt;

function checkIt(evt) {
	x1 = (NS4) ? evt.pageX : event.clientX
	y1 = (NS4) ? evt.pageY : event.clientY

if(pagedefault == "V" || pagedefault == "H" || pagedefault == "") {

	if ((x1 >= 0 && y1 <= 60) || (x1 >320 && y1 >= 115) || (x1 >184 && y1 >= 410) || (x1<184 && y1>=300))
//if (((x1 > 520) && (y1 < 300)))
	{
clearMenu();
restoreDefault();

	}

}

}


//news scroller script

//Default browsercheck, added to all scripts!
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	//this.ie4=(document.all && !this.dom)?1:0;
	this.ie4=(document.all)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()
/*NOTE**************************************************************************
This code is maybe the biggest example of a workaround code as it has different
code for all browsers. But it works like a charm :)

Use the style tag to change the placement and width of the layers.
If you are trying to place this into a table cell or something make the
position of the divNewsCont layer relative...Remeber that that might crash
Netscape 4 though, Good luck!
********************************************************************************/

/****
Variables to set 
****/

//How do you want the script to work? 
//0 = Fade in - Fade out
//1 = Slide in - Fade out
//2 = Random 
nWorks=1

//If you use the slide set these variables:
nSlidespeed=5 //in px
nNewsheight=50 //This is how long down it should start the slide
nNewswidth=50 //This is how long down it should start the slide


nBetweendelay=1000 //The delay before fading out.
nFont='arial,helvetiva' //The font for the news
nFontsize=12 //font size in pixel
nFadespeed=1000 //The speed to fade in, in milliseconds

//Set the colors, first color is same as background, last color is the color it stops at:
//You can have as many colors you want
nColor=new Array('#33ccff', '#000066','#000066','#000066','#000066','#000066','#000066')

//This is the news you wanna have, set the link and the text. If you don't wan't it to link anywhere
//use a # as the link
nNews=new Array()
//Copy there three lines and change the info and numbers to get more news.
nNews[0]=new Array()
nNews[0]["text"]="Last year, 7.8 million Americans used wireless devices to access inbound and outbound information services and Internet messaging.That's expected to explode a whopping 728%, to 61.5 million by 2003 in the US alone. (IDC)";
nNews[1]=new Array();
nNews[1]["text"]="Messaging and the promise of mobile-commerce are transforming the \"nice to have\" wireless phone into a \"must have\" information appliance.\" (Cahners In-Stat Group)";
nNews[2]=new Array();
nNews[2]["text"]="GartnerGroup's Dataquest predicts that 410 million handsets will be sold worldwide in 2000.";
nNews[3]=new Array();
nNews[3]["text"]="A study by the Meta Group found 10% of enterprise workers currently use a handheld device, but that's expected to grow to 36% by 2002. The report suggest that one in three workers could be using PDAs.";
nNews[4]=new Array();
nNews[4]["text"]="The Yankee Group says global wireless subscribers will jump from 469 million at the end of 1999 to 1.26 billion in 2005.";
nNews[5]=new Array();
nNews[5]["text"]="Wireless carriers will be actively looking for ways to differentiate themselves, such as offering location-based services. (IDC)";
nNews[6]=new Array();
nNews[6]["text"]="In an effort to address the growing expectations of Web users, many e-businesses are working toward providing personalization service - often referred to as \"one-to-one marketing.\"";

/********************************************************************************
Object code...Object constructors and functions...
********************************************************************************/
function makeNewsObj(obj,nest,font,size,color,news,fadespeed,betweendelay,slidespeed,works,newsheight){
    nest=(!nest) ? '':'document.'+nest+'.'
   	this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0;	
   	this.writeref=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj+".document"):0;
	if(font){this.color=new Array(); this.color=eval(color); this.news=new Array(); this.news=eval(news)
		this.font=font; this.size=size; this.speed=fadespeed; this.delay=betweendelay; this.newsheight=newsheight
		this.fadeIn=b_fadeIn;this.fadeOut=b_fadeOut; this.newsWrite=b_newsWrite; this.y=1
		this.slideIn=b_slideIn; this.moveIt=b_moveIt; this.slideSpeed=slidespeed; this.works=works
		if(bw.dom || bw.ie4){this.css.fontFamily=this.font; this.css.fontSize=10; this.css.color=this.color[0];}
	}
	this.obj = obj + "Object"; 	eval(this.obj + "=this"); return this
}
function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x; this.css.top=this.y}

function b_newsWrite(num,i){
	if(bw.ns4){
		this.writeref.write("<font face=\""+this.font+"\" color=\"#000066\" size=\"1\">"+this.news[num]['text']+"</font>")
		this.writeref.close()
	} else if(bw.dom){
		atag=document.createElement("A"); atag.href="#"
		atag.id=this.obj+"link"; atag.style.color=this.color[i];
		this.writeref.replaceChild(atag,this.writeref.childNodes[0])
		this.writeref.childNodes[0].appendChild(document.createTextNode(""))
		this.writeref.childNodes[0].replaceChild(document.createTextNode(this.news[num]["text"]),this.writeref.childNodes[0].childNodes[0])
	} 

else if(bw.ie4) this.writeref.innerHTML="<font face=\""+this.face+"\" size=\"1\" color=\"#000066\">"+this.news[num]['text']+"</font>"
}
//Slide in
function b_slideIn(num,i){
	if(this.y>0){
		if(i==0){this.moveIt(0,this.newsheight); this.newsWrite(num,this.color.length-1)}
		this.moveIt(this.x,this.y-this.slideSpeed); i++
		setTimeout(this.obj+".slideIn("+num+","+i+")",50)
	}else setTimeout(this.obj+".fadeOut("+num+","+(this.color.length-1)+")",this.delay)
}
//The fade functions
function b_fadeIn(num,i){
	if(i<this.color.length){
		if(i==0 || bw.ns4)	this.newsWrite(num,i)
		else{obj=bw.ie4?eval(this.obj+"link"):document.getElementById(this.obj+"link");obj.style.color=this.color[i]}
		i++; setTimeout(this.obj+".fadeIn("+num+","+i+")",this.speed)
	}else setTimeout(this.obj+".fadeOut("+num+","+(this.color.length-1)+")",this.delay)
}
function b_fadeOut(num,i){
	if(i>=0){
		if(i==0 || bw.ns4)	this.newsWrite(num,i)	
		else{obj=bw.ie4?eval(this.obj+"link"):document.getElementById(this.obj+"link");obj.style.color=this.color[i]}
		i--; setTimeout(this.obj+".fadeOut("+num+","+i+")",this.speed)
	}else{
		num++; if(num==this.news.length) num=0
		works=!this.works?0:this.works==1?1:Math.round(Math.random())
		if(works==0) setTimeout(this.obj+".fadeIn("+num+",0)",500)
		else if(works==1){this.y=1; setTimeout(this.obj+".slideIn("+num+",0)",500)
		}
	}
}
/********************************************************************************************
The init function. Calls the object constructor and set some properties and starts the fade
*********************************************************************************************/
function fadeInit(){

	oNews=new makeNewsObj('divNews','divNewsCont',nFont,nFontsize,"nColor","nNews",nFadespeed,nBetweendelay,nSlidespeed,nWorks,nNewsheight)
	oNewsCont=new makeNewsObj('divNewsCont')
	works=!oNews.works?0:oNews.works==1?1:Math.round(Math.random())
	if(works==0) oNews.fadeIn(0,0)
	else if(works==1) oNews.slideIn(0,0)
if(bw.dom || bw.ie4) oNewsCont.css.left="30"
	oNewsCont.css.visibility='visible'
}

//Calls the init function on pageload. 
if(bw.bw) onload=fadeInit;





//end of news scroller script
