function searchinput(str){
	var txtfind = "Thanks";
   if (str.search(txtfind) != -1)
       var midstring = true;
   else
       var midstring = false;
   return midstring;
}

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}
function MM_openBrWindow(theURL,winName,features) 
{ 
	//v2.0
	window.open(theURL,winName,features);
}


/*var lastdiv='';
var frmdataabuse="<div class='feedbackfrm'><div class='left_div'> </div>  <div class='discus_panel_head'><h3>Report Abuse</h3></div>  <div class='discus_panel'>	<div id='comment_result_abuse'></div>      <FORM ACTION='' METHOD='post' NAME='frmcommentabuse' CLASS='font' ID='frmcommentabuse' onSubmit='return updateAbuse();'>	<INPUT TYPE='hidden' NAME='commentid' VALUE='' /><INPUT TYPE='hidden' NAME='storyid' VALUE='####STORYID####' />	<table width='65%' border='0' align='center' cellpadding='3' cellspacing='0' style='font-size:11px;'>        <tr>                    <td width='45%' rowspan='3'><div id='divmessageabuse'>Message</div>            <TEXTAREA NAME='comment' ROWS='3' cols='30' ID='textarea' class='textarea'></TEXTAREA>              <span style='color:#f00;'></span></td>        </tr>        <tr>          <td width='45%' rowspan='3'>	<!-- <input name='image' type='image' src='http://static.expressindia.com/ie/story/images/buton_submit.gif' /> --><input type=submit name='Submit' value='Submit'></td>	</tr>      </table>           <div align='center'>      </div>    </FORM>  </div></div><BR><BR>";

var frmdata="<div class='feedbackfrm'><div class='left_div'> </div>  <div class='discus_panel_head'><h3>Write a Message</h3></div>  <div class='discus_panel'>	<div id='comment_result'></div>      <FORM ACTION='' METHOD='post' NAME='frmcomment' CLASS='font' ID='frmcomment' onSubmit='return insertCommet(####STORYID####);'><input type=hidden name=parent><INPUT TYPE='hidden' NAME='typ' VALUE='commentSubmit' />	<INPUT TYPE='hidden' NAME='storyId' VALUE='####STORYID####' />	<table width='96%' border='0' align='center' cellpadding='3' cellspacing='0' style='font-size:11px;'>        <tr>          <td width='19%' valign=top><div id='divname'>Name</div></td>          <td width='36%'><input name='name' type='text' class='textfild' id='name' />              <span style='color:#f00;'>*</span></td>          <td width='45%' rowspan='3' valign=top><div id='divmessage'>Message</div>            <TEXTAREA NAME='comment' ROWS='3' cols='20' ID='textarea' class='textarea'></TEXTAREA>              <span style='color:#f00;'>*</span></td>        </tr>        <tr>          <td valign=top><div id='divemail'>Email ID</div></td>          <td><INPUT NAME='email' TYPE='text' CLASS='input' ID='email' />              <span style='color:#f00; font'>*</span></td>        </tr>        <tr>          <td valign=top><div id='divsubject'>Subject</div></td>          <td><INPUT NAME='subject' TYPE='text' CLASS='input' ID='subject' />              <span style='color:#f00; '>*</span></td>        </tr>      <!--   <tr>          <td>Country</td>          <td><input name='textfield4' type='text' class='textfild' />              <span style='color:#f00;'>*</span></td>          <td align='right'>Maximum characters allowed <span style='margin-right:10px;'>&nbsp; 1200 &nbsp;&nbsp;</span></td>        </tr> -->      </table>      <table width='100%' border='0' cellspacing='0' cellpadding='0'>        <tr>          <td colspan='2' class='terms'>TERMS OF USE:<br />            The views represented here are not neccesarily endorsed by www.expressindia.com and its allied websites. All messages will be moderated and no message that has inflammatory, abusive, derogatory language or any language deemed unfit for publication by the editor will be displayed. Though it will be endeavoured that as many messages as possible be displayed, there will be time lag between the submission and publication of the messages. The website reserves the right to publish or reject any message. </td>        </tr>        <tr>          <td width='5%' align='right'><label>            <input type='checkbox' name='checkbox' value='checkbox' />          </label></td>          <td width='95%' class='terms'>I agree to the terms of use. </td>        </tr>      </table>      <div align='center'>     <input type=submit name='Submit' value='Submit'>   <!-- <input name='image' type='image' src='http://static.expressindia.com/ie/story/images/buton_submit.gif' />        <input name='image' type='image' style='margin-left:10px;' src='http://static.expressindia.com/ie/story/images/but_reset.gif' /> -->      </div>    </FORM>  </div></div><BR><BR>";
var frmdataforward="<div class='feedbackfrm'><div class='left_div'></div>  <div class='discus_panel_head'><h3>Forward To Friend</h3></div>  <div class='discus_panel'>	<div id='comment_result_forward'></div>      <FORM ACTION='' METHOD='post' NAME='frmcommentforward' CLASS='font' ID='frmcommentforward' onSubmit='return forwardLink();'>	<INPUT TYPE='hidden' NAME='link' VALUE='####FORWARDLINK####'/>	<table width='96%' border='0' align='center' cellpadding='3' cellspacing='0' style='font-size:11px;'>        <tr>          <td width='19%' valign='top'><div id='divmynameforward'>Your Name</div></td>          <td width='36%'><input name='myname' type='text' class='textfild' id='myname' />              <span style='color:#f00;'>*</span>	  </td>        </tr>        <tr>          <td valign='top'><div id='divmyemailforward'>Your Email ID</div></td>          <td><INPUT NAME='myemail' TYPE='text' CLASS='input' ID='myemail' />              <span style='color:#f00; font'>*</span></td>        </tr>        <tr>          <td valign='top'><div id='divfriendsemailforward'>Friend's Email ID</div></td>          <td><INPUT NAME='friendsemail' TYPE='text' CLASS='input' ID='friendsemail' />              <span style='color:#f00; font'>*</span></td>        </tr>          </table>      <div align='center'>   <input type=submit name='Submit' value='Submit'>     <!-- <input name='image' type='image' src='http://static.expressindia.com/ie/story/images/buton_submit.gif' /> -->        <input name='image' type='image' style='margin-left:10px;' src='http://static.expressindia.com/ie/story/images/but_reset.gif' />      </div>    </FORM>  </div></div><BR><BR>";*/
// Following function show and hide the form for reporting abuse in a comment.

