﻿// 0 = Disabled; 1 = Enabled;
var popupStatus1 = 0;

// Load Pop-up with jQuery
function loadPopup1(){
	if(popupStatus1==0){
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popup1").fadeIn("slow");
		popupStatus1 = 1;
	}
}

// Disable Pop-up with jQuery
function disablePopup1(){
	if(popupStatus1==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popup1").fadeOut("slow");
		popupStatus1 = 0;
	}
}

// Center Pop-up
function centerPopup1(){
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popup1").height();
	var popupWidth = $("#popup1").width();

	$("#popup1").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});

	$("#backgroundPopup").css({
		"height": windowHeight
	});
}

// Close Pop-up
$(document).ready(function(){
	// Click the X
	$(".popupContactClose").click(function(){
		disablePopup1();
	});
	// Click out
	$("#backgroundPopup").click(function(){
		disablePopup1();
	});
	// Press Esc
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus1==1){
			disablePopup1();
		}
	});
});

function showPopup1() {
	centerPopup1();
	loadPopup1();
}

/**********************************************************/


// 0 = Disabled; 1 = Enabled;
var popupStatus2 = 0;

// Load Pop-up with jQuery
function loadPopup2(){
	if(popupStatus2==0){
		var tmp2 = findSWF('postit');
		if (tmp2 != null) tmp2.Rewind();
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popup2").fadeIn("slow");
		popupStatus2 = 1;
	}
}

// Disable Pop-up with jQuery
function disablePopup2(){
	if(popupStatus2==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popup2").fadeOut("slow");
		popupStatus2 = 0;
	}
}

// Center Pop-up
function centerPopup2(){
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popup2").height();
	var popupWidth = $("#popup2").width();

	$("#popup2").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});

	$("#backgroundPopup").css({
		"height": windowHeight
	});
}

// Close Pop-up
$(document).ready(function(){
	// Click the X
	$(".popupContactClose").click(function(){
		disablePopup2();
	});
	// Click out
	$("#backgroundPopup").click(function(){
		disablePopup2();
	});
	// Press Esc
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus2==1){
			disablePopup2();
		}
	});
});

function showPopup2() {
	centerPopup2();
	loadPopup2();
}

/**********************************************************/


// 0 = Disabled; 1 = Enabled;
var popupStatus3 = 0;

// Load Pop-up with jQuery
function loadPopup3(){
	if(popupStatus3==0){
		$('#popup3').find('iframe').attr('src', 'emobbning01.html');
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popup3").fadeIn("slow");
		popupStatus3 = 1;
	}
}

// Disable Pop-up with jQuery
function disablePopup3(){
	if(popupStatus3==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popup3").fadeOut("slow");
		popupStatus3 = 0;
	}
}

// Center Pop-up
function centerPopup3(){
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popup3").height();
	var popupWidth = $("#popup3").width();

	$("#popup3").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});

	$("#backgroundPopup").css({
		"height": windowHeight
	});
}

// Close Pop-up
$(document).ready(function(){
	// Click the X
	$(".popupContactClose").click(function(){
		disablePopup3();
	});
	// Click out
	$("#backgroundPopup").click(function(){
		disablePopup3();
	});
	// Press Esc
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus3==1){
			disablePopup3();
		}
	});
});

function showPopup3() {
	centerPopup3();
	loadPopup3();
}

/**********************************************************/


// 0 = Disabled; 1 = Enabled;
var popupStatus4 = 0;

// Load Pop-up with jQuery
function loadPopup4(){
	if(popupStatus4==0){
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popup4").fadeIn("slow");
		popupStatus4 = 1;
	}
}

// Disable Pop-up with jQuery
function disablePopup4(){
	if(popupStatus4==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popup4").fadeOut("slow");
		popupStatus4 = 0;
	}
}

// Center Pop-up
function centerPopup4(){
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popup4").height();
	var popupWidth = $("#popup4").width();

	$("#popup4").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});

	$("#backgroundPopup").css({
		"height": windowHeight
	});
}

// Close Pop-up
$(document).ready(function(){
	// Click the X
	$(".popupContactClose").click(function(){
		disablePopup4();
	});
	// Click out
	$("#backgroundPopup").click(function(){
		disablePopup4();
	});
	// Press Esc
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus4==1){
			disablePopup4();
		}
	});
});

function showPopup4() {
	centerPopup4();
	loadPopup4();
}

/**********************************************************/


// 0 = Disabled; 1 = Enabled;
var popupStatus5 = 0;

// Load Pop-up with jQuery
function loadPopup5(){
	if(popupStatus5==0){
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popup5").fadeIn("slow");
		popupStatus5 = 1;
	}
}

// Disable Pop-up with jQuery
function disablePopup5(){
	if(popupStatus5==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popup5").fadeOut("slow");
		popupStatus5 = 0;
	}
}

// Center Pop-up
function centerPopup5(){
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popup5").height();
	var popupWidth = $("#popup5").width();

	$("#popup5").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});

	$("#backgroundPopup").css({
		"height": windowHeight
	});
}

// Close Pop-up
$(document).ready(function(){
	// Click the X
	$(".popupContactClose").click(function(){
		disablePopup5();
	});
	// Click out
	$("#backgroundPopup").click(function(){
		disablePopup5();
	});
	// Press Esc
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus5==1){
			disablePopup5();
		}
	});
});

