var url= document.location.href;
var url1= document.location.href;
function showUrl()
{


//alert('hi'+u);
//document.write(u);
//return u;
}

function showUrl1()
{ 
var title = document.getElementsByTagName("H1")[0];
if (title) h1 = title.innerHTML;
document.getElementById('url1').value=url;
document.getElementById('h1title').value=h1;
return true;
}

function Validate()
{
	var re = /^[A-Za-z ]+$/;
	if(document.form.name.value == '' || !re.test(document.form.name.value))
	{
	alert('Please Enter the Name and Enter Only Alphabets!' );
	document.form.name.focus();
	return false;
	}
	if(document.form.name.value.charAt(0) == ' ')
	{
	alert('Please check there is any space before name! Remove that.');
	document.form.name.focus();
	return false;
	}
	if(document.form.name.value.length>30)
	{
	alert('Your name is Too long! you can only write 30 words in name.');
	document.form.name.focus();
	return false;
	}	   
	if(document.form.email.value == '')
	{
	alert('Please Enter the Email!' );
	document.form.email.focus();
	return false;
	}
	if(!document.form.email.value.match(/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/))
	{
	alert("Please enter Valid Email Address! ");
	document.form.email.focus();
	return false;
	}

	if(document.form.comment.value == '')
	{
	alert('Please write the Comment!');
	document.form.comment.focus();
	return false;
	}
	if(document.form.comment.value.charAt(0) == ' ')
	{
	alert('Please check there is any space before Comment! Remove that.');
	document.form.comment.focus();
	return false;
	}
	if(document.form.comment.value.length>5000)
	{
	alert('Please write comment Less than 5000 words.!');
	document.form.comment.focus();
	return false;
	}
	document.getElementById('url').value=url;
	return true;
}

function stripHTML(){
var re = /(<([^>]+)>)/gi;
for (i=0; i < arguments.length; i++)
arguments[i].value=arguments[i].value.replace(re, "")
}

function showUser(str)
{
if (str=="")
  {
  document.getElementById("txtHint").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","http://www.mapsofindia.com/maps/goa/getuser.php?q="+str,true);
xmlhttp.send();
}

function getStr(){
     var url= document.location.href;
 
  //var a=url.split("/");
 // var str = a[4];
     return url;
  }


/*function displayout()
{

document.write('<div class="comment">');
document.write('<div class="comment-top"><div class="sharetext">Share your Comments Here</div>');
document.write('<div class="viewtext">');
document.write('<form method="post"  name="form1" action="http://www.mapsofindia.com/comment/view-comment.php"><input type="hidden" name="url1" id="url1" value=""><input type="hidden" name="h1title" id="h1title" value="">');
document.write('<a href="#" onClick="showUrl1();document.form1.submit(); return false;">View Comments for this Post</a></form></div>');
document.write('</div>');
document.write('<div class="comment-middle">');
document.write('<div class="apttext"><sup>*</sup>Comments are moderated and will be posted in the page if they are on-topic and not abusive.</div>');
document.write('<div class="formarea">');
document.write('<form name="form" id="form" action="http://www.mapsofindia.com/comment/savecomment.php" method="post" onsubmit="return Validate();">');
document.write('<div class="formarea-l">');
document.write('<div><input type="text" name="name"  size="30"  value="Name (Required)" onfocus="this.value=\'\'" style="height:22px;border:0;font-family:arial;font-size:12px;color:#AAAAAA;font-weight:bold;padding:6px 0 4px 8px;border-left:1px solid #999999; border-top:1px solid #999999;"/></div>');
document.write('<div class="forspace"></div>');
document.write('<div><input type="text" name="email"  size="30"  value="Email (Required)" onfocus="this.value=\'\'" style="height:22px;border:0;font-family:arial;font-size:12px;color:#AAAAAA;font-weight:bold;padding:6px 0 4px 8px;border-left:1px solid #999999; border-top:1px solid #999999;"/></div>');
document.write('</div>');
document.write('<div class="formarea-r">');
document.write('<textarea name="comment" rows="8" id="name1" cols="35" onkeyup="stripHTML(this.form.comment)" style="border:0;font-family:arial;font-size:12px;color:#AAAAAA;font-weight:bold;border-left:1px solid #C3C3C3; border-top:1px solid #C3C3C3;float:left;"></textarea>');
document.write('<div class="submitportion">');
document.write('<div class="submitbt"><input type="hidden" name="hiddenvalue" value="0">');
document.write('<input type="hidden" name="url" id="url" value="">');
document.write('<input type="image" src="http://www.mapsofindia.net/images/post-comment-bt.jpg" style="position:absolute;width:125px;" /><input type="submit" name="submit" onClick="showUrl();"/></div>');
document.write('<div class="resetbt"><input type="image" src="http://www.mapsofindia.net/images/reset-bt.jpg" style="position:absolute;width:65px;" /><input type="reset" name="reset" size="10" /></div>');
document.write('</div>');
document.write('</div>');
document.write('</div>');
document.write('</form>');
document.write('</div>');
document.write('<div class="comment-bottom"></div>');
document.write('</div>');
}*/
