
$(document).ready(function(){ 
	
	/**************/
	/*SEARCH FOCUS*/
	/**************/
    $(".placeholderField").focus(function(){
    	if($(this).val()==$(this).attr('title')){
        	$(this).val('');
        }
    });
    $(".placeholderField").blur(function(){
    	if($(this).val()==''){
       		$(this).val($(this).attr('title'));
       	}
    });
    $(".placeholderField").blur();
    
    /*******************/
	/*Home scroll panel*/
	/*******************/
	//
	if($("#homenews_scroll_panel").length>0){
	    $("#homenews_scroll_panel").scrollable({circular:true,speed:700}).navigator("#homenews_scroll_thumbnav");
		$("#homenews_scroll_panel").scrollable().seekTo(0,0);
	}
	if($("#sponsor_scroll_panel").length>0){
	    $("#sponsor_scroll_panel").scrollable({circular:true,speed:700}).autoscroll({ autoplay:true,interval:3000 }).click(function() {
			//$(this).data("scrollable").next();		
		});
	}
	/***********************************************************************************************/
	/*External links to _blank target (allows valid XHTML strict whilst opening external windows)*/
	/***********************************************************************************************/
	$('a[rel="external"]').click(function(){
		this.target = "_blank";
	});
	
	
    
    /***********/
	/*MAIN MENU*/
	/***********/   
    $("#menu_main>ul li a").hover(function() {
        //Following events are applied to the subnav itself (moving subnav up and down)
        $(this).parent().find("ul").slideDown(200).show(); //Drop down the subnav on click

        $(this).parent().hover(function() {
        }, function(){  
            $(this).parent().find("ul").slideUp(150); //When the mouse hovers out of the subnav, move it back up
        });

        //Following events are applied to the trigger (Hover events for the trigger)
        }).hover(function() { 
            $(this).addClass("subhover"); //On hover over, add class "subhover"
        }, function(){  //On Hover Out
            $(this).removeClass("subhover"); //On hover out, remove class "subhover"
    });
    
    /******************/
	/*NEWSLETTER BUTTON/
	/******************/
    $("#newsletter_button").click(function() {
        //Following events are applied to the subnav itself (moving subnav up and down)
        $("#head_newsletter .panel").slideToggle(300); //Drop down the subnav on click
    });
    
    /**********************/
	/*INIT GALLERY COLORBOX/
	/**********************/
	$('a[rel="gallerySlideshow"]').colorbox({slideshow:true,slideshowSpeed:6000,slideshowAuto:false});
    
});