function showPopup5() {
	centerPopup5();
	loadPopup5();
}

/**********************************************************/


// 0 = Disabled; 1 = Enabled;
var popupStatus6 = 0;

// Load Pop-up with jQuery
function loadPopup6(){
	if(popupStatus6==0){
		var tmp = findSWF('ifriendani');
		if (tmp != null) tmp.Rewind();
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popup6").fadeIn("slow");
		popupStatus6 = 1;
	}
}

// Disable Pop-up with jQuery
function disablePopup6(){
	if(popupStatus6==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popup6").fadeOut("slow");
		popupStatus6 = 0;
	}
}

// Center Pop-up
function centerPopup6(){
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popup6").height();
	var popupWidth = $("#popup6").width();

	$("#popup6").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});

	$("#backgroundPopup").css({
		"height": windowHeight
	});
}

// Close Pop-up
$(document).ready(function(){
	// Click the X
	$(".popupContactClose").click(function(){
		disablePopup6();
	});
	// Click out
	$("#backgroundPopup").click(function(){
		disablePopup6();
	});
	// Press Esc
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus6==1){
			disablePopup6();
		}
	});
});

function showPopup6() {
	centerPopup6();
	loadPopup6();
}

/**********************************************************/


// 0 = Disabled; 1 = Enabled;
var popupStatus7 = 0;

// Load Pop-up with jQuery
function loadPopup7(){
	if(popupStatus7==0){
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popup7").fadeIn("slow");
		popupStatus7 = 1;
	}
}

// Disable Pop-up with jQuery
function disablePopup7(){
	if(popupStatus7==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popup7").fadeOut("slow");
		popupStatus7 = 0;
	}
}

// Center Pop-up
function centerPopup7(){
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popup7").height();
	var popupWidth = $("#popup7").width();

	$("#popup7").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});

	$("#backgroundPopup").css({
		"height": windowHeight
	});
}

// Close Pop-up
$(document).ready(function(){
	// Click the X
	$(".popupContactClose").click(function(){
		disablePopup7();
	});
	// Click out
	$("#backgroundPopup").click(function(){
		disablePopup7();
	});
	// Press Esc
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus7==1){
			disablePopup7();
		}
	});
});

function showPopup7() {
	centerPopup7();
	loadPopup7();
}

/**********************************************************/


// 0 = Disabled; 1 = Enabled;
var popupStatus8 = 0;

// Load Pop-up with jQuery
function loadPopup8(){
	if(popupStatus8==0){
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popup8").fadeIn("slow");
		popupStatus8 = 1;
	}
}

// Disable Pop-up with jQuery
function disablePopup8(){
	if(popupStatus8==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popup8").fadeOut("slow");
		popupStatus8 = 0;
	}
}

// Center Pop-up
function centerPopup8(){
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popup8").height();
	var popupWidth = $("#popup8").width();

	$("#popup8").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});

	$("#backgroundPopup").css({
		"height": windowHeight
	});
}

// Close Pop-up
$(document).ready(function(){
	// Click the X
	$(".popupContactClose").click(function(){
		disablePopup8();
	});
	// Click out
	$("#backgroundPopup").click(function(){
		disablePopup8();
	});
	// Press Esc
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus8==1){
			disablePopup8();
		}
	});
});

function showPopup8() {
	centerPopup8();
	loadPopup8();
}

/**********************************************************/


// 0 = Disabled; 1 = Enabled;
var popupStatus9 = 0;

// Load Pop-up with jQuery
function loadPopup9(){
	if(popupStatus9==0){
		$("#backgroundPopup").css({
			"opacity": "0.7"
		});
		$("#backgroundPopup").fadeIn("slow");
		$("#popup9").fadeIn("slow");
		popupStatus9 = 1;
	}
}

// Disable Pop-up with jQuery
function disablePopup9(){
	if(popupStatus9==1){
		$("#backgroundPopup").fadeOut("slow");
		$("#popup9").fadeOut("slow");
		popupStatus9 = 0;
	}
}

// Center Pop-up
function centerPopup9(){
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popup9").height();
	var popupWidth = $("#popup9").width();

	$("#popup9").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});

	$("#backgroundPopup").css({
		"height": windowHeight
	});
}

function showPopup10(){
	window.open('http://nplay.qbrick.com/index.aspx?cid=03606&amp;amp;amp;amp;amp;amp;mid=', '_blank', 'width=670, height=520, left=0, top=0, location=0, menubar=0, toolbar=0, resizable=1, scrollbars=1');
}

// Close Pop-up
$(document).ready(function(){
	// Click the X
	$(".popupContactClose").click(function(){
		disablePopup9();
	});
	// Click out
	$("#backgroundPopup").click(function(){
		disablePopup9();
	});
	// Press Esc
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus9==1){
			disablePopup9();
		}
	});
});

function showPopup9() {
	centerPopup9();
	loadPopup9();
}

/**********************************************************/

function findSWF(movieName) {
//  if (navigator.appName.indexOf("Microsoft")!= -1) {
//    return window["ie_" + movieName];
//  } else {
    return document[movieName];
//  }
}
