	function Show(e){
			document.getElementById(e).style.display = 'block';
	}
	
	function CloseDIV(e){
			document.getElementById(e).style.display = 'none';
	}
	
	function ShowClose(e){
		if(document.getElementById(e).style.display == 'none'){
			document.getElementById(e).style.display = 'block';
		}
		else{
			document.getElementById(e).style.display = 'none';
		}
	}


        function scrollDiv(strId,intSpd) {
                if ( objScrll=document.getElementById(strId) ) {
                        var left = parseInt(objScrll.style.left);
                        if ( (intSpd>0) ? (left<0) : (left>parseInt(objScrll.parentNode.style.width)-objScrll.offsetWidth) )
                                objScrll.style.left = (left + intSpd) +"px";
                        eval( 'tvar' + strId +'= setTimeout("scrollDiv(\''+ strId +'\',' + intSpd + ')",50)' );
                        if (objSelf=scrollDiv.arguments[2])
                                objSelf.onmouseup = objSelf.onmouseout = new Function('fx','clearTimeout(tvar' + strId + ')');
                }
        }

	function leseDatei(url,id)
	{


		var req = (window.XMLHttpRequest)
		?
		new XMLHttpRequest()
		:
		((window.ActiveXObject)
			?
			new ActiveXObject("Microsoft.XMLHTTP")
			:
			false
		);

		req.open("GET", url ,true);
		req.onreadystatechange = function()
		{
		if (req.readyState==4)
			{
			if (req.status == 200)
				{
				var d = document.getElementById(id);
				d.innerHTML = req.responseText;
				}
			}
		}
		req.send(null);
		return true;

	}
	
	function SlideDown(id) {

	 if (id=='vodafone_box') {window.setTimeout('$("#vodafone_box").slideDown("slow");',0);CloseDIV('vodafone_image');Show('vodafone_image2');}
	 if (id=='tmobile_box') {window.setTimeout('$("#tmobile_box").slideDown("slow");',0);CloseDIV('tmobile_image');Show('tmobile_image2');}
	 if (id=='eplus_box') {window.setTimeout('$("#eplus_box").slideDown("slow");',0);CloseDIV('eplus_image');Show('eplus_image2');}
	 if (id=='o2_box') {window.setTimeout('$("#o2_box").slideDown("slow");',0);CloseDIV('o2_image');Show('o2_image2');}
	 if (id=='base_box') {window.setTimeout('$("#base_box").slideDown("slow");',0);CloseDIV('base_image');Show('base_image2');}
	 if (id=='tarifdetail_an') {window.setTimeout('$("#tarifdetail_an").slideDown("slow");',0);}
	 if (id=='produktdetail_an') {window.setTimeout('$("#produktdetail_an").slideDown("slow");',0);}	 
	 if (id=='tarifdetail_aus') {window.setTimeout('$("#tarifdetail_aus").slideDown("slow");',0);}
	 if (id=='produktdetail_aus') {window.setTimeout('$("#produktdetail_aus").slideDown("slow");',0);}
	 if (id=='handybox_1') {window.setTimeout('$("#handybox_1").slideDown("slow");',0);}
	 if (id=='handybox_2') {window.setTimeout('$("#handybox_2").slideDown("slow");',0);}
	 if (id=='handybox_3') {window.setTimeout('$("#handybox_3").slideDown("slow");',0);}
	 if (id=='zugabebox_1') {window.setTimeout('$("#zugabebox_1").slideDown("slow");',0);}
	 if (id=='zugabebox_2') {window.setTimeout('$("#zugabebox_2").slideDown("slow");',0);}
	 if (id=='tarifbox_1') {window.setTimeout('$("#tarifbox_1").slideDown("slow");',0);}
	 if (id=='tarifbox_2') {window.setTimeout('$("#tarifbox_2").slideDown("slow");',0);}
	 if (id=='tarifbox_3') {window.setTimeout('$("#tarifbox_3").slideDown("slow");',0);}	 	 
	}

	function SlideUp(id) {
	 if (id=='vodafone_box') {window.setTimeout('$("#vodafone_box").slideUp("slow");',0);CloseDIV('vodafone_image2');Show('vodafone_image');}
	 if (id=='tmobile_box') {window.setTimeout('$("#tmobile_box").slideUp("slow");',0);CloseDIV('tmobile_image2');Show('tmobile_image');}
	 if (id=='eplus_box') {window.setTimeout('$("#eplus_box").slideUp("slow");',0);CloseDIV('eplus_image2');Show('eplus_image');}
	 if (id=='o2_box') {window.setTimeout('$("#o2_box").slideUp("slow");',0);CloseDIV('o2_image2');Show('o2_image');}
	 if (id=='base_box') {window.setTimeout('$("#base_box").slideUp("slow");',0);CloseDIV('base_image2');Show('base_image');}
	 if (id=='tarifdetail_aus') {window.setTimeout('$("#tarifdetail_aus").slideUp("slow");',0);}
	 if (id=='produktdetail_aus') {window.setTimeout('$("#produktdetail_aus").slideUp("slow");',0);}
	 if (id=='tarifdetail_an') {window.setTimeout('$("#tarifdetail_an").slideUp("slow");',0);}
	 if (id=='produktdetail_an') {window.setTimeout('$("#produktdetail_an").slideUp("slow");',0);}
	 if (id=='handybox_1') {window.setTimeout('$("#handybox_1").slideUp("slow");',0);}
	 if (id=='handybox_2') {window.setTimeout('$("#handybox_2").slideUp("slow");',0);}
	 if (id=='handybox_3') {window.setTimeout('$("#handybox_3").slideUp("slow");',0);}	
	 if (id=='zugabebox_1') {window.setTimeout('$("#zugabebox_1").slideUp("slow");',0);}
	 if (id=='zugabebox_2') {window.setTimeout('$("#zugabebox_2").slideUp("slow");',0);}
	 if (id=='tarifbox_1') {window.setTimeout('$("#tarifbox_1").slideUp("slow");',0);}
	 if (id=='tarifbox_2') {window.setTimeout('$("#tarifbox_2").slideUp("slow");',0);}
	 if (id=='tarifbox_3') {window.setTimeout('$("#tarifbox_3").slideUp("slow");',0);}		 	 	  	 
	}
	
