if (document.images)
   {
	 pic_utmenu_px= new Image(2,140);
     pic_utmenu_px.src="/themes/max123uus/img/px.gif";
     pic_dm_px= new Image(410,2);
     pic_dm_px.src="/themes/max123uus/img/px.gif";
     
     pic_utmenu_1= new Image(35,215);
     pic_utmenu_1.src="themes/max123uus/img/lang/1/menus/umenu/utmenu_1.jpg";
     pic_utmenu_1_sel= new Image(35,215);
     pic_utmenu_1_sel.src="themes/max123uus/img/lang/1/menus/umenu/utmenu_1_sel.jpg";
     pic_utmenu_1_line= new Image(35,215);
     pic_utmenu_1_line.src="themes/max123uus/img/lang/1/menus/umenu/utmenu_1_line.jpg";
     
     pic_utmenu_2= new Image(35,215);
     pic_utmenu_2.src="themes/max123uus/img/lang/1/menus/umenu/utmenu_2.jpg";
     pic_utmenu_2_sel= new Image(35,215);
     pic_utmenu_2_sel.src="themes/max123uus/img/lang/1/menus/umenu/utmenu_2_sel.jpg";
     pic_utmenu_2_line= new Image(35,215);
     pic_utmenu_2_line.src="themes/max123uus/img/lang/1/menus/umenu/utmenu_2_line.jpg";
     
     pic_utmenu_3= new Image(35,215);
     pic_utmenu_3.src="/themes/max123uus/img/lang/1/menus/umenu/utmenu_3.jpg";
     pic_utmenu_3_sel= new Image(35,215);
     pic_utmenu_3_sel.src="/themes/max123uus/img/lang/1/menus/umenu/utmenu_3_sel.jpg";
     pic_utmenu_3_line= new Image(35,215);
     pic_utmenu_3_line.src="/themes/max123uus/img/lang/1/menus/umenu/utmenu_3_line.jpg";
     
     pic_utmenu_4= new Image(35,215);
     pic_utmenu_4.src="/themes/max123uus/img/lang/1/menus/umenu/utmenu_4.jpg";
     pic_utmenu_4_sel= new Image(35,215);
     pic_utmenu_4_sel.src="/themes/max123uus/img/lang/1/menus/umenu/utmenu_4_sel.jpg";
     pic_utmenu_4_line= new Image(35,215);
     pic_utmenu_4_line.src="/themes/max123uus/img/lang/1/menus/umenu/utmenu_4_line.jpg";
     
     
     
     // D MENU IMAGES
     pic_dm_1= new Image(135,45);
     pic_dm_1.src="themes/max123uus/img/lang/1/menus/dmenu/dm_1.jpg";
     pic_dm_1_sel= new Image(135,45);
     pic_dm_1_sel.src="themes/max123uus/img/lang/1/menus/dmenu/dm_1_sel.jpg";
     pic_dm_1_line= new Image(135,45);
     pic_dm_1_line.src="themes/max123uus/img/lang/1/menus/dmenu/dm_1_line.jpg";
     
     pic_dm_2= new Image(135,45);
     pic_dm_2.src="themes/max123uus/img/lang/1/menus/dmenu/dm_2.jpg";
     pic_dm_2_sel= new Image(135,45);
     pic_dm_2_sel.src="themes/max123uus/img/lang/1/menus/dmenu/dm_2_sel.jpg";
     pic_dm_2_line= new Image(135,45);
     pic_dm_2_line.src="themes/max123uus/img/lang/1/menus/dmenu/dm_2_line.jpg";
     
     pic_dm_3= new Image(135,45);
     pic_dm_3.src="themes/max123uus/img/lang/1/menus/dmenu/dm_3.jpg";
     pic_dm_3_sel= new Image(135,45);
     pic_dm_3_sel.src="themes/max123uus/img/lang/1/menus/dmenu/dm_3_sel.jpg";
     pic_dm_3_line= new Image(135,45);
     pic_dm_3_line.src="themes/max123uus/img/lang/1/menus/dmenu/dm_3_line.jpg";
     // D MENU IMAGES
     
     
     
   }

// D MENU
function d_menusel(itemid,defitemid) {
}

function d_menuunsel(itemid,defitemid) {
}


function d_menudefsel(defitemid) {
}

function d_menudefunsel(defitemid) {
}
// D MENU
var m_menuBar = new Array(  );
if ( typeof ( onMenuLoad ) != 'undefined'){onMenuLoad ();}
var m_isRtl = false;
var isIE6 = false;
var m_anchorClicked = false;

