<!--
function checkloginMember(memberid)
{
	if(memberid=='')
	{
		alert("Please login to submit video");
		location.href="login.php";
		
	}
	else
	{ location.href="submit_video.php";
		
	}
}
function checkmemberUlogin(memberid)
{
	if(memberid=='')
	{
		alert("Please login to submit video");
		location.href="login.php";
		
	}
	else
	{ location.href="upload_video.php";
		
	}
	
}
function checkmemberLogin(memberid,sessionId)
{
	
	if(sessionId=='')
	{
		alert("Please login to post comment on video");
		location.href="login.php";
	}
	if(memberid==sessionId)
	{
		alert("You can't post comment on self video");
		return false;
	}
	document.getElementById("postComment").style.display='';
}

////////////////////   New Validation  for like video //////////////////

function checkmemberLikelogin(video_id, like, memberid)
{
	if(memberid=='')
	{
		alert("Please login to like video");
		location.href="login.php";
	}
	else
	{ 
		likevideo(video_id, like);
	}
	
}

/////////////////////        End /////////////////////////////
function checkloginvalidation()
{
	if(document.getElementById("username").value=='')
	{
		alert("Please enter user name");
		document.getElementById("username").focus();
		return false;
	}
	if(document.getElementById("pass").value=='')
	{
		alert("Please enter user passowrd");
		document.getElementById("pass").focus();
		return false;
	}
	return true;
}

function checkvideovalidation()
{
	if(document.getElementById("youtubevideoid").value=='')
	{
		alert("Please enter youtube video id");
		document.getElementById("youtubevideoid").focus();
		return false;
	}
	if(document.getElementById("videotitle").value=='')
	{
		alert("Please enter video title");
		document.getElementById("videotitle").focus();
		return false;
	}
	if(document.getElementById("videodescription").value=='')
	{
		alert("Please enter video description");
		document.getElementById("videodescription").focus();
		return false;
	}
	Tags = document.getElementById("Tags").value;
	if(Tags=='')
	{
		alert("Please enter video tags");
		document.getElementById("Tags").focus();
		return false;	
	}
	if(Tags.indexOf(" ")>=0)
	{
		alert("Spaces are not allowed");
		document.getElementById("Tags").focus();
		return false;	
	}
	return true;
}

function checkvideovalidationUplodation()
{
	if(document.getElementById("uploadnewvideo").value=='')
	{
		alert("Please select video file");
		document.getElementById("uploadnewvideo").focus();
		return false;
	}
	if(document.getElementById("videotitle").value=='')
	{
		alert("Please enter video title");
		document.getElementById("videotitle").focus();
		return false;
	}
	/*if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{1,9})+$/.test(document.getElementById("videotitle").value)))
	{
		alert('Oops! You have enter some odd character in title,remove it!');
		document.getElementById("videotitle").focus();
		return false;
	} */
	var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";

  for (var i = 0; i < document.getElementById("videotitle").value.length; i++) {
  	if (iChars.indexOf(document.getElementById("videotitle").value.charAt(i)) != -1) {
  	alert ("Oops! You have enter some odd character in title. \nThese are not allowed.\n Please remove them and try again.");
  	return false;
  	}
  }

	
	if(document.getElementById("videodescription").value=='')
	{
		alert("Please enter video description");
		document.getElementById("videodescription").focus();
		return false;
	}
	var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";

  	for (var i = 0; i < document.getElementById("videodescription").value.length; i++) {
  	if (iChars.indexOf(document.getElementById("videodescription").value.charAt(i)) != -1) {
  	alert ("Oops! You have enter some odd character in description. \nThese are not allowed.\n Please remove them and try again.");
  	return false;
  	}
  }
  
	Tags = document.getElementById("Tags").value;
	if(Tags=='')
	{
		alert("Please enter video tags");
		document.getElementById("Tags").focus();
		return false;	
	}
	if(Tags.indexOf(" ")>=0)
	{
		alert("Spaces are not allowed");
		document.getElementById("Tags").focus();
		return false;	
	}
	return true;
}

