var tdId;
var formSubmit
var divId;
var verifyResult;
var verifyFlag=true;
var req;

function checkCookie()
{
  
var ipaddress = getCookie("ipaddress");
if (ipaddress!=null && ipaddress!="")
  {
     return;
  }
else
  {
     IsClientFromGurgaon();
  }
}
function setCookie(c_name,value,exdays)
{
    
    var exdate=new Date();
    exdate.setDate(exdate.getDate() + exdays);
    var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
    document.cookie=c_name + "=" + c_value;
}

function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
{
  x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  x=x.replace(/^\s+|\s+$/g,"");
  if (x==c_name)
    {
    return unescape(y);
    }
  }
}

function IsClientFromGurgaon() {	
	var url = "/homeheader.do?item=IsUserFromGurgaon";
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}
	req.open("POST", url, true);
	req.onreadystatechange = getCity;
	req.send(null);	
	
 }


function getCity() {
	
	if (req.readyState == 4) {
		
		if (req.status == 200) {
			if(req.responseText == 'GURGAON')
			{
                   
				document.write('<div id="flash" style="display:block">');
				document.write('<div style="width:727px; height:auto; margin:0 147px;">');
				document.write('<div style="width:727px; height:55px; margin:0 0 25px 0;">');
				document.write('<div style="width:170px; height:55px; float:left;"><img src="/newcommon/newHeaderFooter/images/mnc-logo.jpg"/></div>');
				document.write('<div style="width:258px; height:15px; float:left; padding:40px 0 0 20px; vertical-align:text-bottom; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:13px;">merinews.com will load in few seconds</div>');
				document.write('<div style="width:30px; height:19px; float:left; padding:36px 0 0 0; text-align:center;">|</div>');
				document.write('<div style="width:248px; height:15px; float:left; padding:40px 0 0 0; text-align:right; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:13px;">');
				document.write('click here to go<a style="text-decoration:none; color:#000000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:13px;" href="http://www.merinews.com/"> www.merinews.com');
				document.write('</a></div>');
				document.write('</div>');
       			document.write('<div  style="width:727px; height:auto;">');
				document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="727" height="500">  <param name="movie" value="/merinews-intro-page-banner.swf" />             <param name="quality" value="high" />            <embed src="/merinews-intro-page-banner.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="727" height="500"></embed></object>');			
                document.write('</div>');
				document.write('</div>');
				document.write('</div>');
           
                document.write('<script>function setCookie(c_name,value,exdays){');
                document.write('var exdate=new Date();'); 
                document.write('exdate.setDate(exdate.getDate() + exdays);');
                document.write('var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());');
                document.write('var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());');
                document.write('document.cookie=c_name + "=" + c_value;}setCookie("ipaddress","merinews_gurgaon",1);</script>');


                    
                document.write('<script>function blankInnerHTML(){');
				document.write('window.location.href="http://www.merinews.com";}');
				document.write('setTimeout("blankInnerHTML()",21000);</script>');
                         
				
			}
		}
	}
}