function initProdMenus ()
{
var divs = document.getElementsByTagName("DIV");
for ( i=0;i < divs.length ; i ++ )
{
if ( divs[i].className == "pmContainer")
{
var pmContainer = divs[i];
var nodes = pmContainer.childNodes;
for ( j =0;j< nodes.length ; j ++)
{
if ( nodes[j].className == "pmShadow")
{
pmContainer.pmShadow = nodes[j];
continue;
}
if ( nodes[j].className == "pmMenu")
{
pmContainer.pmMenu = nodes[j];
var menuItems = pmContainer.pmMenu.getElementsByTagName("DIV");
for ( k=0;k<menuItems.length;k++)
{
var menuItem = menuItems[k];
if ( menuItem.className =="pmMenuItem")
{
menuItem.onclick = function(){ pbRowClick( this );};

}
}
continue;
}
if ( nodes[j].className == "pmPrimaryLinkContainer")
{
pmContainer.pmPrimaryLinkContainer = nodes[j];
var anchors = nodes[j].getElementsByTagName( "A");
if ( anchors != null && anchors.length > 0 )
{
pmContainer.pmPrimaryLink = anchors[0];
var subDivs =pmContainer.pmPrimaryLink .getElementsByTagName("DIV");
if ( subDivs != null && subDivs.length > 0)
{
pmContainer.pmPrimaryImageHolder= subDivs[0];
var imgs = pmContainer.pmPrimaryImageHolder.getElementsByTagName( "IMG");
if ( imgs != null && imgs.length > 0 )
{
pmContainer.pmImage = imgs[0];
}
}
}
}
}
pmContainer.onmouseover = function (){m_pmIsOverLink = true;pmOver ( this );};
pmContainer.onmouseout = function (){m_pmIsOverLink = false;setTimeout('pmTimer()',2000);};
pmContainer.pmShadow.style.width=pmContainer.style.width;

}
}
}
function pbRowClick ( row )
{
for ( i=0 ; i <row.childNodes.length; i++ )
{
if ( row.childNodes[i].tagName == "A")
{
var href= row.childNodes[i].href;
if( window.event != null && window.event.srcElement != null && window.event.srcElement.tagName == "A")
{
return;
}
else
{
row.childNodes[i].href="javascript:void(0);";
}
document.location.href= href;
}
}
}
m_pmIsOverLink=false;
m_pmOld=false;
function pmTimer ()
{
if (!m_pmIsOverLink && m_pmOld )
{
pmOff(m_pmOld);
}
}
function pmOff ( container )
{
container.style.border = "0px solid #ffffff";
container.style.backgroundImage= "";
container.style.backgroundColor ="#ffffff";
container.pmShadow.style.display="none";
container.pmMenu.style.display = "none";
container.style.zIndex = 1;

}
function pmOn ( container )
{
container.style.border = "0px solid #ffffff";
container.style.backgroundColor ="#ffffff";
container.pmMenu.style.display = "block";
container.pmShadow.style.display="block";

if(!m_isRtl)
{
container.pmMenu.style.top = 0;
container.style.zIndex = 2;
}
else
{
container.pmMenu.style.top = 0;
}
if( getLeftOffset ( container.pmMenu) < 0 )
{
container.pmMenu.style.left=0;
}
}
function pmOver ( container )
{
if ( m_pmOld && m_pmOld != container )
{
pmOff( m_pmOld );
}
m_pmOld = container;
pmOn ( container );
}



function getLeftOffset(obj) {
var x = obj.offsetLeft
while (obj = obj.offsetParent) x += obj.offsetLeft
return x
}
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var enableanchorlink=0 //Enable or disable the anchor link when clicked on? (1=e, 0=d)
var hidemenu_onclick=1 //hide menu when user clicks within menu? (1=yes, 0=no)

/////No further editting needed