//var resources='http://172.16.24.10/~dhiraj/newstory/resources/'
var resources='http://www.indianexpress.com/newstory/resources/'
function forward(divid)
{
	if(lastdiv=="")
	{
		document.getElementById(divid).innerHTML=frmdataforward;
		document.getElementById(divid).style.display='block';
		lastdiv=divid;
	}
	else
	{
		document.getElementById(lastdiv).innerHTML='';
		document.getElementById(lastdiv).style.display='none';
		document.getElementById(divid).innerHTML=frmdataforward;
		document.getElementById(divid).style.display='block';
		lastdiv=divid;
	}
}



function abuse(divid,commentid)
{
	if(lastdiv=="")
	{

		document.getElementById(divid).innerHTML=frmdataabuse;
		document.getElementById(divid).style.display='block';
		document.frmcommentabuse.commentid.value=commentid;
		lastdiv=divid;
	}
	else
	{
		document.getElementById(lastdiv).innerHTML='';
		document.getElementById(lastdiv).style.display='none';
		document.getElementById(divid).innerHTML=frmdataabuse;
		document.getElementById(divid).style.display='block';
		document.frmcommentabuse.commentid.value=commentid;
		lastdiv=divid;
	}
}


// Following function show and hide submit comment form.

function con(divid,parent)
{
	if(lastdiv=="")
	{

		document.getElementById(divid).innerHTML=frmdata;
		document.getElementById(divid).style.display='block';
		document.frmcomment.parent.value=parent;
		lastdiv=divid;
	}
	else
	{
		document.getElementById(lastdiv).innerHTML='';
		document.getElementById(lastdiv).style.display='none';
		document.getElementById(divid).innerHTML=frmdata;
		document.getElementById(divid).style.display='block';
		document.frmcomment.parent.value=parent;
		lastdiv=divid;
	}
}

