  /*IE-SPECIFIC CODE TO FIX PSEUDOCLASS-BUG*/
  over = function() {
    addOverEvents(document.getElementById("menu1").childNodes);
    addOverEvents(document.getElementById("containers").getElementsByTagName("li"));
    if(document.getElementById("quickIcons")!=null)
      addOverEvents(document.getElementById("quickIcons").getElementsByTagName("div"));
  }
  function addOverEvents(arrayEl){
    for(var i=0;i<arrayEl.length;i++) {
      //arrayEl[i].onmouseover=addOverClass;
      arrayEl[i].onmouseover=function(){
	this.className+=" over";
      }
      //arrayEl[i].onmouseout=removeOverClass;
      arrayEl[i].onmouseout=function(){
        this.className=this.className.replace(/\s?over/g, "");	
      }
    }
  }
  if (window.attachEvent) window.attachEvent("onload", over);
  /*END IE-SPECIFIC CODE*/

  document.getElementById("searchButton").getElementsByTagName("a")[0].onclick=function(e){
      var searchLi = detectTarget(e).parentNode;
      var searchBox = document.getElementById("searchButton").getElementsByTagName("div")[0];
      if(searchBox.style.visibility=='visible') {
	searchBox.style.visibility='hidden';
	document.getElementById("searchButton").className='';
	searchLi.className=searchLi.className.replace(/\s?active/g, '');
      }
      else {
	searchBox.style.visibility='visible';
	document.getElementById("searchButton").className='over';
	searchLi.className+=" active";
      }
    }

	if(document.getElementById("form_25")!=null){
	  var nameInput = document.getElementById("203");
	  var emailInput = document.getElementById("202");
	  nameInput.value=nameInput.previousSibling.firstChild.nodeValue;
	  emailInput.value=emailInput.previousSibling.firstChild.nodeValue;
	  nameInput.onfocus = function(){
	    removeInputText(this);
	  }
	  emailInput.onfocus = function(){
	    removeInputText(this);
	  }
	  nameInput.onblur=function(){
	    if(this.value=='') {
	      addInputText(this);
	    }
	  }	
	  emailInput.onblur=function(){
	    if(this.value=='') {
	      addInputText(this);
	    }
	  }	
	}
	function removeInputText(inputEl){
	  if(inputEl.value.indexOf(":")>-1){
	    inputEl.value=inputEl.value.substring(inputEl.value.indexOf(":")+1, inputEl.value.length);
	  }
	}
	function addInputText(inputEl){
	  if(inputEl.value=='') {
	    inputEl.value=inputEl.previousSibling.firstChild.nodeValue;
	  }
	}
	if(document.getElementById("productLister")!=null){
	//var calloutLis = document.getElementById("productLister").getElementsByTagName("li");
	var calloutLis = document.getElementById("productLister").getElementsByTagName("a");
	  for(var i=0;i<calloutLis.length;i++){
	    //calloutLis[i].onmousemove=displayCallout;
	    calloutLis[i].onmouseout=hideCallout;
	    calloutLis[i].onmousemove=displayCallout;
	    //calloutLis[i].parentNode.onmouseout=hideCallout;
	  }
	}
	function displayCallout(e){
	  //var target = getReal(detectTarget(e), 'id', 'callout');
	  var target = detectTarget(e);
	  if(target != null) {
	    //var callout = target.getElementsByTagName("div")[0];
	    var callout = target.nextSibling;
	    callout.style.display='block';
	    if (!e) var e = window.event;
	    if (e.pageX || e.pageY) {
		posx = e.pageX;
		posy = e.pageY;
	    }
	    else if (e.clientX || e.clientY) {
		posx = e.clientX + document.body.scrollLeft;
		posy = e.clientY + document.body.scrollTop;
	    }

	    callout.style.left=(posx-43)+'px';
	    callout.style.top=(posy-50)+'px';
	  }
	}
	
	function hideCallout(e){
	  //alert('hidecallout');
	  //var target = getReal(detectTarget(e), 'id', 'callout');
	  var target = detectTarget(e);
	  //var callout = target.getElementsByTagName("div")[0];
	  var callout = target.nextSibling;
	  if(callout != null){
	    callout.style.display='none';
	  }
	}

    var container = document.getElementById("subMenuContainer");
    var submenu   = document.getElementById("subMenuList");
    var testButt  = document.getElementById("menu1").getElementsByTagName("a")[0];

    var minSpeed = 3;
    var KP = 1/5;

    var buttons = 		document.getElementById("menu1").getElementsByTagName("a");
    var subListContainers = 	document.getElementById("containers").getElementsByTagName("div");
    var sublists = 		document.getElementById("containers").getElementsByTagName("ul");
    var booleans = new Array(
		false, false,
		false, false,
		false, false,
		false, false,
		false, false
	);

    buttons[0].onmouseover=function(){
      collapseList(1);
      collapseList(2);
      collapseList(3);
      collapseList(4);
      if(sublists[0].getElementsByTagName("li").length>0)
      expandList(0);
    }
    buttons[1].onmouseover=function(){
      collapseList(0);
      collapseList(2);
      collapseList(3);
      collapseList(4);
      if(sublists[1].getElementsByTagName("li").length>0)
      expandList(1);
    }
    buttons[2].onmouseover=function(){
      collapseList(0);
      collapseList(1);
      collapseList(3);
      collapseList(4);
      if(sublists[2].getElementsByTagName("li").length>0)
      expandList(2);
    }
    buttons[3].onmouseover=function(){
      collapseList(0);
      collapseList(1);
      collapseList(2);
      collapseList(4);
      if(sublists[3].getElementsByTagName("li").length>0)
      expandList(3);
    }
    buttons[4].onmouseover=function(){
      collapseList(0);
      collapseList(1);
      collapseList(2);
      collapseList(3);
      if(sublists[4].getElementsByTagName("li").length>0)
      expandList(4);
    }
    //var left = document.getElementById("root").offsetLeft;
    //var top = document.getElementById("root").offsetTop;

    onload = function(){
      initAllLists();
    }
    window.onresize = function(){
      initAllLists();
    }
    document.onclick = function(e){
      var target = detectTarget(e);
      if(getReal(target, "id", "searchButton")==null) {
	document.getElementById("searchButton").className='';
	document.getElementById("searchButton").getElementsByTagName("div")[0].style.visibility='hidden';
      }
    }
    document.onmouseover = function(e){
      var openIndex = -1;
      for(i=0;i<5;i++){
        if(booleans[2*i]) openIndex = i;
      }
      if(openIndex>-1){
	//alert('opened list, '+openIndex);
        var target = detectTarget(e);
	var container = subListContainers[openIndex];
        if(target!=buttons[openIndex] &&
	   target!=container &&
	   target.parentNode!=container &&
	   target.parentNode.parentNode!=null &&
	   target.parentNode.parentNode!=container &&
	   target.parentNode.parentNode.parentNode!=container){ //Check for null
	     collapseList(openIndex);
	}
      }
    }

    var visibleAltList;
    function displaylist(listindex){
      document.getElementById("arguments").style.display='block';
      if(visibleAltList!=null) document.getElementById('list_'+visibleAltList).style.display='none';
      document.getElementById('list_'+listindex).style.display='block';
        visibleAltList = listindex;
    }

    function returnToTop(listNumber){
      var currentList = sublists[listNumber];
      currentList.style.visibility='visible';
      currentList.style.top=-currentList.offsetHeight+'px'; //start from the beginning
    }
    function initAllLists(){ //init container-left positions, collapse alla lists (move them to the top)

        var left = document.getElementById("root").offsetLeft;
        var top = document.getElementById("root").offsetTop;
	var offsetListLeft = 0;
	for(i=0;i<buttons.length;i++){
	  sublists[i].parentNode.style.left = (i*65-offsetListLeft+left+2)+'px';
	  sublists[i].parentNode.style.top = (top+88)+'px';
	  //sublists[i].parentNode.style.display='block';
	  sublists[i].style.top = (-sublists[i].offsetHeight)+'px';
	}
    }

    function expandList(listNumber){
      if(booleans[2*listNumber]) return false;
      else {
	sublists[listNumber].parentNode.style.display='block';
	booleans[2*listNumber+1]=false; //Abort collapsion
	booleans[2*listNumber]=true;
	if(!booleans[2*listNumber+1]) returnToTop(listNumber);
	moveList(listNumber, 1);
      }
    }
    function collapseList(listNumber){
      if(booleans[2*listNumber+1]) return false;
      else {
	booleans[2*listNumber]=false; //Abort expanding
	booleans[2*listNumber+1]=true
	moveList(listNumber, -1);
      }
    }

    function moveList(listNumber, moveDirection){
      var submenu = sublists[listNumber];
      var counter = submenu.style.top.substring(0,submenu.style.top.length-2)*1;
      var add=0;
      if(moveDirection<0){
	add=(submenu.offsetHeight+counter)*KP;
      }
      else {
	add=Math.abs(counter)*KP;
      }
      if(add<minSpeed) add=minSpeed;
      counter += moveDirection*add;

      if(Math.abs(counter)<=3) submenu.style.top= '0px';
      else if(Math.abs(counter+submenu.offsetHeight)<=3) submenu.style.top= -submenu.offsetHeight-4 + 'px';

      if((moveDirection>0 && booleans[2*listNumber] && counter<0) || (moveDirection<0 && booleans[2*listNumber+1] && counter>-submenu.offsetHeight)) {
        submenu.style.top = counter + 'px';
	setTimeout('moveList('+listNumber+','+moveDirection+');', 2);
      }
      else if(moveDirection<0){ //List is fully collapsed, make the container div disappear
	//alert('fully collapsed, moveDirection: '+moveDirection);
	submenu.parentNode.style.display='none';
      }
    }

