/* Declare a namespace for the site */
var Site = window.Site || {};

/* Create a closure to maintain scope of the '$'
   and remain compatible with other frameworks.  */


(function($) {
	//same as $(document).ready();
	$(function() {
        $("a.big").fancybox({cyclic:true,centerOnScroll:true,transitionIn:'elastic'});
        $("img[title]").tooltip({
               // tweak the position
               offset: [10, 2],
               // use the "slide" effect
               effect: 'slide'
               // add dynamic plugin with optional configuration for bottom edge
        }).dynamic({ bottom: { direction: 'down', bounce: true } });
        $(".fakeRadio input[type=radio], .fakeCheckBox input[type=checkbox]").styleIt();

	});
/*
	$(window).bind("load", function() {

	
	});

    $(window).resize(function() {

    });
*/

})(jQuery);

jQuery.fn.styleIt=function(){
    if(this.length<1) return;
    var i=this.length;
    while(i--){
        this.eq(i).change(function(){
            var t=$(this);
            var p=t.parent();
            if(t.attr('type')=='radio'){
                $(".fakeRadio input[name="+t.attr('name')+"]").parent().removeClass('checked');
            }
            if(this.checked){
                p.addClass('checked');
            }else{
                p.removeClass('checked');
            }
        });
    }
}

