function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}


function openSendthis(url,heading){
        var targetLink = "/mini/2004/send_this.asp?url="+url+"&title="+heading;
        var sendthis=window.open(targetLink,'sendthis','toolbar=no,height=650,width=400,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no');
        sendthis.focus();
}


function openConverter(){
        var targetLink = "/mini/2004/converter.html";
        var converter=window.open(targetLink,'converterPop','toolbar=no,height=650,width=400,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no');
        converter.focus();
}


function openGlossary(section){
	var targetLink = "/mini/2004/glossary.html#"+section;
	var mynotes=window.open(targetLink,'glossaryPop','toolbar=no,height=600,width=400,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no');
	mynotes.focus();
}


function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}



var preloadFlag = false;

function preloadImages() {
	if (document.images) {
		company_over = newImage("/mini/2004/images/navi/company-over.gif");
		financials_over = newImage("/mini/2004/images/navi/financials-over.gif");
		sustainability_over = newImage("/mini/2004/images/navi/sustainability-over.gif");
		tip_print_over = newImage("/mini/2004/images/floater/tip_print-over.gif");
		tip_mail_over = newImage("/mini/2004/images/floater/tip_mail-over.gif");
		tip_calc_over = newImage("/mini/2004/images/floater/tip_calc-over.gif");
		tip_glossary_over = newImage("/mini/2004/images/floater/tip_glossary-over.gif");
		tip_pdf_over = newImage("/mini/2004/images/floater/tip_pdf-over.gif");
		tip_xls_over = newImage("/mini/2004/images/floater/tip_xls-over.gif");
		preloadFlag = true;
	}
}


if (document.images) {
	pic=new Array();
	pic[20]=new Image; pic[20].src="/mini/2004/images/bottom/search_off.gif";
	pic[21]=new Image; pic[21].src="/mini/2004/images/bottom/search_on.gif";
	pic[22]=new Image; pic[22].src="/mini/2004/images/bottom/sitemap_off.gif";
	pic[23]=new Image; pic[23].src="/mini/2004/images/bottom/sitemap_on.gif";
	pic[24]=new Image; pic[24].src="/mini/2004/images/bottom/downloads_off.gif";
	pic[25]=new Image; pic[25].src="/mini/2004/images/bottom/downloads_on.gif";
	pic[26]=new Image; pic[26].src="/mini/2004/images/bottom/millmap_off.gif";
	pic[27]=new Image; pic[27].src="/mini/2004/images/bottom/millmap_on.gif";
	pic[28]=new Image; pic[28].src="/mini/2004/images/bottom/organisation_off.gif";
	pic[29]=new Image; pic[29].src="/mini/2004/images/bottom/organisation_on.gif";
	pic[30]=new Image; pic[30].src="/mini/2004/images/bottom/capacity_off.gif";
	pic[31]=new Image; pic[31].src="/mini/2004/images/bottom/capacity_on.gif";
	pic[32]=new Image; pic[32].src="/mini/2004/images/bottom/visuals_off.gif";
	pic[33]=new Image; pic[33].src="/mini/2004/images/bottom/visuals_on.gif";
	pic[34]=new Image; pic[34].src="/mini/2004/images/bottom/help_off.gif";
	pic[35]=new Image; pic[35].src="/mini/2004/images/bottom/help_on.gif";
	pic[36]=new Image; pic[36].src="/mini/2004/images/bottom/contacts_off.gif";
	pic[37]=new Image; pic[37].src="/mini/2004/images/bottom/contacts_on.gif";
}


function swapper(pica, picb) {

	if (document.getElementById) {
		document.images[pica].src=pic[picb].src;
	}
	else if (document.all) {
		document.images[pica].src=pic[picb].src;
	}
	else if (document.layers) {
		document.images[pica].src=pic[picb].src;
	}
}


function locateObject(n, d) { //v3.0
  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];
  else if (!(x=d[n]) && d.getElementById)
  	x=d.getElementById(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=locateObject(n,d.layers[i].document);
  return x;
}

var tipTimer;


function swapper(pica, picb) {
	if (document.getElementById) {
		document.images[pica].src=pic[picb].src;
	}
	else if (document.all) {
		document.images[pica].src=pic[picb].src;
	}
	else if (document.layers) {
		document.images[pica].src=pic[picb].src;
	}
}


	function winopen(url,name,leveys,korkeus) {

		if (document.all) {
			window.open(url,name,'width='+leveys+',height='+korkeus+',titlebar=no,toolbar=no,location=no,status=no,scrollbars=yes,menubar=no,resizable=no'); 
		}
		if (document.layers) {
			window.open(url,name,'width='+leveys+',height='+korkeus+',titlebar=no,toolbar=no,location=no,status=no,scrollbars=yes,menubar=no,resizable=no'); 
		}
		if (document.getElementById) {
			// NS6
			window.open(url,name,'width='+leveys+',height='+korkeus+',titlebar=no,toolbar=no,location=no,status=no,scrollbars=yes,menubar=no,resizable=no'); 
		}
	}


function getRealLeft(el) {

	if(document.all) { 
		if (arguments.length==0) el = this;
    	xPos = el.offsetLeft;
    	tempEl = el.offsetParent;
    	while (tempEl != null) {
    	    xPos += tempEl.offsetLeft;
    	    tempEl = tempEl.offsetParent;
    	} 
		return xPos;
	}
	else if(document.getElementById) { 
		if (arguments.length==0) el = this;
    	xPos = el.offsetLeft;
    	tempEl = el.offsetParent;
    	while (tempEl != null) {
    	    xPos += tempEl.offsetLeft;
    	    tempEl = tempEl.offsetParent;
    	} 
		return xPos;
	}
}


function getRealTop(el) {
	
	if(document.all) { 
		if (arguments.length==0) el = this;
	    yPos = el.offsetTop;
    	tempEl = el.offsetParent;
	    while (tempEl != null) {
        	yPos += tempEl.offsetTop;
        	tempEl = tempEl.offsetParent;
	    }
		return yPos;
	}
	else if(document.getElementById) { 
		if (arguments.length==0) el = this;
	    yPos = el.offsetTop;
    	tempEl = el.offsetParent;
	    while (tempEl != null) {
        	yPos += tempEl.offsetTop;
        	tempEl = tempEl.offsetParent;
	    }
		return yPos;
	}
}



function locateObject(n, d) { //v3.0
  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];
  else if (!(x=d[n]) && d.getElementById)
  	x=d.getElementById(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=locateObject(n,d.layers[i].document);
  return x;
}

