var flashVideoPlayer;

/*if(document.getElementById("pageBlockDiv") == null)
{
	document.write("<div onClick='closeVideo()' id='pageBlockDiv' style='border:none;position:absolute;left:0px;top:0px;width:100%;background-color:#000000;display:none;z-index:99;filter:alpha(opacity=50);-moz-opacity:.50;opacity:.50;'></div>");
//	document.write("<div id='videoBox' style='width:100%; border:none; position:absolute; left:100px; top:0px; display:none; z-index:100;'><table width=100%><tr><td onClick='closeVideo()' width=50%></td><td><table border='0' cellpadding='0' cellspacing='15' bgcolor='#333333'><tr><td><div id='videoPlayer'></div></td><td><iframe name='videoList' id='videoList' src='' height='350' frameborder=0 ></iframe></td></tr><tr><td colspan=2 align='right' style='padding-top:0px'><span onClick='closeVideo()' style='cursor:pointer;'><B>CLOSE</B></span></td></tr></table></td><td onClick='closeVideo()' width=50%></td></tr></table></div>");
	document.write("<div id='videoBox' style='width:100%; border:none; position:absolute; left:100px; top:0px; display:none; z-index:100;'><table width=100%><tr><td onClick='closeVideo()' width=50%></td><td><table border='0' cellpadding='0' cellspacing='0'><tr>	<td rowspan='2'><img src='/images/left_vid_box.gif' /></td> <td style='background-image: url(/images/mid_vid_box_stretch.gif)'><img src='/images/vid_heading.gif' alt='Videos &amp; Demos' width='140' height='23' style='float:left;padding-top:7px;' /></td> <td style='background-image: url(/images/mid_vid_box_stretch.gif)'><a href='javascript:closeVideo()'><img src='/images/close_heading.gif' alt='Close' width='54' height='23' border='0' style='float:right;padding-top:7px;' /></a></td> <td rowspan='2'><img src='/images/right_vid_box.gif' /></td></tr><tr>	<td valign='top' style='background: url(/images/mid_vid_box_stretch.gif) bottom;padding:20px 20px 20px 0px;'><div id='videoPlayer' style='padding-top:10px;'></div></td> <td valign='top' style='background: url(/images/mid_vid_box_stretch.gif) bottom;padding:20px 0px;'><iframe name='videoList' id='videoList' src='' height='394' width='300' frameborder=0 ></iframe></td></tr></table></td><td onClick='closeVideo()' width=50%></td></tr></table></div>");
}*/

function showVideo(filename, type)
{
	/*var pageBlockDiv = document.getElementById("pageBlockDiv");
	var videoBox = document.getElementById("videoBox");
	var videoPlayer = document.getElementById("videoPlayer");

	pageBlockDiv.style.height= document.body.clientHeight + "px";
	pageBlockDiv.style.display="block";
	
	//videoPlayer.innerHTML = "<embed type='application/x-shockwave-flash' src='/videos/player.swf' width='425' height='350' style='undefined' id='single' name='single' quality='high' allowfullscreen='true' wmode='opaque' flashvars='fullscreen=true&amp;file=/videos/"+ filename +".flv&amp;image=/videos/"+ filename +".jpg&amp;skin=/videos/snel.swf&autostart=true'></embed>";
	videoPlayer.innerHTML = "<embed src='/videos/player2.swf?murl=/videos/" + filename + ".flv' width='425' height='350' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' wmode='transparent' name='mainplayer2'></embed>";
	videoBox.style.display = "block";
	//videoBox.style.top = ((document.body.clientHeight - videoBox.clientHeight) / 3) + "px";
	videoBox.style.top = "150px";
	videoBox.style.left = ((document.body.clientWidth - videoBox.clientWidth) / 2) + "px";
	
	document.getElementById("videoList").src = "/videos/video-list.php?type="+ type +"&name=" + filename;*/
}

