var tmp;
function PopUp(page,name,w,h,scroll,pos){
 if(pos=="random"){
	 LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
 	TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
 } else if(pos=="center"){
 	LeftPosition=(screen.width)?(screen.width-w)/2:100;
 	TopPosition=(screen.height)?(screen.height-h)/2:100;
 } else if(pos=="right"){
 	LeftPosition=(screen.width)?(screen.width-w):1024-w;
 	TopPosition=0; h=Math.min(screen.height,600);
 } else {
 	LeftPosition=0;
 	TopPosition=20;
 }
 settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
 return window.open(page,name,settings);
}



function displayText(i, img){
	document.getElementById("title_" + i).style.display = "block";
	document.getElementById("link_" + i).className = "over";
	if(img) {
		document.getElementById("link_" + i).style.backgroundImage = "url(" + img + ")";
	} 
}

function hideText(i, img){
	document.getElementById("title_" + i).style.display = "none";
	document.getElementById("link_" + i).className = "";
	if(img) {
		document.getElementById("link_" + i).style.backgroundImage = "url(" + img + ")";
	} 
}

var play = false, toUrl, o, player, speed;
function fade(who) {
	if(play) {
		return;
	}
	play = true;
	toUrl = who.href;
	player = who;
	o = 100;
	speed = -5;
	setTimeout("ff();", 39);
	return false;
}
function ff() {
	o = o + speed;
	if(o >= 100) {
		o = 99;
		play = false;
	} else if(o < 0) {
		o = 0
		document.location.href = toUrl;
		play = false;
	} else {
		setTimeout("ff();", 39);
	}
	player.style.opacity = o / 100;
	player.style.filter = "alpha(opacity=" + o + ")";
}

function fadeIn() {
	if(play) {
		return;
	}
	play = true;
	player = document.getElementById("activename");;
	o = 0;
	speed = 2;
	ff();
	setTimeout("ff();", 200);
}

var activeEmp = false
function emp(num) {
	if(activeEmp) {
		activeEmp.style.display = "none";
	}
	activeEmp = document.getElementById("emp_" + num);
	activeEmp.style.display = "block";
}



$(document).ready(function() {
	
   	$("a.flowplayer").each(function() {
		$f(this, "/js/flowplayer/flowplayer.commercial-3.2.7.swf", {key: "#@dffaaaafc40360f79d1", clip: {scaling:"fit"}}).ipad();
	});
});

function checkInput(frm) {
	var r = true;
	$(frm).find(".mandatory").each(function() {
		
		if($(this).val() == "") {
			$(this).focus();
			
			$(this).css("background", "red");
			var bla = this;
			setTimeout(function() {
				$(bla).css("background", "#FFFFFF");
			}, 500);
			
			
			r = false;
			return false;
		}
	});
	return r;
}