function setCookie(cookieName, cookieValue) {
	var expireDate = new Date();
	expireDate.setDate(365 + expireDate.getDate());
	document.cookie = cookieName + "=" + escape(cookieValue) + "; expires=" + expireDate.toGMTString() + "; path=/;";
}

function deleteCookie(cookieName) {
	document.cookie = cookieName + "=0; expires=Fri, 31 Dec 1999 23:59:59 GMT; path=/;";
}

function getCookie(cookieName) {
	var cookieList = document.cookie.split("; ");
	for (var i = 0; i < cookieList.length; i++) {
		var name = cookieList[i].split("=");
		if (unescape(name[0]) == cookieName) return unescape(name[1]);
	}
	return null;
}

function _flowGetField(frm, fieldName) {
	if (document.all) return eval("frm.elements('" + fieldName + "')")
	else if (document.getElementById) return document.getElementById(fieldName)
	else return eval("frm.elements['" + fieldName + "']");
}

function submitSearchSmall(frm) {
	naviEl = _flowGetField(frm, 'navipath');
	navipath = naviEl.value;
	countEl = _flowGetField(frm, 'count');
	count = countEl.value;
	indexEl = _flowGetField(frm, 'indexids');
	indexIds = indexEl.value;
	languageEl = _flowGetField(frm, 'searchlang');
	languageId = languageEl.value;
	searchEl = _flowGetField(frm, 'searchSmall');
	searchStr = searchEl.value;
	setCookie('search', searchStr);
	//url = '/default.aspx?page=471&indexids=' + indexIds + '&count=' + count + '&search=' + searchStr + ' AND navipath:' + navipath;
	url = '/default.aspx?page=471&indexids=' + indexIds + '&count=' + count + '&search=' + searchStr + ' AND language:' + languageId;
	window.location.href = url;
	return false;
}

