// JavaScript Document
$(document).ready(function(){


/*********************************************************/

var sudoSlider = $("#bannerWrapp").sudoSlider({
continuous:true,
numeric:true,
auto:true,
speed: 2000,
pause: 3000,
controlsFade: false,
fade:true
});


/******************************************************************************/
/*
$("#gotop").click(function(event){
event.preventDefault();
var full_url = this.href;
var parts = full_url.split("#");
var trgt = parts[1];
var target_offset = $("#"+trgt).offset();
var target_top = target_offset.top;
$('html, body').animate({scrollTop:target_top}, 500);
});
*/
/*********************************************************/

/*
$("#navtab ul li:first").addClass("active"); //Activate first tab
$(".contentbox") .hide();
$(".contentbox:first").show(); //Show first tab content
//On Click Event
$("#navtab ul li").click(function() {
$("#navtab ul li").removeClass("active"); //Remove any "active" class
$(this).addClass("active");
$(".contentbox").hide(); //Hide all tab content
var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active content
return false;
});
*/

/**************************************************************************************/

$('input.date_picker').date_input();

//for text replacement
$('.focusField').focus(function() {
if (this.value == this.defaultValue){ 
this.value = '';
}
if(this.value != this.defaultValue){
this.select();
}
});
$('.focusField').blur(function() {
if ($.trim(this.value) == ''){
this.value = (this.defaultValue ? this.defaultValue : '');
}
});
});

$(document).ready(function () {
    /*
    *   Examples - images
    */

    $("a#example1").fancybox({
        'titleShow': false
    });

    $("a#example2").fancybox({
        'titleShow': false,
        'transitionIn': 'elastic',
        'transitionOut': 'elastic'
    });

    $("a#example3").fancybox({
        'titleShow': false,
        'transitionIn': 'none',
        'transitionOut': 'none'
    });

    $("a#example4").fancybox();

    $("a#example5").fancybox({
        'titlePosition': 'inside'
    });

    $("a#example6").fancybox({
        'titlePosition': 'over'
    });

    $("a[rel=example_group]").fancybox({
        'height': '100%',
        'autoScale': true,
        'transitionIn': 'none',
        'transitionOut': 'none',
        'titlePosition': 'over',
        'titleFormat': function (title, currentArray, currentIndex, currentOpts) {
            return '<span id="fancybox-title-over">' + (title.length ? ' &nbsp; ' + title : '') + '</span>';
        }
    });

    /*
    *   Examples - various
    */

    $("#various1").fancybox({
        'titlePosition': 'inside',
        'transitionIn': 'none',
        'transitionOut': 'none'
    });

    $("#various2").fancybox();

    $("#various3").fancybox({
        'height': '100%',
        'autoScale': true,
        'transitionIn': 'none',
        'transitionOut': 'none',
        'type': 'iframe'
    });

    $("#various4").fancybox({
        'padding': 0,
        'autoScale': false,
        'transitionIn': 'none',
        'transitionOut': 'none'
    });
});