var ie5=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden){
if (ie5||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie5 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie5 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie5 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function dropdownmenu(obj, e, dropmenuID){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
if (typeof dropmenuobj!="undefined") //hide previous menu
dropmenuobj.style.visibility="hidden"
clearhidemenu()
if (ie5||ns6){
obj.onmouseout=delayhidemenu
dropmenuobj=document.getElementById(dropmenuID)
if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden'}
dropmenuobj.onmouseover=clearhidemenu
dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
showhide(dropmenuobj.style, e, "visible", "hidden")
dropmenuobj.x=getposOffset(obj, "left")

dropmenuobj.y=getposOffset(obj, "top")

dropmenuobj.contentmeasure=dropmenuobj.offsetHeight

dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")-50+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")-50+obj.offsetHeight+"px"


}
return clickreturnvalue()
}

function clickreturnvalue(){
if ((ie5||ns6) && !enableanchorlink) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie5&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("dropmenuobj.style.visibility='hidden'",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}// <script>

// Copyright (C) 2005 Ilya S. Lyubinskiy. All rights reserved.
// Technical support: http://www.php-development.ru/
//
// YOU MAY NOT
// (1) Remove or modify this copyright notice.
// (2) Distribute this code, any part or any modified version of it.
//     Instead, you can link to the homepage of this code:
//     http://www.php-development.ru/javascripts/dropdown.php.
//
// YOU MAY
// (1) Use this code on your website.
// (2) Use this code as a part of another product provided that
//     its main use is not creating javascript menus.
//
// NO WARRANTY
// This code is provided "as is" without warranty of any kind, either
// expressed or implied, including, but not limited to, the implied warranties
// of merchantability and fitness for a particular purpose. You expressly
// acknowledge and agree that use of this code is at your own risk.


// ----- Popup Control ---------------------------------------------------------

function at_display(x)
{
  var win = window.open();
  for (var i in x) win.document.write(i+' = '+x[i]+'<br>');
}

// ----- Show Aux -----

function at_show_aux(parent, child)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child );

  var top  = (c["at_position"] == "y") ? p.offsetHeight+2 : 0;
  var left = (c["at_position"] == "x") ? p.offsetWidth +2 : 0;

  for (; p; p = p.offsetParent)
  {
    top  += p.offsetTop;
    left += p.offsetLeft;
  }


  c.style.position   = "absolute";
  c.style.top        = top +'px';
  c.style.left       = left+'px';
  c.style.visibility = "visible";
}

// ----- Show -----

function at_show()
{
  var p = document.getElementById(this["at_parent"]);
  var c = document.getElementById(this["at_child" ]);

  at_show_aux(p.id, c.id);

  clearTimeout(c["at_timeout"]);
}

// ----- Hide -----

function at_hide()
{
  var c = document.getElementById(this["at_child"]);

  c["at_timeout"] = setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'", 333);
}

// ----- Click -----

function at_click()
{
  var p = document.getElementById(this["at_parent"]);
  var c = document.getElementById(this["at_child" ]);

  if (c.style.visibility != "visible")
       at_show_aux(p.id, c.id);
  else c.style.visibility = "hidden";

  return false;
}

// ----- Attach -----

// PARAMETERS:
// parent   - id of visible html element
// child    - id of invisible html element that will be dropdowned
// showtype - "click" = you should click the parent to show/hide the child
//            "hover" = you should place the mouse over the parent to show
//                      the child
// position - "x" = the child is displayed to the right of the parent
//            "y" = the child is displayed below the parent
// cursor   - Omit to use default cursor or check any CSS manual for possible
//            values of this field

