// global den seitenpfad, verfügbar für andere js-funktionen
var strLPATH;

function PreloadNav(LPATH){

    strLPATH = LPATH;

    nav_on = new Array();
  	nav_off = new Array();

    PATH = LPATH+ "shared/img/nav/nav_";

   	for(i = 1; i <= 5; i++){
    	nav_on[i] = new Image();
    	nav_on[i].src = PATH+ i +"_on.gif";
    	nav_off[i] = new Image();
    	nav_off[i].src = PATH+ i +"_off.gif";
  	}

}


////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////


function PreloadSubNav(LPATH){

    strLPATH = LPATH;

    subnav_on = new Array();
  	subnav_off = new Array();

    PATH = LPATH+ "shared/img/subnav/subnav_";

   	for(i = 1; i <= 2; i++){
    	subnav_on[i] = new Image();
    	subnav_on[i].src = PATH+ i +"_on.gif";
    	subnav_off[i] = new Image();
    	subnav_off[i].src = PATH+ i +"_off.gif";
  	}

}


////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////


function NavOnOff(IMG,TYP){

    if(TYP == 'on'){
        document.images['nav_'+ IMG].src = nav_on[IMG].src;
    }else if(TYP == 'off'){
       	document.images['nav_'+ IMG].src = nav_off[IMG].src;
    }
}


////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////


function SubNavOnOff(IMG,TYP){

    if(TYP == 'on'){
        document.images['subnav_'+ IMG].src = subnav_on[IMG].src;
    }else if(TYP == 'off'){
       	document.images['subnav_'+ IMG].src = subnav_off[IMG].src;
    }
}


////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////


function PicBorderOnOff(OBJ, TYP){

    if(TYP == 'on'){
        OBJ.className = 'pic_border_2';
    }else if(TYP == 'off'){
		OBJ.className = 'pic_border_1';
    }
}


////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////


function popupRoutenplaner(URL){

 	var W = 400;
    var H = 230;
    var LEFT = (screen.width / 2) - (W / 2);
    var TOP = (screen.height / 2) - (H / 2) - 50;
    var GEOM = 'width='+W+',height='+H+',left='+LEFT+',top='+TOP+',location=no,menubar=yes,resizeable=no,scrollbars=auto,status=yes,toolbar=no';
    WINDOW = window.open(URL,"Window",GEOM);

}


//////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////


function resize() {

  	if(document.images[0]){
  		window.resizeTo(document.images[0].width+30, document.images[0].height + 120);
        window.moveTo((screen.width / 2) - (document.images[0].width / 2), (screen.height / 2) - 190 - (document.images[0].height / 2));
  		self.focus();
  	}
}


////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////


function popupWindow(url){

   	var strGeom = 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,left=100,top=100';
    window.open(url,"popupWindow",strGeom);
}


////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////


function ActNorm(ID,TYPE){

    if(TYPE == 'on'){
        if((ID == 'senden') || (ID == 'senden2')){
    		document.getElementById(ID).className = 'input_def input_1b_act';
        }else if(ID == 'text'){
	    	document.getElementById(ID).className = 'input_def input_2_act';
        }else{
	    	document.getElementById(ID).className = 'input_def input_1_act';
        }
    }else{
        if((ID == 'senden') || (ID == 'senden2')){
    		document.getElementById(ID).className = 'input_def input_1b';
        }else if(ID == 'text'){
    		document.getElementById(ID).className = 'input_def input_2';
        }else{
	    	document.getElementById(ID).className = 'input_def input_1';
        }
    }
}



