var combodropleftimage='/alphatecc-theme/images/custom/left.jpg'
var combodroprightimage='/alphatecc-theme/images/custom/right.jpg' //path to "drop down" image
var combozindex=100
 


function mouseout()
{
document.getElementById("td1").style.color="#000000"


}

function mouseover()
{
document.getElementById("td1").style.color="#042B4C"

}

function click1()
{
document.getElementById("td1").style.color="#042B4C"
}

function mouseout1()
{
document.getElementById("td2").style.color="#000000"
document.getElementById("td2").style.decoration="none"

}

function mouseover1()
{
document.getElementById("td2").style.color="#042B4C"
document.getElementById("td2").style.decoration="none"
}

function click2()
{
document.getElementById("td2").style.color="#042B4C"
document.getElementById("td2").style.decoration="none"
}















function gotoZipSearch()
 {
 Application.evalCode('esuche_window', true)
 }
 function gotoMap()
 {
 location.href="/web/elektrofachmarkt/search"
 }
 
function opendropdown()
{
 if(document.getElementById("idcmb").style.display=="block")
                {
                 cmbclick=0;
                 document.getElementById("idcmb").style.display="none"
                }
                else
                 {
                  cmbclick=0;
		    document.getElementById("idcmb").style.display="block"
                  document.getElementById("idcmb1").style.display="none"

                 }

}


     
function dhtmlselect(selectid, selectwidth, optionwidth){






 BrowserDetect.init();

 


     
       var count=0;
       var  cmbclick=0;
	var selectbox=document.getElementById(selectid)
           
    
	document.write('<div id="dhtml_'+selectid+'" >')

        


       document.write('<div  class="dhtmlselect"  style="background-color:#FFFFFF;">')

      
	if (BrowserDetect.version==6 || BrowserDetect.version==7 || BrowserDetect.version==8  )
        {
          
	   document.write('<div id="idcmb" class="dropdown" style="position:absolute;display:none;background-color:#042B4C; border-bottom:1px solid #042B4C; margin-top:-13px;width:200px;">')
       }
       else 

       {

          document.write('<div id="idcmb" class="dropdown" style="position:absolute;display:none;background-color:#042B4C;border-bottom:1px solid #042B4C;margin-top:-13px;width:200px;">')
         

       }
        
            document.write('<div style="display:block;background-color:#042B4C;">')

             document.write('<table  style="background-color:#ffffff;border-color:#ffffff;margin:3px;"><tr ><td width=175>&nbsp;&nbsp;<b style="font-size:10px;color:#000000;text-decoration:none;"     onclick="gotoZipSearch()"  id="td1" onmouseout="mouseout()" onmouseover="mouseover()" onclick="click1()"><img src="'+combodropleftimage+'" style="padding-top:10px;"/>&nbsp;erweiterte Suche</b></td></tr>')
           
            document.write('<tr><td >&nbsp;&nbsp;<b style="font-size:10px;color:#000000;text-decoration:none;"  class="external" onclick="gotoMap()"  id="td2" onmouseout="mouseout1()" onmouseover="mouseover1()" onclick="click2()"><img src="'+combodroprightimage+'" style="padding-top:10px;"/>&nbsp;Kartenansicht aller M&auml;rkte</b><p></p></td></tr></table>')


         
          
         
	
         document.write('</div>')
 
	

	for (var i=0; i<selectbox.options.length; i++)
            {
             
		document.write('<a  href="'+selectbox.options[i].value+'"><img src="/alphatecc-theme/images/custom/home.png"/>&nbsp;'+selectbox.options[i].text+'</a>')
         
	     
             }
      
       document.write('</div>')
       
       
       document.write('</div>')
     
     
        
      
     





        document.write('</div>')
      

             jQuery(document).bind('click', function(e){
                 
                  if(!((e.pageX>425 && e.pageX<611) && (e.pageY>51&&e.pageY<79)))
                    {
                    this.getElementById("idcmb").style.display="none";
                    }
               });


 
	selectbox.style.display="none"
	
	var dhtmlselectbox=document.getElementById("dhtml_"+selectid)
	dhtmlselectbox.style.zIndex=combozindex
	combozindex--
	if (typeof selectwidth!="undefined")
		dhtmlselectbox.style.width=selectwidth
	if (typeof optionwidth!="undefined")
		dhtmlselectbox.getElementsByTagName("div")[1].style.width=optionwidth

     
          
     if (BrowserDetect.version==6)
        {
           
           dhtmlselectbox.getElementsByTagName("div")[1].style.left="446px"

        }
        else if(BrowserDetect.version==7)
              {
                 dhtmlselectbox.getElementsByTagName("div")[1].style.left="431px"

              }  
        else
        {
        dhtmlselectbox.getElementsByTagName("div")[1].style.left="421px"
        }
	

}


var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};