window.onscroll = ScrollMap;   
function gid(id) {
    return document.getElementById(id);
}
function ScrollMap() {
    var num = 0;
    var slt = gid("searchBody").offsetHeight, flt = gid("mapbar").offsetHeight, fst = gid("searchBody").offsetParent.offsetTop;
    if (slt < flt) { gid("searchBody").style.height = flt + "px"; }
    var th = document.documentElement.scrollTop || document.body.scrollTop;
    var ftt = gid("footer").offsetTop;
    if (th > fst) {
        gid("mapbar").style.top = th - fst - num + "px";
    } else {
        gid("mapbar").style.top = "0";
    }
    if ((ftt - flt) < th) {
        if (slt > flt) {
            gid("mapbar").style.top = slt - flt + "px";
        } else gid("mapbar").style.top = "0";
    }
}
function getArea(obj)
{
$.post("/area_list.php", {city: ""+obj.value+""}, function(data){
 if(data.length >0) {$("#district").html(data);}
 });
}
$(function(){
$("#hotelName").suggest("/ajax_hotel_list.php",{onSelect: function(){
$("#searchHotels").submit();}});
$("#HotelList li").hover(
function(){
	$(this).addClass("ItineraryIndexHover");
	GEvent.trigger(marker[$(this).attr("id").replace("hotel","")],'mouseover');
	},
function(){
	$(this).removeClass("ItineraryIndexHover");
	GEvent.trigger(marker[$(this).attr("id").replace("hotel","")],'mouseout');
	}
);
		   });
function ZMarker(point,label,n,imInd,i,visited) {
	marker[i] = new GMarker(point,{title:label});
	map.addOverlay(marker[i]);
	marker[i].setImage(markerImage[imInd]);
	marker[i].visited = visited;
	GEvent.addListener(marker[i], "click", function() {
	marker[i].visited = true;
	GEvent.trigger(marker[i],"mouseout");
	destination(i);
	});
	GEvent.addListener(marker[i],'mouseover',function(){
	marker[i].setImage(markerImage[3]);
	});
	GEvent.addListener(marker[i],'mouseout',function(){
		if(marker[i].visited){
		marker[i].setImage(markerImage[4]);
		}else{
		marker[i].setImage(markerImage[0]);
		}
	});

	}
$(function(){
		   loadMap();
		   });
var map;
var marker = [];
var bounds = new GLatLngBounds();
var markerImage = [
G_DEFAULT_ICON.image,
"http://maps.google.com/mapfiles/dd-start.png",
"http://maps.google.com/mapfiles/dd-end.png",
"http://www.uchinatravel.com/tours/icon/markeryellow.png",
"http://www.uchinatravel.com/tours/icon/temp_marker.png"
];
