function lightboxclose() 
	{
		document.getElementById('m').className='off';
		document.getElementById('d').style.display='none';
 	}

function activateLoginLightbox() {
	if (document.all && document.createAttribute && document.compatMode != 'BackCompat') {
     // IE6 (and above) in standards mode
    			 document.getElementsByTagName('html')[0].style.overflow = 'hidden'; // set to '' to show
		} else {
     			document.body.style.overflow = 'hidden'; // set to '' to show
		}
		moveLightBox("LightBoxLogin");
	document.getElementById('m').className='on';
	document.getElementById('LightBoxLogin').style.display='block';
	document.getElementById('loginlightboxForm').style.display='none';
 	}
function closeLoginLightbox() {
	if (document.all && document.createAttribute && document.compatMode != 'BackCompat') {
     // IE6 (and above) in standards mode
    			 document.getElementsByTagName('html')[0].style.overflow = ''; // set to '' to show
		} else {
     			document.body.style.overflow = ''; // set to '' to show
		}
    document.getElementById('m').className='off';
	document.getElementById('LightBoxLogin').style.display='none';
	document.getElementById("rightArr").style.display='block';
	document.getElementById("leftArr").style.display='block';
 	}
function activateLoginLightForget() {
	if (document.all && document.createAttribute && document.compatMode != 'BackCompat') {
     // IE6 (and above) in standards mode
    			 document.getElementsByTagName('html')[0].style.overflow = 'hidden'; // set to '' to show
		} else {
     			document.body.style.overflow = 'hidden'; // set to '' to show
		}
		moveLightBox("forGetlightboxForm");
	document.getElementById('m').className='on';
	document.getElementById('forGetlightboxForm').style.display='block';
	document.getElementById('loginlightboxForm').style.display='none';
	document.getElementById("rightArr").style.display='none';
	document.getElementById("leftArr").style.display='none';
 	}
	
function forgetlightboxclose() {
		if (document.all && document.createAttribute && document.compatMode != 'BackCompat') {
     // IE6 (and above) in standards mode
    			 document.getElementsByTagName('html')[0].style.overflow = ''; // set to '' to show
		} else {
     			document.body.style.overflow = ''; // set to '' to show
		}
    document.getElementById('m').className='off';
	document.getElementById('forGetlightboxForm').style.display='none';
//		document.getElementById("leftImg").style.opacity=100;
//	document.getElementById("rightImg").style.opacity=100;
//	document.getElementById("rightImg").style.filter='Alpha(opacity=100)';
//		document.getElementById("leftImg").style.filter='Alpha(opacity=100)';
		document.getElementById("rightArr").style.display='block';
		document.getElementById("leftArr").style.display='block';
		
 	}
 	
 	function loginlightboxclose() {
 	if (document.all && document.createAttribute && document.compatMode != 'BackCompat') {
     // IE6 (and above) in standards mode
    			 document.getElementsByTagName('html')[0].style.overflow = ''; // set to '' to show
		} else {
     			document.body.style.overflow = ''; // set to '' to show
		}
    document.getElementById('m').className='off';
    document.getElementById('user_email2').value='';
    document.getElementById('pass2').value='';
	document.getElementById('loginlightboxForm').style.display='none';
//	document.getElementById("leftImg").style.opacity=100;
//	document.getElementById("rightImg").style.opacity=100;
//	document.getElementById("rightImg").style.filter='Alpha(opacity=100)';
//		document.getElementById("leftImg").style.filter='Alpha(opacity=100)';
		document.getElementById("rightArr").style.display='block';
		document.getElementById("leftArr").style.display='block';
		
 	}
