function waitWindowOpen() {                                       
     $("#WaitWindow").css("visibility", "visible");
     $("#WaitWindow").dialog({resizable: false, height: 50, width: 160, autoOpen: true, modal: true});
     
     $("#WaitWindow").dialog('option', 'height', 70); 
}

function waitWindowClose() {
    if($("#WaitWindow").dialog('isOpen')){
        $("#WaitWindow").dialog('close');
    }
    
}
$(document).ready(function() {
    //$("form").submit(function() { waitWindowOpen(); });
    $(".waitingWindow").click(function() { waitWindowOpen(); });
        $(".row").hover(
            function(){
		        $(this).addClass("current");
	        }, 
            function(){
		        $(this).removeClass("current");
	        }
        );
		$(".row:odd").css("background","#fff");
 });
	
function handleApiReady() {
    var myLatlng = new google.maps.LatLng(-34.397, 150.644);
    var myOptions = {
      zoom: 8,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}

function load_page_with_offset(language, keywords, location_keywords, page) {       
        var offset = (page-1)*20;
        $("#rightContent").load('index.php?act=search_page&lan=' + encodeURIComponent(language) + 
        '&key=' + keywords + 
        '&lk=' + location_keywords +
        '&ofs=' + offset);
}
    
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}    

this.tooltip = function(){
	xOffset = 10; // Pixel distance from cursor in X axis
	yOffset = 20; // Pixel distance from cursor in Y axis
	$("a.tooltip").hover(
		function(e) {
			this.t = this.title;
			this.title = "";
			$("body").append("<div id='tooltip'>"+ this.t +"</div>");
			$("#tooltip")
					.css("top",(e.pageY - xOffset) + "px")
					.css("left",(e.pageX + yOffset) + "px")
					.fadeIn("fast");
		},
		function(){
				this.title = this.t;
				$("#tooltip").remove();
		}
	);
	$("a.tooltip").mousemove(function(e){
			$("#tooltip")
					.css("top",(e.pageY - xOffset) + "px")
					.css("left",(e.pageX + yOffset) + "px");
	});
};

// starting the script on page load
$(document).ready(function(){
        tooltip();
});