var flag;
var imgpath='http://172.16.24.10/~dhiraj/frontend/www/static/fe/images';
function selectStarts(num)
{
flag=1;	

	if(num==1)
	{
		document.image1.src=imgpath+'/star_over.gif';
		document.image2.src=imgpath+'/star.gif';
		document.image3.src=imgpath+'/star.gif';
		document.image4.src=imgpath+'/star.gif';
		document.image5.src=imgpath+'/star.gif';
		document.image6.src=imgpath+'/star.gif';
		document.image7.src=imgpath+'/star.gif';
		document.image8.src=imgpath+'/star.gif';
		document.image9.src=imgpath+'/star.gif';
		document.image10.src=imgpath+'/star.gif';
	}
	if(num==2)
	{
		document.image1.src=imgpath+'/star_over.gif';
		document.image2.src=imgpath+'/star_over.gif';
		document.image3.src=imgpath+'/star.gif';
		document.image4.src=imgpath+'/star.gif';
		document.image5.src=imgpath+'/star.gif';
		document.image6.src=imgpath+'/star.gif';
		document.image7.src=imgpath+'/star.gif';
		document.image8.src=imgpath+'/star.gif';
		document.image9.src=imgpath+'/star.gif';
		document.image10.src=imgpath+'/star.gif';

	}
	if(num==3)
	{
		document.image1.src=imgpath+'/star_over.gif';
		document.image2.src=imgpath+'/star_over.gif';
		document.image3.src=imgpath+'/star_over.gif';
		document.image4.src=imgpath+'/star.gif';
		document.image5.src=imgpath+'/star.gif';
		document.image6.src=imgpath+'/star.gif';;
		document.image7.src=imgpath+'/star.gif';
		document.image8.src=imgpath+'/star.gif';
		document.image9.src=imgpath+'/star.gif';
		document.image10.src=imgpath+'/star.gif';

	}
	if(num==4)
	{
		document.image1.src=imgpath+'/star_over.gif';
		document.image2.src=imgpath+'/star_over.gif';
		document.image3.src=imgpath+'/star_over.gif';
		document.image4.src=imgpath+'/star_over.gif';
		document.image5.src=imgpath+'/star.gif';
		document.image6.src=imgpath+'/star.gif';
		document.image7.src=imgpath+'/star.gif';
		document.image8.src=imgpath+'/star.gif';
		document.image9.src=imgpath+'/star.gif';
		document.image10.src=imgpath+'/star.gif';

	}
	if(num==5)
	{
		document.image1.src=imgpath+'/star_over.gif';
		document.image2.src=imgpath+'/star_over.gif';
		document.image3.src=imgpath+'/star_over.gif';
		document.image4.src=imgpath+'/star_over.gif';
		document.image5.src=imgpath+'/star_over.gif';
		document.image6.src=imgpath+'/star.gif';
		document.image7.src=imgpath+'/star.gif';
		document.image8.src=imgpath+'/star.gif';
		document.image9.src=imgpath+'/star.gif';
		document.image10.src=imgpath+'/star.gif';

	}
	if(num==6)
	{
		document.image1.src=imgpath+'/star_over.gif';
		document.image2.src=imgpath+'/star_over.gif';
		document.image3.src=imgpath+'/star_over.gif';
		document.image4.src=imgpath+'/star_over.gif';
		document.image5.src=imgpath+'/star_over.gif';
		document.image6.src=imgpath+'/star_over.gif';
		document.image7.src=imgpath+'/star.gif';
		document.image8.src=imgpath+'/star.gif';
		document.image9.src=imgpath+'/star.gif';
		document.image10.src=imgpath+'/star.gif';
	}
	if(num==7)
	{
		document.image1.src=imgpath+'/star_over.gif';
		document.image2.src=imgpath+'/star_over.gif';
		document.image3.src=imgpath+'/star_over.gif';
		document.image4.src=imgpath+'/star_over.gif';
		document.image5.src=imgpath+'/star_over.gif';
		document.image6.src=imgpath+'/star_over.gif';
		document.image7.src=imgpath+'/star_over.gif';
		document.image8.src=imgpath+'/star.gif';
		document.image9.src=imgpath+'/star.gif';
		document.image10.src=imgpath+'/star.gif';

	}
	if(num==8)
	{
		document.image1.src=imgpath+'/star_over.gif';
		document.image2.src=imgpath+'/star_over.gif';
		document.image3.src=imgpath+'/star_over.gif';
		document.image4.src=imgpath+'/star_over.gif';
		document.image5.src=imgpath+'/star_over.gif';
		document.image6.src=imgpath+'/star_over.gif';
		document.image7.src=imgpath+'/star_over.gif';
		document.image8.src=imgpath+'/star_over.gif';
		document.image9.src=imgpath+'/star.gif';
		document.image10.src=imgpath+'/star.gif';

	}
	if(num==9)
	{
		document.image1.src=imgpath+'/star_over.gif';
		document.image2.src=imgpath+'/star_over.gif';
		document.image3.src=imgpath+'/star_over.gif';
		document.image4.src=imgpath+'/star_over.gif';
		document.image5.src=imgpath+'/star_over.gif';
		document.image6.src=imgpath+'/star_over.gif';
		document.image7.src=imgpath+'/star_over.gif';
		document.image8.src=imgpath+'/star_over.gif';
		document.image9.src=imgpath+'/star_over.gif';
		document.image10.src=imgpath+'/star.gif';

	}
	if(num==10)
	{
		document.image1.src=imgpath+'/star_over.gif';
		document.image2.src=imgpath+'/star_over.gif';
		document.image3.src=imgpath+'/star_over.gif';
		document.image4.src=imgpath+'/star_over.gif';
		document.image5.src=imgpath+'/star_over.gif';
		document.image6.src=imgpath+'/star_over.gif';
		document.image7.src=imgpath+'/star_over.gif';
		document.image8.src=imgpath+'/star_over.gif';
		document.image9.src=imgpath+'/star_over.gif';
		document.image10.src=imgpath+'/star_over.gif';
	}

}

