$(document).ready(function() {     
 
    $("#Sandakan").mouseover(function () {
		    $("#Sandakan_balloon").fadeIn(150);
		    return false;
    });
    
        $("#Sandakan").mouseout(function () {
    		    $("#Sandakan_balloon").fadeOut(150);
    		    return false;
        });
        
    $("#Pedalaman_Bawah").mouseover(function () {
		    $("#Pedalaman_Bawah_balloon").fadeIn(150);
		    return false;
    });
    
        $("#Pedalaman_Bawah").mouseout(function () {
    		    $("#Pedalaman_Bawah_balloon").fadeOut(150);
    		    return false;
        });
        
    $("#Tawau").mouseover(function () {
		    $("#Tawau_balloon").fadeIn(150);
		    return false;
    });
    
        $("#Tawau").mouseout(function () {
    		    $("#Tawau_balloon").fadeOut(150);
    		    return false;
        });
        
    $("#Pantai_Barat_Utara").mouseover(function () {
		    $("#Pantai_Barat_Utara_balloon").fadeIn(150);
		    return false;
    });
    
        $("#Pantai_Barat_Utara").mouseout(function () {
    		    $("#Pantai_Barat_Utara_balloon").fadeOut(150);
    		    return false;
        });        
        
    $("#Labuan").mouseover(function () {
		    $("#Labuan_balloon").fadeIn(150);
		    return false;
    });
    
        $("#Labuan").mouseout(function () {
    		    $("#Labuan_balloon").fadeOut(150);
    		    return false;
        });        
        
    $("#Pedalaman_Atas").mouseover(function () {
		    $("#Pedalaman_Atas_balloon").fadeIn(150);
		    return false;
    });
    
        $("#Pedalaman_Atas").mouseout(function () {
    		    $("#Pedalaman_Atas_balloon").fadeOut(150);
    		    return false;
        });        
        
    $("#Pantai_Barat_Selatan").mouseover(function () {
		    $("#Pantai_Barat_Selatan_balloon").fadeIn(150);
		    return false;
    });
    
        $("#Pantai_Barat_Selatan").mouseout(function () {
    		    $("#Pantai_Barat_Selatan_balloon").fadeOut(150);
    		    return false;
        });        

    $("#Languagebar_BI").mouseover(function () {
		    $("#LanguageTooltip_BI").fadeIn(100);
		    return false;
    });
    
        $("#Languagebar_BI").mouseout(function () {
    		    $("#LanguageTooltip_BI").fadeOut(100);
    		    return false;
        });  

    $("#Languagebar_BM").mouseover(function () {
		    $("#LanguageTooltip_BM").fadeIn(100);
		    return false;
    });
    
        $("#Languagebar_BM").mouseout(function () {
    		    $("#LanguageTooltip_BM").fadeOut(100);
    		    return false;
        });          
            
    //jquery bookmark script
    $('#favme').jFav();
    
    $("#calSearchSubmit_BI").click(function(){
      
        var length = $("#calSearchKeyword").val().length;

        if (length < 1){
        alert("Please insert a keyword"); 
        return false;
        }
        
        else if (length < 3){
        alert("Please use a keyword that has more than 2 characters");
        return false; 
        }
    })  
    
    $("#calSearchSubmit_BM").click(function(){
      
        var length = $("#calSearchKeyword").val().length;

        if (length < 1){
        alert("Sila masukkan kata kunci untuk dicari"); 
        return false; 
        }
        
        else if (length < 3){
        alert("Sila gunakan kata kunci yang mempunyai lebih daripada 2 huruf");
        return false; 
        }         
    })         
	
// 	//'sliding' effect on page load
// 	$("#ContentContainer").slideDown(1500);
// 
// 	//glowing effect (yellow) when navlink is hovered 
// 	$('.navglow').addGlow({
// 	textColor: '#F0F601',
// 	duration: 500
// 	});	
// 		
// 	//Sub menu for Programme navlink
//      $("#menuFacility").click(function () {
// 		$("#menuFacility_drop").slideToggle(200);
// 		return false;
//      });
//      
//      //show tooltip
//      tooltip();
//      
//      //for smooth scrolling page
// 	$.localScroll();
//     
// 	//show loading bar
// 	function showLoading(){
// 		$("#loading")
// 			.css({visibility:"visible"})
// 			.css({opacity:"1"})
// 			.css({display:"block"})
// 		;
// 	}
// 	
// 	//hide loading bar
// 	function hideLoading(){
// 		$("#loading").fadeTo(1000, 0);
// 	};
// 
// 	//for news.php - contents will be read from section.html
// 	$(".headline").click(function(){
// 
// 		//show loading icon first
// 		showLoading();
// 	
// 		var $this = $(this);
//  		var article = $this.attr("id").replace("headline_", "viewer_");
// 			$("#Viewer").load("sections.html #" + article, hideLoading);
// 		return false;
// 	});	 
// 	
// 	//contact form checker
// 	$("#contactform").submit(function(){
// 		if ( ($('#cnt_name').val() == "") || ($('#cnt_email').val() == "") || 
// 		($('#cnt_captcha').val() == "") || ($('#cnt_message').val() == "")   ) {
// 				
// 					if ($('#cnt_name').val() == ""){
// 					$(".warn_name").fadeIn(500);
// 					}
// 						else {
// 						$(".warn_name").fadeOut(500);
// 						}
// 					
// 					if ($('#cnt_email').val() == ""){
// 					$(".warn_email").fadeIn(500);
// 					}
// 						else {
// 						$(".warn_email").fadeOut(500);
// 						}
// 					
// 					if ($('#cnt_captcha').val() == ""){
// 					$(".warn_captcha").fadeIn(500);
// 					}	
// 						else {
// 						$(".warn_captcha").fadeOut(500);
// 						}		
// 						
// 					if ($('#cnt_message').val() == ""){
// 					$(".warn_message").fadeIn(500);
// 					}	
// 						else {
// 						$(".warn_message").fadeOut(500);
// 						}
// 					
// 				return false;
// 				}	
// 				
// 				else{
// 				//show loading icon first
// 				showLoading();			
// 				}	
// 	});
// 
// 	$(".icon_close_message").click(function(){
// 		$(".success_message").fadeOut(1500);
// 		return false;
// 	});	
// 	
// 	$(".icon_close_message").click(function(){
// 		$(".failure_message").fadeOut(1500);
// 		return false;
// 	});	
// 	
// 	$(".icon_close_message").click(function(){
// 		$(".warn_captcha_incorrect").fadeOut(1500);
// 		return false;
// 	});	
// 		
	
	
});