function open_comment_div(userId)
{
	if(userId!=0)
	{
		if(document.getElementById('div_comment').style.display=='none')
		{
			document.getElementById('div_comment').style.display='block';
					}
		else
		{
			document.getElementById('div_comment').style.display='none';
		}
	}
	else
	{
		open_login_lightBox('You must be login before posting comment');
		//document.getElementById("leftImg").style.opacity=0;
		//document.getElementById("rightImg").style.opacity=0;
		//document.getElementById("rightImg").style.filter='Alpha(opacity=0)';
		//document.getElementById("leftImg").style.filter='Alpha(opacity=0)';
		document.getElementById("rightArr").style.display='none';
		document.getElementById("leftArr").style.display='none';
		
		
	}
		
}
/////////// function to open upload video response div
function upload_response(userId)
{
	if(userId!=0)
	{
		if(document.getElementById('div_upload_response').style.display=='none')
		{
			moveLightBox("div_upload_response");
			document.getElementById('m').className='on';
			document.getElementById("div_upload_response").style.display='block';
			document.getElementById("rightArr").style.display='none';
			document.getElementById("leftArr").style.display='none';
		}
		else
		{
			if (document.all && document.createAttribute && document.compatMode != 'BackCompat') {
     // IE6 (and above) in standards mode
    			 document.getElementsByTagName('html')[0].style.overflow = ''; // set to '' to show
			} else {
	     			document.body.style.overflow = ''; // set to '' to show
			}
    		document.getElementById('m').className='off';
			document.getElementById('div_upload_response').style.display='none';
//			document.getElementById("leftImg").style.opacity=100;
//			document.getElementById("rightImg").style.opacity=100;
//		document.getElementById("rightImg").style.filter='Alpha(opacity=100)';
//		document.getElementById("leftImg").style.filter='Alpha(opacity=100)';
		document.getElementById("rightArr").style.display='block';
		document.getElementById("leftArr").style.display='block';
		
		}
			
	}
	else
	{
		open_login_lightBox('You must be login before posting video response');
		document.getElementById("rightArr").style.display='none';
		document.getElementById("leftArr").style.display='none';
				
	}

		
}
	function lightbox_close(div) {
 	if (document.all && document.createAttribute && document.compatMode != 'BackCompat') {
     // IE6 (and above) in standards mode
    			 document.getElementsByTagName('html')[0].style.overflow = ''; // set to '' to show
		} else {
     			document.body.style.overflow = ''; // set to '' to show
		}
    document.getElementById('m').className='off';
    document.getElementById(div).style.display='none';
//    document.getElementById("leftImg").style.opacity=100;
//    document.getElementById("rightImg").style.opacity=100;
//    document.getElementById("rightImg").style.filter='Alpha(opacity=100)';
//		document.getElementById("leftImg").style.filter='Alpha(opacity=100)';
		document.getElementById("rightArr").style.display='block';
		document.getElementById("leftArr").style.display='block';
		
 	}
function post_rate(SitePath,userId,videoId,rate,type,rated)
{
	if(type=='B')
	{
		var vmsg='broadcast';
	}	
	else
	{
		var vmsg='video';
	}	
	if(rated==0)
	{
		
			if(userId!=0)
			{
				
				if(confirm("Are you sure you want to rate this "+vmsg+" with "+rate+" stars?")) 
				{
					var url = SitePath+'postRate.php?vId='+videoId+'&rateVideo='+rate+'&type='+type;	
					
					req = false;
				
					var req = getObject();
				
				 	if(req)
				 	{
						req.onreadystatechange = postRate;
						req.open("GET", url, true);
						req.send(null);
					}
				}
				else
				{
					return false;
					
				}
		}
		else
		{
			
		insertTempRate(SitePath,'post_rate',videoId,rate,type);
		open_login_lightBox('You must login before you can rate this '+vmsg);
		
//		document.getElementById("leftImg").style.opacity=0;
//		document.getElementById("rightImg").style.opacity=0;
//		document.getElementById("rightImg").style.filter='Alpha(opacity=0)';
//		document.getElementById("leftImg").style.filter='Alpha(opacity=0)';
		document.getElementById("rightArr").style.display='none';
		document.getElementById("leftArr").style.display='none';
		
		}	
	}
	else
	{
		alert("Sorry, you already rated this "+vmsg+"!");
	}		
}
function insertTempRate(SitePath,action,videoId,rate,type)
{
	if(action!='')
	{
		
		var url = SitePath+'temp_action.php?action='+action+'&videoId='+videoId+'&rate='+rate+'&type='+type;
		req = false;
			var req = getObject();
		 	if(req)
		 	{
				req.onreadystatechange = call_temp_rate;
				req.open("GET", url, true);
				req.send(null);
			}
		
	}	
}
function call_temp_rate()
{
	if(req.readyState == 4)
	{		
		
		if(req.status==200)
		{
					
	    }
	}
}

