
	
	
var is_ie_front/*@cc_on = {
  // quirksmode : (document.compatMode=="BackCompat"),
  version : parseFloat(navigator.appVersion.match(/MSIE (.+?);/)[1])
}@*/;

function opacity_front(id_front, opacStart_front, opacEnd_front, millisec_front) {
	//speed for each frame
	var speed_front = Math.round(millisec_front / 100);
	var timer_front = 0;
	//determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart_front > opacEnd_front) {
		for(i = opacStart_front; i >= opacEnd_front; i--) {
			setTimeout("changeOpac_front(" + i + ",'" + id_front + "')",(timer_front * speed_front));
			timer_front++;
		}
	} else if(opacStart_front < opacEnd_front) {
		for(i = opacStart_front; i <= opacEnd_front; i++)
			{
			setTimeout("changeOpac_front(" + i + ",'" + id_front + "')",(timer_front * speed_front));
			timer_front++;
		}
	}
}

//change the opacity for different browsers
function changeOpac_front(opacity_front, id_front) {
	var object_front = document.getElementById(id_front).style; 
	object_front.opacity = (opacity_front / 100);
	object_front.MozOpacity = (opacity_front / 100);
	object_front.KhtmlOpacity = (opacity_front / 100);
    object_front.filter = "alpha(opacity=" + opacity_front + ")";
}

function y(divid_front, imageid_front, imagefile_front, millisec_front) {
	var speed_front = Math.round(millisec_front / 100);
	var timer_front = 0;
	
	//set the current image as background
	document.getElementById(divid_front).style.backgroundImage = "url(" + document.getElementById(imageid_front).src + ")";
	
	//make image transparent
	changeOpac_front(0, imageid_front);
	
	//make new image
	document.getElementById(imageid_front).src = imagefile_front;

	//fade in image
	for(i = 0; i <= 100; i++) {
		setTimeout("changeOpac_front(" + i + ",'" + imageid_front + "')",(timer_front * speed_front));
		timer_front++;
	}
}

function currentOpac_front(id_front, opacEnd_front, millisec_front) {
	//standard opacity is 100
	var currentOpac_front = 100;
	
	//if the element has an opacity set, get it
	if(document.getElementById(id_front).style.opacity < 100) {
		currentOpac_front = document.getElementById(id_front).style.opacity * 100;
	}

	//call for the function that changes the opacity
	opacity_front(id_front, currentOpac_front, opacEnd_front, millisec_front)
}




var front_current = 0;
var front_hov = 0;

function front_out_hover() {
	front_hov = 1;
}

function front_out_hover_out() {
	front_hov = 0;
}

function f1() {
	
	front_current = 1;
	
	if (document.getElementById("f1_1")) {
		document.getElementById("f1_1").style.backgroundImage = "url("+box1_pic+")";
	}
	if (document.getElementById("f1_2")) {
		document.getElementById("f1_2").style.backgroundImage = "url("+box2_pic+")";
	}
	if (document.getElementById("f1_3")) {
		document.getElementById("f1_3").style.backgroundImage = "url("+box3_pic+")";
	}
	if (document.getElementById("front_4")) {
		document.getElementById("front_4").style.backgroundImage = "url("+box4_pic+")";
	}
	if (document.getElementById("front_5")) {
		document.getElementById("front_5").style.backgroundImage = "url("+box5_pic+")";
	}
	if (document.getElementById("front_6")) {
		document.getElementById("front_6").style.backgroundImage = "url("+box6_pic+")";
	}
	if (document.getElementById("front_7")) {
		document.getElementById("front_7").style.backgroundImage = "url("+box7_pic+")";
	}
	if (document.getElementById("front_8")) {
		document.getElementById("front_8").style.backgroundImage = "url("+box8_pic+")";
	}
	
	document.getElementById("f1_1").style.backgroundImage = "url("+box1_pic_hover+")";
	
y('x','y',top1_pic,400);

	if (top1_hyperlink != "") {
		document.getElementById("x").style.cursor = "pointer";
		document.getElementById("x").onclick = f1_click_top;
	}
	if (top1_hyperlink == "") {
		document.getElementById("x").style.cursor = "default";
		document.getElementById("x").onclick = "";
	}
	if (box1_hyperlink != "") {
		document.getElementById("f1_1").style.cursor = "pointer";
		document.getElementById("f1_1").onclick = f1_click_box;
	}
}

function f1_click_top() {
	if (top1_target == "same") {
		window.location.href=top1_hyperlink;
		}
	else {
		window.open(top1_hyperlink);
	}
}

function f1_click_box() {
	if (box1_target == "same") {
		window.location.href=box1_hyperlink;
		}
	else {
		window.open(box1_hyperlink);
	}
}



