
/* start load background */
var s5_act_counter = 10;
var s5_act_img = "a";
var s5_vm_period_index = -1;

function s5_load_bg() {
var s5_nm_img = document.getElementById("s5_navv").getElementsByTagName("A");
for (var s5_nm_y=0; s5_nm_y<s5_nm_img.length; s5_nm_y++) {

	if(s5_nm_img[s5_nm_y].id == "active0") {
		s5_act_counter = 0;
		s5_act_img = document.getElementById("active0").parentNode.style.backgroundImage;
	}
	
	else if(s5_nm_img[s5_nm_y].id == "active1") {
		s5_act_counter = 1;
		s5_act_img = document.getElementById("active1").parentNode.style.backgroundImage;
	}
	
	else if(s5_nm_img[s5_nm_y].id == "active2") {
		s5_act_counter = 2;
		s5_act_img = document.getElementById("active2").parentNode.style.backgroundImage;
	}
	
	else if(s5_nm_img[s5_nm_y].id == "active3") {
		s5_act_counter = 3;
		s5_act_img = document.getElementById("active3").parentNode.style.backgroundImage;
	}
	
}

if (s5_act_img.indexOf('.jpg') > 0 || s5_act_img.indexOf('.png') > 0 || s5_act_img.indexOf('.gif') > 0){
	s5_vm_period_index = 10;
}

	if (s5_act_counter == 0 && s5_vm_period_index > 1) {
		document.getElementById("s5_body").style.backgroundImage = document.getElementById("active0").parentNode.style.backgroundImage;
	}
	
	else if (s5_act_counter == 1 && s5_vm_period_index > 1) {
		document.getElementById("s5_body").style.backgroundImage = document.getElementById("active1").parentNode.style.backgroundImage;
	}
	
	else if (s5_act_counter == 2 && s5_vm_period_index > 1) {
		document.getElementById("s5_body").style.backgroundImage = document.getElementById("active2").parentNode.style.backgroundImage;
	}
	
	else if (s5_act_counter == 3 && s5_vm_period_index > 1) {
		document.getElementById("s5_body").style.backgroundImage = document.getElementById("active3").parentNode.style.backgroundImage;
	}
	
	else {
	document.getElementById("s5_body").style.backgroundImage = s5_bg;
	}
	
	window.setTimeout('s5_popups_bg()',1000);
}

	function s5_popups_bg(){
	if (document.getElementById("popup_outer")) {
	document.getElementById("popup_outer").style.backgroundImage = document.getElementById("s5_body").style.backgroundImage;
	}
	if (document.getElementById("lbOverlay")) {
	document.getElementById("lbOverlay").style.backgroundImage = document.getElementById("s5_body").style.backgroundImage;
	}
	}
	
/* end load background */




function s5_mouseopen() {
	document.getElementById("s5_searchbox").style.display = "block";
}
		
function s5_mouseclose() {
	document.getElementById("s5_searchbox").style.display = "none";
}



function s5_load_pos() {

var pos6 = 0;
var pos7 = 0;
var pos8 = 0;


 if (document.getElementById("s5_modleft")) {
 pos6 = document.getElementById("s5_modleft").offsetHeight;
 }
 if (document.getElementById("s5_modmiddle")) {
 pos7 = document.getElementById("s5_modmiddle").offsetHeight;
 }
 if (document.getElementById("s5_modright")) {
 pos8 = document.getElementById("s5_modright").offsetHeight;
 }

 
 
 
 if (pos6 >= pos7 && pos6 >= pos8) {
if (document.getElementById("s5_modleft")) {
document.getElementById("s5_modleft").style.height = pos6 + "px";
}
if (document.getElementById("s5_modmiddle")) {
document.getElementById("s5_modmiddle").style.height = ((pos6) + 1) + "px";
}
if (document.getElementById("s5_modright")) {
document.getElementById("s5_modright").style.height = pos6 + "px";
}
}

if (pos7 >= pos6 && pos7 >= pos8) {
if (document.getElementById("s5_modleft")) {
document.getElementById("s5_modleft").style.height = pos7 + "px";
}
if (document.getElementById("s5_modmiddle")) {
document.getElementById("s5_modmiddle").style.height = ((pos7) + 1) + "px";
}
if (document.getElementById("s5_modright")) {
document.getElementById("s5_modright").style.height = pos7 + "px";
}
}

if (pos8 >= pos7 && pos8 >= pos6) {
if (document.getElementById("s5_modleft")) {
document.getElementById("s5_modleft").style.height = pos8 + "px";
}
if (document.getElementById("s5_modmiddle")) {
document.getElementById("s5_modmiddle").style.height = ((pos8) + 1) + "px";
}
if (document.getElementById("s5_modright")) {
document.getElementById("s5_modright").style.height = pos8 + "px";
}
}
}