function postRate()
{
	if(req.readyState == 4)
	{
		
		if(req.status==200)
		{
			var div=req.responseText;
			alert('Rating has been posted successfully');
			document.getElementById("rating").innerHTML=div;
		}
		 else
        {
        	alert("There was a problem retrieving data :"+req.statusText);
        }
	}	
}	

function subscribe_user(SitePath,userId,posterId,posterType,subscribed,type)
{
	if(type=='B')
	{var vmsg="broadcast";}
	else
	{var vmsg="video";}	
	if(subscribed==0)
	{
		
			if(userId!=0)
			{
				if(userId==posterId)
				{
					alert("Sorry, you can't subscribed yourself!");
				}
				else
				{
						if(confirm("Are you sure you want to subscribe this "+vmsg+" owner?")) 
						{
							var url = SitePath+'subscribeUser.php?uId='+userId+'&posterId='+posterId+'&posterType='+posterType+'&type='+type;	
							
							req = false;
						
							var req = getObject();
						
						 	if(req)
						 	{
								req.onreadystatechange = subscribeUser;
								req.open("GET", url, true);
								req.send(null);
							}
						}
						else
						{
							return false;
							
						}
				}
		}
		else
		{
			insertTempSubscribe(SitePath,'subscribe_user',posterId,posterType);
			open_login_lightBox('You must login before you can subscribe this '+vmsg+' owner');
		
			document.getElementById("rightArr").style.display='none';
			document.getElementById("leftArr").style.display='none';
		
		}	
	}
	else
	{
		alert("Sorry, you already subscribed this "+vmsg+" owner!");
	}		
}
function insertTempSubscribe(SitePath,action,posterId,posterType)
{
	if(action!='')
	{
		
		var url = SitePath+'temp_action.php?action='+action+'&posterId='+posterId+'&posterType='+posterType;
		req = false;
			var req = getObject();
		 	if(req)
		 	{
				req.onreadystatechange = call_temp_subscription;
				req.open("GET", url, true);
				req.send(null);
			}
		
	}	
}
function call_temp_subscription()
{
	if(req.readyState == 4)
	{		
		
		if(req.status==200)
		{
					
	    }
	}
}

function subscribeUser()
{
	if(req.readyState == 4)
	{
		
		if(req.status==200)
		{
			var div=req.responseText;
			var text=div.split("##");
			if(text[0]=="V")
				alert("You have subscribed successfully. You will receive an email notification each time this user posts a new video. You can also see new video posts on your user profile page by clicking on 'Video Subscriptions'");
			else if(text[0]=="B")
				alert("You have subscribed successfully. You will receive an email notification each time this user posts a new broadcast. You can also see new broadcast posts on your user profile page by clicking on 'Upcomming Broadcast'");
			document.getElementById("subscribing").innerHTML=text[1];
		}
		 else
        {
        	alert("There was a problem retrieving data :"+req.statusText);
        }
	}	
}	
function open_email_div(userId)
{
	
	if(userId!=0)
	{
		if(document.getElementById('div_email').style.display=='none')
		{
			document.getElementById('div_email').style.display='block';
		}
		else
		{
			document.getElementById('div_email').style.display='none';
		}
	}
	else
	{
		
		//alert("You must login before sending email.");
		open_login_lightBox('You must login before sending email.');
		
		
	}	
}

