/*config */

//homepage slide image
var img1 = 'images/silvia-poloto.jpg';
var img2 = 'images/silvia-poloto-2.jpg';
var img3 = 'images/silvia-poloto-3.jpg';

$(document).ready(function(){
$(".prev").addClass("hidden");
$(".prev a").hide();
$(".next").addClass("hidden");
$(".next a").hide();

if (jQuery.browser.safari && document.readyState != "complete"){
    //console.info('ready...');
    setTimeout( arguments.callee, 10 );
    return;
  }

  $(".confirm_button").click( function() {
                    var url = $(this).attr('href'); 
					jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) {
					   if( r ) {
                                location.href = url;
                                } else { } 
                        });
                                
                            return false; 
                });



    if($('#slider').length > 0){
        $('#slider').crossSlide({
            sleep: 4,
            fade: 2
                }, [
                    { src: img1 },
                    { src: img2 },
                    { src: img3 }
        ]);      	
    }

    $(".sub").click(function(){
	  if($(this).next().slideToggle("normal")){
	  }
	});
	
//	$("a[rel='gallery']").colorbox();
    $("a[rel='gallery']").colorbox({transition:"none", width:"75%", height:"95%",opacity:0.25});
	
    	
	//scroll gallery
    var scroll = 554; 
    scrolls = 0; 
    w = $(".anythingSlider ul").height();
    

   // $(".sss").text(scroll+"x"+w);
    if(w > scroll) { //hide for one 
        $(".next").removeClass("hidden");
        $(".next a").show();
    }
    
	$(".next").click(function(){     
                    if(w > scrolls+scroll) { 
                    
	                scrolls = scrolls+scroll;
					$(".anythingSlider ul").animate({marginTop:'-'+ scrolls +'px'},'slow'); 
                    $(".prev").removeClass("hidden");
					$(".prev a").show();
					if((scrolls+scroll)>=w){
                    //$(".next").addClass("hidden");
                    $(".next a").hide();
                    }
                    // $(".sss").text(scrolls+scroll+"x"+w);
                     }
        						   
	});
    $(".prev").click(function(){                    
	                 
                   if(w > scrolls-scroll && scrolls > 0 ) {
                   scrolls = scrolls-scroll;;	                
				   $(".anythingSlider ul").animate({marginTop: '-'+ scrolls +'px'},'slow'); 
				   if((scrolls+scroll)<w){
                    $(".next").removeClass("hidden");
                    $(".next a").show();
                    }
                    if(scrolls==0){
                   $(".prev").addClass("hidden");
                   $(".prev a").hide();
                 }
                // $(".sss").text(scrolls-scroll+"x"+w);
                 } 
              						   
	}); 
	
});

			   