
//	setTitle is not a functions
function setTitle(newTitle)
{
	if(parent.location!=document.location)
	{
		parent.setTitle(newTitle)
	}
}
// end bugg fix for parent. Updated from volvo.com code, 010428 adalin

var ns = (navigator.appName == "Netscape");
var win = (navigator.userAgent.indexOf("Win")!=-1)
var browserversion = navigator.appVersion.substring(0,3)

function setTitle(str) {
  if (typeof(parent) != "undefined" && document.location != parent.location) {
    if (parent.setTitle) {
      parent.setTitle(str)
    }
  }
}

if(!ns) document.write('<SCRIPT src="menudata.js"></SCRIPT>')

var initTimer
var pageLoaded = false
function initWhenReady(yColPos) {
// ######## Starts the output for the left menus ########
// ######## Stops the dynamic left meny then page is printed ########

if(document.layers)
{
	if(!parent.printmess) {
	  WQ_Menu(openColActive,yColPos)
  }
}
else
{
	  WQ_Menu(openColActive,yColPos)
}
	// ######## Initates variables ########
	top.navigate_top.menuActive=false
	top.navigate_top.currentMenu=''
	nextUrl=''
	top.AddToHistory()
	top.navigate_top.changeDocinfo()

	// ####### Back/Forward #########

	// ######## Loads event-handlers for menu removal ########
	if(document.layers) document.captureEvents(Event.MOUSEUP)
	if(document.layers) document.onmouseup = removeMenu
	else {
		document.onclick = removeMenu
		//self.onscroll = removeMenu
	}
  pageLoaded = true
  // ######## Starts the scroll-following top-menus ########
  if (document.all) self.onscroll = WQ_ScrollIE
  if (document.layers) WQ_ScrollNN()
}

function WQ_ScrollIE() {
  for (var i in menuArr) document.all.item(menuArr[i]+"menu").style.top = document.body.scrollTop
}
var scrollTimern
function WQ_ScrollNN() {
  clearTimeout(scrollTimern)
  for (var i in menuArr) document.layers[menuArr[i]+"menu"].top = pageYOffset
  scrollTimern = setTimeout("WQ_ScrollNN()",100) // 100 = the time in millisecond between the browser checks whether it has be an "onScroll"-event
}

function openwin(URL){       
window.open(URL,URL,'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,scrollbars=no,width=300,height=167,top=236,left=470');
}

var openColActive
function init(yColPos) {
  openColActive = (typeof(openCol) != 'undefined') ? openCol : [] ;
  if(top.topReady && top.bottomReady) {
    clearTimeout(initTimer)
    initWhenReady(yColPos)
  }
  else {
    yColPos = (typeof(yColPos) == "undefined") ? '' : yColPos
	if(parent.printmess && document.layers){ top.close();}
    initTimer=setTimeout('init('+yColPos+')',100)
  }
}

var openColActive
function popupInit(yColPos) {
  if (top.topReady) {
    openColActive = (typeof(openCol) != 'undefined') ? openCol : [] ;
    WQ_Menu(openColActive,yColPos)
  } else {
    yColPos = (typeof(yColPos) == "undefined") ? '' : yColPos
    setTimeout("popupInit("+yColPos+")",200)
  }
}

function exit() {
	top.mainReady=false
}

// ######## Function: Closes current menu (when user clicks outside menu) ########
var nextUrl = ""
function removeMenu() {
	menuItemOver=false
	menuLinkOver=false
	top.navigate_top.menuActive=false
	top.navigate_top.hideMenu(top.navigate_top.currentMenu)

  // Changed by Glenn Nilsson 1999-11-30 
	if(nextUrl.length > 0) { // här hopppar nn vidare ... långt från där IE hoppar!! 
    stat = ""
    if (nextUrl.substring(0,9) == "external:") {
      stat = "external"
      nextUrl = nextUrl.substring(9)
    }
    if (nextUrl.substring(0,9) == "internal:") {
      stat = "internal"
      nextUrl = nextUrl.substring(9)
    }
    if (stat == "external") nextUrl = "window.open('"+nextUrl+"')"
    if (stat == "internal") nextUrl = "top.document.location='"+nextUrl+"'"
	
//	Changed by Glenn Nilsson 2000-04-28, next row was changed to the senond next row :)
//	if (stat == "") nextUrl = "document.location='"+nextUrl+"'"
	if (stat == "") nextUrl = "top.main.location='"+nextUrl+"'"
    eval(nextUrl)
  }
  //  End changes
}

function tandLager(lager){
	if(ns) document.layers[lager].visibility = 'show'
	else document.all.item(lager).style.visibility = ''
}
   
