/*********************
*Rollover*
*********************/

function swap(obj,bild){
	obj.firstChild.src = bild;
}




/**************************************************************************
* REPOSITIONING THE OUTER-CONTAINER *
*
* FOR HORIZONTALLY-AND-VERTICALLY-CENTERED SITES:*
* <body onResize='reposition_main(10,10)' onLoad='reposition_main(10,10)'>*
*
* FOR HORIZONTALLY-CENTERED ONLY SITES:*
* <body onResize='reposition_main(10,'')' onLoad='reposition_main(10,'')'>*
*
* CSS-STYLES FOR OUTER_CONTAINER HAVE TO BE SET WITHIN THE HTML CODE      *
***************************************************************************/

// m = margin  ||  w = width  ||  h = height  ||  hor = horizontal  || vert = vertical

function reposition_main(new_hor_margin, new_vert_margin){
	
	cont = document.getElementById('outer_container').style;
	
	
	cont_w_px = cont.width;
	cont_w = cont_w_px.substr(0, 3);					//3 fuer 3-stellige outer_container_width, 4 fuer 4-stellige outer_container_width.
	
	cont_hor_m_px = cont.marginLeft;
	cont_hor_m = cont_hor_m_px.substr(0, 4);
	
	
	
	cont_h_px = cont.height;
	cont_h = cont_h_px.substr(0, 3);
	
	cont_vert_m_px = cont.marginTop;
	cont_vert_m = cont_vert_m_px.substr(0, 4);
	
	
				
	if (window.innerHeight!=undefined){												//mozilla etc
		avail_win_w = window.innerWidth;
		avail_win_h = window.innerHeight;
	}
	else {
		avail_win_w = document.body.offsetWidth;								//pc ie
		avail_win_h = document.body.offsetHeight;	
	}
		
	
	if (new_hor_margin!=''){
		if (avail_win_w < cont_w){
			new_hor_m = Math.abs(cont_hor_m - new_hor_margin);
			cont.left= new_hor_m;
		}
		else {
			cont.left='50%';
		}
	}
	
	
	if (new_vert_margin!=''){
		if (avail_win_h < cont_h){
			new_vert_m = Math.abs(cont_vert_m - new_vert_margin);
			cont.top= new_vert_m;
		}
		else {
			cont.top='50%';
		}
	}

}