    function Inint_AJAX() {
		try { return new ActiveXObject("Msxml2.XMLHTTP");  } catch(e) {} //IE
		try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} //IE
		try { return new XMLHttpRequest();          } catch(e) {} //Native Javascript
		alert("XMLHttpRequest not supported");
		return null;
	}
	function limitText(limitField, limitCount, limitNum) {
		if (limitField.value.length > limitNum) {
			limitField.value = limitField.value.substring(0, limitNum);
		} else {
			limitCount.value = limitNum - limitField.value.length;
		}
	}
	function echeck(str) {
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		/*alert(str+' '+lstr);
		alert(str.charAt(0));
		alert(str.charAt[(lstr-1)]);
		*/
		
		if (str.indexOf(at)==-1){
		   //alert("Invalid E-mail ID");
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   //alert("Invalid E-mail ID");
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    //alert("Invalid E-mail ID");
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    //alert("Invalid E-mail ID");
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    //alert("Invalid E-mail ID");
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    //alert("Invalid E-mail ID");
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		    //alert("Invalid E-mail ID");
		    return false;
		 }
		 //check for invalid start/end with underscore
		 

 		 return true;					
	}
	function trimAll(sString){
		while (sString.substring(0,1) == ' ')
		{
			sString = sString.substring(1, sString.length);
		}
		while (sString.substring(sString.length-1, sString.length) == ' ')
		{
			sString = sString.substring(0,sString.length-1);
		}
		return sString;
	}
	
	function chkStatus(){
		if(trimAll(document.profile_status.txtStatus.value)==""){
			alert('Please enter the status');
			document.profile_status.txtStatus.focus();
			return false;
		}
	}
	function chkProfileImage(){
		if(trimAll(document.profile_image.profileimage.value)==""){
			alert('Please upload the image');
			document.profile_image.profileimage.focus();
			return false;
		}
	}
	function chkProfile(){
		if(trimAll(document.profile_details.txtFname.value)=="" || !isNaN(document.profile_details.txtFname.value)){
           alert("Please enter your First Name");
           document.profile_details.txtFname.value="";
           document.profile_details.txtFname.focus();
           return false;
        }
        if(trimAll(document.profile_details.txtLname.value)=="" || !isNaN(document.profile_details.txtLname.value)){
           alert("Please enter your Last Name");
           document.profile_details.txtLname.value="";
           document.profile_details.txtLname.focus();
           return false;
        }
        	
		if(trimAll(document.profile_details.txtPwd.value)==""){
           alert("Please enter your Password");
           document.profile_details.txtPwd.value="";
           document.profile_details.txtPwd.focus();
           return false;
        }

        if(trimAll(document.profile_details.txtDD.value)=="" || isNaN(document.profile_details.txtDD.value)){
           alert("Please enter your Day of Birth");
           document.profile_details.txtDD.value="";
           document.profile_details.txtDD.focus();
           return false;
        }
        if(trimAll(document.profile_details.txtMM.value)=="" || isNaN(document.profile_details.txtMM.value)){
           alert("Please enter your Month of Birth");
           document.profile_details.txtMM.value="";
           document.profile_details.txtMM.focus();
           return false;
        }
        if(trimAll(document.profile_details.txtYY.value)=="" || isNaN(document.profile_details.txtYY.value)){
           alert("Please enter your Year of Birth");
           document.profile_details.txtYY.value="";
           document.profile_details.txtYY.focus();
           return false;
        }
        if(trimAll(document.profile_details.txtLoc.value)=="" || !isNaN(document.profile_details.txtLoc.value)){
           alert("Please enter your location");
           document.profile_details.txtLoc.value="";
           document.profile_details.txtLoc.focus();
           return false;
        }
		if(document.profile_details.txtGender.selectedIndex==0){
		   alert("Please select your gender");
           document.profile_details.txtGender.focus();
           return false;
		}
	}
	function chkRegister(){
		var emailID=document.frm_register.txtEmail;
		if ((emailID.value==null)||(emailID.value=="")){
			alert("Please Enter your Email ID")
			emailID.focus()
			return false
		}
		
		if(emailID.value.indexOf("_")==0)
		{
			alert("Invalid E-mail ID,Underscore at the begining not allowed.");
			return false;
		}
		
		if(emailID.value.lastIndexOf("_")==((emailID.value.indexOf("@"))-1))
		{
			alert("Invalid E-mail ID,Underscore at the end not allowed.");
			return false;
		}
		
		if (echeck(emailID.value)==false){
			alert("Invalid E-mail ID");
			emailID.value=""
			emailID.focus()
			return false
		}

		if(trimAll(document.frm_register.txtFname.value)=="" || !isNaN(document.frm_register.txtFname.value)){
		//if(trimAll(document.frm_register.txtFname.value)==""){
           alert("Please enter your First Name");
           document.frm_register.txtFname.value="";
           document.frm_register.txtFname.focus();
           return false;
        }
		if(trimAll(document.frm_register.txtFname.value)!=""){
          	re = /^[A-Za-z]+$/;
			if(re.test(trimAll(document.frm_register.txtFname.value)))
			{
			//alert('Valid Name.');
			}
			else
			{
			alert("Please enter Valid First Name");
           document.frm_register.txtFname.value="";
           document.frm_register.txtFname.focus();
           return false;
			
			}
        }
		
        if(trimAll(document.frm_register.txtLname.value)=="" || !isNaN(document.frm_register.txtLname.value)){
           alert("Please enter your Last Name");
           document.frm_register.txtLname.value="";
           document.frm_register.txtLname.focus();
           return false;
        }
		if(trimAll(document.frm_register.txtLname.value)!=""){
          	re = /^[A-Za-z]+$/;
			if(re.test(trimAll(document.frm_register.txtLname.value)))
			{
			//alert('Valid Name.');
			}
			else
			{
			alert("Please enter Valid Last Name");
           document.frm_register.txtLname.value="";
           document.frm_register.txtLname.focus();
           return false;
			
			}
        }
        	
		if(trimAll(document.frm_register.txtPwd.value)==""){
           alert("Please enter your Password");
           document.frm_register.txtPwd.value="";
           document.frm_register.txtPwd.focus();
           return false;
        }

        if(trimAll(document.frm_register.txtDD.value)=="" || isNaN(document.frm_register.txtDD.value)){
           alert("Please enter your Day of Birth");
           document.frm_register.txtDD.value="";
           document.frm_register.txtDD.focus();
           return false;
        }
        if(trimAll(document.frm_register.txtMM.value)=="" || isNaN(document.frm_register.txtMM.value)){
           alert("Please enter your Month of Birth");
           document.frm_register.txtMM.value="";
           document.frm_register.txtMM.focus();
           return false;
        }
        if(trimAll(document.frm_register.txtYY.value)=="" || isNaN(document.frm_register.txtYY.value)){
           alert("Please enter your Year of Birth");
           document.frm_register.txtYY.value="";
           document.frm_register.txtYY.focus();
           return false;
        }
        if(trimAll(document.frm_register.txtLoc.value)=="" || !isNaN(document.frm_register.txtLoc.value)){
           alert("Please enter your location");
           document.frm_register.txtLoc.value="";
           document.frm_register.txtLoc.focus();
           return false;
        }
		if(trimAll(document.frm_register.txtLoc.value)!=""){
          	re = /^[A-Za-z]+$/;
			if(re.test(trimAll(document.frm_register.txtLoc.value)))
			{
			//alert('Valid Name.');
			}
			else
			{
			alert("Please enter Valid Location");
           document.frm_register.txtLoc.value="";
           document.frm_register.txtLoc.focus();
           return false;
			
			}
        }
		
		if(document.frm_register.txtGender.selectedIndex==0){
		   alert("Please select your gender");
           document.frm_register.txtGender.focus();
           return false;
		}
		if(trimAll(document.frm_register.profileimage.value)==""){
			alert('Please upload the image');
			document.frm_register.profileimage.focus();
			return false;
		}
	}
	function chkContact(){
		if(trimAll(document.frmcontact.contact_name.value)==""){
			alert('Please enter the contact persons name');
			document.frmcontact.contact_name.focus();
			return false;
		}
		var emailID=document.frmcontact.contact_email;
		if (echeck(emailID.value)==false){
			alert("Invalid E-mail ID");
			emailID.value="";
			emailID.focus();
			return false;
		}
		if(trimAll(document.frmcontact.contact_subject.value)==""){
			alert('Please enter the subject');
			document.frmcontact.contact_subject.focus();
			return false;
		}
	}
	
	function myopinion(x,y){
	   $.post("/myopinion.php",{MyOpinion: x , Recordid: y},
		function(data)
		{
			if(data=="N"){
				showpop('layerpop','pop_login');
			}else if(data==""){
				alert('We are facing problems in processing data, kindly try again in sometime.');
			}else{
				mypoints();
				var myString = data;
				var mySplitResult = myString.split("::");				
				var BC = "BC"+y;
				var BF = "BF"+y;
				$("#" + BC).html(mySplitResult[0]);
				$("#" + BF).html(mySplitResult[1]);
			}
		}
		
		);
	   
	}
	function articlecomment(x,y,z){
		var req = Inint_AJAX();
		req.onreadystatechange = function () {
				if (req.readyState==4) {
					if (req.status==200) {
						pageTracker._trackPageview("/articlecomment");
						//alert(req.responseText);
						var result = req.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
						document.getElementById("Listing").innerHTML = result;
					}
				}
			 };
		
		req.open("GET", "/ajax_comments.php?article_id="+x+ "&Page="+ y + "&category_id="+ z);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
		req.send(null);
	}
	function usercomment(x,y,z){
		var req = Inint_AJAX();
		req.onreadystatechange = function () {
				if (req.readyState==4) {
					if (req.status==200) {
						pageTracker._trackPageview("/comment");
						//alert(req.responseText);
						var result = req.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
						document.getElementById("Listing").innerHTML = result;
					}
				}
			 };
		
		req.open("GET", "/ajax_common_comments.php?record_id="+x+ "&Page="+ y + "&category_type="+ z);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
		req.send(null);
	}
	function showcomment(x,y){
		var req = Inint_AJAX();
		req.onreadystatechange = function () {
				if (req.readyState==4) {
					if (req.status==200) {
						pageTracker._trackPageview("/showcomments");
						//alert(req.responseText);
						var result = req.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
						document.getElementById("table_comment").innerHTML = result;
					}
				}
			 };
		
		req.open("GET", "/ajax_comments.php?show_id="+x+ "&Page="+ y);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
		req.send(null);
	}
	function connect(url,params)
	{
		var connection;  // The variable that makes Ajax possible!
		try{// Opera 8.0+, Firefox, Safari
		connection = new XMLHttpRequest();}
		catch (e){// Internet Explorer Browsers
		try{
		connection = new ActiveXObject("Msxml2.XMLHTTP");}
		catch (e){
		try{
		connection = new ActiveXObject("Microsoft.XMLHTTP");}
		catch (e){// Something went wrong
		return false;}}}
		connection.open("POST", url, true);
		connection.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		connection.setRequestHeader("Content-length", params.length);
		connection.setRequestHeader("connection", "close");
		connection.send(params);
		return(connection);
	}
	function totalEncode(str){ 
		var s=escape(str); 
		s=s.replace(/\+/g,"+"); 
		s=s.replace(/@/g,"@"); 
		s=s.replace(/\//g,"/"); 
		s=s.replace(/\*/g,"*"); 
		return(s); 
	}
	function articlegallery(x,y){
		var req = Inint_AJAX();
		req.onreadystatechange = function () {
				if (req.readyState==4) {
					if (req.status==200) {
						pageTracker._trackPageview("/gallery");
						//alert(req.responseText);
						var result = req.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
						document.getElementById("Gallery").innerHTML = result;
					}
				}
			 };
		
		req.open("GET", "/ajax_article_gallery.php?article_id="+x+ "&Page="+ y );
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
		req.send(null);
	}
	function vjgallery(x,y){
		var req = Inint_AJAX();
		req.onreadystatechange = function () {
				if (req.readyState==4) {
					if (req.status==200) {
						pageTracker._trackPageview("/vjgallery");
						//alert(req.responseText);
						var result = req.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
						document.getElementById("Gallery").innerHTML = result;
					}
				}
			 };
		
		req.open("GET", "/ajax_vj_gallery.php?album_id="+x+ "&Page="+ y );
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
		req.send(null);
	}
	function vministry(y){
		var req = Inint_AJAX();
		req.onreadystatechange = function () {
				if (req.readyState==4) {
					if (req.status==200) {
						//pageTracker._trackPageview("/vministry");
						//alert(req.responseText);
						var result = req.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
						alert(result);
					}
				}
			 };
		
		req.open("GET", "/ajax_vministry.php?ministry="+ y );
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
		req.send(null);
	}  
	function pokeme(x){
		var req = Inint_AJAX();
		req.onreadystatechange = function () {
				if (req.readyState==4) {
					if (req.status==200) {
						//alert(req.responseText);
						var result = req.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
						if(result=="N"){
							//pageTracker._trackPageview("/login");	
							showpop('layerpop','pop_login');
						}else if(result=="I"){
							alert("No No");
						}else{
							mypoints();
							//pageTracker._trackPageview("/pokeme");
							//document.getElementById("pokes"+x).innerHTML = "<span style='font-family:Myriad Pro;font-size:12px;text-transform:uppercase;color:#000; margin:40px 0 0 10px; font-weight:bold;'>" + result +" FRIENDLY POKES</span>";
						}
					}
				}
			 };
		
		req.open("GET", "/ajax_pokes.php?poked_id="+x);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
		req.send(null);
	}
	function flirtwithme(x){
		var req = Inint_AJAX();
		req.onreadystatechange = function () {
				if (req.readyState==4) {
					if (req.status==200) {
						//alert(req.responseText);
						var result = req.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
						if(result=="N"){
							//pageTracker._trackPageview("/login");
							showpop('layerpop','pop_login');
						}else if(result=="I"){
							alert("No No");
						}else{
							mypoints();
							//pageTracker._trackPageview("/flirtwithme");
							//document.getElementById("flirts"+x).innerHTML = "<span style='font-family:Myriad Pro;font-size:12px;text-transform:uppercase;color:#000; margin:40px 0 0 10px; font-weight:bold;'>" + result +" FLIRTS</span>";
						}
					}
				}
			 };
		
		req.open("GET", "/ajax_flirts.php?flirts_id="+x);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
		req.send(null);
	}
	function bloodyhotme(x){
		var req = Inint_AJAX();
		req.onreadystatechange = function () {
				if (req.readyState==4) {
					if (req.status==200) {
						//alert(req.responseText);
						var result = req.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
						if(result=="N"){
							//pageTracker._trackPageview("/login");	
							showpop('layerpop','pop_login');
						}else if(result=="I"){
							alert("No No");
						}else{
							document.getElementById("mybloodyhot").innerHTML = result;
							//pageTracker._trackPageview("/pokeme");
							//document.getElementById("bloodyhot"+x).innerHTML = "<span style='font-family:Myriad Pro;font-size:12px;text-transform:uppercase;color:#000; margin:40px 0 0 10px; font-weight:bold;'>" + result +" FRIENDLY POKES</span>";
						}
					}
				}
			 };
		
		req.open("GET", "/ajax_bloodyhot.php?bloodyhot_id="+x);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
		req.send(null);
	}
	function bloodyhot(){
		var req = Inint_AJAX();
		req.onreadystatechange = function () {
				if (req.readyState==4) {
					if (req.status==200) {
						//alert(req.responseText);
						//pageTracker._trackPageview("/bloodyhotCount");
						var result = req.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
						document.getElementById("mybloodyhot").innerHTML = result;
					}
				}
			 };
		
		req.open("GET", "/ajax_bloodyhot_count.php");
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
		req.send(null);
	}
	function pokes(){
		var req = Inint_AJAX();
		req.onreadystatechange = function () {
				if (req.readyState==4) {
					if (req.status==200) {
						//alert(req.responseText);
						//pageTracker._trackPageview("/pokeCount");
						var result = req.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
						document.getElementById("mypoke").innerHTML = result;
					}
				}
			 };
		
		req.open("GET", "/ajax_poke_count.php");
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
		req.send(null);
	}
	function flirts(){
		var req = Inint_AJAX();
		req.onreadystatechange = function () {
				if (req.readyState==4) {
					if (req.status==200) {
						//alert(req.responseText);
						//pageTracker._trackPageview("/flirtCount");
						var result = req.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
						document.getElementById("myflirt").innerHTML = result;
					}
				}
			 };
		
		req.open("GET", "/ajax_flirt_count.php");
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
		req.send(null);
	}
	function mypoints(){
		var req = Inint_AJAX();
		req.onreadystatechange = function () {
				if (req.readyState==4) {
					if (req.status==200) {
						//alert(req.responseText);
						//pageTracker._trackPageview("/flirtCount");
						var result = req.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
						document.getElementById("mypoints").innerHTML = result;
					}
				}
			 };
		
		req.open("GET", "/ajax_mypoints.php");
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
		req.send(null);
	}
	function mydisplaystatus(){
		var req = Inint_AJAX();
		req.onreadystatechange = function () {
				if (req.readyState==4) {
					if (req.status==200) {
						//alert(req.responseText);
						//pageTracker._trackPageview("/flirtCount");
						var result = req.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
						document.getElementById("mydisplaystatus").innerHTML = result;
					}
				}
			 };
		
		req.open("GET", "/mydisplaystatus.php");
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
		req.send(null);
	}
	function mydisplayimage(){
		var req = Inint_AJAX();
		req.onreadystatechange = function () {
				if (req.readyState==4) {
					if (req.status==200) {
						//alert(req.responseText);
						//pageTracker._trackPageview("/flirtCount");
						var result = req.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
						document.getElementById("mydisplayimage").innerHTML = result;
					}
				}
			 };
		
		req.open("GET", "/mydisplayimage.php");
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
		req.send(null);
	}
	
	function calendar(x,y,z){
		var req = Inint_AJAX();
		req.onreadystatechange = function () {
				if (req.readyState==4) {
					if (req.status==200) {
						//alert(req.responseText);
						pageTracker._trackPageview("/events");
						var result = req.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
						document.getElementById("calendar").innerHTML = result;
					}
				}
			 };
		
		req.open("GET", "calendar.php?prm="+x+ "&chm="+ y +"&yrm=" + z);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
		req.send(null);
	}
	function chk_comment(w,x,y,z){
		var success  = true;
		var userCommentRecId	 =	document.getElementById(x).value;
		var userCommentType	 	=	document.getElementById(y).value;
		var usertxtComment	 	=	eval("document."+ w +"."+ z);
		//alert(userCommentRecId);
		if(trimAll(usertxtComment.value)==""){
			alert("Please enter your Comment");
			userComment.value="";
			userComment.focus();
			success = false;
			return false;
		}
		if(success){
			var xmlHttp = false;
			if (window.XMLHttpRequest){ // Mozilla, Safari,...
			   xmlHttp = new XMLHttpRequest();
			   if (xmlHttp.overrideMimeType){
			   // set type accordingly to anticipated content type
				xmlHttp.overrideMimeType('text/html');
			   }
			}else if (window.ActiveXObject){ // IE
			  try{
				xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
			  }
			 catch (e){
					try {
							xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
					} catch (e) {}
				}
			}
			
			xmlHttp.onreadystatechange=function() {
				if(xmlHttp.readyState==4){
					var result = xmlHttp.responseText.replace(/^\s*/, "").replace(/\s*$/, "");
					if(result!="N"){
						var myString = result;
						listComments(userCommentRecId);
						hidepop('layerpop','pop_comment');
					}else{
					   alert('Thats not it! Please enter your Comment');
					}//end else
				}//end if readyState==4
			}
			var params = "record_id="+userCommentRecId+"&comment_type="+userCommentType+"&comment="+escape(usertxtComment.value);
			xmlHttp.open("POST", "/ajax_common_comment.php", true);
			xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
			xmlHttp.send(params);
			
		}
	}
	
	function getHTTPObject(){
		if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
		else if (window.XMLHttpRequest) return new XMLHttpRequest();
		else {
			alert("Your browser does not support AJAX.");
		return null;
		}
	}
	
	
	function setOutput(){
		if(httpObject.readyState == 4){
			document.getElementById('uploadphoto').innerHTML = httpObject.responseText;
		}
	}
	// Implement business logic
	function doWork(x){
		httpObject = getHTTPObject();
		if (httpObject != null) {
			httpObject.open("GET", "/uploadphoto.php?userid="+x, true);
			httpObject.send(null);
			httpObject.onreadystatechange = setOutput;
		}
	}
	function setVideoOutput(){
		if(httpObject.readyState == 4){
			document.getElementById('playvideo').innerHTML = httpObject.responseText;
		}
	}
	function playVideo(x,y,z){
		httpObject = getHTTPObject();
		if (httpObject != null) {
			httpObject.open("GET", "/playvideo.php?videoid="+x+"&episode="+y+"&clipnumber="+z, true);
			httpObject.send(null);
			httpObject.onreadystatechange = setVideoOutput;
		}
	}
	function setCommentOutput(){
		if(httpObject.readyState == 4){
			document.getElementById('writeComment').innerHTML = httpObject.responseText;
		}
	}
	// Implement business logic
	function doComment(){
		httpObject = getHTTPObject();
		if (httpObject != null) {
			httpObject.open("GET", "/writecomment.php", true);
			httpObject.send(null);
			httpObject.onreadystatechange = setCommentOutput;
		}
	}
	function setlistCommentOutput(){
		if(httpObject.readyState == 4){
			document.getElementById('listComments').innerHTML = httpObject.responseText;
		}
	}
	// Implement business logic
	function listComments(x){
		httpObject = getHTTPObject();
		if (httpObject != null) {
			httpObject.open("GET", "/listcomments.php?record_id="+x, true);
			httpObject.send(null);
			httpObject.onreadystatechange = setlistCommentOutput;
		}
	}
	var httpObject = null;