function replaceLocation(s1, v1, s2, v2) {
	url = replaceQuery(s1, v1);
	if (s2 != null) url = replaceQuery(s2, v2, url);
	window.location.href = url;
}

function replaceQuery(s, v, str) {
	if (str == null) str = window.location.href;
	aStr = "";
	idx = str.indexOf("#");
	if (idx != -1) {
		aStr = str.substring(idx, str.length);
		str = str.substring(0, idx);
	}
	s1 = '?' + s + '=';
	l = s1.length;
	lIdx = str.indexOf(s1);
	if (lIdx == -1) {
		s1 = '&' + s + '=';
		lIdx = str.indexOf(s1);
	}
	if (lIdx == -1) {
		str += s1 + v;
		str += aStr;
		return str;
	}
	lStr = str.substring(0, lIdx+l);
	rStr = str.substring(lStr.length, str.length);
	rIdx = rStr.indexOf("&");
	if (rIdx != -1) rStr = rStr.substring(rIdx, rStr.length)
	else rStr = '';
	str = lStr + v + rStr;
	str += aStr;
	return str;
}

function tipFriend(url) {
	if (url == null) url = document.location.href;
	window.open('/?page=470&tipurl=' + escape(url), '', 'width=423,height=262,status=0,toolbar=0,scrollbars=0,resizable=0, menubar=0');
}

