
 //<![CDATA[
        /*Shadowbox.init({
        handleOversize: "drag",
        modal: true
        });*/

        // credits to http://shadowbox-js.com/forum.html#nabble-td3617720
        Shadowbox.init({
            onFinish : function() {
                $('#sb-body-inner img').one('click', Shadowbox.close);
            }
        });
        $(document).ready( function() {
        	 //<![CDATA[

            Shadowbox.setup(".reference a");
            /* adds rel attribute instead of writing it in the HTML */
            
            $('#button a').click( function() {
                    var integer = $(this).attr('rel');
                    $('#myslide .cover').animate({left:-990*(parseInt(integer)-1)})  /*----- Width of div mystuff (here 160) ------ */
                    $('#button a').each( function() {
                        $(this).removeClass('active');
                        if($(this).hasClass('button'+integer)) {
                            $(this).addClass('active')
                        }
                    });
                    return false;
                });
                
             $('#bbutton a').click( function() {
                    var integer = $(this).attr('rel');
                    $('#bmyslide .bcover').animate({left:-790*(parseInt(integer)-1)})  /*----- Width of div mystuff (here 160) ------ */
                    $('#bbutton a').each( function() {
                        $(this).removeClass('bactive');
                        if($(this).hasClass('bbutton'+integer)) {
                            $(this).addClass('bactive')
                        }
                    });
                    return false;
                });
                
                
                 $(".btn-slide").click( function() {
            $("#panel").slideToggle("slow");
            $(this).toggleClass("activess");
            return false;
        });
        
        $('#password-clear').show();
$('#password-password').hide();

$('#password-clear').focus(function() {
    $('#password-clear').hide();
    $('#password-password').show();
    $('#password-password').focus();
});
$('#password-password').blur(function() {
    if($('#password-password').val() == '') {
        $('#password-clear').show();
        $('#password-password').hide();
    }
});










 
	$('#password-clear').show();
	$('#password-password').hide();
 
	$('#password-clear').focus(function() {
		$('#password-clear').hide();
		$('#password-password').show();
		$('#password-password').focus();
	});
	$('#password-password').blur(function() {
		if($('#password-password').val() == '') {
			$('#password-clear').show();
			$('#password-password').hide();
		}
	});
 
	$('.default-value').each(function() {
		var default_value = this.value;
		$(this).focus(function() {
			if(this.value == default_value) {
				this.value = '';
			}
		});
		$(this).blur(function() {
			if(this.value == '') {
				this.value = default_value;
			}
		});
	});
	
	
	
	
	
	
	
	
	
	(function($) {
                                $.fn.sorted = function(customOptions) {
                                    var options = {
                                        reversed : false,
                                        by : function(a) {
                                            return a.text();
                                        }
                                    };
                                    $.extend(options, customOptions);
                                    $data = $(this);
                                    arr = $data.get();
                                    arr.sort( function(a, b) {

                                        var valA = options.by($(a));
                                        var valB = options.by($(b));
                                        if(options.reversed) {
                                            return (valA < valB) ? 1 : (valA > valB) ? -1 : 0;
                                        } else {
                                            return (valA < valB) ? -1 : (valA > valB) ? 1 : 0;
                                        }
                                    });
                                    return $(arr);
                                };
                            })(jQuery);
                            $( function() {

                                var read_button = function(class_names) {
                                    var r = {
                                        selected : false,
                                        type : 0
                                    };
                                    for(var i = 0; i < class_names.length; i++) {
                                        if(class_names[i].indexOf('selected-') == 0) {
                                            r.selected = true;
                                        }
                                        if(class_names[i].indexOf('segment-') == 0) {
                                            r.segment = class_names[i].split('-')[1];
                                        }
                                    };
                                    return r;
                                };
                                var determine_sort = function($buttons) {
                                    var $selected = $buttons.parent().filter('[class*="selected-"]');
                                    return $selected.find('a').attr('data-value');
                                };
                                var determine_kind = function($buttons) {
                                    var $selected = $buttons.parent().filter('[class*="selected-"]');
                                    return $selected.find('a').attr('data-value');
                                };
                                var $preferences = {
                                    duration : 800,
                                    easing : 'easeInOutQuad',
                                    adjustHeight : false
                                };

                                var $list = $('#list');
                                var $data = $list.clone();

                                var $controls = $('ul.splitter ul');

                                $controls.each( function(i) {

                                    var $control = $(this);
                                    var $buttons = $control.find('a');

                                    $buttons.bind('click', function(e) {

                                        var $button = $(this);
                                        var $button_container = $button.parent();
                                        var button_properties = read_button($button_container.attr('class').split(' '));
                                        var selected = button_properties.selected;
                                        var button_segment = button_properties.segment;

                                        if(!selected) {

                                            $buttons.parent().removeClass('selected-0').removeClass('selected-1').removeClass('selected-2');
                                            $button_container.addClass('selected-' + button_segment);

                                            var sorting_type = determine_sort($controls.eq(1).find('a'));
                                            var sorting_kind = determine_kind($controls.eq(0).find('a'));

                                            if(sorting_kind == 'all') {
                                                var $filtered_data = $data.find('li');
                                            } else {
                                                var $filtered_data = $data.find('li.' + sorting_kind);
                                            }

                                            if(sorting_type == 'size') {
                                                var $sorted_data = $filtered_data.sorted({
                                                    by : function(v) {
                                                        return parseFloat($(v).find('span').text());
                                                    }
                                                });
                                            } else {
                                                var $sorted_data = $filtered_data.sorted({
                                                    by : function(v) {
                                                        return $(v).find('strong').text().toLowerCase();
                                                    }
                                                });
                                            }

                                            /* modified code to integrate shadowbox */
                                            $list.quicksand($sorted_data, $preferences, function() {

                                                Shadowbox.clearCache();
                                                Shadowbox.setup(".reference a");
                                                /* adds rel attribute instead of writing it in the HTML */

                                                Shadowbox.init({
                                                    handleOversize : "drag",
                                                    modal : true

                                                });

                                                $( function() {
                                                    $('#set1 *').tooltip({
                                                        track : true,
                                                        delay : 0,
                                                        showURL : false,
                                                        showBody : " - ",
                                                        fade : 250
                                                    });

                                                });
                                            });
                                            //$list.quicksand($sorted_data, $preferences); /* original quicksand code */

                                        }

                                        e.preventDefault();
                                    });
                                });
                                var high_performance = true;
                                var $performance_container = $('#performance-toggle');
                                var $original_html = $performance_container.html();

                                $performance_container.find('a').live('click', function(e) {
                                    if(high_performance) {
                                        $preferences.useScaling = false;
                                        $performance_container.html('CSS3 scaling turned off. Try the demo again. <a href="#toggle">Reverse</a>.');
                                        high_performance = false;
                                    } else {
                                        $preferences.useScaling = true;
                                        $performance_container.html($original_html);
                                        high_performance = true;
                                    }
                                    e.preventDefault();
                                });
                            });
	
	
	
	
	
	
	
	$( function() {
                    $('#set1 *').tooltip({
                        track : true,
                        delay : 0,
                        showURL : false,
                        showBody : " - ",
                        fade : 250
                    });

                });

	
	
	
	
	
	
	
	
	
	
	
	$(window).load( function() {
                                $('#slider').nivoSlider({
                                    effect : 'sliceUp', // Specify sets like: 'fold,fade,sliceDown'
                                    slices : 15, // For slice animations
                                    boxCols : 8, // For box animations
                                    boxRows : 4, // For box animations
                                    animSpeed : 400, // Slide transition speed
                                    pauseTime : 3000, // How long each slide will show
                                    startSlide : 0, // Set starting Slide (0 index)
                                    directionNav : true, // Next & Prev navigation
                                    directionNavHide : true, // Only show on hover
                                    controlNav : true, // 1,2,3... navigation
                                    controlNavThumbs : false, // Use thumbnails for Control Nav
                                    controlNavThumbsFromRel : false, // Use image rel for thumbs
                                    controlNavThumbsSearch : '.jpg', // Replace this with...
                                    controlNavThumbsReplace : '_thumb.jpg', // ...this in thumb Image src
                                    keyboardNav : true, // Use left & right arrows
                                    pauseOnHover : true, // Stop animation while hovering
                                    manualAdvance : false, // Force manual transitions
                                    captionOpacity : 0.8, // Universal caption opacity
                                    prevText : 'Prev', // Prev directionNav text
                                    nextText : 'Next', // Next directionNav text
                                    beforeChange : function() {
                                    }, // Triggers before a slide transition
                                    afterChange : function() {
                                    }, // Triggers after a slide transition
                                    slideshowEnd : function() {
                                    }, // Triggers after all slides have been shown
                                    lastSlide : function() {
                                    }, // Triggers when last slide is shown
                                    afterLoad : function() {
                                    } // Triggers when slider has loaded
                                });
                            });
	
	
	
	
	
	
	
$(".scroll").click( function(event) {
                        //prevent the default action for the click event
                        event.preventDefault();

                        //get the full url - like mysitecom/index.htm#home
                        var full_url = this.href;

                        //split the url by # and get the anchor target name - home in mysitecom/index.htm#home
                        var parts = full_url.split("#");
                        var trgt = parts[1];

                        //get the top offset of the target anchor
                        var target_offset = $("#"+trgt).offset();
                        var target_top = target_offset.top;

                        //goto that anchor by setting the body scroll top to anchor top
                        $('html, body').animate({scrollTop:target_top}, 500);
                    });	
	
	$('#testimonials .slidet');
	setInterval(function(){
		$('#testimonials .slidet').filter(':visible').fadeOut(2000,function(){
			if($(this).next('li.slidet').size()){
				$(this).next().fadeIn(1000);
			}
			else{
				$('#testimonials .slidet').eq(0).fadeIn(1000);
			}
		});
	},8000);	
	
	
		$('#testimonialsb .slidetb');
	setInterval(function(){
		$('#testimonialsb .slidetb').filter(':visible').fadeOut(2000,function(){
			if($(this).next('li.slidetb').size()){
				$(this).next().fadeIn(1000);
			}
			else{
				$('#testimonialsb .slidetb').eq(0).fadeIn(1000);
			}
		});
	},15000);	
	
	
	
	/*]]>*/

	 
            
            
        });
        //]]>



