$(document).ready(function() {
    try
    {
    datetoday = new Date();
    timenow = datetoday.getTime();
    datetoday.setTime(timenow);
    thehour = datetoday.getHours();
    
    //alert(thehour);
    if (thehour < 6)
    {
    //alert('night');
       $('body').addClass('nighttime');
       }
    else if(thehour >= 6 && thehour < 9 )
    {
    //alert('sunrise');
       $('body').addClass('sunrise');
       }
    else if(thehour >= 9 && thehour < 17)
    {
    //alert('day');
       $('body').addClass('daytime');
       }
    else if(thehour >= 17 && thehour < 19)
    {
    //alert('dusk');
       $('body').addClass('sunrise');  
       }
    else {
    //alert('night');
       $('body').addClass('nighttime');
    }
    
    $('.rays').innerfade({
        speed: 'slow',
        timeout: 1000,
        type: 'sequence',
        containerheight: '174px'
    });
    
    
}
catch(err)
{}

    $("#main").tabs({ selected: 0 });
    $("#tabs1").tabs();
    $("#tabs2").tabs();
    $("#tabs3").tabs();
    
    

    $("#history").easySlider({
        auto: true,
        continuous: true,
        speed: 1,
        pause: 5000,
        numeric: true
    });

    

    $('fieldset').each(function(i) {

    if ($(this).find('.text').val() == '' || $(this).find('.searchField').val() == '') {

            $(this).addClass('default');

        }



    });



    $('.text, .searchField').click(function(e) {

        $(this).parent('fieldset').removeClass('default');

        if (this.tagName == "span") {

            if ($(this).siblings(".text")) {

                $(this).siblings(".text").focus();

            }

        }

    })

	.focus(function(e) {

	    $(this).parent('fieldset').removeClass('default');

	})

	.blur(function() {

	    if ($(this).val() == '')

	        $(this).parent('fieldset').addClass('default');

	});

});



function init() {

    man = new jsAnimManager();

    cm1 = man.createAnimObject("balloon3");
    cm4 = man.createAnimObject("balloon4");
    cm5 = man.createAnimObject("balloon5");
    cm6 = man.createAnimObject("balloon6");

    cm1.add({ property: Prop.top, from: 69, to: 64, duration: 1950, loop: -1, ease: jsAnimEase.bounceSmooth });

    cm4.add({ property: Prop.top, from: 94, to: 89, duration: 1750, loop: -1, ease: jsAnimEase.bounceSmooth });

    cm5.add({ property: Prop.top, from: 101, to: 96, duration: 1500, loop: -1, ease: jsAnimEase.bounceSmooth });

    cm6.add({ property: Prop.top, from: 89, to: 84, duration: 2200, loop: -1, ease: jsAnimEase.bounceSmooth });

    

}


