
// QR - nur aus kompatibilätsgründen....
function openinlayer(link)
{
	return true;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
   window.open(theURL,winName,features);
}	
function MM_callJS(jsStr) { //v2.0
   return eval(jsStr);
}   
function NummernCheck(feldname){
 	if (feldname == 'Vorwahl'){
        if(document.myForm.intTelephoneCountryCode.value != document.myForm.intTelephoneCountryCode2.value){
	        alert("\nDie Vorwahl stimmt nicht mit ihrer Best?tigung ?berein!\nBitte korrigieren Sie Ihre Eingabe");
		    	document.myForm.intTelephoneCountryCode.focus();
			    document.myForm.intTelephoneCountryCode.select();
	    }	
	}
	else
	    if(document.myForm.intTelephoneDigits.value != document.myForm.intTelephoneDigits2.value){
	    alert("\nDie Telefonnummer stimmt nicht mit ihrer Best?tigung ?berein!\nBitte korrigieren Sie Ihre Eingabe");
			document.myForm.intTelephoneDigits.focus();
			document.myForm.intTelephoneDigits.select();
		}	
}
var Cookiewert;

function GetLogCookie()
  {
   var loogedin
   loggedin = document.cookie.indexOf('uestico_member=');
   if (loggedin > 0) {
	   //document.images['log'].src="pics/menue_logout_0.gif";
	   Cookiewert = "logged=in";
	}
   else{
	 //document.images['log'].src="pics/menue_login_0.gif";
	 Cookiewert = "logged=out";
    } 
}

function BildwechselMouseOut()
{
   if(Cookiewert == "logged=out")
     document.images['log'].src="pics/menue_login_0.gif";
   else
     document.images['log'].src="pics/menue_logout_0.gif";   
}

function BildwechselMouseOver()
{
   if(Cookiewert == "logged=out")
     document.images['log'].src="pics/menue_login_1.gif";
   else
     document.images['log'].src="pics/menue_logout_1.gif";   
}

function MoveToLog()
{
   if(Cookiewert == "logged=out")
     window.location.href = "../live/non_ssl_link?i_url=menu_callbacks.login?l_referrer=" + window.location.href;
   else
   	 window.location.href = "../live/non_ssl_link?i_url=menu_callbacks.logout";
}

function parent_ref(ref)
{
  parent.window.location.href=ref;
}

var clicked="no";
		
function disable_link(myForm)
{
    if(myForm==false){
    	clicked="no";
    	return false;
    }
    if(clicked=="no"){
        clicked="yes";
        return true;
    }
   
    return false;
}   

function replaceAll(str, searchString, replacement)
{
	var str_temp = str;
	while(str_temp.indexOf(searchString) != -1) {
   		str_temp = str_temp.replace(searchString, replacement);
    }
    return str_temp;
}

String.prototype.trim = function(){
	return this.replace(/^ +/, "").replace(/ +$/, "");
}

String.prototype.replaceAll = function(searchString, replacement){
	return replaceAll(this, searchString, replacement);
}

/*
 * kovertiert einen datumsstring im java simple date format in das von dynarch verwendete format. 
 * unterstützt wird allerdings nur dd,MM,yyyy,HH und mm. Alle anderen nicht.
 */
function convertJavaSimpleDateFormatToDynarchDateFormat(str)
{
	if(!str || str=='')
		str = "dd/MM/yyyy HH:mm";

	str = str.replaceAll("dd", "%d");
	str = str.replaceAll("MM", "%m");
	str = str.replaceAll("yyyy", "%Y");
	str = str.replaceAll("HH", "%H");
	str = str.replaceAll("mm", "%M");
	return str;
}

