/////////////////////////////////////////////////news comment/////////////////////////////////////////////

var xmlHttp_new_com;

function post_comment1()

{
if(document.f3.post_comm.value=="")
{

	alert("<?php echo b_Insert_Your; ?>");

}else
{
var id1=document.f3.contestId.value;
var comm1=document.f3.post_comm.value;
var page_n=document.f3.paggnname.value;
document.getElementById('cancel').style.display='none';
xmlHttp_new_com=GetXmlHttpObject();
if (xmlHttp_new_com==null)
  {
  alert ("<?php echo b_Your_browser_does; ?>");
  return;
  } 
var url="post_comment.php";
url=url+"?id1="+id1+"&msg1="+comm1+"&page_n="+page_n;
xmlHttp_new_com.onreadystatechange=comment_com_stateChanged;
xmlHttp_new_com.open("GET",url,true);
xmlHttp_new_com.send(null);
}
}
function comment_com_stateChanged() 
{ 
if (xmlHttp_new_com.readyState==4)
{ 
document.f3.post_comm.value='';
var test_new_com=xmlHttp_new_com.responseText;
document.getElementById("show_com").innerHTML=test_new_com;
}
}
///////////////////////////////////////////////end////////////////news_reply////////////////////////////////////////////////////////
var xmlHttp_rep;
function reply_comm(numblock,formname,divid,textid,a,b,c)
{
if(numblock==1)
{
alert("<?php echo a_You_are;?>");
	document.getElementById(divid).style.display='none';
    document.getElementById(textid).value='';
}else
{
document.getElementById(divid).style.display='';
xmlHttp_rep=GetXmlHttpObject();
if (xmlHttp_rep==null)
  {
  alert ("<?php echo b_Your_browser_does; ?>");
  return;
  } 
var url="post_comment.php";
url=url+"?a="+a+"&b="+b+"&c="+c+"&page_n=news_comment_reply.php?newsId=";
xmlHttp_rep.onreadystatechange=comment_rep_stateChanged;
xmlHttp_rep.open("GET",url,true);
xmlHttp_rep.send(null);
}
}
function comment_rep_stateChanged() 
{ 
if (xmlHttp_rep.readyState==4)

{ 

var test_rep=xmlHttp_rep.responseText;
document.getElementById("show_com").innerHTML=test_rep;

}
}

/////////////////////////////////////end/////////////////////photo comment//////////////////////////////////////////////////

var xmlHttp_photo;
function post_photo_comment()
{
	var id1=document.f3.contestId.value;
	var comm1=document.f3.post_comm.value;
	var coid=parseInt(document.f3.num_chk_comnt.value);
	var user_id_u=document.f3.photo_userId.value;
	var page_n=document.f3.paggnname.value;
	
		if(comm1=='')
			{
				alert("Por favor digite Comentário");
				return;
			}
		if(user_id_u==1)
			{
				alert("Essa é sua própria foto!");
				document.f3.post_comm.value='';
				return;
			}
	if(coid>0)
	{
		alert("<?php echo b_you_are_blocked; ?>");
		document.f3.post_comm.value='';
	}else
	{
	xmlHttp_photo=GetXmlHttpObject();
	if (xmlHttp_photo==null)
	  {
	 alert ("<?php echo b_Your_browser_does; ?>");
	 return;
	  } 
	var url="show_comment_photo.php";
	url=url+"?id1="+id1+"&msg1="+comm1+"&page_n="+page_n;
	xmlHttp_photo.onreadystatechange=comment_photo_stateChanged;
	xmlHttp_photo.open("GET",url,true);
	xmlHttp_photo.send(null);
}
}
function comment_photo_stateChanged() 
{ 
  if (xmlHttp_photo.readyState==4)
{ 
   document.f3.post_comm.value='';
   var test_photo_com =xmlHttp_photo.responseText;
   var text_array=test_photo_com.split("alada123");
  
   document.getElementById('fcomment').innerHTML=text_array[1];
}
}
///////////////////////////////////////////////////////end//////////////////////////////////////////////////////////
var xmlHttp_rep_comm;
function insert_comm_reply(divid1)
{
var user_id_="user_id_pro"+divid1;







var scrapmsg_="text_area"+divid1;







var id=document.getElementById(user_id_).value;







var comm=document.getElementById("text_area"+divid1).value;







document.getElementById(scrapmsg_).style.display='none';







xmlHttp_rep_comm=GetXmlHttpObject();







if (xmlHttp_rep_comm==null)







  {







  alert ("<?php echo b_Your_browser_does; ?>");







  return;







  } 







var url="show_comment_photo.php";







url=url+"?id="+id+"&comm="+comm;







xmlHttp_rep_comm.onreadystatechange=comment_photo_rep_stateChanged;







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







xmlHttp_rep_comm.send(null);







}







function comment_photo_rep_stateChanged() 







{ 







if (xmlHttp_rep_comm.readyState==4)



{ 

if(xmlHttp_rep_comm.status == 200)

{





document.f3.post_comm.value='';







var test_photo_comm=xmlHttp_rep_comm.responseText;







document.getElementById("fcomment").innerHTML=test_photo_comm;



}



}







}







//////////////////////////////////////////////////////////scrap//////////////////////////////////////////////////







var xmlHttp_scrap;







function post_scrap12()



{



var u=document.getElementById('suid').value;



if(u==1)



{



//document.getElementById('cancel').style.display='none';



alert("<?php echo b_You_can_not_post; ?>");

document.f3.post_scrap.value="";

return;



}







var id1=document.f3.userid.value;







var comm1=document.f3.post_scrap.value;







xmlHttp_scrap=GetXmlHttpObject();







if (xmlHttp_scrap==null)







  {



  alert ("<?php echo b_Your_browser_does; ?>");







  return;







  } 







var url="show_post_scrap.php";







url=url+"?id1="+id1+"&msg1="+comm1;







xmlHttp_scrap.onreadystatechange=comment_test_post_scrap_stateChanged;







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







xmlHttp_scrap.send(null);







}







function comment_test_post_scrap_stateChanged() 







{ 







if (xmlHttp_scrap.readyState==4)







{ 







document.f3.post_scrap.value='';







var test_post_scrap=xmlHttp_scrap.responseText;







document.getElementById("fcomment_scrap").innerHTML=test_post_scrap;







}







}







///////////////////////////////////////////////////////end//////////////////////////////////////////////////////////







function GetXmlHttpObject()

{

var xmlHttp=null;

try

  {

  xmlHttp=new XMLHttpRequest();

  }

catch (e)

 {

  try

    {

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

    }

  catch (e)

    {

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

   }

 }

return xmlHttp;

}











