var DOM=false;
document.getElementById ? DOM=true : DOM=false;



function openWin(newURL,params) {
openwin(newURL,params);
}
function OpenWin(newURL,params) {
openwin(newURL,params);
}
function openwin(newURL,params)
{
	if (!params) {
	var temp=window.open(newURL);
	return; 
	}	
	var weite=params.indexOf("width=");
	var hoehe=params.indexOf("height=");
	var resWeite=params.substring(weite+6,weite+9);
	var resHoehe=params.substring(hoehe+7,hoehe+10);
	
	var WindowName=escape(newURL).replace(/\%/g,"");
		WindowName=WindowName.replace(/\//g,'')
		WindowName=WindowName.replace(/\./g,'')
		WindowName=WindowName.replace(/-/g,'')
		WindowName=WindowName.replace(/\+/g,'')
	var temp= "window.open('"+newURL+"','"+WindowName+"','"+params+"')";
	  var newWin = eval(temp)
	temp="";
	newWin="";
}

document.write("<style type=\"text/css\"\>#schnelleinstieg ul {display:none;}"+
"#schnelleinstieg {\n"+
" position:absolute;\n"+
" top:0px;\n"+
" width:213px;\n"+
" height:65px;\n"+
" background:#02254F;\n"+
" padding:12px 15px 5px 23px;\n"+
" border-bottom:30px solid #295A7B;\n"+
" }\n"+
" #schnelleinstieg select {\n"+
" width:210px;\n"+
" margin-bottom:10px;\n"+
" font-size: 80%;\n"+
" }\n"+
" #schnelleinstieg option {\n"+
" font-size:10pt;\n"+
" }\n"+
  
" #NavWrapper {\n"+
" border-bootom:0px solid lime !important;\n"+
" padding-top:112px;\n"+
" }\n"+
"<\/style\>");

function arrayMachen(block, Anzeige) {
var Ar=document.getElementById(block).getElementsByTagName("A");
//var opt="\n\n<select id=\""+block+"\" onchange='window.top.location.href=this.options[this.selectedIndex].value'>\n\t<option selected=\"selected\">"+Anzeige+"</option>";
var opt="\n\n<select id=\""+block+"\" onchange='Schnelleinstieg(this.options[this.selectedIndex].value,\""+Anzeige+"\",this.options[this.selectedIndex].text)'>\n\t<option selected=\"selected\">"+Anzeige+"</option>";
  for (var i=0; i<Ar.length; i++) {
  opt+="\n\t<option value='"+Ar[i].getAttribute("href")+"'>"+Ar[i].firstChild.data+"</option>";
  }
opt+="\n</select>";
return opt;
}

function Schnelleinstieg(loc,anz,txt){
anz.indexOf("Produkt")>-1 ? dcsMultiTrack('DCS.dcsuri','/event_click/produkt/'+txt+'.evts', 'WT.ti','Klick Produkt '+txt, 'DCS.dcsref', 'http://www.ruv.de/de/index.jsp') : dcsMultiTrack('DCS.dcsuri','/event_click/tarifrechner/'+txt+'.evts', 'WT.ti','Klick Tarifrechner '+txt, 'DCS.dcsref', 'http://www.ruv.de/de/index.jsp');
window.top.location.href=loc;
}

/* Kommentar */

function selectBoxes() {
var bo=arrayMachen("Block1", "W&auml;hlen Sie ein Produkt ...")+
  arrayMachen("Block2", "Berechnen Sie selbst ...");
  document.getElementById("schnelleinstieg").innerHTML=bo;
}

function validatePLZ(n) {
	if (!isNaN(n.value)) {
//	openWin("http://customer.map24.com/ruv/index.php?act=search.proxy&searchtxt="+n.value,"height=600,width=565,resizable=yes,menubar=yes,status=no,loactionbar=no,scrollbars=yes");
	openWin("/de/servicecenter/ansprechpartner.html?"+n.value,"height=600,width=565,resizable=yes,menubar=yes,status=no,loactionbar=no,scrollbars=yes");

	return false;
	} else {
	return true;
	}
}
function adaptieren() { 
if(document.getElementById("schnelleinstieg")){selectBoxes()};
	if (document.all) {
	document.getElementById('sucMSuche').setAttribute("onblur",function anonymous() {checkVal(this,'Suchwort/PLZ',false)});
	document.getElementById('sucMSuche').setAttribute("onfocus",function anonymous() {checkVal(this,'Suchwort/PLZ',true)});
	document.getElementById('SuchDispatcherForm').setAttribute("onsubmit",function anonymous() { return validatePLZ(document.getElementById('sucMSuche'))});
	}
	else {
	document.getElementById('sucMSuche').setAttribute("onblur","checkVal(this,'Suchwort/PLZ',false)");
	document.getElementById('sucMSuche').setAttribute("onfocus","checkVal(this,'Suchwort/PLZ',true)");
	document.getElementById('SuchDispatcherForm').setAttribute("onsubmit","return validatePLZ(benutzereingabe)");
	}
}

/* CheckVal: diese Funktion setzt beim Focus das Suchfeld zurueck */
function checkVal(el,val,cursor) {
	if (cursor) {
		if (el.value==val)
		el.value = "";
	} else {
		if (el.value=="")
		el.value=val;
	}
}
if (DOM) 
window.onload=adaptieren;