// JavaScript Document
  function overlayopen(divid,blackoverlayid)
  {
   var browserName = whichBrs(); 
   var leftPos = (screen.width / 2) - 390;
   var topPos = (screen.height / 2) - 320;
   var bodywidth;
   var bodyheight;
   
   document.getElementById(divid).style.left=leftPos+"px";
   document.getElementById(divid).style.top=topPos+"px";
      
   bodywidth = document.body.scrollWidth;
   bodyheight = document.body.scrollHeight;

   document.getElementById(blackoverlayid).style.height=bodyheight+"px";	

   if(browserName=="IE")
  	{
  	 	document.getElementById(blackoverlayid).style.width=bodywidth+"px";
  	 	document.getElementById(blackoverlayid).style.height=bodyheight+"px";	
  	}

   if(browserName=="Firefox")
  	{
  	document.getElementById(blackoverlayid).style.height=bodyheight+"px";	
 		document.getElementById(divid).style.top=topPos-30+"px";	  		
  	}

  	document.getElementById(divid).style.display="block";
  	document.getElementById(blackoverlayid).style.display="block";
  }	
  
  
  function overlayclose(divid,blackoverlayid)
  {
  	document.getElementById(divid).style.display="none";
  	document.getElementById(blackoverlayid).style.display="none";
  }
  
  
function whichBrs() {
		var agt=navigator.userAgent.toLowerCase();
		if (agt.indexOf("opera") != -1) return 'Opera';
		if (agt.indexOf("staroffice") != -1) return 'Star Office';
		if (agt.indexOf("webtv") != -1) return 'WebTV';
		if (agt.indexOf("beonex") != -1) return 'Beonex';
		if (agt.indexOf("chimera") != -1) return 'Chimera';
		if (agt.indexOf("netpositive") != -1) return 'NetPositive';
		if (agt.indexOf("phoenix") != -1) return 'Phoenix';
		if (agt.indexOf("firefox") != -1) return 'Firefox';
		if (agt.indexOf("safari") != -1) return 'Safari';
		if (agt.indexOf("skipstone") != -1) return 'SkipStone';
		if (agt.indexOf("msie") != -1) return "IE";
		if (agt.indexOf("netscape") != -1) return 'Netscape';
		if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
		if (agt.indexOf('\/') != -1) {
		if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
		return navigator.userAgent.substr(0,agt.indexOf('\/'));}
		else return 'Netscape';} else if (agt.indexOf(' ') != -1)
		return navigator.userAgent.substr(0,agt.indexOf(' '));
		else return navigator.userAgent;
}

function setContainerHeight()
{
	     		var maxheight="";
          var leftpanelheight = document.getElementById("leftpanel").offsetHeight;
          var midpanelheight = document.getElementById("rightpanel").offsetHeight;
          var rightpanelheight = document.getElementById("innerhome-mid-bloc").offsetHeight;
					var Obj= document.getElementById("headerarea");
					if(Obj.offsetHeight){var ObjoffsetHeight= Obj.offsetHeight;}		
					
					
			//alert(leftpanelheight+"--"+midpanelheight+"---"+rightpanelheight);
          if(leftpanelheight>=midpanelheight && leftpanelheight>=rightpanelheight){maxheight = leftpanelheight;}
          else if(midpanelheight>=leftpanelheight && midpanelheight>=rightpanelheight){maxheight = midpanelheight;}
          else
          {
		      maxheight = rightpanelheight;
		      document.getElementById("leftpanel").style.height = maxheight+"px";
	        document.getElementById("rightpanel").style.height =  maxheight+"px";
          document.getElementById("innerhome-mid-bloc").style.height = maxheight+ObjoffsetHeight+20+"px";
          }

		 if(maxheight!= rightpanelheight)
          {
             document.getElementById("leftpanel").style.height = maxheight+"px";
             document.getElementById("rightpanel").style.height =  maxheight+"px";
             document.getElementById("innerhome-mid-bloc").style.height = maxheight+ObjoffsetHeight+20+"px";
		  }
}

function goToURL(url){
newWin = window.open(url,'_self');
}

function openViriSignPopup(){
myWindow = window.open('http://www.verisign.com/ssl/index.html?sl=t31290225400000002&gclid=CM7q9J_wrYsCFQmJTAodG1sROg','myWindow','menubar=no,width=800,height=700,toolbar=no,directories=no,resizable=no,scrollbars=no,location=no,status=yes');
}

function redirectURL(){
self.location.href="http://www.makemytrip.com/flights/";
}

function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {
  	var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
        	curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y){curtop += obj.y;}
    return curtop;
  }
  
  function findHeight(obj)
  {
  	var currntheight =0;
  	if(obj.offsetHeight)
  			currntheight+=obj.offsetHeight;
		return currntheight;  			
	}

 function setTopPos(obj,setpix)
 {
 	if(obj)
 		obj.style.marginTop= setpix-280+"px";
 }
 