function call_abuse(userId,commentId,Id,SitePath,type)
{
	
	if(userId!=0)
	{
		
		var url = SitePath+'postAbuse.php?fld_comment_id='+commentId+'&fld_id='+Id+'&type='+type;	
		req = false;
	
		var req = getObject();
	
	 	if(req)
	 	{
			req.onreadystatechange = postAbuse;
			req.open("GET", url, true);
			req.send(null);
		}
	}
	else
	{
		//alert("You must login before sending abuse report.");
		insertTempAbuse(SitePath,'video_abuse',commentId,Id,type);
		open_login_lightBox('You must login before sending abuse report.');
		document.getElementById("rightArr").style.display='none';
		document.getElementById("leftArr").style.display='none';
		
	}	
}
function postAbuse()
{
	if(req.readyState == 4)
	{
		
		if(req.status==200)
		{
			alert('Abuse Report has been posted to admin.');
		}
		 else
        {
        	alert("There was a problem retrieving data :"+req.statusText);
        }
	}	
}
function insertTempAbuse(SitePath,action,commentId,Id,type)
{
	if(action!='')
	{
		
		var url = SitePath+'temp_action.php?action='+action+'&commentId='+commentId+'&videoId='+Id+'&type='+type;
		req = false;
			var req = getObject();
		 	if(req)
		 	{
				req.onreadystatechange = call_temp_abuse;
				req.open("GET", url, true);
				req.send(null);
			}
		
	}	
}
function call_temp_abuse()
{
	if(req.readyState == 4)
	{		
		
		if(req.status==200)
		{
					
	    }
	}
}	
function open_send_div(userId)
{
	if(userId!=0)
	{
		if(document.getElementById('div_send').style.display=='none')
		{
			document.getElementById('div_send').style.display='block';
	
		}
		else
		{
			document.getElementById('div_send').style.display='none';
		
		}
	}
	else
	{
		
		open_login_lightBox('You must login before sending link.');
//		document.getElementById("leftImg").style.opacity=0;
//			document.getElementById("rightImg").style.opacity=0;
//			document.getElementById("rightImg").style.filter='Alpha(opacity=0)';
//		document.getElementById("leftImg").style.filter='Alpha(opacity=0)';
		document.getElementById("rightArr").style.display='none';
		document.getElementById("leftArr").style.display='none';
		
		
	}	
}
function open_login_lightBox(msg)
{	moveLightBox("loginlightboxForm");
	document.getElementById('m').className='on';
	document.getElementById("loginlightboxForm").style.display='block';
	document.getElementById("lmsg").innerHTML=msg;
}
function moveLightBox(div)
{
	var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			   string: navigator.userAgent,
			   subString: "iPhone",
			   identity: "iPhone/iPod"
	    },
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

	
		if(BrowserDetect.browser=='Explorer' && BrowserDetect.version>=7)
		{	
			//do nothing
		}
		else
		{	
		var scrolly = typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement.scrollTop;
				var scrollx = typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement.scrollLeft;
				document.getElementById(div).style.top = parseInt(scrolly)+"px";
				document.getElementById(div).style.left = parseInt(scrollx)+"px";
		
				if (document.all && document.createAttribute && document.compatMode != 'BackCompat') {
		     // IE6 (and above) in standards mode
		    			 document.getElementsByTagName('html')[0].style.overflow = 'hidden'; // set to '' to show
				} else {
		     			document.body.style.overflow = 'hidden'; // set to '' to show
		     	}
		} 	
     	
}		
function form_check(form)
{
	if(form.fld_subject.value=="")
	{
		alert('Please enter subject');
		form.fld_subject.focus();
		return false;
	}
	if(form.fld_comment.value=="")
	{
		alert('Please enter comment.');
		form.fld_comment.focus();
		return false;
	}		
}	
function open_popup(userId,path)
{
	if(userId!="0")
	{
		newwindow=window.open(path,'name','height=400,width=500,resizable=yes');
	}
	else
	{
		//alert("You must login before sending Email.");
		open_login_lightBox('You must login before sending Email.');
		
		
		
	}
}
function email_check(form)
{
	if(form.fld_subject.value == "")
	{
		alert("Please enter subject");
		form.fld_subject.focus();
		return false;
	}	
	if(form.fld_message.value == "")
	{
		alert("Please enter message");
		form.fld_message.focus();
		return false;
	}	
}
function send_check(form)
{
	if(form.fld_email.value == "")
	{
		alert("Please enter your friend email address");
		form.fld_email.focus();
		return false;
	}
	if(!emailCheck(form.fld_email.value))
	{
		form.fld_email.focus();
		return false;
	}	 	
	if(form.fld_name.value == "")
	{
		alert("Please enter your friend name");
		form.fld_name.focus();
		return false;
	}	
	
}
function emailCheck (emailStr) {
 
/* The following variable tells the rest of the function whether or not
to verify that the address ends in a two-letter country or well-known
TLD.  1 means check it, 0 means don't. */
 
var checkTLD=1;
 
/* The following is the list of known TLDs that an e-mail address must end with. */
 
var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
 
/* The following pattern is used to check if the entered e-mail address
fits the user@domain format.  It also is used to separate the username
from the domain. */
 
var emailPat=/^(.+)@(.+)$/;
 
/* The following string represents the pattern for matching all special
characters.  We don't want to allow special characters in the address. 
These characters include ( ) < > @ , ; : \ " . [ ] */
 
var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]\\'";
 