function slackLager(lager){
	if(ns) document.layers[lager].visibility = 'hide'
	else document.all.item(lager).style.visibility = 'hidden'
}


// Öppnar upp ett nytt fönster.
// Type=campaign | form | contactForm | release | calendar | freeWin
// Vid annat värde av Type används parametrarna width och height för storlek.

function openWin(url,type,width,height) {
	switch (type){
	case "campaign":	width=755; height=390; xAdjust=385;	break;
	case "form": 		width=360; height=332; xAdjust=405;	break;
	case "contactForm": 	width=610; height=348; xAdjust=155;	break;
	case "release": 	width=610; height=348; xAdjust=155;	break;
	case "calendar": 	width=610; height=348; xAdjust=155;	break;
	case "freeWin": 	width=610; height=348; xAdjust=155;	break;
	case "productKey":	width=750; height=365; xAdjust=385;	break;
	default: 		xAdjust=0;
	}

	window.open(url,type, 'width=' + width + ',height=' + height + ',menubar=no,resizable=no,titlebar=no,alwaysRaised=yes,status=no,scrollbars=no,left='+(screen.width/2-385)+',top='+(screen.height/2-210)+',screenX=0,screenY=0');
}

function WQ_Popup(url,title) {
  loc = top.document.location+''
  host = loc.substring(0,loc.indexOf('/',10))
  window.open(''+url,'win'+(Math.random()+'').substring(4,10),'width=745,height=360,scrollbars=auto')
}

function truckPopup() {
  window.open('http://volvo.pre.framfab.se/truck/customeroffer/bodybuilder/popup.asp','win'+Math.ceil((10000*Math.random())),'width=775,height=360,scrollbars=auto')
}

function WQ_Preload() {
  var args = WQ_Preload.arguments
  var imgArr = new Array()
  for (var i=0; i<args.length; i++) {
    imgArr[i] = new Image()
    imgArr[i].src = args[i]
  }
}

function pagePrinter()
{
   	var ngn_str="/printwindow.asp?url=" + document.location.pathname
	hej=window.open(ngn_str,"printwin","width=100,height=100")
//	alert('pagePrint')
}

function printPage(url) {
  if (ns) {
  	window.print()
  } else {
  	printWin=window.open(url,'printWindow', 'width=600,height=100,menubar=no,resizable=no,titlebar=no,status=no,scrollbars=no');
  	printWin.print()
  	window.focus()
  	printWin.close()
  }
}


function openCampaign(url) {
	window.open(url,'', 'menubar=no,resizable=no,width=755,height=390,titlebar=no,status=no,scrollbars=no,left='+(screen.width/2-385)+',top='+(screen.height/2-210)+',screenX=0,screenY=0');
}

function openForm(url) {
	window.open(url,'', 'menubar=no,resizable=no,width=360,height=332,titlebar=no,status=no,scrollbars=no,left='+(screen.width/2-(385-405))+',top='+(screen.height/2-210)+',screenX=0,screenY=0');
}

function openContactForm(url) {
	window.open(url,'', 'menubar=no,resizable=no,width=610,height=348,titlebar=no,status=no,scrollbars=no,left='+(screen.width/2-(385-155))+',top='+(screen.height/2-210)+',screenX=0,screenY=0');
}

function openRelease(url) {
	window.open(url,'release', 'menubar=no,resizable=no,width=610,height=348,titlebar=no,status=no,scrollbars=no,left='+(screen.width/2-(385-155))+',top='+(screen.height/2-210)+',screenX=0,screenY=0');
}

function openCalendar(url) {
	window.open(url,'calendar', 'menubar=no,resizable=no,width=460,height=348,titlebar=no,status=no,scrollbars=no,left='+(screen.width/2-(385-155))+',top='+(screen.height/2-210)+',screenX=0,screenY=0');
}

function openFreeWin(url) {
	window.open(url,'calendar', 'menubar=no,resizable=no,width=610,height=348,titlebar=no,status=no,scrollbars=auto,left='+(screen.width/2-(385-155))+',top='+(screen.height/2-210)+',screenX=0,screenY=0');
}

function openImgPreviewWin(preview,hires) {
	window.open('/news/ib/preview_popup.asp?preview='+preview+'&hires='+hires,'imagebank', 'menubar=no,resizable=no,width=482,height=352,titlebar=no,status=no,scrollbars=no,left='+(screen.width/2-(385-155))+',top='+(screen.height/2-210)+',screenX=0,screenY=0');
}

function careerPop(URL){       
window.open(URL,"windowname",'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,scrollbars=no,width=300,height=167,top=236,left=470');
}