function setTitlePos()
{
	var titleObj=document.getElementById("middle-box");
	var titleObj1=document.getElementById("headerarea");
	var titlecurrentTop = findPosY(titleObj);
	var titlecurrentTop1= findPosY(titleObj1);
	if(titleObj.offsetHeight)
	{
		var titlecurrentHeight= titleObj.offsetHeight;
	}	
	if(titleObj1.offsetHeight)
	{
		var titlecurrentHeight1= titleObj1.offsetHeight;
	}		
	
	var exactPos=titlecurrentTop+titlecurrentHeight+"px";
	var exactPos1= titlecurrentTop1+titlecurrentHeight1;
	
	if(document.getElementById("block7"))
	{
		document.getElementById("block7").style.top=exactPos;
	}
	
	if(document.getElementById("block-fcca"))	
	{
		document.getElementById("block-fcca").style.top=exactPos;
	}
	
	if(document.getElementById("block-fcc"))
	{
		document.getElementById("block-fcc").style.top=exactPos;
	}	
	
	if(document.getElementById("leftpanelcontainer"))
	{
		document.getElementById("leftpanelcontainer").style.top=exactPos1+15+"px";
	}	
}



/* GOOGLE Map Code */
var geocoder, location1, location2;
function initialize() {	geocoder = new GClientGeocoder();}

function showLocation(getfromCity,gettoCity) {
	var fromCity = getfromCity;
	var toCity = gettoCity;

	alert(fromCity+"--"+toCity);
	geocoder.getLocations(fromCity, function (response) {
		if (!response || response.Status.code != 200){alert("Sorry, we were unable to geocode the first address");}
		else
		{
			location1 = {lat: response.Placemark[0].Point.coordinates[1], lon: response.Placemark[0].Point.coordinates[0], address: response.Placemark[0].address};
			geocoder.getLocations(toCity, function (response) {
				if (!response || response.Status.code != 200)
				{
					alert("Sorry, we were unable to geocode the second address");
				}
				else
				{
					location2 = {lat: response.Placemark[0].Point.coordinates[1], lon: response.Placemark[0].Point.coordinates[0], address: response.Placemark[0].address};
					showMap();
				}
			});
		}
	});
}

function showMap(){
 var map = new GMap2(document.getElementById("map_area"));
map.setCenter(new GLatLng((location1.lat+location2.lat)/2, (location1.lon+location2.lon)/2), 2);

// Create GPolylineOptions argument as an object literal.
// Note that we don't use a constructor.

var polyOptions = {geodesic:true};
var polyline = new GPolyline([
  new GLatLng(location1.lat, location1.lon),
  new GLatLng(location2.lat, location2.lon)
  ], "#033", 4, 1, polyOptions);
  map.addOverlay(polyline);
}
/* GOOGLE Map Code */


/* GOOGLE City Map */
    var map = null;
    var geocoder = null;

    function initializeCityMap() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("city_map"));
        geocoder = new GClientGeocoder();
      }
    }

    function showCityMap(address) {
		
     if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " not found");
            } else {
              map.setCenter(point, 13);
              var marker = new GMarker(point);
              map.addOverlay(marker);
              marker.openInfoWindowHtml(address);
            }
          }
        );
      }
    }
/* GOOGLE City Map */


function headerCall()
{
	document.write('<div id="header-bloc"><div class="logo"><a title="MakeMyTrip &ndash; India&rsquo;s No.1 Travel Website" href="http://www.makemytrip.com"><img border="0" height="85" width="196" alt="MakeMyTrip &ndash; India&rsquo;s No.1 Travel Website" src="http://www.makemytrip.com/images/makemytrip-logo.gif"></a></div><div class="home-toplink"><ul><li><div class="us-flag"><a rel="nofollow" title="US Site" href="http://us.makemytrip.com"><img border="0" height="12" width="17" alt="US Site" src="http://www.makemytrip.com/images/spacer.gif"></a></div></li><li><a rel="nofollow" title="MakeMyTrip US" alt="MakeMyTrip US" href="http://us.makemytrip.com">US Site</a></li><li>|</li><li><div class="uae-flag"><a rel="nofollow" alt="MakeMyTrip UAE" title="MakeMyTrip UAE" href="http://www.makemytrip.ae/"><img border="0" height="12" width="17" alt="UAE Site" src="http://www.makemytrip.com/images/spacer.gif"></a></div></li><li><a rel="nofollow" alt="MakeMyTrip UAE" title="MakeMyTrip UAE" href="http://www.makemytrip.ae/">UAE Site</a></li><li>|</li><li><a rel="nofollow" href="http://www.makemytrip.com/support/customersupport.html">Sign In / Register</a></li></ul></div></div><div id="nav-bloc"><ul id="navList"><li class="top"><a class="top_link" href="http://www.makemytrip.com/"><span>Home</span></a></li><li class="top"><img border="0" alt="" src="http://www.makemytrip.com/images/nav-strk.gif"></li><li class="top"><a class="flight-bg top_link" href="http://www.makemytrip.com/flights/"><span class="down">Flights</span></a><ul class="sub"><li><a href="http://www.makemytrip.com/flights/">Flights Within India</a></li><li><a href="http://www.makemytrip.com/international-flights/">International Flights</a></li></ul></li><li class="top"><img border="0" alt="" src="http://www.makemytrip.com/images/nav-strk.gif"></li><li class="top"><a class="top_link" href="http://www.makemytrip.com/hotels/"><span class="down">Hotels</span></a><ul class="sub"><li><a href="http://www.makemytrip.com/hotels/">Hotels In India</a></li><li><a href="http://www.makemytrip.com/hotels/#intl">International Hotels</a></li></ul></li><li class="top"><img border="0" alt="" src="http://www.makemytrip.com/images/nav-strk.gif"></li><li class="top"><a class="top_link" href="http://www.makemytrip.com/bus-tickets/"><span>Bus</span></a></li><li class="top"><img border="0" alt="" src="http://www.makemytrip.com/images/nav-strk.gif"></li><li class="top"><a class="top_link" href="http://www.makemytrip.com/railways/"><span>Rail</span></a></li><li class="top"><img border="0" alt="" src="http://www.makemytrip.com/images/nav-strk.gif"></li><li class="top"><a class="top_link" href="http://www.makemytrip.com/holidays-india"><span class="down">Holidays</span></a><ul class="sub"><li><a href="http://www.makemytrip.com/holidays-india">Holidays In India</a></li><li><a href="http://www.makemytrip.com/holidays-international">International Holidays</a></li></ul></li><li class="top"><img border="0" alt="" src="http://www.makemytrip.com/images/nav-strk.gif"></li><li class="top"><a class="top_link" href="http://www.makemytrip.com/travel-guides/"><span>Travel Guides</span></a></li><li class="top"><img border="0" alt="" src="http://www.makemytrip.com/images/nav-strk.gif"></li><li class="top"><a class="top_link" href="http://mobile.makemytrip.com/"><span>Mobile</span></a></li><li class="top"><img border="0" alt="" src="http://www.makemytrip.com/images/nav-strk.gif"></li><li id="support" class="top"><a class="support top_link" href="http://www.makemytrip.com/support/customersupport.html"><span>CustomerSupport</span></a></li></ul></div>');
}

