  //<script src="/messagecentral/jquery-latest.js"></script>
  var call_fun="";
  var call_param="";
  var call_param1="";
  var open_div="";
	
	var call_param2 = "";
	var call_param3 = "";
	var call_param4 = "";
	var	call_param5 = "";
	var call_param6 = "";

/** Current URL **/
if( location.href==null || location.href=="" || location.href=="undefined" )
	var W18ReturnURL = "http://www.in.com/";
else
	var W18ReturnURL = location.href;

if(!W18ReturnURL)
	var W18ReturnURL = "http://www.in.com/";


function verify_insign()
{
	var f_idval="";
	var f_fwdval="";
	var remembermeval="";
	if($('#f_id').val()=='')
	{
		alert("please enter username");
		$("#f_id").focus();  
		return;
	}
	if($('#f_pwd').val()=='')
	{
		alert("please enter password");
		$("#f_pwd").focus();  
		return;
	}

	if(document.getElementById('f_id')!=null&&document.getElementById('f_id').value!=''&&document.getElementById('f_id').value!='Username'){f_idval=$('#f_id').val();if(document.getElementById('rememberme')!=null){if(document.getElementById('rememberme').checked==true){remembermeval=$('#rememberme:checked').val()}}if(document.getElementById('f_pwd')!=null){f_fwdval=$('#f_pwd').val()}}	
	//$(document).ready(function(){		
		setTimeout(function() {$.getJSON("http://www.in.com/loginverify.php?f_id="+f_idval+"&f_pwd="+f_fwdval+"&f_referrer=undefined&rememberme="+remembermeval+"&f_source=jquery&rcode=undefined&f_domain=cross&format=json&jsoncallback=?",function(data){			
			if(data.status=='success')
			{
				closesignin();
				put_username();
			}
			else
			{
				err=data.errorcode;msgdisp="";messagedispaly="";if(err==1){msgdisp='<b>The password you entered is not correct. <br>Password is case sensitive </b><span style="padding-top:5px;"></span>'}else if(err==2){msgdisp='<b>Please enter your IN.com Username and Password </b>'}else if(err==3){msgdisp='<b>The password you entered is not correct. <br>Password is case sensitive </b><span style="padding-top:5px;"></span>';window.location='/login.php?err=3';}else if(err==4){msgdisp='<b>Sorry! this is not a valid IN.com Username </b>'}else if(err==5){msgdisp='<b>Please enter correct Captcha code. </b>';window.location='/login.php?err=5';}else  if(err==6){msgdisp='<b>Your email id is temporarily blocked. <br>For further clarification <br> please mail to <A HREF="mailto:feedback@in.com" class="bl_2_12">feedback@in.com</A> or call 022-66184478</b>'}else if(err==8){msgdisp='<b>Your email id is temporarily blocked. <br>For further clarification <br> please mail to <A HREF="mailto:feedback@in.com" class="bl_2_12">feedback@in.com</A> or call 022-66184478</b>'}else   if(err==9){msgdisp='<b>Sorry! We are facing some Technical error. <br>Please try after sometime.</b>'}else if(err==10){msgdisp='<b>Sorry! you have tried 30 wrong login attempts and your IP is blocked for a day. </b>'}$('#disperrpop').html(msgdisp);
			}           
        });
		}, 500); 
	//});
}