/* The following string represents the range of characters allowed in a 
username or domainname.  It really states which chars aren't allowed.*/
 
var validChars="\[^\\s" + specialChars + "\]";
 
/* The following pattern applies if the "user" is a quoted string (in
which case, there are no rules about which characters are allowed
and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
is a legal e-mail address. */
 
var quotedUser="(\"[^\"]*\")";
 
/* The following pattern applies for domains that are IP addresses,
rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
e-mail address. NOTE: The square brackets are required. */
 
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
 
/* The following string represents an atom (basically a series of non-special characters.) */
 
var atom=validChars + '+';
 
/* The following string represents one word in the typical username.
For example, in john.doe@somewhere.com, john and doe are words.
Basically, a word is either an atom or quoted string. */
 
var word="(" + atom + "|" + quotedUser + ")";
 
// The following pattern describes the structure of the user
 
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
 
/* The following pattern describes the structure of a normal symbolic
domain, as opposed to ipDomainPat, shown above. */
 
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
 
/* Finally, let's start trying to figure out if the supplied address is valid. */
 
/* Begin with the coarse pattern to simply break up user@domain into
different pieces that are easy to analyze. */
 
var matchArray=emailStr.match(emailPat);
 
if (matchArray==null) {
 
/* Too many/few @'s or something; basically, this address doesn't
even fit the general mould of a valid e-mail address. */
 
alert("Email address seems incorrect (check @ and .'s)");
return false;
}
var user=matchArray[1];
var domain=matchArray[2];
 
// Start by checking that only basic ASCII characters are in the strings (0-127).
 
for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("Ths username contains invalid characters.");
return false;
   }
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("Ths domain name contains invalid characters.");
return false;
   }
}
 
// See if "user" is valid 
 
if (user.match(userPat)==null) {
 
// user is not valid
 
alert("The username doesn't seem to be valid.");
return false;
}
 
/* if the e-mail address is at an IP address (as opposed to a symbolic
host name) make sure the IP address is valid. */
 
var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {
 
// this is an IP address
 
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!");
return false;
   }
}
return true;
}
 
// Domain is symbolic name.  Check if it's valid.
 
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
alert("The domain name does not seem to be valid.");
return false;
   }
}
 
/* domain name seems valid, but now make sure that it ends in a
known top-level domain (like com, edu, gov) or a two-letter word,
representing country (uk, nl), and that there's a hostname preceding 
the domain or country. */
 
if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("The address must end in a well-known domain or two letter " + "country.");
return false;
}
 
// Make sure there's a host name preceding the domain.
 
if (len<2) {
alert("This address is missing a hostname!");
return false;
}
 
// If we've gotten this far, everything's valid!
return true;
}
 // function to create object for XML/ActiveX com[