function footerCall()
{
	document.write('<div id="footer"><p class="footerbg"></p><div class="H-links topborder0 mrgintop4"><ul><li><a href="http://www.makemytrip.com/flights/international_airlines.html">International Airlines</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/international-flights/">International Flights</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/international-flights-rss.xml">International Flights RSS</a></li></ul><div class="clr"></div></div><div class="H-links topborder0"><ul><li><a href="http://www.makemytrip.com/about-us/company_profile.php" >About Us</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/about-us/media.php">Media</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/about-us/testimonials.html">Testimonial</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/about-us/jobs.html">Careers</a></li><li class="seprator">|</li><li><a href="http://partners.makemytrip.com/">Affiliates</a></li><li class="seprator">|</li><li><a href="http://b2b.makemytrip.com/makemytrip/AffiliateLoginHome.do">B2B</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/offsites/mice.html">MICE</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/offsites/corporatetravel.html">Corporate Travel</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/legal/payment_security.html">Payment Security</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/legal/privacy_policy.html">Privacy Policy</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/legal/user_agreement.html">User Agreement</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/legal/visaregulations.php">Visa Information</a></li></ul><div class="clr"></div></div><div class="H-links topborder0"><ul><li><a href="http://www.makemytrip.com/support/faqs.html">FAQs</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/support/sitemap.html">Site Map</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/support/feedback.html">Feedback</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/support/contact_us.html">Contact Us</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/sitemap.xml">XML Sitemap</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/ror.xml">ROR Sitemap</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.com/support/dnd.jsp">Unsubscribe</a></li></ul><div class="clr"></div></div><div class="H-links topborder0"><div class="H-linksinner"><ul><li>International Websites:</li><li><a href="http://us.makemytrip.com/">USA</a></li><li class="seprator">|</li><li><a href="http://www.makemytrip.ae/">UAE</a></li></ul><div class="clr"></div></div></div><div class="bottom-footer"><div class="partners-container"><div class="partners-bolc leftpad0"><p>Verisign Secure</p><div class="verisignimg"><a href="#" onclick="openViriSignPopup();"><img src="http://www.makemytrip.com/images/spacer.gif" alt="Verisign Secure" width="58" height="29" border="0" /></a></div></div><div class="partners-bolc"><p>We Accept <a onClick="javascript: overlayopen(\'overlaycontents\',\'blackoverlay\');" class="partner-link" title="" href="#">(more)</a></p><div class="weaccept"><div class="mastervisaimg"></div></div></div><div class="partners-bolc"><p>Members of</p><div class="membersimg"><img src="http://www.makemytrip.com/images/spacer.gif" alt="Members of" width="159" height="31" /></div></div><div class="partners-bolc"><p>Rewards powered by</p><div class="imint-rewards"><div onclick="javascript:window.location.href=\'../imint\'" class="imintimg" style="cursor:pointer;">&nbsp;</div></div></div><div class="partners-bolc rhtpad0 rhtborder0" style="float:right;"><div class="superbrandimg"><a href="#"><img src="http://www.makemytrip.com/images/spacer.gif" alt="International site" width="69" height="48" border="0" /></a></div></div><div class="clr"></div></div></div></div>');
}	