function addsignin(page,show_gbtn,str)
{
	var loginhtml="<div id='commentsDivId'></div> <div style='padding:10px; text-align:left; cursor:default;'> 		<div class='hd_brd_b MB10 PB3'> 			<h3 class='FL'>Sign in &nbsp;<span style='display:none;' class='gD_12' id='post_msg' name='post_msg' ></span></h3> 			<div class='FR' onclick='javascript:closesignin()'> 				<div class='b_11' style='cursor:pointer;'><b>Close</b></div> 			</div> 			<div class='CL'></div> 		</div> 		<div id='disperrpop' style='color:red'></div> 		<table width='370' cellpadding='0' cellspacing='3' border='0' class='form1'> 			<tr> 				<td width='100' class='gD_12' align='right' id='f_id_text'>Username :&nbsp;</td> 				<td width='300'><input type='text'  name='f_id' id = 'f_id' value='' size='40' class='txtInput' onkeypress='{if (event.keyCode==13) verify_insign()}' /> 					<input type='hidden' name='f_sourcelogin' id='f_sourcelogin' /></td> 			</tr> 			<tr> 				<td height='2'></td> 			</tr> 			<tr> 				<td class='gD_12' align='right'  id='f_pwd_text'>Password :&nbsp;</td> 				<td><input type='password' name='f_pwd' id = 'f_pwd' size='40' class='txtInput' onkeypress='{if (event.keyCode==13) verify_insign()}' /></td> 			</tr> 			<tr> 				<td height='5'></td> 			</tr> 			<tr> 				<td colspan='2' align='center'><input type='checkbox' name='rememberme_new' id='rememberme_new' value='1'  /> 					Remember me on this computer.</td> 			</tr> 			<tr> 				<td height='5'></td> 			</tr> 			<tr> 				<td></td> 				<td><input type='button'  id='f_submit' value='Login' class='btn' onclick='verify_insign()' />&nbsp;&nbsp;&nbsp;<a style='color: rgb(0, 102, 204);' href='http://secure.in.com/sso/forgotpwd.php?ref=IN' target='_blank'>Forgot password?</a>&nbsp;&nbsp;&nbsp;<span id='signinBoxGuest' style='display:none'><input type='button' value='Guest Login' class='btn' onclick='msg_guest();' /></span></td> 			</tr> 			<tr> 				<td height='5'></td> 			</tr> 			<tr> 				<td colspan='2'><div style='border-top:1px #ccc solid; padding:10px;' class='gD_12'><b>Don't have an account yet?</b> <a href='http://secure.in.com/sso/commonregister.php?ref=IN&returnurl=" + W18ReturnURL + "' style='cursor:pointer;' class='gr_14'><b>Register Now!</b></a></div></td> 			</tr> 		</table> 	</div>";
		
	$.blockUI({ message: loginhtml,css: {width:'400px'}}); 
	//});
}

function verify_signin()
{
	var f_idval="";
	var f_fwdval="";
	var remembermeval="";
	if($('#f_id').val()=='')
	{
		alert("please enter username");
		$("#f_id").focus();  
		return;
	}
	if($('#f_pwd').val()=='')
	{
		alert("please enter password");
		$("#f_pwd").focus();  
		return;
	}

	if(document.getElementById('f_id')!=null&&document.getElementById('f_id').value!=''&&document.getElementById('f_id').value!='Username'){f_idval=$('#f_id').val();if(document.getElementById('rememberme')!=null){if(document.getElementById('rememberme').checked==true){remembermeval=$('#rememberme:checked').val()}}if(document.getElementById('f_pwd')!=null){f_fwdval=$('#f_pwd').val()}}	
	//$(document).ready(function(){		
		setTimeout(function() {$.getJSON("http://www.in.com/loginverify.php?f_id="+f_idval+"&f_pwd="+f_fwdval+"&f_referrer=undefined&rememberme="+remembermeval+"&f_source=jquery&rcode=undefined&f_domain=cross&format=json&jsoncallback=?",function(data){			
			if(data.status=='success')
			{
				closesignin();
				put_username();
				var ret_det=data.status+"|~"+data.userid+"|~"+data.username;
				if(call_fun=='1')
					update_new_msg(ret_det);
				else if(call_fun=='2')
					update_reply_msg(call_param,open_div,ret_det);
				else if(call_fun=='3')
					update_offence(call_param,ret_det);
				else if(call_fun=='4')
					update_rate(call_param,call_param1,ret_det);
				else if(call_fun=='5')
					valid_poll(ret_det);
				else if(call_fun=='6')
					update_reply_topoll(call_param,open_div,ret_det,call_param1);
			}
			else
			{
				err=data.errorcode;msgdisp="";messagedispaly="";if(err==1){msgdisp='<b>The password you entered is not correct. <br>Password is case sensitive </b><span style="padding-top:5px;"></span>'}else if(err==2){msgdisp='<b>Please enter your IN.com Username and Password </b>'}else if(err==3){msgdisp='<b>The password you entered is not correct. <br>Password is case sensitive </b><span style="padding-top:5px;"></span>';window.location='/login.php?err=3';}else if(err==4){msgdisp='<b>Sorry! this is not a valid IN.com Username </b>'}else if(err==5){msgdisp='<b>Please enter correct Captcha code. </b>';window.location='/login.php?err=5';}else  if(err==6){msgdisp='<b>Your email id is temporarily blocked. <br>For further clarification <br> please mail to <A HREF="mailto:feedback@in.com" class="bl_2_12">feedback@in.com</A> or call 022-66184478</b>'}else if(err==8){msgdisp='<b>Your email id is temporarily blocked. <br>For further clarification <br> please mail to <A HREF="mailto:feedback@in.com" class="bl_2_12">feedback@in.com</A> or call 022-66184478</b>'}else   if(err==9){msgdisp='<b>Sorry! We are facing some Technical error. <br>Please try after sometime.</b>'}else if(err==10){msgdisp='<b>Sorry! you have tried 30 wrong login attempts and your IP is blocked for a day. </b>'}$('#disperrpop').html(msgdisp);
			}           
        });
		}, 500); 
	//});
}

