var winImages = null;
function popupImages(_id){
	winImages = window.open('images.asp?id='+_id,'','width=500,height=450,location=0,status=0');
}
function popupAdminImages(_id){
	winImages = window.open('adm_images.asp?id='+_id,'','width=500,height=500,location=0,status=0,resizable=yes');
}

function popupHallOfFame(_id){
	winImages = window.open('halloffame.asp','','width=700,height=700,location=0,status=0,');
}

var winImages = null;
function popupAdminHallOfFame(_id){
	winImages = window.open('adm_images.asp?id='+_id,'','width=700,height=700,location=0,status=0,resizable=yes');
}

function popupEnglish(){
	alert("Dear visitor, the english version of this Website will be ready within a few days.");
}


function switchHome(_id){
	var imgHome = document.getElementById('imgHome');
	if(imgHome){
		if(_id!=''){
			document.getElementById('imgHome').src = '_images/_img/img_home_'+_id+'.gif';
		}
		else {
			document.getElementById('imgHome').src = '_images/_img/img_home_team.gif';
		}
	}
	
	/*
	//switch bgcolor footer
	var bgcolorFooter = document.getElementById('divFooter');
	
	if(_id=='team'){
		bgcolorFooter.style.backgroundColor = '#938f86';
	}
	else if(_id=='firma'){
		bgcolorFooter.style.backgroundColor = '#879f9e';
	}
	else if(_id=='kontakt'){
		bgcolorFooter.style.backgroundColor = '#c4c8ac';
	}
	else if(_id=='aktuell'){
		bgcolorFooter.style.backgroundColor = '#444d57';
	}
	else if(_id=='engagement'){
		bgcolorFooter.style.backgroundColor = '#77606f';
	}
	else {
		bgcolorFooter.style.backgroundColor = '#'+footerColor;
	}
	*/

}




function initRollover(_name)
{
	
	var _doc = document;
	
	if(_name != "" && window.document.getElementById(_name).document) {
		_doc = window.document.getElementById(_name).document;
	}
	
	for(i=0;i<_doc.images.length;i++){
			if(_doc.images[i].src.indexOf('nav') != -1 || _doc.images[i].src.indexOf('but') != -1){    		 
				var parentNode = document.images[i].parentNode;
				
				parentNode.onmouseover = imgButtonHi;
				parentNode.onmouseout = imgButtonLo;
				parentNode.lock = imgButtonLock;
				parentNode.unlock = imgButtonUnlock;	
			
				parentNode.imgLo = new Image();
				parentNode.imgHi = new Image();
				
				parentNode.imgLo = document.images[i].src;
				parentNode.imgHi = document.images[i].src.replace('_lo-','_hi-');
				
				parentNode.img = document.images[i];			
				parentNode.img.blnLocked = false;
			}
	}        
	
	function imgButtonHi(){
		this.img.src = this.imgHi;
		switchHome(this.img.id);
	}
	function imgButtonLo(){
		if(!this.img.blnLocked) this.img.src = this.imgLo;
		switchHome('');
	}
	function imgButtonLock(){
		this.img.blnLocked = true;
		this.img.src = this.imgHi;
		switchHome(this.img.id);
	}
	function imgButtonUnlock(){		
		this.img.src = this.imgLo;
		this.img.blnLocked = false;	
		switchHome('');
	}
	
}




function sCmsCreateCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";		
}

function sCmsReadCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}


function getScrollXY() {
    var x = 0, y = 0;
    if( typeof( window.pageYOffset ) == 'number' ) {
        // Netscape
        x = window.pageXOffset;
        y = window.pageYOffset;
    } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        // DOM
        x = document.body.scrollLeft;
        y = document.body.scrollTop;
    } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        // IE6 standards compliant mode
        x = document.documentElement.scrollLeft;
        y = document.documentElement.scrollTop;
    }
    return [x, y];
}
            
function setScrollXY(x, y) {
    window.scrollTo(x, y);
}