function getObject()
{
	if(window.XMLHttpRequest) 
	{	
		// branch for native XMLHttpRequest object
		try 
		{
			req = new XMLHttpRequest();
		} 
		catch(e) 
		{
			req = false;
		}
	}
	else if(window.ActiveXObject) 
	{	
		// branch for IE/Windows ActiveX version
		try 
		{
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch(e) 
		{
			try 
			{
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(e) 
			{
				req = false;
			}
		}
	}
	return req;
}
	
function call_video_comment(SitePath,videoId,page)
{
		var url = SitePath+'call_video_comments.php?videoId='+videoId+'&page='+page;	
		req = false;
		var req = getObject();
	 	if(req)
	 	{
			req.onreadystatechange = call_video_c;
			req.open("GET", url, true);
			req.send(null);
		}
}
	
function call_video_c()
{
	if(req.readyState == 4){
   
	 	var objXML1 = req.responseXML;
	 	if(req.status==200)
		{	
			var div=req.responseText;
		  	document.getElementById("div_comment_box").innerHTML=div;
		  	//document.getElementById("div_paging").innerHTML=div[1];
		  	//document.getElementById("div_msg").innerHTML="";
		  	
        }
      	
  }else{
  		
  }
}	

function call_player_comment(SitePath,playerId,page)
{
		var url = SitePath+'call_player_comments.php?playerId='+playerId+'&page='+page;	
		req = false;
		var req = getObject();
	 	if(req)
	 	{
			req.onreadystatechange = player_comment_ajax;
			req.open("GET", url, true);
			req.send(null);
		}
}
	
function player_comment_ajax()
{
	if(req.readyState == 4){
   
	 	var objXML1 = req.responseXML;
	 	if(req.status==200)
		{	
			var div=req.responseText.split("##");
		  	document.getElementById("div_comment_box").innerHTML=div[0];
		  	document.getElementById("div_paging").innerHTML=div[1];
		  	//document.getElementById("div_msg").innerHTML="";
		  	
        }
      	
  }else{
  		
  }
}
function call_video_list(SitePath,userId,videoId,type,page)
{
		var url = SitePath+'call_video_list.php?videoId='+videoId+'&page='+page+'&userId='+userId+'&type='+type;	
		req = false;
		var req = getObject();
	 	if(req)
	 	{
			req.onreadystatechange = call_video_list_ajax;
			req.open("GET", url, true);
			req.send(null);
		}
}
function call_video_list_ajax()
{
	if(req.readyState == 4){
   
	 	var objXML1 = req.responseXML;
	 	if(req.status==200)
		{	
			var div=req.responseText;
		  	//document.getElementById("VideolistBox").innerHTML=div[1];
		  	document.getElementById("recentBox").innerHTML=div;
		  	//document.getElementById("div_msg").innerHTML="";
		  	
        }
      	
  }else{
  		
  }
}


function call_broadcast_list(SitePath,userId,videoId,page)
{
		var url = SitePath+'call_broadcast_list.php?videoId='+videoId+'&page='+page+'&userId='+userId
		req = false;
		var req = getObject();
	 	if(req)
	 	{
			req.onreadystatechange = call_broadcast_list_ajax;
			req.open("GET", url, true);
			req.send(null);
		}
}
function call_broadcast_list_ajax()
{
	if(req.readyState == 4){
   
	 	var objXML1 = req.responseXML;
	 	if(req.status==200)
		{	
			var div=req.responseText;
		  	//document.getElementById("VideolistBox").innerHTML=div[1];
		  	document.getElementById("recentBox_b").innerHTML=div;
		  	//document.getElementById("div_msg").innerHTML="";
		  	
        }
      	
  }else{
  		
  }
}



function show_comment_div(login,divId)
{
	if(login!=0)
	{
		
			if(document.getElementById(divId).style.display=='none')
			{
				document.getElementById(divId).style.display='block';
			}
			else
			{
				document.getElementById(divId).style.display='none';
			}
		
	}	
	else
	{
		//alert("You must login before posting comment.");
		open_login_lightBox('You must login before posting comment.');
		
		
	}	
}

///////// function to show recent video or comment box
function call_box(div1,div2,div3)
{
	document.getElementById(div1).style.display="block";
	document.getElementById(div2).style.display="none";
	document.getElementById(div3).style.display="none";
	document.getElementById(div1+'_t').className='midTab';
	document.getElementById(div2+'_t').className='midTabGrey';
	document.getElementById(div3+'_t').className='midTabGrey';
}
function call_video_paging(type,SitePath,vid,currenthit,start,keyword)
{
	var url = SitePath+'video_paging.php?vId='+vid+'&currenthit='+currenthit+'&start='+start+'&type='+type+'&keyword='+keyword;
    req = false;

            if(window.XMLHttpRequest) {                   // branch for native XMLHttpRequest object

                        try {

                                    req = new XMLHttpRequest();

                        } catch(e) {

                                    req = false;

                        }

            }

            else if(window.ActiveXObject) {                // branch for IE/Windows ActiveX version

                        try {

                                    req = new ActiveXObject("Msxml2.XMLHTTP");

                        } catch(e) {

                                    try {

                                                req = new ActiveXObject("Microsoft.XMLHTTP");

                                    } catch(e) {

                                                req = false;

                                    }

                        }

            }

            if(req)

            {

                        
						req.onreadystatechange = show_video_paging;
						
						
						

                        req.open("GET", url, true);

                        req.send(null);

            }
}	

function show_video_paging()

{

       if(req.readyState == 4){

	 	if(req.status==200)
		{	
			var div=req.responseText.split("##");
		  	document.getElementById("mostrecent").innerHTML=div[0];
		  	document.getElementById("mostrecent_p").innerHTML=div[1];
		 }
      	
  }else{
  		
  }

}
function video_category_paging(topicId,SitePath,vid,currenthit,start)
{
	var url = SitePath+'video_category_paging.php?vId='+vid+'&currenthit='+currenthit+'&start='+start+'&topicId='+topicId;

   req = false;

            if(window.XMLHttpRequest) {                   // branch for native XMLHttpRequest object

                        try {

                                    req = new XMLHttpRequest();

                        } catch(e) {

                                    req = false;

                        }

            }

            else if(window.ActiveXObject) {                // branch for IE/Windows ActiveX version

                        try {

                                    req = new ActiveXObject("Msxml2.XMLHTTP");

                        } catch(e) {

                                    try {

                                                req = new ActiveXObject("Microsoft.XMLHTTP");

                                    } catch(e) {

                                                req = false;

                                    }

                        }

            }

            if(req)

            {

                        
						req.onreadystatechange = show_video_category_paging;
						
						
						

                        req.open("GET", url, true);

                        req.send(null);

            }
}

function show_video_category_paging()
{
	  if(req.readyState == 4){

	 	if(req.status==200)
		{	
			var div=req.responseText.split("##");
		  	document.getElementById("div_topic_list").innerHTML=div[0];
		  	document.getElementById("div_video_list").innerHTML=div[1];
		  	document.getElementById("div_video_page").innerHTML=div[2];
		 }
      	
  }else{
  		
  }
}

function play_all_video(cnt)
{
	for(var j=0;j<cnt;j++)
	{
		
		play_video(j);
	}	
}
function show_response_upload_div(div1,div2)
{
	document.getElementById(div1).style.display='block';
	document.getElementById(div2).style.display='none';
}

function show_select_flv(flv)
{
	if(flv!="")
	{	
	var div=flv.split("##");
		document.getElementById('rvideoId').value=div[0];
		play_flv_player(div[1]);
	}
	else
	{
		document.getElementById('rvideoId').value='';
		document.getElementById('putPlayer').innerHTML='';
		
	}	
			
}

function select_video_response(SitePath,vId,type)
{
	var rId=document.getElementById('rvideoId').value;
	if(rId!="")
	{
		var url = SitePath+'map_video_response.php?vId='+vId+'&rvideoId='+rId+'&type='+type;	
						
						req = false;
				
						var req = getObject();
				
				 		if(req)
				 		{
							req.onreadystatechange = update_video_response;
							req.open("GET", url, true);
							req.send(null);
						}
	}
	else
	{
		alert("Plaese select a video");
		return false;
	}					
	
}

function update_video_response()
{
	if(req.readyState == 4){
   
	 		//var div=req.responseText.split("##");
		
	 	if(req.status==200)
		{	
			document.getElementById("mmsg").innerHTML=req.responseText;
					
		  	
        }
      	
  }else{
  		
  }
}


	