function check_login(btn)
{	
	//$(document).ready(function(){
		setTimeout(function() {$.getJSON("http://www.in.com/checkauth.php?json=1&format=json&jsoncallback=?",function(data){
				if(data.status=="success"){
				//alert('Logged');
				var ret_det=data.status+"|~"+data.userid+"|~"+data.username;
				if(call_fun=='1')
					update_new_msg(ret_det);
				else if(call_fun=='2')
					update_reply_msg(call_param,open_div,ret_det);
				else if(call_fun=='3')
					update_offence(call_param,ret_det);
				else if(call_fun=='4')
					update_rate(call_param,call_param1,ret_det);
				else if(call_fun=='5') 
					valid_poll(ret_det);
				else if(call_fun=='6') 
					update_reply_topoll(call_param,open_div,ret_det,call_param1);
					
			}else{				
				callout(btn);	    
			}		
        });
		 }, 500); 
  //});	
}

function insert_msg(par_st)
{
	var ret_det='success|~16000725373|~Guest';
	if(par_st==1)
		update_new_msg(ret_det);
	else if(par_st==2)
		update_reply_msg(call_param,open_div,ret_det);
	
}


function callout(show_gbtn)
{
	if(show_gbtn==1)
		var g_btn="&nbsp;&nbsp;&nbsp;<input type='button'  id='btn_guest' value='Guest Login' class='btn' onclick='insert_msg(1)' />";
	else if(show_gbtn==2)
		var g_btn="&nbsp;&nbsp;&nbsp;<input type='button'  id='btn_guest' value='Guest Login' class='btn' onclick='insert_msg(2)' />";
	else
		var g_btn='';
	var loginhtml="<div id='disperrhome' style='color:red'></div><div id='commentsDivId'></div><div style='padding:10px; text-align:left; cursor:default;'>		<div class='hd_brd_b MB10 PB3'>			<h3 class='FL'>Sign in &nbsp;<span style='display:none;' class='gD_12' id='post_msg' name='post_msg' ></span></h3>			<div class='FR' onclick='javascript:closesignin()'>				<div class='b_11' style='cursor:pointer;'><b>Close</b></div>			</div>			<div class='CL'></div>		</div>		<div id='disperrpop' style='color:red'></div>		<table width='370' cellpadding='0' cellspacing='3' border='0' class='form1'>			<tr>				<td width='100' class='gD_12' align='right' id='f_id_text'>Username :&nbsp;</td>				<td width='300'><input type='text'  name='f_id' id = 'f_id' value='' size='40' class='txtInput' onkeypress='if(event.keyCode==13) verify_signin()' />					<input type='hidden' name='f_sourcelogin' id='f_sourcelogin' /></td>			</tr>			<tr>				<td height='2'></td>			</tr>			<tr>				<td class='gD_12' align='right'  id='f_pwd_text'>Password :&nbsp;</td>				<td><input type='password' name='f_pwd' id = 'f_pwd' size='40' class='txtInput' onkeypress='if(event.keyCode==13) verify_signin()' /></td>			</tr>			<tr>				<td height='5'></td>			</tr>			<tr>				<td colspan='2' align='center'><input type='checkbox' name='rememberme' id='rememberme' value='1'  />					Remember me on this computer.</td>			</tr>			<tr>				<td height='5'></td>			</tr>		<tr>			<td></td>				<td><input type='button'  id='f_submit' value='Login' class='btn' onclick='verify_signin()' />&nbsp;&nbsp;&nbsp;<a style='color: rgb(0, 102, 204);' href='http://secure.in.com/sso/forgotpwd.php?ref=IN' target='_blank'>Forgot password?</a>"+g_btn+"</td>			</tr>			<tr>				<td height='5'></td>			</tr>			<tr>				<td colspan='2'><div style='border-top:1px #ccc solid; padding:10px;' class='gD_12'><b>Don't have an account yet?</b> <a href='http://secure.in.com/sso/commonregister.php?ref=IN&returnurl=" + W18ReturnURL + "' style='cursor:pointer;' class='gr_14'><b>Register Now!</b></a></div></td>			</tr>		</table>	</div>";
	
	$.blockUI({ message: loginhtml,css: {width:'400px'}}); 
	//});
}