function Mout()
{
		document.image1.src=imgpath+'/star.gif';
		document.image2.src=imgpath+'/star.gif';
		document.image3.src=imgpath+'/star.gif';
		document.image4.src=imgpath+'/star.gif';
		document.image5.src=imgpath+'/star.gif';
		document.image6.src=imgpath+'/star.gif';
		document.image7.src=imgpath+'/star.gif';
		document.image8.src=imgpath+'/star.gif';
		document.image9.src=imgpath+'/star.gif';
		document.image10.src=imgpath+'/star.gif';
}

function setCookie123(val)
{
	if(getCookie("ratingdone-"+val))
	{
		alert('Rating already done.');
		return false;
	}
	else
	{
		document.cookie="ratingdone-"+val+"=yes";
		return true;
	}
}


function setVal(strURL,content_id)
{
	//alert("Nitin");
	var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
	if(setCookie123(content_id) == false)
	{
		return;
	}
    if (window.XMLHttpRequest) 
	{
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) 
	{
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('GET', '/storyresources.php?flag=Rating&rating='+strURL+'&content_id='+content_id+'&website=festorypage', true);

	self.xmlHttpReq.onreadystatechange = function()
	{
        if (self.xmlHttpReq.readyState == 4)
		{    	
			//alert(self.xmlHttpReq.responseText);
			updatepage(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(null);
}


function updatepage(str)
{
 document.getElementById("result").innerHTML = str;
}


function getCookie(name) 
{
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) {
	return null;
	}
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}
	
		
		if(str.indexOf(dot) == str.length -1){
			return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true					
}

function insertCommetMain(content_id)
{
    var xmlHttpReq1 = false;
    var self = this;
    var name=document.frmcommentmain.name.value
    var email=document.frmcommentmain.email.value
    var comment=document.frmcommentmain.comment.value
    var subject=document.frmcommentmain.subject.value
	var formObj = document.replycomment;
	var flag=true;
    var done=false;

    if(name=="")
    {
	document.getElementById("divnamemain").innerHTML = "<font face=verdana size=2 color=red>Name</font>";
	flag=false;
    }
    else
    {
    	document.getElementById("divnamemain").innerHTML = "Name";
    }


   if((email=="")||(echeck(email)==false))
    {
	document.getElementById("divemailmain").innerHTML = "<font face=verdana size=2 color=red>Email</font>";	
	flag=false;
    }
    else
    {
	document.getElementById("divemailmain").innerHTML = "Email";	
    }

    if(subject=="")
    {
	document.getElementById("divsubjectmain").innerHTML = "<font face=verdana size=2 color=red>Subject</font>";	
	flag=false;
    }
    else
    {
    	document.getElementById("divsubjectmain").innerHTML = "Subject";	
    }

    if(comment=="")
    {
	document.getElementById("divmessagemain").innerHTML = "<font face=verdana size=2 color=red>Message</font>";	
	flag=false;
    }
    else
    {
	document.getElementById("divmessagemain").innerHTML = "Message";	
    }

   if(!document.frmcommentmain.checkbox.checked)
   {
	 document.getElementById("comment_result_main").innerHTML = "<center><font face=verdana size=2 color=red>Please accept the terms of use.</font></center>";	
	 flag=false;
	 done=true;
   }

if(flag==true)
{
    if (window.XMLHttpRequest) 
    {
        self.xmlHttpReq1 = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) 
    {
        self.xmlHttpReq1 = new ActiveXObject("Microsoft.XMLHTTP");
    }

	self.xmlHttpReq1.open('GET', '/storyresources.php?flag=SubmitComment&name='+name+'&content_id='+content_id+'&email='+email+'&subject='+subject+'&comment='+escape(comment)+'&typ=commentSubmit&parent=0', true);

	self.xmlHttpReq1.onreadystatechange = function()
	{
        if (self.xmlHttpReq1.readyState == 4)
		{    	
			
            updateCommentResultMain(self.xmlHttpReq1.responseText);
        }
		else
		{
			document.frmcommentmain.submit.disabled = true;	
		   document.getElementById("comment_result_main").innerHTML = "<center><font face=verdana size=2 color=red>Submitting...</font></center>";	
		}
    }
    self.xmlHttpReq1.send(null);

}
else
{
	if(!done)
	{
	  document.getElementById("comment_result_main").innerHTML = "<center><font face=verdana size=2 color=red>Please fill the fields indicated in the red color.</font></center>";	
	}
}
return false;
}

function updateCommentResultMain(str)
{
	
 document.getElementById("comment_result_main").innerHTML = "<center><font face=verdana size=2 color=red>"+str+"</font></center>";
 	var txtfind = searchinput(str);
	if(txtfind == true){
		window.location = location.href;
	}
}

<!-- -------------------------------------------------------------------------------------------------- -->


function insertCommet(content_id)
{

    var xmlHttpReq1 = false;
    var self = this;
    var name=document.frmcomment.name.value
    var email=document.frmcomment.email.value
    var comment=document.frmcomment.comment.value
    var subject=document.frmcomment.subject.value
    var parent=document.frmcomment.parent.value
    var flag=true;
  var done=false;
	if(name=="")
    {
	document.getElementById("divname").innerHTML = "<font face=verdana size=2 color=red>Name</font>";
	flag=false;
    }
    else
    {
    	document.getElementById("divname").innerHTML = "Name";
    }

   if((email=="")||(echeck(email)==false))
    {
	document.getElementById("divemail").innerHTML = "<font face=verdana size=2 color=red>Email</font>";	
	flag=false;
    }
    else
    {
	document.getElementById("divemail").innerHTML = "Email";	
    }

    if(subject=="")
    {
	document.getElementById("divsubject").innerHTML = "<font face=verdana size=2 color=red>Subject</font>";	
	flag=false;
    }
    else
    {
    	document.getElementById("divsubject").innerHTML = "Subject";	
    }

    if(comment=="")
    {
	document.getElementById("divmessage").innerHTML = "<font face=verdana size=2 color=red>Message</font>";	
	flag=false;
    }
    else
    {
	document.getElementById("divmessage").innerHTML = "Message";	
    }
   
   if(!document.frmcomment.checkbox.checked)
   {
	 document.getElementById("comment_result").innerHTML = "<center><font face=verdana size=2 color=red>Please accept the terms of use.</font></center>";	
	 flag=false;
	 done=true;
   }


if(flag==true)
{
    if (window.XMLHttpRequest) 
    {
        self.xmlHttpReq1 = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) 
    {
        self.xmlHttpReq1 = new ActiveXObject("Microsoft.XMLHTTP");
    }
	self.xmlHttpReq1.open('GET', '/storyresources.php?flag=SubmitComment&name='+name+'&content_id='+content_id+'&parent='+parent+'&email='+email+'&subject='+subject+'&comment='+escape(comment)+'&typ=commentSubmit', true);
	self.xmlHttpReq1.onreadystatechange = function()
	{
        if (self.xmlHttpReq1.readyState == 4)
	{    	
            updateCommentResult(self.xmlHttpReq1.responseText);
			
        }
	else
	{
	   document.frmcomment.submit.disabled = true;	
	   document.getElementById("comment_result").innerHTML = "<center><font face=verdana size=2 color=red>Submitting...</font></center>";	
	}
    }
    self.xmlHttpReq1.send(null);

}
	else
	{
		if(!done)
		{
		  document.getElementById("comment_result").innerHTML = "<center><font face=verdana size=2 color=red>Please fill the fields indicated in the red color.</font></center>";	
		}
	}
return false;
}



function updateCommentResult(str)
{
 document.getElementById("comment_result").innerHTML = "<center><font face=verdana size=2 color=red>"+str+"</font></center>";
 var txtfind = searchinput(str);
	if(txtfind == true){
		window.location = location.href;
	}

}



function updateAbuse()
{
    var xmlHttpReq1 = false;
    var self = this;
    var comment=document.frmcommentabuse.comment.value
    var commentid=document.frmcommentabuse.commentid.value
    var storyid=document.frmcommentabuse.storyid.value
    var flag=true;
    document.getElementById("divmessageabuse").innerHTML = "Message";	
    if (window.XMLHttpRequest) 
    {
        self.xmlHttpReq1 = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) 
    {
        self.xmlHttpReq1 = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq1.open('GET','/storyresources.php?flag=ProcessAbuse&comment='+escape(comment)+'&commentid='+commentid+'&storyid='+storyid, true);
	self.xmlHttpReq1.onreadystatechange = function()
	{
        if (self.xmlHttpReq1.readyState == 4)
	{    
 	    document.getElementById("comment_result_abuse").innerHTML = "<center><font face=verdana size=2 color=red>"+self.xmlHttpReq1.responseText+"</font></center>";
		window.location = location.href;
        }
	else
	{
	   document.frmcommentabuse.submit.disabled = true;	
	   document.getElementById("comment_result_abuse").innerHTML = "<center><font face=verdana size=2 color=red>Submitting...</font></center>";	
	}
    }
    self.xmlHttpReq1.send(null);
return false;
}



function forwardLink()
{
    var xmlHttpReq1 = false;
    var self = this;
    var myname=document.frmcommentforward.myname.value
    var myemail=document.frmcommentforward.myemail.value
    var friendsemail=document.frmcommentforward.friendsemail.value
    var linkforward=document.frmcommentforward.link.value
    var flag=true;
    
    if(myname=="")
    {
	document.getElementById("divmynameforward").innerHTML = "<font face=verdana size=2 color=red>Your Name</font>";
	flag=false;
    }
    else
    {
    	document.getElementById("divmynameforward").innerHTML = "Your Name";
    }

    if(myemail=="")
    {
	document.getElementById("divmyemailforward").innerHTML = "<font face=verdana size=2 color=red>My Email</font>";	
	flag=false;
    }
    else
    {
	document.getElementById("divmyemailforward").innerHTML = "My Email";	
    }

    if(friendsemail=="")
    {
	document.getElementById("divfriendsemailforward").innerHTML = "<font face=verdana size=2 color=red>Friend's Email</font>";	
	flag=false;
    }
    else
    {
    	document.getElementById("divfriendsemailforward").innerHTML = "Friend's Email";	
    }

if(flag)
{
    if (window.XMLHttpRequest) 
    {
        self.xmlHttpReq1 = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) 
    {
        self.xmlHttpReq1 = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq1.open('GET', '/storyresources.php?flag=LinkForward&myname='+myname+'&friendsemail='+friendsemail+'&myemail='+myemail+'&linkforward='+linkforward, true);
	self.xmlHttpReq1.onreadystatechange = function()
	{
        if (self.xmlHttpReq1.readyState == 4)
	{    	
            document.getElementById("comment_result_forward").innerHTML = "<center><font face=verdana size=2 color=red>"+self.xmlHttpReq1.responseText+"</font></center>";
        }
	else
	{
	   document.getElementById("comment_result_forward").innerHTML = "<center><font face=verdana size=2 color=red>Submitting...</font></center>";	
	}
    }
    self.xmlHttpReq1.send(null);

}
else
{
	document.getElementById("comment_result_forward").innerHTML = "<center><font face=verdana size=2 color=red>Please fill the fields indicated in the red color.</font></center>";	
}
return false;

}
