	function showCommentsInputBox(inputBox, methodValue, newsID, commentID){
		document.getElementById('inputBox').style.visibility='visible';
		 document.getElementById('inputBox').style.display='';// none;
		 var coords = findPositionCommon(document.getElementById("showComTab"+newsID));							// get our co-ordinates from the findPosition function
		document.getElementById('inputBox').style.top = (coords[1]-70) + 'px'; 					// change the 100 to alter co-ordinates of popup
		
		if(methodValue=='postComment'){
			document.getElementById("_headingTab").innerHTML = "Post Comments";
		}else if(methodValue=='replyComment'){
			document.getElementById("_headingTab").innerHTML = "Reply Comments";
		}else{
			document.getElementById("_headingTab").innerHTML = "Report Abouse";
		}		
		 document.justinform.method.value=methodValue;
		 document.justinform.newsID.value=newsID;
		 document.justinform.commentID.value=commentID;
		 //document.justinform.profileID.value=profileID;
	} 
	
	function hideInputBox(inputBox){
		document.getElementById('inputBox').style.visibility='hidden';
		document.getElementById('inputBox').style.display='none';// none;
	}
	
	function submitRequest(obj){
		//alert(obj);
		if(obj.name.value == ''){
			alert('Please enter your name');
			obj.name.focus();
			return false;
		}
		
		if(obj.email.value == ''){
			alert('Please enter your email');
			obj.email.focus();
			return false;
		}
		
		if(notValidEmail(obj.email)){
        alert('Please enter valid email');
		obj.email.focus();
        return false;
    	}
    
		if(obj.comment.value == ''){
			alert('Please enter your comments');
			obj.comment.focus();
			return false;
		}
		
		return true;
	}
	
	

function notValidEmail( str ){
    mailRE = new RegExp( );
    mailRE.compile( '^[\._a-z0-9-]+@[\.a-z0-9-]+[\.]{1}[a-z]{2,4}$', 'gi' );
    return !(mailRE.test( str.value ));
} 

function checkClickMain(param1, param2, newsID, noOfComments){
		var divID= param1;
		var html="";
		html+="<a style='cursor: pointer;' onclick='removeCommentTab(\""+param1+"\", \""+param2+"\", \""+newsID+"\", \""+noOfComments+"\");'>";
		html+="<img src='/justin/images/minus.jpg' width='13' height='11' border='0'> </a>";
		html+="<span class='justin_cnt-share2'>Comments("+noOfComments+")</span>";
		
		document.getElementById(param1).innerHTML="";
		document.getElementById(param1).innerHTML=html;
		
	}
	
	function removeCommentTab(param1, param2, newsID, noOfComments){
		
		var html="";
		html+="<a style='cursor: pointer;' onclick='checkClickMain(\""+param1+"\", \""+param2+"\", \""+newsID+"\", \""+noOfComments+"\");";
		html+="sendRequest(\"GET\", \"/cjjustin.do?method=CJJustInComment&newID="+newsID+"\&pageNo=0\", \""+param2+"\");'>";
		html+="<img src='/justin/images/plus.jpg' width='13' height='11' border='0'> </a>";
		html+="<span class='justin_cnt-share2'>Comments("+noOfComments+")</span>";
		
		document.getElementById(param2).innerHTML="";
		document.getElementById(param1).innerHTML="";
		document.getElementById(param1).innerHTML=html;
	}
	function checkClick(divID, showDivID, newsId, pageNo){
		var html="";
		html += '<div class="justin_cnt-reply"><a style="cursor:pointer;"'; 
		html += 'onclick="removeDivTab(\''+divID+'\',\''+showDivID+'\',\''+newsId+'\', \''+pageNo+'\');">';
		html += '<img src="/justin/images/minus.jpg" width="13" height="11" border="0"></a><a href="#"></a></div>';
		document.getElementById(divID).innerHTML="";
		document.getElementById(divID).innerHTML=html;
		
	}
	
	function removeDivTab(divID, showDivID, newsId, pageNo){
		var html="";
		html += "<div class='justin_cnt-reply'>";
      	html += "<a style='cursor: pointer;' onclick='checkClick(\""+divID+"\", "+showDivID+", "+newsId+", "+pageNo+");";
      	html += "sendRequest(\"GET\", \"/cjjustin.do?method=CJJustInComment&newID="+newsId+"&pageNo="+pageNo+"\", \""+showDivID+"\");'>";
      	html += "<img src='/justin/images/plus.jpg' width='13' height='11' border='0'></a></div>";
		
		
		document.getElementById(divID).innerHTML=html;
		document.getElementById(showDivID).innerHTML="";
	}
