$(document).ready(function(){
	$(".placeholderField").focus(function(){
    	if($(this).val()==$(this).attr('title')){
        	$(this).val('');
        }
    });
    $(".placeholderField").blur(function(){
    	if($(this).val()==''){
       		$(this).val($(this).attr('title'));
       	}
    });
    $(".placeholderField").blur();

	
	
	/*********************************************************************************************/
	/*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"
    });
    
    /*******************/
	/*Home scroll panel*/
	/*******************/
	if($("#homeslideshow").length>0){
	    $("#homeslideshow").scrollable({circular:true,speed:700}).navigator("#homeslideshow_nav").autoscroll({ autoplay:true, interval:4000 });
		$("#homeslideshow").scrollable().seekTo(0,0);
		
		$("#homeslideshow_nav").children().each(function(i, val) {
			$(this).html(i+1);
			//alert(i+' '+val);
	      //$("#" + i).append(document.createTextNode(" - " + val));
	    });

	}
	
	
	
	
	
	//Page scroll slideshows   
    //$(".slideshow").scrollable({circular: true}).autoscroll({ autoplay:true });
    /* uncomment to allow click rotation
    $(".slideshow").click(function() {
		$(this).data("scrollable").next();
	});
	*/
	/**********************/
	/*INIT GALLERY COLORBOX/
	/**********************/
	//$('a[rel="gallerySlideshow"]').colorbox({slideshow:true,slideshowSpeed:6000,slideshowAuto:true});



});