function showVideo2(filename, type)
{
	var videoPlayer = document.getElementById("videoPlayer2");
	
	videoPlayer.innerHTML = "<embed src='/videos/player2.swf?murl=/videos/" + filename + ".flv' width='425' height='350' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' wmode='transparent' name='mainplayer2'></embed>";
	
	document.getElementById("videoList2").src = "/videos/video-list2.php?type="+ type +"&name=" + filename;
}

function closeVideo()
{
	var videoBox = document.getElementById("videoBox");
	var videoPlayer = document.getElementById("videoPlayer");

	videoBox.style.display = "none";
	videoPlayer.innerHTML = "";
	document.getElementById("pageBlockDiv").style.display="none";
}

function showVideoInParent(filename, type)
{
	//window.parent.document.getElementById("videoPlayer").innerHTML = "<embed type='application/x-shockwave-flash' src='/videos/player.swf' width='425' height='350' style='undefined' id='single' name='single' quality='high' allowfullscreen='true' wmode='opaque' flashvars='fullscreen=true&amp;file=/videos/"+ filename +".flv&amp;image=/videos/"+ filename +".jpg&amp;skin=/videos/snel.swf&autostart=true'></embed>";
	window.parent.document.getElementById("videoPlayer").innerHTML = "<embed src='/videos/player2.swf?murl=/videos/" + filename + ".flv' width='425' height='350' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' wmode='transparent' name='mainplayer2'></embed>";
	window.parent.document.getElementById("videoList").src = "/videos/video-list.php?type="+ type +"&name=" + filename;
}

function showVideoInParent2(filename, type)
{
	window.parent.document.getElementById("videoPlayer2").innerHTML = "<embed src='/videos/player2.swf?murl=/videos/" + filename + ".flv' width='425' height='350' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' wmode='transparent' name='mainplayer2'></embed>";
	window.parent.document.getElementById("videoList2").src = "/videos/video-list2.php?type="+ type +"&name=" + filename;
}

// === Cativate demo

if(document.getElementById("pageBlockDemoDiv") == null)
{
	document.write("<div onClick='closeDemo()' id='pageBlockDemoDiv' style='border:none;position:absolute;left:0px;top:0px;width:100%;background-color:#000000;display:none;z-index:99;filter:alpha(opacity=50);-moz-opacity:.50;opacity:.50;'></div>");
	document.write("<div id='demoBox' style='width:100%; border:none; position:absolute; left:100px; top:0px; display:none; z-index:100;'><table width=100%><tr> <td onClick='closeDemo()' width=50%></td> <td> <table border='0' cellpadding='0' cellspacing='0'><tr><td rowspan='2'> <div style='background: url(/images/left_vid_box.gif) no-repeat;width:37px;height:232px;'></div> <div style='background-color: #ffffff;height:121px;border-left: 1px solid #DFDFDF;'><div style='background-color: #f6f6f6;width:20px;height:121px;float:left;'></div></div> <div style='background: url(/images/left_vid_box.gif) no-repeat bottom;width:37px;height:232px;'></div> </td> <td style='background-image: url(/images/mid_vid_box_stretch.gif)'><a href='javascript:closeDemo()'><img src='/images/close_heading.gif' alt='Close' width='54' height='23' border='0' style='float:right;padding-top:8px;' /></a></td> <td rowspan='2'> <div style='background: url(/images/right_vid_box.gif) no-repeat;width:37px;height:232px;'></div> <div style='background-color: #ffffff;height:121px;border-right: 1px solid #DFDFDF;'><div style='background-color: #f6f6f6;width:20px;height:121px;float:right;'></div></div> <div style='background: url(/images/right_vid_box.gif) no-repeat bottom;width:37px;height:232px;'></div> </td></tr><tr><td valign='top' style='background: url(/images/mid_vid_box_stretch.gif) bottom;padding:10px 0px 20px;'><iframe name='demoFrame' id='demoFrame' src='' height='524' width='880' frameborder=0 style='overflow:hidden;background-color:#FFFFFF;'></iframe></td></tr></table></td> <td onClick='closeDemo()' width=50%></td></tr></table></div>");
}

