var newwin;
function popup(winurl,winname,winfeatures) {              
	newwin = window.open(winurl,winname,winfeatures);      
	newwin.focus();             
}

function checkBrowser(){
        this.ver = navigator.appVersion;

        this.dom = document.getElementById?1:0;

        this.ie7 = (this.ver.indexOf("MSIE 7")>-1 && this.dom)?1:0;
		this.ie6 = (this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
        this.ie55 = (this.ver.indexOf("MSIE 5.5")>-1 && this.dom)?1:0;
        this.ie5 = (this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
        this.ie4 = (document.all && !this.dom) ? 1:0;
        this.ns5 = (this.dom && parseInt(this.ver) >= 5) ? 1:0;
        this.ns4 = (document.layers) ? 1:0;
        this.bw  = (this.ie5 || this.ie4 || this.ns4 || this.ns5 || this.ie55 || this.ie6);
        this.os  = (this.ver.indexOf("Macintosh")>-1)? "mac":"pc";
        this.ie  = (this.ie5 || this.ie4 || this.ie55 || this.ie6);
        this.ns  = (this.ns4 || this.ns5);
        this.client = (this.ie) ? "ie" : "ns";
		this.ok  =  (this.dom)
		return this;
}

function chkRegForm() {
	meldung = varfillinyour+"\n" 
	theForm = findObj('formular');
		if (theForm.Nickname.value == "" || theForm.Nickname.value.length < 6)
			{ meldung += "   - "+varUsername+"\n"}
		if (theForm.Email.value == "" || theForm.Email.value.indexOf("@") == -1 || theForm.Email.value.indexOf(".") == -1)
			{ meldung += "   - "+varEmail+"\n"}
		if (theForm.Password.value == "" || theForm.Password.value.length < 6)
			{ meldung += "   - "+varPassword+"\n"}
		if (theForm.PasswordConfirm.value == "" || theForm.PasswordConfirm.value != theForm.Password.value)
			{ meldung += "   - "+varConfirmPassword+"\n"}
		if (!theForm.TermsAccept.checked)
			{ meldung += "   - "+varTermsAccept+"\n"}
		if (theForm.Captcha.value == "")
			{ meldung += "   - "+varCaptcha+"\n"}
				
	if (meldung.length > varfillinyour.length+2)
		{alert(meldung)}
	else {theForm.Password.value = MD5(theForm.Password.value); theForm.submit()}
}

var donotCheckPw = false;
function chkSettForm(Kat) {
	meldung = varfillinyour+"\n" 
	theForm = findObj('formular');
		//fuer premium user
		if (Kat == "prem") {
			if (theForm.Vorname.value == "")
			{ meldung += "   - "+varVorname+"\n"}
			if (theForm.Nachname.value == "")
			{ meldung += "   - "+varNachname+"\n"}
			
		}
		
		else if (theForm.Email.value == "" || theForm.Email.value.indexOf("@") == -1 || theForm.Email.value.indexOf(".") == -1) { 
			meldung += "   - "+varEmail+"\n"
		}
			
		if (theForm.Password.value == "******") {
			donotCheckPw = true;
		} 
		else if (theForm.Password.value == "" || theForm.Password.value.length < 6)	{ 
			meldung += "   - "+varPassword+"\n"
		}
		if (donotCheckPw == false) {
			if (theForm.PasswordConfirm.value == "" || theForm.PasswordConfirm.value != theForm.Password.value)
				{ meldung += "   - "+varConfirmPassword+"\n"}
		}
		if (theForm.NewsletterCheck.checked) {
			theForm.Newsletter.value = 1;
		}
		else {
			theForm.Newsletter.value = 0;
		}
		
		if (Kat == "prem") {
			if (theForm.Country.value == "")
			{ meldung += "   - "+varCountry+"\n"}
			if (theForm.Address.value == "")
			{ meldung += "   - "+varAddress+"\n"}
			if (theForm.Citytown.value == "")
			{ meldung += "   - "+varCity+"\n"}
			if (theForm.Zip.value == "")
			{ meldung += "   - "+varZip+"\n"}
			if (theForm.Birthmonth.value == "" || theForm.Birthday.value == "" || theForm.Birthyear.value == "")
			{ meldung += "   - "+varBirthday+"\n"}
		}
		
	if (meldung.length > varfillinyour.length+2) {
		alert(meldung)
	}
	else { 
		if (theForm.Email.value == theForm.Emailalt.value) {
			theForm.Email.value = "";
		}
		if (theForm.Password.value == "******") {
			theForm.Password.value = "";
		} 
		if (donotCheckPw == false) { 
			theForm.Password.value = MD5(theForm.Password.value); 
		}  
		theForm.submit()}
}

function chkLoginForm() {    
	meldung = varfillinyour+"\n" 
	theForm = findObj('formularlogin');
		if (theForm.Username.value == "" || theForm.Username.value == "Username")
			{ meldung += "   - "+varUsername+"\n"}
		if (theForm.PasswordCheck.value == "" || theForm.PasswordCheck.value == "Username")
			{ meldung += "   - "+varPassword+"\n";}
		if 	(theForm.Username.value == "" && theForm.PasswordCheck.value == ""){
			theForm.Username.focus();
		}
		else {
			theForm.PasswordCheck.focus();
		}	
	if (meldung.length > varfillinyour.length+2)
		{alert(meldung)}
	else { 
	   theForm.Password.value = MD5(theForm.PasswordCheck.value); 
       theForm.PasswordCheck.value = "";
       	if (window.rba === undefined && window.fcb === undefined) { 
      		document.getElementById('logincontainer').style.display = 'none';
      		document.getElementById('loadingcontainer').style.display = 'block';
      		 submitlogin() // ajax submit
      		}
      	else {
       		theForm.submit() // php submit
       		}
       }
}
function chkCommForm() {
	meldung = varfillinyour+"\n" 
	theForm = findObj('formular');
		if (theForm.Name.value == "")
			{ meldung += "   - "+varName+"\n"}
		if (theForm.Kommentar.value == "")
			{ meldung += "   - "+varKommentar+"\n"}
		if (theForm.Captcha.value == "")
			{ meldung += "   - "+varCaptcha+"\n"}
			
	if (meldung.length > varfillinyour.length+2)
		{alert(meldung)}
	else {theForm.submit()}
}
function chkTafForm() {
	meldung = varfillinyour+"\n" 
	theForm = findObj('formular');
		if (theForm.Name.value == "")
			{ meldung += "   - "+varName+"\n"}
		if (theForm.Email.value == "" || theForm.Email.value.indexOf("@") == -1 || theForm.Email.value.indexOf(".") == -1)
			{ meldung += "   - "+varEmail+"\n"}
		if (theForm.EmpfaengerName.value == "")
			{ meldung += "   - "+varEmpfaengerName+"\n"}
		if (theForm.EmpfaengerEmail.value == "" || theForm.EmpfaengerEmail.value.indexOf("@") == -1 || theForm.EmpfaengerEmail.value.indexOf(".") == -1)
			{ meldung += "   - "+varEmpfaengerEmail+"\n"}
		if (theForm.Nachricht.value == "")
			{ meldung += "   - "+varNachricht+"\n"}
		if (theForm.Captcha.value == "")
			{ meldung += "   - "+varCaptcha+"\n"}
			
	if (meldung.length > varfillinyour.length+2)
		{alert(meldung)}
	else {theForm.submit()}
}
function chkContactForm() {
	meldung = varfillinyour+"\n" 
	theForm = findObj('formular');
		if (theForm.Name.value == "")
			{ meldung += "   - "+varName+"\n"}
		if (theForm.Email.value == "" || theForm.Email.value.indexOf("@") == -1 || theForm.Email.value.indexOf(".") == -1)
			{ meldung += "   - "+varEmail+"\n"}
		if (theForm.Nachricht.value == "")
			{ meldung += "   - "+varNachricht+"\n"}
		if (theForm.Captcha.value == "")
			{ meldung += "   - "+varCaptcha+"\n"}
			
	if (meldung.length > varfillinyour.length+2)
		{alert(meldung)}
	 else {
	 	if (window.rba === undefined && window.fcb === undefined) { 
	 		submitcontact() // ajax submit
	 	}
	 	else { 
	 		theForm.submit() //php submit
	 		} 
	 }
}

function chkForgotForm() {
	meldung = varfillinyour+"\n" 
	theForm = findObj('formularlogin');
		if (theForm.Email.value == "" || theForm.Email.value.indexOf("@") == -1 || theForm.Email.value.indexOf(".") == -1)
			{ meldung += "   - "+varEmail+"\n"}
		if (theForm.PasswordNew.value == "")
			{ meldung += "   - "+varNewPassword+"\n"}
		if (theForm.PasswordConfirm.value == "" || theForm.PasswordConfirm.value != theForm.PasswordNew.value)
			{ meldung += "   - "+varConfirmPassword+"\n"}
				
	if (meldung.length > varfillinyour.length+2)
		{alert(meldung)}
	else {
		theForm.PasswordNew.value = MD5(theForm.PasswordNew.value);
		if (window.rba === undefined && window.fcb === undefined) {  
			submitlogin() // ajax
			}
		else {
			theForm.submit() //php
			}
	}
}
function chkNlForm() {
	meldung = varfillinyour+"\n" 
	theForm = findObj('formular');
		if (theForm.Email.value == "" || theForm.Email.value.indexOf("@") == -1 || theForm.Email.value.indexOf(".") == -1)
			{ meldung += "   - "+varEmail+"\n"}
				
	if (meldung.length > varfillinyour.length+2)
		{alert(meldung)}
	else { theForm.submit()}
}

function chkScBuyForm() {
	meldung = varfillinyour+"\n" 
	theForm = findObj('formular2');
		if (theForm.Nummer.value == "")
			{ meldung += "   - "+varNumber+"\n"}
				
	if (meldung.length > varfillinyour.length+2)
		{alert(meldung)}
	else { theForm.submit()}
}
function chkScRedeemForm() {
	meldung = varfillinyour+"\n" 
	theForm = findObj('formular3');
		if (theForm.SmsPin.value == "")
			{ meldung += "   - "+varPin+"\n"}		
        if (theForm.Captcha.value == "")
			{ meldung += "   - "+varCaptcha+"\n"}		
	if (meldung.length > varfillinyour.length+2)
		{alert(meldung)}
	else { theForm.submit()}
}

function chkRegAgain() {
	meldung = varfillinyour+"\n" 
	theForm = findObj('formular2');
		if (theForm.Email.value == "" || theForm.Email.value.indexOf("@") == -1 || theForm.Email.value.indexOf(".") == -1)
			{ meldung += "   - "+varEmail+"\n"}
				
	if (meldung.length > varfillinyour.length+2)
		{alert(meldung)}
	else { theForm.submit()}
}
function findObj(n, d){       
		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=findObj(n,d.layers[i].document);
	  	if(!x && document.getElementById) x=document.getElementById(n); return x;
	}

function switchImg(imgName, imgtype, xmlName, preFix) {
        
		oImg = findObj('switchB'+preFix)
		if (imgtype == 'flv') {
		
			oImg.innerHTML = '<div id="flashContent"><a href="http://www.adobe.com/go/getflashplayer"><img src="images/get_flash_player.gif" alt="Get Adobe Flash player" border="0"></a></div>';
			var flashvars = false;
			var videofile = imgName;
			var xmlfile = xmlName;
			var params = {
			  menu: "false",
			  allowscriptaccess: "always",
			  allowfullscreen: "true",
			  wmode: "transparent",
			  flashvars: "file="+videofile+"&autostart=true&backcolor=666666&frontcolor=EEEEEE&lightcolor=FFFFFF&plugins=drelated-1&"+escape("drelated.dxmlpath")+"="+xmlfile+"&"+escape("drelated.dposition")+"=center&"+escape("drelated.dskin")+"=3d_sport/skins/grayskin.swf&"+escape("drelated.dtarget")+"=_self"
			};
			var attributes = {
			  id: "myDynamicContent",
			  name: "myDynamicContent"
			};
			swfobject.embedSWF("player.swf", "flashContent", "320", "260", "10.0.0","expressInstall.swf", flashvars, params, attributes);
			
		}
		else {
			//alert(oImg.innerHTML)
            oImg.innerHTML = '<img src="'+imgName+'" width="320" height="240" border="0">';
		}
		
}

function showRegTxt(id)	{
	if (window.fcb === undefined && window.rba === undefined)  {
		
		parent.$.fn.colorbox({href:"agb_lightbox.php", open:true});
	}
	else if (window.fcb !== undefined && fcb == 0){
		parent.$.fn.colorbox({href:"agb_lightbox.php", open:true});
	}
	else	{
	divAkt = findObj("regagb");
	divAkt2 = findObj("regtxt");
	divAkt3 = findObj("tabregisteragain");

		if (id == 'agb') {
			divAkt.style.display = "block";
			divAkt2.style.display = "none";
			if (window.rba === undefined){				
			}
			else if (rba == 1) {
			divAkt3.style.display = "none";
			}
		}
		else
		{
			divAkt2.style.display = "block";
			divAkt.style.display = "none";
			if (window.rba === undefined){				
			}
			else if (rba == 1) {
			divAkt3.style.display = "block";
			}
		}		
	}
}

function showRegForm()	{
	divAkt = findObj("rbarechts");
	divAkt.style.display = "block";		
}

function showNews(id) {
	for (k=0;k<nLayer.length;k++) {
	     
		divAkt = findObj('newsblock'+nLayer[k]);
		divAkt.style.display = "none";
		divAkt = findObj('newstable'+nLayer[k]);
		//divAkt.className = 'textnewshead ' + farbe;
		divAkt1 = findObj('newsLink1'+nLayer[k]);
		divAkt2 = findObj('newsLink2'+nLayer[k]);
        /*if (divAkt1.className == 'rot' || divAkt1.className == 'rot weiss') {
    		divAkt1.className = 'rot';
    		divAkt2.className = 'rot';
        }
        else {
    		divAkt1.className = 'gruen';
    		divAkt2.className = 'gruen';
        }*/
	}
		divAkt = findObj('newsblock'+id);
		divAkt.style.display = "block";
		divAkt = findObj('newstable'+id);
		//divAkt.className = 'textnewshead';
		divAkt1 = findObj('newsLink1'+id);
		divAkt2 = findObj('newsLink2'+id);
        /*if (divAkt1.className == 'rot' || divAkt1.className == 'rot weiss') {
    		divAkt1.className = 'rot weiss';
    		divAkt2.className = 'rot weiss';
        }
        else {
    		divAkt1.className = 'gruen weiss';
    		divAkt2.className = 'gruen weiss';
        }*/
}
var timer = "";
function hideFlagTimeout(id) {
	//if (timer == "") {
		//zeit = (document.all) ? 3000 : 3500;
		zeit = 2500;
		timer = setTimeout(function(){hideFlag(id)},zeit)
	//}
	
}

function hideFlag(id) {
		divAkt = findObj('flag'+id);
		divAkt.style.display = "none";
		timer = "";
}

function showFlag(id,KoordX,KoordY) {
	//clearTimeout(timer);
	for (k=0;k<nLayer.length;k++) {
		divAkt = findObj('flag'+nLayer[k]);
		divAkt.style.display = "none";
	}
		divAkt = findObj('flag'+id);
		//divAkt.style.top = KoordX+"px";
		//divAkt.style.left = KoordY+"px";
		divAkt.style.display = "block";
}

function hideThis(id) {
		divAkt = findObj(id);
		divAkt.style.display = "none";
}

function showThis(id) {
		divAkt = findObj(id);
		divAkt.style.display = "block";
}

function setXYShow(id,e) {
		mPos = getMousePos(e);
		divAkt = findObj(id);
		divAkt.style.display = "block";
		divAkt.style.top = (mPos[1] + 0) + "px";
		divAkt.style.left = (mPos[0] + 0) + "px";
}

function setXY(id,KoordX,KoordY) {
		divAkt = findObj(id);
		divAkt.style.top = KoordX+"px";
		divAkt.style.left = KoordY+"px";
}
function getMousePos(e) {
	var posx = 0;
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
	// posx and posy contain the mouse position relative to the document
	// Do something with this information
	coord = new Array(posx,posy)
	return coord;
}
function chngColor(id) {
	divAkt = findObj(id);
	classAlt = divAkt.className;
	divAkt.className = classAlt + ' orange';	
}

function makeRequest(job, typ, parameters, returnType, whereParam) 
	{   
    	if(!whereParam) whereParam = '';
        $.get("ajax.php", { job: escape(job), typ: escape(typ), sel: escape(parameters), whereParam: escape(whereParam) },
            function(data){
                if(returnType == 'iHTML')
                   		{                 		   
                            $('#ajax_'+typ).html(data);	
                        }
        			else
                   		{
        					func = returnType+'('+data+')'					
        					eval(func);		
        				}
           });
    }
    
/**
*
*  MD5 (Message-Digest Algorithm)
*  http://www.webtoolkit.info/
*
**/

var MD5 = function (string) {

    function RotateLeft(lValue, iShiftBits) {
        return (lValue<<iShiftBits) | (lValue>>>(32-iShiftBits));
    }

    function AddUnsigned(lX,lY) {
        var lX4,lY4,lX8,lY8,lResult;
        lX8 = (lX & 0x80000000);
        lY8 = (lY & 0x80000000);
        lX4 = (lX & 0x40000000);
        lY4 = (lY & 0x40000000);
        lResult = (lX & 0x3FFFFFFF)+(lY & 0x3FFFFFFF);
        if (lX4 & lY4) {
            return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
        }
        if (lX4 | lY4) {
            if (lResult & 0x40000000) {
                return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
            } else {
                return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
            }
        } else {
            return (lResult ^ lX8 ^ lY8);
        }
     }

     function F(x,y,z) { return (x & y) | ((~x) & z); }
     function G(x,y,z) { return (x & z) | (y & (~z)); }
     function H(x,y,z) { return (x ^ y ^ z); }
    function I(x,y,z) { return (y ^ (x | (~z))); }

    function FF(a,b,c,d,x,s,ac) {
        a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
        return AddUnsigned(RotateLeft(a, s), b);
    };

    function GG(a,b,c,d,x,s,ac) {
        a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
        return AddUnsigned(RotateLeft(a, s), b);
    };

    function HH(a,b,c,d,x,s,ac) {
        a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
        return AddUnsigned(RotateLeft(a, s), b);
    };

    function II(a,b,c,d,x,s,ac) {
        a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
        return AddUnsigned(RotateLeft(a, s), b);
    };

    function ConvertToWordArray(string) {
        var lWordCount;
        var lMessageLength = string.length;
        var lNumberOfWords_temp1=lMessageLength + 8;
        var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1 % 64))/64;
        var lNumberOfWords = (lNumberOfWords_temp2+1)*16;
        var lWordArray=Array(lNumberOfWords-1);
        var lBytePosition = 0;
        var lByteCount = 0;
        while ( lByteCount < lMessageLength ) {
            lWordCount = (lByteCount-(lByteCount % 4))/4;
            lBytePosition = (lByteCount % 4)*8;
            lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount)<<lBytePosition));
            lByteCount++;
        }
        lWordCount = (lByteCount-(lByteCount % 4))/4;
        lBytePosition = (lByteCount % 4)*8;
        lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80<<lBytePosition);
        lWordArray[lNumberOfWords-2] = lMessageLength<<3;
        lWordArray[lNumberOfWords-1] = lMessageLength>>>29;
        return lWordArray;
    };

    function WordToHex(lValue) {
        var WordToHexValue="",WordToHexValue_temp="",lByte,lCount;
        for (lCount = 0;lCount<=3;lCount++) {
            lByte = (lValue>>>(lCount*8)) & 255;
            WordToHexValue_temp = "0" + lByte.toString(16);
            WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);
        }
        return WordToHexValue;
    };

    function Utf8Encode(string) {
        string = string.replace(/\r\n/g,"\n");
        var utftext = "";

        for (var n = 0; n < string.length; n++) {

            var c = string.charCodeAt(n);

            if (c < 128) {
                utftext += String.fromCharCode(c);
            }
            else if((c > 127) && (c < 2048)) {
                utftext += String.fromCharCode((c >> 6) | 192);
                utftext += String.fromCharCode((c & 63) | 128);
            }
            else {
                utftext += String.fromCharCode((c >> 12) | 224);
                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
                utftext += String.fromCharCode((c & 63) | 128);
            }

        }

        return utftext;
    };

    var x=Array();
    var k,AA,BB,CC,DD,a,b,c,d;
    var S11=7, S12=12, S13=17, S14=22;
    var S21=5, S22=9 , S23=14, S24=20;
    var S31=4, S32=11, S33=16, S34=23;
    var S41=6, S42=10, S43=15, S44=21;

    string = Utf8Encode(string);

    x = ConvertToWordArray(string);

    a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476;

    for (k=0;k<x.length;k+=16) {
        AA=a; BB=b; CC=c; DD=d;
        a=FF(a,b,c,d,x[k+0], S11,0xD76AA478);
        d=FF(d,a,b,c,x[k+1], S12,0xE8C7B756);
        c=FF(c,d,a,b,x[k+2], S13,0x242070DB);
        b=FF(b,c,d,a,x[k+3], S14,0xC1BDCEEE);
        a=FF(a,b,c,d,x[k+4], S11,0xF57C0FAF);
        d=FF(d,a,b,c,x[k+5], S12,0x4787C62A);
        c=FF(c,d,a,b,x[k+6], S13,0xA8304613);
        b=FF(b,c,d,a,x[k+7], S14,0xFD469501);
        a=FF(a,b,c,d,x[k+8], S11,0x698098D8);
        d=FF(d,a,b,c,x[k+9], S12,0x8B44F7AF);
        c=FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1);
        b=FF(b,c,d,a,x[k+11],S14,0x895CD7BE);
        a=FF(a,b,c,d,x[k+12],S11,0x6B901122);
        d=FF(d,a,b,c,x[k+13],S12,0xFD987193);
        c=FF(c,d,a,b,x[k+14],S13,0xA679438E);
        b=FF(b,c,d,a,x[k+15],S14,0x49B40821);
        a=GG(a,b,c,d,x[k+1], S21,0xF61E2562);
        d=GG(d,a,b,c,x[k+6], S22,0xC040B340);
        c=GG(c,d,a,b,x[k+11],S23,0x265E5A51);
        b=GG(b,c,d,a,x[k+0], S24,0xE9B6C7AA);
        a=GG(a,b,c,d,x[k+5], S21,0xD62F105D);
        d=GG(d,a,b,c,x[k+10],S22,0x2441453);
        c=GG(c,d,a,b,x[k+15],S23,0xD8A1E681);
        b=GG(b,c,d,a,x[k+4], S24,0xE7D3FBC8);
        a=GG(a,b,c,d,x[k+9], S21,0x21E1CDE6);
        d=GG(d,a,b,c,x[k+14],S22,0xC33707D6);
        c=GG(c,d,a,b,x[k+3], S23,0xF4D50D87);
        b=GG(b,c,d,a,x[k+8], S24,0x455A14ED);
        a=GG(a,b,c,d,x[k+13],S21,0xA9E3E905);
        d=GG(d,a,b,c,x[k+2], S22,0xFCEFA3F8);
        c=GG(c,d,a,b,x[k+7], S23,0x676F02D9);
        b=GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A);
        a=HH(a,b,c,d,x[k+5], S31,0xFFFA3942);
        d=HH(d,a,b,c,x[k+8], S32,0x8771F681);
        c=HH(c,d,a,b,x[k+11],S33,0x6D9D6122);
        b=HH(b,c,d,a,x[k+14],S34,0xFDE5380C);
        a=HH(a,b,c,d,x[k+1], S31,0xA4BEEA44);
        d=HH(d,a,b,c,x[k+4], S32,0x4BDECFA9);
        c=HH(c,d,a,b,x[k+7], S33,0xF6BB4B60);
        b=HH(b,c,d,a,x[k+10],S34,0xBEBFBC70);
        a=HH(a,b,c,d,x[k+13],S31,0x289B7EC6);
        d=HH(d,a,b,c,x[k+0], S32,0xEAA127FA);
        c=HH(c,d,a,b,x[k+3], S33,0xD4EF3085);
        b=HH(b,c,d,a,x[k+6], S34,0x4881D05);
        a=HH(a,b,c,d,x[k+9], S31,0xD9D4D039);
        d=HH(d,a,b,c,x[k+12],S32,0xE6DB99E5);
        c=HH(c,d,a,b,x[k+15],S33,0x1FA27CF8);
        b=HH(b,c,d,a,x[k+2], S34,0xC4AC5665);
        a=II(a,b,c,d,x[k+0], S41,0xF4292244);
        d=II(d,a,b,c,x[k+7], S42,0x432AFF97);
        c=II(c,d,a,b,x[k+14],S43,0xAB9423A7);
        b=II(b,c,d,a,x[k+5], S44,0xFC93A039);
        a=II(a,b,c,d,x[k+12],S41,0x655B59C3);
        d=II(d,a,b,c,x[k+3], S42,0x8F0CCC92);
        c=II(c,d,a,b,x[k+10],S43,0xFFEFF47D);
        b=II(b,c,d,a,x[k+1], S44,0x85845DD1);
        a=II(a,b,c,d,x[k+8], S41,0x6FA87E4F);
        d=II(d,a,b,c,x[k+15],S42,0xFE2CE6E0);
        c=II(c,d,a,b,x[k+6], S43,0xA3014314);
        b=II(b,c,d,a,x[k+13],S44,0x4E0811A1);
        a=II(a,b,c,d,x[k+4], S41,0xF7537E82);
        d=II(d,a,b,c,x[k+11],S42,0xBD3AF235);
        c=II(c,d,a,b,x[k+2], S43,0x2AD7D2BB);
        b=II(b,c,d,a,x[k+9], S44,0xEB86D391);
        a=AddUnsigned(a,AA);
        b=AddUnsigned(b,BB);
        c=AddUnsigned(c,CC);
        d=AddUnsigned(d,DD);
    }

    var temp = WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d);

    return temp.toLowerCase();
}