wmtt = null;
document.onmousemove = updateWMTT;
 
function updateWMTT(e) {
  if (wmtt != null) {
    x = (document.all) ? window.event.x + wmtt.offsetParent.scrollLeft : e.pageX;
    y = (document.all) ? window.event.y + wmtt.offsetParent.scrollTop  : e.pageY;
    wmtt.style.left = (x + 20) + "px";
    wmtt.style.top   = (y + 20) + "px";
  }
}
 
function showWMTT(id) {
  wmtt = document.getElementById(id);
  wmtt.style.display = "block"
}
 
function hideWMTT() { wmtt.style.display = "none";}	

function postvars(formularname) {

var count = 0;
var el = document.forms[formularname].elements;
newvar='';
for(i=0; i < el.length; i++)  {

    count++;
    
    if (el[i].type!='checkbox' && el[i].type!='radio') {
    	
    wert=(el[i].value.replace("+", "%2B"));
	newvar = newvar + el[i].name + '=' + escape(wert) + '&';
    
    }
    
    if (el[i].type=='checkbox' ||  el[i].type=='radio')
    
    {

		if (el[i].checked == true) 
    	{
    		newvar = newvar + el[i].name + '=' + escape(el[i].value) + '&';
    	}
    	
    }
    
  }
  
  return (newvar);
 }
 
 	function posteDatei(url,formname,id)
	{
		 
		document.getElementById(id).innerHTML = '<div style="text-align:center;padding:10px;font-size:12px;font-weight:bold;color:#999"><img src="user_handyagent/template/images/indicator.gif"> ... bitte warten</div>'; 
		pars=postvars(formname); 

		var req = (window.XMLHttpRequest)
		?
		new XMLHttpRequest()
		:
		((window.ActiveXObject)
			?
			new ActiveXObject("Microsoft.XMLHTTP")
			:
			false
		);

		req.open("POST", url ,true);
	 
		req.onreadystatechange = function()
		{
		if (req.readyState==4)
			{
			if (req.status == 200)
				{
				var d = document.getElementById(id);
				d.innerHTML = req.responseText;
				}
			}
		}

		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		req.send(pars); 
		return true;

	}
	
function changeCBstatus(id) {
	
	     if (document.getElementById(id).checked==false) {document.getElementById(id).checked=true;}
	else if (document.getElementById(id).checked==true)  {document.getElementById(id).checked=false;}
}

function blockCheck(id) {
    
    if (document.getElementById(id).kundenname.value == "") {alert ("Bitte einen Namen eingeben!");return false;} 
    else {document.getElementById(id).submit(); }

    } 

function blockCheck2(id) {
    
    if (document.getElementById(id).kundenname.value == "") {alert ("Bitte einen Namen eingeben!");return false;}
    else if (document.getElementById(id).rufnummer.value == "") {alert ("Bitte die Rufnummer eingeben!");return false;}  
    else {document.getElementById(id).submit(); }
    }     