function showDemo(url)
{
	//stopPendingPlayback();
	var pageBlockDemoDiv = document.getElementById("pageBlockDemoDiv");
	var demoBox = document.getElementById("demoBox");
	var demoPlayer = document.getElementById("demoPlayer");

	pageBlockDemoDiv.style.height= document.body.clientHeight + "px";
	pageBlockDemoDiv.style.display="block";

	demoBox.style.display = "block";
	//demoBox.style.top = ((document.body.clientHeight - demoBox.clientHeight) / 3) + "px";
	//demoBox.style.top = "50px";
	demoBox.style.top = (f_scrollTop() + 20) + "px";
	demoBox.style.left = ((document.body.clientWidth - demoBox.clientWidth) / 2) + "px";
	
	document.getElementById("demoFrame").src = url;
}

function closeDemo()
{
	var demoBox = document.getElementById("demoBox");
	var demoPlayer = document.getElementById("demoPlayer");

	demoBox.style.display = "none";
	document.getElementById("demoFrame").src = "javascript:'&nbsp;';";		// Remove source from iFrame otherwise demo keeps on playing in Opera.
	document.getElementById("pageBlockDemoDiv").style.display="none";
}

function showVideo(filename, type)
{
	document.location = "http://" + document.domain + "/videos/";
	/*var pageBlockDiv = document.getElementById("pageBlockDiv");
	var videoBox = document.getElementById("videoBox");
	var videoPlayer = document.getElementById("videoPlayer");

	pageBlockDiv.style.height= document.body.clientHeight + "px";
	pageBlockDiv.style.display="block";
	
	//videoPlayer.innerHTML = "<embed type='application/x-shockwave-flash' src='/videos/player.swf' width='425' height='350' style='undefined' id='single' name='single' quality='high' allowfullscreen='true' wmode='opaque' flashvars='fullscreen=true&amp;file=/videos/"+ filename +".flv&amp;image=/videos/"+ filename +".jpg&amp;skin=/videos/snel.swf&autostart=true'></embed>";
	videoPlayer.innerHTML = "<embed src='/videos/player2.swf?murl=/videos/" + filename + ".flv' width='425' height='350' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' wmode='transparent' name='mainplayer2'></embed>";
	
	//videoBox.style.top = ((document.body.clientHeight - videoBox.clientHeight) / 3) + "px";
	videoBox.style.top = (f_scrollTop() + 100) + "px";
	videoBox.style.display = "block";
	videoBox.style.left = ((document.body.clientWidth - videoBox.clientWidth) / 2) + "px";
	
	document.getElementById("videoList").src = "/videos/video-list.php?type="+ type +"&name=" + filename;*/
}

function inPageVideo(divID, filename)
{
	var videoPlayer = document.getElementById(divID);
	videoPlayer.innerHTML = "<embed type='application/x-shockwave-flash' src='/videos/player.swf' width='440' height='295' style='undefined' id='single' name='single' quality='high' allowfullscreen='true' wmode='opaque' flashvars='fullscreen=true&amp;file=/videos/"+ filename +".flv&amp;image=/videos/"+ filename +".jpg&amp;skin=/videos/snel.swf&autostart=true'></embed>";
}

function inPageVideo2(divID, filename)
{
	var videoPlayer = document.getElementById(divID);
	videoPlayer.innerHTML = "<embed src='/videos/player2.swf?murl=/videos/" + filename + ".flv' width='425' height='350' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' wmode='transparent' name='mainplayer2'></embed>";
}

function stopPendingPlayback()
{
	inPageVideo('vodePageContent', 'none')
}

//--- Get top of visiable browser area.
function f_filterResults(n_win, n_docel, n_body) 
{
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

function f_scrollTop() 
{
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
//---

function gotoDashboard()
{
	window.open("hr/index.php?ACTION=DASHBOARD", "Sample");
}

function loadJob(tabName)
{
	window.open("hr/index.php?ACTION=LOADJOB&tab="+ tabName, "Sample");
}

function downloadReport()
{
	window.open("images/pdf/sample-report.pdf", "report");
}