function closesignin(){$.unblockUI()}

function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length)}return null}



function update_rate(msgid,rate,data)
{
	if(data=="1")
	{
		$.blockUI({ message: "<img src='http://www.in.com/images/ajax-loader.gif'>",css: {width:'400px'}});
		call_fun="4";
		call_param=msgid;
		call_param1=rate;
		check_login('0');
	}
	else
	{		
		var login_det=data.split("|~");
		var status=login_det[0];
		var userid=login_det[1];
		var uname=login_det[2];
		
		if(status=='success')
		{
			
			$.get("/messagecentral/msg_rating.php?mid="+msgid+"&uid="+userid+"&rate="+rate+"",{},function(data){
		
			closesignin();			
			alert(data);				
			
			closeme(open_div);
			});
		}
		else
		{			
			call_fun="4";
			call_param=msgid;
			call_param1=rate;
			callout('0');
		}
	}
}


function update_offence(msgid,data)
{		
	var reason = $('input[name=ofc_reason]:checked').val();	
	if(data=="1")
	{
		$.blockUI({ message: "<img src='http://www.in.com/images/ajax-loader.gif'>",css: {width:'400px'}});
		call_fun="3";
		call_param=msgid;
		check_login('0');
	}
	else
	{		
		var login_det=data.split("|~");
		var status=login_det[0];
		var userid=login_det[1];
		var uname=login_det[2];
		
		if(status=='success')
		{			
			$.get("/messagecentral/update_msg_offensive.php?mid="+msgid+"&uid="+userid+"&reason="+reason+"",{},function(data){
			//$('#login_box').html(data);
			closesignin();
			if(data=='1')
				alert("Thank you");				
			
			closeme(open_div);
			});
		}
		else
		{			
			call_fun="3";
			call_param=msgid;
			closesignin();
			callout('0');
		}
	}
		
}



/////////////////////////////////////////////////////////////////////// Section Message Page JS

