/* $(window).bind("load", function() { 
        $("div#mygalone").slideView();   
        
        var container = $("div#mygalone");        
        var pictEls = container.find("li").size();
        window.setInterval(function() {
        	
        	jQuery("div#stripTransmitter" + j + " a").parent().parent().parent().prev().find("img").each(function(z) {
		  
			var ui 	= 	jQuery(this).parent().parent().parent().next().find("a");
			if(z+1 < pictEls){
				ui.eq(z+1).trigger("click");
			}
			else ui.eq(0).trigger("click");
		   
		});  
        	
        }, 1);
 });*/

$(document).ready(function() {
	
	 $("div#mygalone").slideViewerPro({ 
        galBorderWidth: 0, 
        autoslide: true,  
        thumbsVis: false, 
        shuffle: true,
        asTimer: 5000 
        });     
        
        
        
     $('.apply_offer').click(function() {
			var offerId = parseInt(this.id.replace("apply_", ''));
			var href = this.href;
			var url = document.location.href;
			
			url = href.replace(/employees\/offer.*/, 'employees/logged');
			 
			$.get(url, { offer_id: offerId }, function(data){
				isLogged = parseInt(data);
				if(!isLogged) {
					$.blockUI( { message: $('#logged_box')} );
				    $('.blockOverlay').click($.unblockUI); 
				} else {
					document.location.href = href;
				}
			});
			
			return false;
	});   
	
});