function sortingbyrepo(type,divid)
{
	show("index_left_ajax.php?type="+type,divid);
}
function sortingbyrepoMem(type,memid,divid)
{
	//	alert("member_video_listing_ajax.php?type="+type+"&MemberID="+memid)
	show("member_video_listing_ajax.php?type="+type+"&MemberID="+memid,divid);
}
function sortingbyrepoTag(type,memid,divid)
{
	show("member_video_listing_ajax.php?type="+type+"&TagId="+memid,divid);
}
function checkRegisterValidation()
{
	if(document.getElementById("uanme").value=='')
	{
		alert("Please enter user name");
		document.getElementById("uanme").focus();
		return false;
	}
	if(document.getElementById("email").value=='')
	{
		alert("Please enter user email");
		document.getElementById("email").focus();
		return false;
	}
	if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById("email").value)))
	{
		alert('Oops! You have forgotten to tell us your Valid Email Address!');
		document.getElementById("email").focus();
		return false;
	} 
	if(document.getElementById("pass").value=='')
	{
		alert("Please enter user passowrd");
		document.getElementById("pass").focus();
		return false;
	}
	if(document.getElementById("cpass").value=='')
	{
		alert("Please enter confirmation passowrd");
		document.getElementById("cpass").focus();
		return false;
	}
	if(document.getElementById("pass").value!=document.getElementById("cpass").value)
	{
		alert('Oops! confirmation password does not match. Please Re-Enter confimration password');
		document.getElementById("cpass").focus();
		return false;
	}
}
function submitcomment(videoid,divid)
{
	if(document.getElementById("postcomment").value=='')
	{
		alert("Please enter video comment");
		document.getElementById("postcomment").focus();
		return false;
	}
		comment = document.getElementById("postcomment").value;
		comm = comment.replace(/&/g,"andpercent");
		document.getElementById("postComment").style.display='none';
		show("video_comment_ajax.php?videoId="+videoid+"&action=savecomment&comment="+comm,divid)
}

function submitReportcomment(videoid,commentid,divid)
{
		divid1 = divid+commentid;
	if(document.getElementById("postcommentReport").value=='')
	{
		alert("Please enter Report comment");
		document.getElementById("postcommentReport").focus();
		return false;
	}
		comment = document.getElementById("postcommentReport").value;
		comm = comment.replace(/&/g,"andpercent");
		document.getElementById("postcommentReport").style.display='none';
		location.href="reportlink.php?videoId="+videoid+"&action=Reportcomment&comment="+comm
		//show("video_comment_ajax.php?videoId="+videoid+"&action=Reportcomment&comment="+comm,divid1)
}

function checkmemberLoginComment(memberid,commentid,sessionId)
{
	
	if(sessionId=='')
	{
		alert("Please login to post comment on video");
		location.href="login.php";
	}
	if(memberid==sessionId)
	{
		alert("You can't post comment on self video");
		return false;
	}
	if(document.getElementById("ReportLink"+commentid).style.display=='none')
			document.getElementById("ReportLink"+commentid).style.display='';
	else
			document.getElementById("ReportLink"+commentid).style.display='none';
}
function likevideo(videoid,divid)
{
	show("like_video.php?action=likevideo&videoId="+videoid,divid)
}
function checksearchvalue()
{
	if(document.getElementById("searchByTag").value=='')
	{
		alert("Please enter tag for video search");
		document.getElementById("searchByTag").focus();
		return false;
	}
	return true;
}

function Changepassvalidation()
{
	
	if(document.getElementById("old_pass").value=='')
	{
		alert("Please enter old passowrd");
		document.getElementById("old_pass").focus();
		return false;
	}
	if(document.getElementById("new_pass").value=='')
	{
		alert("Please enter new passowrd");
		document.getElementById("new_pass").focus();
		return false;
	}
	if(document.getElementById("confirm_pass").value=='')
	{
		alert("Please enter confirmation passowrd");
		document.getElementById("confirm_pass").focus();
		return false;
	}
	if(document.getElementById("new_pass").value!=document.getElementById("confirm_pass").value)
	{
		alert('Oops! confirmation password does not match. Please Re-Enter confimration password');
		document.getElementById("confirm_pass").focus();
		return false;
	}
}
function ChangeForgotPassword()
{
	if(document.getElementById("email").value=='')
	{
		alert('Please enter your valid email address');
		document.getElementById("email").focus();
		return false;
	} 
	
	if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById("email").value)))
	{
		alert('Oops! You have forgotten to tell us your Valid Email Address!');
		document.getElementById("email").focus();
		return false;
	} 
}
-->