function f2() {
	
	front_current = 2;
	
	if (document.getElementById("f1_1")) {
		document.getElementById("f1_1").style.backgroundImage = "url("+box1_pic+")";
	}
	if (document.getElementById("f1_2")) {
		document.getElementById("f1_2").style.backgroundImage = "url("+box2_pic+")";
	}
	if (document.getElementById("f1_3")) {
		document.getElementById("f1_3").style.backgroundImage = "url("+box3_pic+")";
	}
	if (document.getElementById("front_4")) {
		document.getElementById("front_4").style.backgroundImage = "url("+box4_pic+")";
	}
	if (document.getElementById("front_5")) {
		document.getElementById("front_5").style.backgroundImage = "url("+box5_pic+")";
	}
	if (document.getElementById("front_6")) {
		document.getElementById("front_6").style.backgroundImage = "url("+box6_pic+")";
	}
	if (document.getElementById("front_7")) {
		document.getElementById("front_7").style.backgroundImage = "url("+box7_pic+")";
	}
	if (document.getElementById("front_8")) {
		document.getElementById("front_8").style.backgroundImage = "url("+box8_pic+")";
	}
	
	document.getElementById("f1_2").style.backgroundImage = "url("+box2_pic_hover+")";
	
y('x','y',top2_pic,400);

	if (top2_hyperlink != "") {
		document.getElementById("x").style.cursor = "pointer";
		document.getElementById("x").onclick = f2_click_top;
	}
	if (top2_hyperlink == "") {
		document.getElementById("x").style.cursor = "default";
		document.getElementById("x").onclick = "";
	}
	if (box2_hyperlink != "") {
		document.getElementById("f1_2").style.cursor = "pointer";
		document.getElementById("f1_2").onclick = f2_click_box;
	}
}

function f2_click_top() {
	if (top2_target == "same") {
		window.location.href=top2_hyperlink;
		}
	else {
		window.open(top2_hyperlink);
	}
}

function f2_click_box() {
	if (box2_target == "same") {
		window.location.href=box2_hyperlink;
		}
	else {
		window.open(box2_hyperlink);
	}
}



function f3() {
	
	front_current = 3;
	
	if (document.getElementById("f1_1")) {
		document.getElementById("f1_1").style.backgroundImage = "url("+box1_pic+")";
	}
	if (document.getElementById("f1_2")) {
		document.getElementById("f1_2").style.backgroundImage = "url("+box2_pic+")";
	}
	if (document.getElementById("f1_3")) {
		document.getElementById("f1_3").style.backgroundImage = "url("+box3_pic+")";
	}
	if (document.getElementById("front_4")) {
		document.getElementById("front_4").style.backgroundImage = "url("+box4_pic+")";
	}
	if (document.getElementById("front_5")) {
		document.getElementById("front_5").style.backgroundImage = "url("+box5_pic+")";
	}
	if (document.getElementById("front_6")) {
		document.getElementById("front_6").style.backgroundImage = "url("+box6_pic+")";
	}
	if (document.getElementById("front_7")) {
		document.getElementById("front_7").style.backgroundImage = "url("+box7_pic+")";
	}
	if (document.getElementById("front_8")) {
		document.getElementById("front_8").style.backgroundImage = "url("+box8_pic+")";
	}
	
	document.getElementById("f1_3").style.backgroundImage = "url("+box3_pic_hover+")";
	
y('x','y',top3_pic,400);

	if (top3_hyperlink != "") {
		document.getElementById("x").style.cursor = "pointer";
		document.getElementById("x").onclick = f3_click_top;
	}
	if (top3_hyperlink == "") {
		document.getElementById("x").style.cursor = "default";
		document.getElementById("x").onclick = "";
	}
	if (box3_hyperlink != "") {
		document.getElementById("f1_3").style.cursor = "pointer";
		document.getElementById("f1_3").onclick = f3_click_box;
	}
}

function f3_click_top() {
	if (top3_target == "same") {
		window.location.href=top3_hyperlink;
		}
	else {
		window.open(top3_hyperlink);
	}
}

function f3_click_box() {
	if (box3_target == "same") {
		window.location.href=box3_hyperlink;
		}
	else {
		window.open(box3_hyperlink);
	}
}







function front_load_first() {
	if (front_highlight == "1") {
		f1();
	}
	if (front_highlight == "2") {
		f2();
	}
	if (front_highlight == "3") {
		f3();
	}
	if (front_highlight == "4") {
		f4();
	}
	if (front_highlight == "5") {
		f5();
	}
	if (front_highlight == "6") {
		f6();
	}
	if (front_highlight == "7") {
		f7();
	}
	if (front_highlight == "8") {
		f8();
	}
}

function front_next() {
	
	if (front_hov == "0") {
		
		if (front_current == "1") {
			if (document.getElementById("f1_2")) {
				f2();
			}
			else {
				f1();
			}
			return false;
		}
		if (front_current == "2") {
			if (document.getElementById("f1_3")) {
				f3();
			}
			else {
				f1();
			}
			return false;
		}
		if (front_current == "3") {
			if (document.getElementById("front_4")) {
				f4();
			}
			else {
				f1();
			}
			return false;
		}
		if (front_current == "4") {
			if (document.getElementById("front_5")) {
				f5();
			}
			else {
				f1();
			}
			return false;
		}
		if (front_current == "5") {
			if (document.getElementById("front_6")) {
				f6();
			}
			else {
				f1();
			}
			return false;
		}
		if (front_current == "6") {
			if (document.getElementById("front_7")) {
				f7();
			}
			else {
				f1();
			}
			return false;
		}
		if (front_current == "7") {
			if (document.getElementById("front_8")) {
				f8();
			}
			else {
				f1();
			}
			return false;
		}
		if (front_current == "8") {
			if (document.getElementById("f1_1")) {
				f1();
			}
			else {
				f1();
			}
			return false;
		}
	
	}
}

function front_load_module() {
	opacity_front('front_out', 0, 100, 1000);
	front_load_interval();
}

window.setTimeout('front_load_module()',1300);
window.setTimeout('front_load_first()',800);

function front_load_interval() {
	if (front_rotate == "yes") {
	var myInterval_front_int = window.setInterval("front_next()",(front_speed*1000));
	}
}