// JavaScript Document
var $j = jQuery.noConflict();

function vIE(){return (navigator.appName=='Microsoft Internet Explorer')?parseFloat((new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})")).exec(navigator.userAgent)[1]):-1;}

function dispVideoDiv(val){
	
	if(window.innerHeight){
		document.getElementById('hideVideoDiv').style.height = window.innerHeight+"px";
		document.getElementById('hideVideoDiv').style.width = window.innerWidth+"px";	
		document.getElementById('videoDiv').style.left=(window.innerWidth-550)/2+"px";
		document.getElementById('videoDiv').style.top=(window.innerHeight-450)/2+"px";	
	}else if(document.documentElement.clientHeight){
		
		
		if(vIE() == "7" || vIE() == "8"){
			$('hideVideoDiv').style.top = 0;
			document.getElementById('videoDiv').style.left = (document.documentElement.clientWidth-550)/2+"px";
			document.getElementById('videoDiv').style.top = (document.documentElement.clientHeight-450)/2;
		}else{
			document.getElementById('hideVideoDiv').style.height = document.documentElement.clientHeight+"px";
			document.getElementById('hideVideoDiv').style.width = document.documentElement.clientWidth+"px";	
			$('hideVideoDiv').style.top = document.documentElement.scrollTop;
			$('hideVideoDiv').style.left = document.documentElement.scrollLeft;
			document.getElementById('videoDiv').style.left = (document.documentElement.clientWidth-550)/2+"px";
			document.getElementById('videoDiv').style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight-450)/2+"px";
		}
	}
	$j('#hideVideoDiv').fadeIn(10);
	$j('#videoDiv').fadeIn(10);
	
	$("videoBox").innerHTML='<object width="560" height="340"><param name="movie" value="'+val+'"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="'+val+'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>';
	
}
function hideVideoDiv(){
	$j('#videoDiv').fadeOut(10);		
	$j('#hideVideoDiv').fadeOut(10);
}


function playVideo(val,type,video_type){
	var video = val;
	
	if(window.innerHeight){
		document.getElementById('hideVideoLightDiv').style.height = window.innerHeight+"px";
		document.getElementById('hideVideoLightDiv').style.width = window.innerWidth+"px";	
		document.getElementById('videoLightDiv').style.left=(window.innerWidth-550)/2+"px";
		document.getElementById('videoLightDiv').style.top=(window.innerHeight-450)/2+"px";	
	}else if(document.documentElement.clientHeight){
		if(vIE() == "7" || vIE() == "8"){
			$('hideVideoLightDiv').style.top = 0;
			document.getElementById('videoLightDiv').style.left = (document.documentElement.clientWidth-550)/2+"px";
			document.getElementById('videoLightDiv').style.top = (document.documentElement.clientHeight-450)/2;
		}else{
			document.getElementById('hideVideoLightDiv').style.height = document.documentElement.clientHeight+"px";
			document.getElementById('hideVideoLightDiv').style.width = document.documentElement.clientWidth+"px";	
			$('hideVideoLightDiv').style.top = document.documentElement.scrollTop;
			$('hideVideoLightDiv').style.left = document.documentElement.scrollLeft;
			document.getElementById('videoLightDiv').style.left = (document.documentElement.clientWidth-550)/2+"px";
			document.getElementById('videoLightDiv').style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight-450)/2+"px";
		}
	}
	$j('#hideVideoLightDiv').fadeIn(10);
	$j('#videoLightDiv').fadeIn(10);
	
	if( type == "other" )
		$("videoPlayBox").innerHTML=video;
	else{
	
		if( video_type == "flv" ){ 
			$("videoPlayBox").innerHTML='<embed src="flash/swf/video.swf" flashvars="autostart=true&file='+val+'" type="application/x-shockwave-flash" height="350" width="400" wmode="transparent" allowFullScreen="true"></embed>';
		}else{
			$("videoPlayBox").innerHTML='<embed src=val width="400" height="350" autostart=1 align="top"  type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/download/default.asp" showcontrols=1 showdisplay=0 showstatusbar=1 defaultframe="Slide" name="movie1" enablejavascript="true"> </embed>';	
		}
		
	}
	
}
function hideVideoLightDiv(){
	$j('#videoLightDiv').fadeOut(10);		
	$j('#hideVideoLightDiv').fadeOut(10);
}