function update_new_msg(data)
	{		
		var heading=$('#n_heading').val();
		var new_msg=$('#n_message').val();
		
		if(heading=="" || heading=="Heading" || heading==" ")
		{
			alert("Please input heading");
			$("#n_heading").focus();
			return false;
		}
		else if(heading.length < 6)
		{
			alert ("Please enter the heading more then 6 character");
			$("#n_heading").focus();  
			return false;
		}
		else if(heading.length > 200)
		{
			alert("Heading: max 200 characters allowed");
			$("#n_heading").focus();  
			return false;
		}
		
		var str=heading;
		str=str.toLowerCase();
		var char1h=new Array('<','>','www','&lt;','&gt;','http://','https://','.com','.net','.org','.fr','.in','fuck','asshole','co.uk','madarchod', 'bhenchod', 'gandu', 'chutiya', 'chutyie', 'chut', ' chuth', 'bahenchod', 'randi', 'rascal', 'bastard', 'basturd', 'bastered', 'assole', 'asshole', 'fuck', 'f*u*c*k', ' sucker', 'fucker', 'chodu', 'lavde', 'makichut', 'makachut', 'mchod', ' m chod', 'm.chod', 'rand', 'raandi', 'raand', 'raandii', ' randii', ' laude', 'b.a.s.t.a.r.d.', ' b a s t a r d', ' chuteyas', ' chuteya', ' chut', ' c h u t', ' harame', ' harami', ' madar chod', 'bhen chod', 'benched', ' bhosdivaale', 'fodrichya', ' bosrichya', 'ayzavadya', 'badwa', ' bedwa', 'bedve', 'gaandu', ' gandki', 'gaand', ' chudu', 'chodu');
		for(i=0;i<=char1h.length;++i)
		{
			if(str.indexOf(char1h[i],0)!=-1)
			{
				alert("Word "+char1h[i]+" not allowed");
				$("#n_heading").focus();
				return false;
			}				
		}

		if(new_msg=="")
		{
			alert("please enter the message");
			$("#n_message").focus();  
			return;
		}
		else if(new_msg.length < 20)
		{
			alert ("Please enter the message more then 20 character");
			$("#n_message").focus();  
			return false;
		}
		else if(new_msg.length > 5000)
		{
			alert("Message: max 5000 characters allowed");
			$("#n_message").focus();  
			return false;
		}
		else
		{				
			for(i=0;i<=char1h.length;++i)
			{
				if(new_msg.indexOf(char1h[i],0)!=-1)
				{
				alert("Word "+char1h[i]+" not allowed");
				return false;
				}					
			}
		}

		if(data=="1")
		{
			$.blockUI({ message: "<img src='http://www.in.com/images/ajax-loader.gif'>",css: {width:'400px'}});
			call_fun="1";
			closesignin();
			check_login('1');
			return false;
		}
		else
		{		
			var login_det=data.split("|~");
			var status=login_det[0];
			var userid=login_det[1];
			var uname=login_det[2];
			
			if(status=='success')
			{				
				closesignin();
				document.enter_newmsg.r_userid.value=userid;			
				document.enter_newmsg.submit();
			}
			else
			{			
				call_fun="1";				
				closesignin();
				callout('1');
				return false;
			}
		}		
	}


 function update_reply_msg(msgid,dvid,data)
	{		
		var reply_msg=$('#f_message_'+dvid).val();
		if(reply_msg=="" || reply_msg=='Comment')
		{
			alert("please enter the message");
			$("#f_message_"+dvid).focus();  
			return;
		}
		else if(reply_msg.length < 20)
		{
			alert ("Please enter the message more then 20 character");
			$("#f_message_"+dvid).focus();  
			return false;
		}
		else if(reply_msg.length > 5000)
		{
			alert("max 5000 characters allowed");
			$("#f_message_"+dvid).focus();  
			return false;
		}
		else
		{
			var char1h=new Array('<','>','www','&lt;','&gt;','http://','.com','.net','.org','.fr','.in','fuck','asshole','co.uk');
			
			for(i=0;i<=char1h.length;++i)
			{
				if(reply_msg.indexOf(char1h[i],0)!=-1)
				{
				alert("Word "+char1h[i]+" not allowed");
				return false;
				}					
			}
		}
			
		if(data=="1")
		{
			$.blockUI({ message: "<img src='http://www.in.com/images/ajax-loader.gif'>",css: {width:'400px'}});
			call_fun="2";
			call_param=msgid;
			open_div=dvid;
			check_login('2');
		}
		else
		{		
			var login_det=data.split("|~");
			var status=login_det[0];
			var userid=login_det[1];
			var uname=login_det[2];
			
			if(status=='success')
			{			
				closeme(open_div);
				closesignin();			
				document.replyfrm.r_rply_id.value=msgid;
				document.replyfrm.r_userid.value=userid;
				document.replyfrm.r_message.value=reply_msg;
				
				document.replyfrm.submit();
			}
			else
			{			
				call_fun="2";
				call_param=msgid;
				closesignin();
				callout('2');
			}
		}		
	}