function browserOk(){
	var userAgent = navigator.userAgent.toLowerCase();
	$.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());
	var version = 0;
	
	// Is this a version of IE?
	if($.browser.msie){
		userAgent = $.browser.version;
		userAgent = userAgent.substring(0,userAgent.indexOf('.'));	
		version = userAgent;
		if(version >=7) return true;
	}
	
	// Is this a version of Chrome?
	if($.browser.chrome){
		userAgent = userAgent.substring(userAgent.indexOf('chrome/') +7);
		userAgent = userAgent.substring(0,userAgent.indexOf('.'));	
		version = userAgent;
		// If it is chrome then jQuery thinks it's safari so we have to tell it it isn't
		$.browser.safari = false;
		return true;
	}
	
	// Is this a version of Safari?
	if($.browser.safari){
		userAgent = userAgent.substring(userAgent.indexOf('safari/') +7);	
		userAgent = userAgent.substring(0,userAgent.indexOf('.'));
		version = userAgent;
		return true;
	}
	
	// Is this a version of Mozilla?
	if($.browser.mozilla){
		//Is it Firefox?
		if(navigator.userAgent.toLowerCase().indexOf('firefox') != -1){
			userAgent = userAgent.substring(userAgent.indexOf('firefox/') +8);
			userAgent = userAgent.substring(0,userAgent.indexOf('.'));
			version = userAgent;
			if(version >=3) return true;
		}
		// If not then it must be another Mozilla
		else{
		}
	}
	
	// Is this a version of Opera?
	if($.browser.opera){
		userAgent = userAgent.substring(userAgent.indexOf('version/') +8);
		userAgent = userAgent.substring(0,userAgent.indexOf('.'));
		version = userAgent;
		}
	return false;
}

function getSite()
    {
        return document.location.href;
    }

    
function HsScroll(vorback) {
    if (vorback == "next") { dzt = start*proSeite; } else { dzt = start*proSeite-2*proSeite; }
    makeRequest('Highscore', 'highscore', Hswertung+'_'+dzt+'_'+proSeite, 'iHTML', HsGid);
    if (vorback == "next") { start++; } else { start--; }
    if (start <= 1) { document.getElementById('highscore_back').style.display = "none"; } else { document.getElementById('highscore_back').style.display = "block"; }
    if (start >= 25 || (dzt+25) >= 1600) { document.getElementById('highscore_next').style.display = "none"; } else { document.getElementById('highscore_next').style.display = "block"; }
}
function chkBonForm() {
	theForm = findObj('minibon');
	theForm.submit();
}
