function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function openPopUp(URLStr, winName, left, top, width, height, menubar, scrollbars, resizable) { 
	newWin = window.open(URLStr, winName, 'toolbar=no,location=no,directories=no,status=no,menubar='+menubar+',scrollbars='+scrollbars+',resizable='+resizable+',copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
	newWin.focus();
}

function goto_URL(object) {
    window.location.href = object.options[object.selectedIndex].value;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function menuOn(num) {
	pMenu.over('root', num);
	MM_swapImage('topmenu','','http://www.novatel.com/images/topmenu_home_' + num + '.gif',1);
}
function menuOff(num) {
	pMenu.out('root', num);
}

function WriteRandomBanner(size) {
	var numLargeBanners = 4;
	var numSmallBanners = 7;
	if (size==1) {
		imagenum1=Math.round(Math.random()*(numLargeBanners-1))+1
		if (imagenum1==1){var image1="<a href=\"http://www.novatel.com/products/span.htm\"><img src=\"http://www.novatel.com/images/banners/lg_1.jpg\" width=760 height=120 border=0 alt=\"Click here to learn more about SPAN\"></a>"}
		else 
		if (imagenum1==2){var image1="<a href=\"http://www.novatel.com/products/propakv3.htm\"><img src=\"http://www.novatel.com/images/banners/lg_2.jpg\" width=760 height=120 border=0 alt=\"Click here to learn more about ProPak\"></a>"}
		else 
		if (imagenum1==3){var image1="<a href=\"http://www.novatel.com/products/oemV.htm\"><img src=\"http://www.novatel.com/images/banners/lg_3.jpg\" width=760 height=120 border=0 alt=\"Click here to learn more about OEMV\"></a>"}
		else 
		if (imagenum1==4){var image1="<a href=\"http://www.novatel.com/products/15a_receiver.htm\"><img src=\"http://www.novatel.com/images/banners/lg_4.jpg\" width=760 height=120 border=0 alt=\"Click here to learn more about Galileo\"></a>"}
		document.write(image1);
	}
	else if (size==2) {
		imagenum1=Math.round(Math.random()*(numSmallBanners-1))+1
		if (imagenum1==1){var image1="<img src=\"http://www.novatel.com/images/banners/sm_1.jpg\" width=507 height=60 alt=\"\">"}
		else if (imagenum1==2){var image1="<img src=\"http://www.novatel.com/images/banners/sm_2.jpg\" width=507 height=60 alt=\"\">"}
		else if (imagenum1==3){var image1="<img src=\"http://www.novatel.com/images/banners/sm_3.jpg\" width=507 height=60 alt=\"\">"}
		else if (imagenum1==4){var image1="<img src=\"http://www.novatel.com/images/banners/sm_4.jpg\" width=507 height=60 alt=\"\">"}
		else if (imagenum1==5){var image1="<img src=\"http://www.novatel.com/images/banners/sm_5.jpg\" width=507 height=60 alt=\"\">"}
		else if (imagenum1==6){var image1="<img src=\"http://www.novatel.com/images/banners/sm_6.jpg\" width=507 height=60 alt=\"\">"}
		else if (imagenum1==7){var image1="<img src=\"http://www.novatel.com/images/banners/sm_7.jpg\" width=507 height=60 alt=\"\">"}
		document.write(image1);
	}
}

function WriteRandomCaseStudy() {

	var numCaseStudies = 2;

	imagenum1=Math.round(Math.random()*(numCaseStudies - 1))+1
	if (imagenum1==1) {
		var image1="<img src=\"http://www.novatel.com/images/case_studies/1_sm.jpg\" width=120 height=90 border=0 alt=\"\">"
		var head1="Leica Geosystems";
		var head2="Large, industry-leading company chooses NovAtel";
		var text1="Leica Geosystems is recognized as a market leader and pioneer in GPS surveying and mapping systems. Although Leica Geosystems historically designed and manufactured their core GPS technology in-house, it recognized that development of next generation GPS technology was becoming increasingly expensive and embarked on an evaluation of outsourcing options in 2001. After considering several high-precision GPS manufacturers, Leica Geosystems chose NovAtel.</p>";
		var href="/about_gps/leica_geosystems.htm";
	}
	else if (imagenum1==2) {
		var image1="<img src=\"http://www.novatel.com/images/case_studies/3_sm.jpg\" width=120 height=90 border=0 alt=\"\">"
		var head1="Forsberg Services and FSL Deutschland"
		var head2="NovAtel's 2006 Dealer of the Year";
		var text1="With a 60% increase in sales, totaling $3.2 million, Forsberg Services and FSL Deutschland is NovAtel’s Dealer of the Year.  The percentage of growth this UK-based company achieved was due to success in key industry sectors including automotive, military/defence, as well as container port systems.  NovAtel's dealers and distributors are critical in extending our market reach worldwide. ";
		var href="/sales/dealers.htm";
	}
	document.write("<div style=\"margin-bottom:15px;\"><a href=\"\"><img src=\"http://www.novatel.com/images/titles/case_study_1.gif\" width=80 height=17 border=0 alt=\"Case Study\"></a></div>")
	document.write("<div style=\"margin-bottom:10px;\">"+image1+"</div>");
	//document.write("<h5><a href=\""+href+"\">"+head1+"</a></h5>");
	document.write("<h6>"+head1+"</h6>");
	document.write("<p><b>"+head2+"</b></p>");
	document.write("<p>"+text1+"</p>");
	//document.write("<p><a href=\""+href+"\">More &#155;&#155;</a>");
}

var ie4 = false; if(document.all) { ie4 = true; }

function getObject(id) {
	if (ie4) {
		return document.all[id];
	} else {
		return document.getElementById(id);
	}
}
// FAQ page
function toggle(link, divId) {
	var lText = link.innerHTML;
	var d = getObject(divId);
	if (lText == 'Answer +') {
		link.innerHTML = 'Close -'; d.style.display = 'block';
	} else {
		link.innerHTML = 'Answer +'; d.style.display = 'none';
	}
}
// Careers page
function toggle_careers(link, divId) {
	var lText = link.innerHTML;
	var d = getObject(divId);
	if (lText == 'Description +') {
		link.innerHTML = 'Close -'; d.style.display = 'block';
	} else {
		link.innerHTML = 'Description +'; d.style.display = 'none';
	}
}

// Dealers page
function toggle_dealers(link, divId) {
	var lText = link.innerHTML;
	var d = getObject(divId);
	if (lText == 'Open +') {
		link.innerHTML = 'Close -'; d.style.display = 'block';
	} else {
		link.innerHTML = 'Open +'; d.style.display = 'none';
	}
}

// Expandable content script from flooble.com.
// For more information please visit:
//   http://www.flooble.com/scripts/expand.php
// Copyright 2002 Animus Pactum Consulting Inc.
//----------------------------------------------

var currentURL = unescape(window.location.pathname);
var currentQuery = unescape(window.location.search);
function viewer(type) {
    window.location.href = currentURL  + type;
}

function viewerTraining(type) {
    window.location.href = currentURL + currentQuery + type;
}

function addr(ename, emailserver) {
var emailE=(ename + '@' + emailserver);
document.write('<'+'A href="mailto:' + emailE + '">' + emailE  + ' <' + '/a>')
}
function mailaddr(address, domain, name) 
{
	var first = 'ma';
	var second = 'il';
	var third = 'to:';
	var ext = 'com'; 
	document.write('<a href="');
	document.write(first+second+third);
	document.write(address);
	document.write('&#64;');
	document.write(domain);
	document.write('.');
	document.write(ext);  
	document.write('">'); 
	document.write(name); 
	document.write('</a>');
}
function mailaddrext(address, domain,ext, name) 
{
	var first = 'ma';
	var second = 'il';
	var third = 'to:';
	document.write('<a href="');
	document.write(first+second+third);
	document.write(address);
	document.write('&#64;');
	document.write(domain);
	document.write('.');
	document.write(ext);  
	document.write('">'); 
	document.write(name); 
	document.write('</a>');
}