function valid_poll(data)
{	
	var ur_quest = document.getElementById('ur_quest');
	var qString = "&quest="+ur_quest.value;

//		var num_ans = 3;
	var num_ans = document.getElementById('theValue').value;
	if(ur_quest.value =="")
	{
		alert("Please input your question");
		ur_quest.focus();
		return false;
	}else if(ur_quest.value.length > 250)
	{
		alert("Please enter the question less than 250 characters");
		ur_quest.focus();
		return false;
	}	
	else
	{
		for(var i=1;i<=2;i++)
		{	
			var elem = document.getElementById('txt_ans_'+i);			
			qString += "&opt_"+i+"="+elem.value;
			if(elem.value =="")
			{
				alert("Please input your answers");
				document.getElementById('txt_ans_'+i).focus();
				return false;
			}else if(elem.value.length >100)
			{
				alert("Please enter the option less than 100 characters");
				elem.focus();
				return false;
			}
		}//for
	}

	for(var i=3;i<=num_ans;i++)
	{
		var elem = document.getElementById('txt_ans_'+i);
		//alert(i+">>"+elem.value);
		qString += "&opt_"+i+"="+elem.value;		
	}
	
	if(data=="1")
	{
		$.blockUI({ message: "<img src='http://www.in.com/images/ajax-loader.gif'>",css: {width:'400px'}});
		call_fun="5";
		call_param = qString;
		check_login('0');
	}
	else
	{	//alert('inside2');
		var login_det=data.split("|~");
		var status=login_det[0];
		var userid=login_det[1];
		var uname=login_det[2];		
		if(status=='success')
		{	
			document.frm_post_poll.quest.value = call_param;
			document.frm_post_poll.uid.value = userid;
			document.frm_post_poll.submit();			
		}
		else
		{			
			call_fun="5";
			closesignin();
			callout('0');
		}
	}
		
}

function repy_open_ajax(dvid,tot,msgid) {	
    for(i=1;i<=tot;i++) {
		document.getElementById("rate_msg_"+i).style.display = "none";
	}
	for(i=1;i<=tot;i++) {
		document.getElementById("offens_msg_"+i).style.display = "none";
	}	

	document.getElementById("rep_msg_"+dvid).innerHTML='<div class="repCont">						<div class="MT5 FL"><img src="http://im.in.com/messagecentral/images/replyTab.gif" width="53" height="25" alt="Reply" /></div>						<a href="javascript:void(0);" onClick="closeme('+dvid+');" class="bl_10 FR MR25 MT15" style="cursor: hand;">x Close</a>						<textarea class="PA5 gL_12 FL" style="width: 550px; border-top: 3px #aec0cc solid; border-bottom: 1px #aec0cc solid; border-left: 1px #aec0cc solid; border-right: 1px #aec0cc solid;" name="f_message_'+dvid+'" id="f_message_'+dvid+'" onclick=\'javascript:if(this.value=="Comment"){this.value=""}\' rows="4" cols="" name="">Comment</textarea>					</div>					<div class="CL"></div>					<div class="MT5"><a href="javascript:void(0);" onclick="update_reply_msg('+msgid+','+dvid+',1);"/><img src="http://im.in.com/connect/images/submitBtn2.gif" width="54" height="17" border="0"></a></div>';
	
	open_div=dvid;	
	document.getElementById("rep_msg_"+dvid).style.display = "block";
	//document.getElementById("thank_msg_"+dvid).style.display = "none";
}

function rate_open_ajax(dvid,tot,msgid) {	
	for(i=1;i<=tot;i++) {
		document.getElementById("rep_msg_"+i).style.display = "none";
	 }
	 for(i=1;i<=tot;i++) {
		document.getElementById("offens_msg_"+i).style.display = "none";
	 }
	 for(i=1;i<=tot;i++) {
		document.getElementById("rate_msg_"+i).style.display = "none";
	 }
	 document.getElementById("rate_msg_"+dvid).innerHTML='<div class="comn_Box"><span class="gD_12 FL MR10"><strong>Rate this Comment</strong></span><p class="FL PB7"><a href="javascript:void(0);" onclick="update_rate('+msgid+',1,1);" class="star_b_btn FL"></a><a href="javascript:void(0);" onclick="update_rate('+msgid+',2,1);" class="star_b_btn FL"></a><a href="javascript:void(0);" onclick="update_rate('+msgid+',3,1);" class="star_b_btn FL"></a><a href="javascript:void(0);" onclick="update_rate('+msgid+',4,1);" class="star_b_btn FL"></a><a href="javascript:void(0);" onclick="update_rate('+msgid+',5,1);" class="star_b_btn FL"></a></p></div>';

	 open_div=dvid;
	 document.getElementById("rate_msg_"+dvid).style.display = "block";
	
}