function at_attach(parent, child, showtype, position, cursor)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child);

  p["at_parent"]     = p.id;
  c["at_parent"]     = p.id;
  p["at_child"]      = c.id;
  c["at_child"]      = c.id;
  p["at_position"]   = position;
  c["at_position"]   = position;

  c.style.position   = "absolute";
  c.style.visibility = "hidden";

  if (cursor != undefined) p.style.cursor = cursor;

  switch (showtype)
  {
    case "click":
      p.onclick     = at_click;
      p.onmouseout  = at_hide;
      c.onmouseover = at_show;
      c.onmouseout  = at_hide;
      break;
    case "hover":
      p.onmouseover = at_show;
      p.onmouseout  = at_hide;
      c.onmouseover = at_show;
      c.onmouseout  = at_hide;
      break;
  }
}
/***********************************************
* DHTML Ticker script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function domticker(content,contentlink, divId, divClass, delay, fadeornot){
this.content=content
this.contentlink=contentlink
this.tickerid=divId //ID of master ticker div. Message is contained inside first child of ticker div
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over ticker (and pause it if it is)
this.pointer=1
this.opacitystring=(typeof fadeornot!="undefined")? "width: 100%; filter:progid:DXImageTransform.Microsoft.alpha(opacity=100); -moz-opacity: 1" : ""
if (this.opacitystring!="") this.delay+=500 //add 1/2 sec to account for fade effect, if enabled
this.opacitysetting=0.2 //Opacity value when reset. Internal use.
document.write('<div id="'+divId+'" class="'+divClass+'"><div style="'+this.opacitystring+'"><a class="'+divClass+'" href="'+contentlink[0]+'">'+content[0]+'</a></div></div>')
var instanceOfTicker=this
setTimeout(function(){instanceOfTicker.initialize()}, delay)
}

domticker.prototype.initialize=function(){
var instanceOfTicker=this
this.contentdiv=document.getElementById(this.tickerid).firstChild //div of inner content that holds the messages
document.getElementById(this.tickerid).onmouseover=function(){instanceOfTicker.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){instanceOfTicker.mouseoverBol=0}
this.rotatemsg()
}

domticker.prototype.rotatemsg=function(){
var instanceOfTicker=this
if (this.mouseoverBol==1) //if mouse is currently over ticker, do nothing (pause it)
setTimeout(function(){instanceOfTicker.rotatemsg()}, 100)
else{
this.fadetransition("reset") //FADE EFFECT- RESET OPACITY
this.contentdiv.innerHTML="<a href='" + this.contentlink[this.pointer] + "'>" + this.content[this.pointer] + "</a>";
this.fadetimer1=setInterval(function(){instanceOfTicker.fadetransition('up', 'fadetimer1')}, 100) //FADE EFFECT- PLAY IT
this.pointer=(this.pointer<this.content.length-1)? this.pointer+1 : 0
setTimeout(function(){instanceOfTicker.rotatemsg()}, this.delay) //update container
}
}

// -------------------------------------------------------------------
// fadetransition()- cross browser fade method for IE5.5+ and Mozilla/Firefox
// -------------------------------------------------------------------

domticker.prototype.fadetransition=function(fadetype, timerid){
var contentdiv=this.contentdiv
if (fadetype=="reset")
this.opacitysetting=0.2
if (contentdiv.filters && contentdiv.filters[0]){
if (typeof contentdiv.filters[0].opacity=="number") //IE6+
contentdiv.filters[0].opacity=this.opacitysetting*100
else //IE 5.5
contentdiv.style.filter="alpha(opacity="+this.opacitysetting*100+")"
}
else if (typeof contentdiv.style.MozOpacity!="undefined" && this.opacitystring!=""){
contentdiv.style.MozOpacity=this.opacitysetting
}
else
this.opacitysetting=1
if (fadetype=="up")
this.opacitysetting+=0.2
if (fadetype=="up" && this.opacitysetting>=1)
clearInterval(this[timerid])
}
// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;



// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 700;
defaultHeight = 700;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================

if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}

var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){

if (isNN){var imgWin=window.open('about:blank','',optNN);}
if (isIE){var imgWin=window.open('about:blank','',optIE);}

with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(300,300);');
writeln('width=300-(document.body.clientWidth-document.images[0].width);');
writeln('height=300-(document.body.clientHeight-document.images[0].height);');
writeln('var posX=(screen.width/2-document.images[0].width/2);');
writeln('var posY=(screen.height/2-document.images[0].height/2);');
writeln('window.moveTo(posX,posY);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();		
}}function validate_max_ee_form(errormessage)
{
	var missing_values ='' ;
	var formobj = document.forms["vorm"];
	
	for (n=3; n<formobj.elements.length; n++) {
		tempelem=formobj.elements[n];
		if (tempelem.alt=="req" && tempelem.value=="") {
			missing_values=1;
		}
	}
	if(missing_values==0)
		{ formobj.submit(); }
	else
		{ alert(errormessage);	return false; }
}

function validateForm(errormessage){
    var radioGroups = new Array();
    var missing_elements_array = new Array();
    var form = document.forms["vorm"];
    var missing_values ='' ;
  
    for(var i = 0; i < form.elements.length; i++)
    {
        if (document.getElementById('form_element_table['+form.elements[i].name+']'))
        {
        document.getElementById('form_element_table['+form.elements[i].name+']').style.backgroundColor="";
        }

        if((form.elements[i].tagName.toLowerCase() == 'select' ||
        form.elements[i].tagName.toLowerCase() == 'textarea' ||
        (form.elements[i].tagName.toLowerCase() == 'input' &&
        (form.elements[i].type.toLowerCase() == 'text' ||
        form.elements[i].type.toLowerCase() == 'file'))) &&
        form.elements[i].className.indexOf('Required') > 0 &&
        form.elements[i].value == ''){
        missing_values += '|' + form.elements[i].name;
        }
        else if(form.elements[i].tagName.toLowerCase() == 'input' &&
        form.elements[i].type.toLowerCase() == 'checkbox' &&
        form.elements[i].className.indexOf('Required') == 0 &&
        !form.elements[i].checked){
        missing_values += '|' + form.elements[i].name; 
        }
        else if(form.elements[i].tagName.toLowerCase() == 'input' &&
        form.elements[i].type.toLowerCase() == 'radio' &&
        !radioGroups[form.elements[i].name] &&
        radioGroups[form.elements[i].name] !== null &&
        form.elements[i].className.indexOf('Required') == 0){
        var t = (form.elements[i].checked)? true : null;
        radioGroups[form.elements[i].name] = t;
        }
        else if(form.elements[i].tagName.toLowerCase() == 'input' &&
        form.elements[i].type.toLowerCase() == 'radio' &&
        (radioGroups[form.elements[i].name] ||
        radioGroups[form.elements[i].name] == null) &&
        form.elements[i].className.indexOf('Required') == 0){
        if(form.elements[i].checked) radioGroups[form.elements[i].name] = true;
        }
    }
    for(var i in radioGroups){
      if(!radioGroups[i]){
          missing_values += '|' + i;  
      }
    }
    if(missing_values==0)
    { 
        form.submit(); 
        return true;
    }
    else
    { 
        //alert(missing_values);    
        splitted=missing_values.split('|');
        for(var m = 0; m < splitted.length; m++){        
            if (splitted[m] != null) {
                if (document.getElementById('form_element_table['+splitted[m]+']'))
                {
                    document.getElementById('form_element_table['+splitted[m]+']').style.backgroundColor="#FFEEEE";
                }
            }  
        }
        alert(errormessage);
        return false; 
    }
}
// Copyright 2006-2007 javascript-array.com

var timeout	= 500;
var closetimer	= 0;
var closetimer2    = 0;  
var headerclosetimer    = 0; 
var ddmenuitem	= 0;
var ddmenuitem2    = 0;
var ddheadermenuitem    = 0;
var currentcolor    = "";  
var currentactiveheader    = "";
var last_header_id =0; 

// open hidden layer
function mopen(id,header_id,color,activeheader)
{	
	// cancel close timer
	mcancelclosetime();

    
	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
    if(ddheadermenuitem) 
    {
        if (last_header_id != activeheader) ddheadermenuitem.style.borderLeft = '7px solid white';   
    }
	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible'; 
    ddmenuitem.style.borderLeft = '7px solid '+color;

    ddheadermenuitem = document.getElementById(header_id);
    last_header_id=header_id;
    ddheadermenuitem.style.borderLeft = '7px solid '+color; 
    
    currentactiveheader=activeheader;
    currentcolor=color;    
}




// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
    ddheadermenuitem.style.borderLeft = '7px solid white';
    activedmenuitem = document.getElementById(currentactiveheader);
    activedmenuitem.style.borderLeft = '7px solid '+currentcolor;
}


// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);  
		closetimer = null;
	}
    if(headerclosetimer)
    {
        window.clearTimeout(headerclosetimer);    
        headerclosetimer = null; 
    }
}


function mopen2(id)
{    
    // cancel close timer
    mcancelclosetime2();

    // close old layer
    if(ddmenuitem2) ddmenuitem2.style.visibility = 'hidden';
   
    // get new layer and show it
    ddmenuitem2 = document.getElementById(id);
    ddmenuitem2.style.visibility = 'visible'; 
}


// close showed layer
function mclose2()
{
    if(ddmenuitem2) ddmenuitem2.style.visibility = 'hidden';
}

// go close timer
function mclosetime2()
{
    closetimer2 = window.setTimeout(mclose2, timeout);
}

// cancel close timer
function mcancelclosetime2()
{
    if(closetimer2)
    {
        window.clearTimeout(closetimer2);  
        closetimer2 = null;
    }
}
// close layer when click-out
document.onclick = mclose; 
document.onclick = mclose2; function calculate_change(span_id,price_before,price) {
    var muutus="";
    var span_elem=document.getElementById('price_change_'+span_id);    
    muutus_eek = price_before-price; 
    muutus_percent = Math.floor(100-(price*100/price_before));
    if (muutus_percent > 10) muutus='â€“' + muutus_percent + '%';
    //if (muutus_eek > 1999 && muutus=="") muutus='â€“' + muutus_eek + '.â€“'; 
    span_elem.innerHTML = muutus;
}