function printPage() {
	url = replaceQuery('media', 'print');
	var printpage = window.open(url);
	//printpage.print();
}

function detectTarget(e){
  var targ;
  if (!e) var e=window.event;
  if (e.target){targ=e.target;}
  else if(e.srcElement){targ=e.srcElement;}
  if (targ.nodeType==3){targ=targ.parentNode;}
  return targ;
}
function getReal(el, type, value) {
	tempEl = el;
	while ((tempEl != null) && (tempEl.tagName!=null) && (tempEl.tagName != "BODY")) {
		if (tempEl.getAttribute(type) == value) {
			el = tempEl;
			return el;
		}
		tempEl = tempEl.parentNode;
	}
	return null;
}
function validEmail(fieldname) {
	var str = fieldname.value;
	var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
	var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
	if ((!reg1.test(str) && reg2.test(str)) || str.length==0) { // if syntax is valid
		return true;
	}
	return false;
}
	function _tip() {
	if ((document.forms['mailform'].toemail.value == '') || (document.forms['mailform'].fromname.value == '') || (document.forms['mailform'].fromemail.value == '')) {
		alert(msg);
		return false;
	}
	else if (!validEmail(document.forms['mailform'].toemail)) {
	alert(tomsg);
		return false;
	}
	else if (!validEmail(document.forms['mailform'].fromemail)) {
		alert(frommsg);
		return false;
		}
	else
		return true;
	}



//Start of DeepMetrix (.NET) StatScript
var DMNETdomain = "";
var DMNETpage = window.location;
var DMNETversion = "86";
var DMNETsendTo = "//collector.upstream.se/dm.gif?";
var DMNETsession;

function dmneterr(){return true;}

window.onerror=dmneterr;
var s = new Date();

if (navigator.userAgent.indexOf('Mac') >= 0 && s.getTimezoneOffset() >= 720)
  s.setTime (s.getTime() - 1440*60*1000);

var dmnetURL = location.protocol + DMNETsendTo+"v="+DMNETversion+"&vst=1";
var dmnetCookieString = document.cookie.toString();

if(dmnetCookieString.indexOf("_dmnid") == -1)
  {
    DMNETsession = parseInt( Math.random()*1000000 ) + "_" + s.getTime();
    var domStr = "";
    if(DMNETdomain != "")
    {
      domStr = "domain="+ DMNETdomain +";";
    }
    document.cookie = "_dmnid=" + DMNETsession + ";expires=Mon, 31-Dec-2008 00:00:00 GMT;"+domStr+"path=/;";
  }
dmnetCookieString = document.cookie.toString();
if(dmnetCookieString.indexOf('_dmnid') == -1)
  {
    DMNETsession = "";
  }
else
  {
    if(dmnetCookieString.indexOf(';') == -1)
      dmnetCookieString = dmnetCookieString.replace(/_dm/g, ';_dm');

    var start = dmnetCookieString.indexOf("_dmnid=") + 7;
    var end = dmnetCookieString.indexOf(";",start);

    if (end == -1)
      end = dmnetCookieString.length;
    DMNETsession = unescape(dmnetCookieString.substring(start,end));
  }
dmnetURL += "&id="+DMNETsession+"&url="+escape(DMNETpage) + "&ref="+escape(document.referrer)+"&lng=" + ((!document.all ||  navigator.userAgent.match('Opera')) ? navigator.language : navigator.userLanguage) + "&tz=" + (Math.round(new Date('dec 1, 2002').getTimezoneOffset()/60)*-1);
if(screen)
  dmnetURL += "&scr=" + escape( screen.width + "x" + screen.height + " " + screen.colorDepth + "bpp" );

dmnetURL += "&rnd=" + new Date().getTime();

if(document.layers)
{
  document.write("<la"+"yer name=\"DMStats\" visibility=hide><img src=\""+dmnetURL+"\" height=1 width=1></la"+"yer>");
}
else
{
  document.write("<di"+"v id=\"DMStats\" STYLE=\"position:absolute;visibility:hidden;\"><img src=\""+dmnetURL+"\" height=1 width=1></di"+"v>");
}


// End of DeepMetrix (.NET) StatScript 