function offens_open_ajax(dvid,tot,msgid) {

	for(i=1;i<=tot;i++) {
		document.getElementById("rep_msg_"+i).style.display = "none";
	}
	for(i=1;i<=tot;i++) {
		document.getElementById("rate_msg_"+i).style.display = "none";
	}
	for(i=1;i<=tot;i++) {
		document.getElementById("offens_msg_"+i).style.display = "none";
	}

	document.getElementById("offens_msg_"+dvid).innerHTML='<div class="offPointer"></div><div class="offCont"><ul>	<li><input type="radio" name="ofc_reason" value="1"/><label class="gD_11 PL5">Personal attacks - name calling, insulting, etc - on other boarders</label></li><li><input type="radio" name="ofc_reason" value="2"/><label class="gD_11 PL5">Insensitive references to any race, sex, religion, caste or linguistic community</label></li><li><input type="radio" name="ofc_reason" value="3"/><label class="gD_11 PL5">Statements that are deliberately made to evoke outrage</label></li><li><input type="radio" name="ofc_reason" value="4"/><label class="gD_11 PL5">Verbal violence or threats</label></li><li><input type="radio" name="ofc_reason" value="5" checked/><label class="gD_11 PL5">Offensive or abusive language</label></li><li><input type="radio" name="ofc_reason" value="6"/><label class="gD_11 PL5">Blatant and mischievous misrepresentation of facts</label></li><li><input type="radio" name="ofc_reason" value="7"/><label class="gD_11 PL5">Spamming - obsessive repetitiveness</label></li><li><input type="radio" name="ofc_reason" value="8"/><label class="gD_11 PL5">Message with commercial or promotional content</label></li><li><input type="radio" name="ofc_reason" value="9"/><label class="gD_11 PL5">Malafide insinuations related to the integrity, probity and judgment of the In.com Team</label></li></ul><div class="MT5 FL"><div class="btn3"><span></span><a href="javascript:void(0);" onclick="update_offence('+msgid+',1);" class="bl_11" style="cursor: hand">Submit</a></div></div><p class="FL PA10 MT3"> <a href="javascript:void(0);" onclick="closeme('+dvid+');" class="bl_11" style="cursor: hand">Cancel</a></p><div class="CL"></div></div>';

	open_div=dvid;
	document.getElementById("offens_msg_"+dvid).style.display = "block";
	//document.getElementById("thank_msg_"+dvid).style.display = "none";
	  
}

  function closeme(dvid)
	{	  
		 document.getElementById("rate_msg_"+dvid).style.display = "none";
		 document.getElementById("rep_msg_"+dvid).style.display = "none";
		 document.getElementById("offens_msg_"+dvid).style.display = "none";
		 //document.getElementById("thank_msg_"+dvid).style.display = "none";
	}

function add_row()
{	
	var ni = document.getElementById('ur_answ');
	var numi = document.getElementById('theValue');
	//alert(numi.value);
	if(numi.value <5)
	{
		var num = (document.getElementById("theValue").value -1)+ 2;
		numi.value = num;
		var divIdName = "ans_"+num;
		var txtfldName = "txt_ans_"+num;
		//alert(numi.value);
		var newdiv = document.createElement('div');
	
		newdiv.setAttribute("id",divIdName);
		newdiv.innerHTML = "<div class='MB10' id='"+divIdName+"'><span class='answer_btn FL MR5 MT5'></span><input type='text' class='comm_txtbox FL' id='"+txtfldName+"' name='"+txtfldName+"'/><div class='CL'></div></div>";
	
		ni.appendChild(newdiv);
	}else alert("5 done!");
	
}

function close_only_me()
{
	document.getElementById("rep_msg_"+dvid).style.display = "none";
}
