/***************************************
****************************************
    GENERAL SCRIPTS
****************************************
***************************************/


/***************************************
    ON DOCUMENT LOAD
    ------------------------------------
    Any code between this function
    executs when the page had loaded
    fully.
***************************************/
$(document).ready(function(){
    $("div#main div.content h2:first, div#main div.content p:first, div#news h2:first").css("margin-top", "4px");

    $("a.lightbox[rel^='prettyPhoto']").prettyPhoto({
        theme: 'light_rounded'
    });

    $("#courses select").sSelect({
        ddMaxHeight: '300px'
    });

    $("div#courses div.selectedTxt").textOverflow(null, true);

    /*$("div#courses div.selectedTxt").change(function(){
        $(this).ellipsis();
    });*/

    $("div.Required label").append(" (<span class='red'>*</span>)");

    $('.banner').innerfade({ 
        animationtype: "fade", //Type of animation 'fade' or 'slide' (Default: 'fade'), 
        speed: "slow", //Fading-/Sliding-Speed in milliseconds or keywords (slow, normal or fast) (Default: 'normal'), 
        timeout: "5000" ,// Time between the fades in milliseconds (Default: '2000'), 
        type: "sequence", //Type of slideshow: 'sequence', 'random' or 'random_start' (Default: 'sequence'), 
        containerheight:  "226px"//Height of the containing element in any css-height-value (Default: 'auto'),
        //runningclass: CSS-Class which the container get’s applied (Default: 'innerfade'),
        //children: optional children selector (Default: null)
    }); 
        
        
        
        
        
    $(".Date input").datepicker({
        changeMonth: true,
        changeYear: true,
        //showOn: 'button',         
        //buttonImage: '../../../Images/BOS/calendar.gif', 
        buttonImageOnly: true,
        numberOfMonths: 1,
        showButtonPanel: true,
        dateFormat: "dd/mm/yy",
        constrainInput: true
    });
    //$(".Date input").next().css("vertical-align", "middle"); //fix lil icon
        
        
    
    
    
    $(".coursesearchbutton").click(function(e){
        e.preventDefault();
        if($("#courses select").val().indexOf(".aspx") != -1)
            window.location.href = $("#courses select").val();
    });
    
    
});
