var Site = {
		
	checkLinksTarget: function(domaineSite) {
		$('a.checkTarget[href*="'+domaineSite+'"] , a.checkTarget[href*="'+domaineSite.replace('http://','http://www.')+'"]').each(function(){ 
			$(this).attr('target','_self');
		});
	},
	
	addHref: function(domaineSite,id,href){
		$("#"+id).addClass('hovercursor');
		$("#"+id).click(
			function (e) {
				var target = "_blank";	
				if(href.indexOf(domaineSite) != -1){
					target = '_self';
				}
				window.open(href,target);	
				e.preventDefault();
			}		  
		);
	},
	
	slideshow: function(){ 
		$('.slideshow').cycle({ 
		    fx:    		'fade',
		    timeout:	5000,
		    speed:  	1000,
		    pause:		true
		 });
	},
	
	nl_subscribe: function(email){
		if(typeof email=='string' && email != ""){
			$.ajax({
				type: "POST",
				url: Shin.href(":newsletter/subscribe/"),
				data: "e="+email,
				error: function() {
					Shin.stopLoading();
					Shin.alert("error",Shin.i18n('NEWSLETTERS.ALERT_TITLE_SUBSCRIBE_ERROR'), Shin.i18n('NEWSLETTERS.ALERT_MESSAGE_ERROR'),Shin.i18n('NEWSLETTERS.ALERT_ACTION_TEXT'));
				}, 
				success: function(respons) {
					Shin.stopLoading();
					var responses = respons.split('_');		
					Shin.alert(responses[0],Shin.i18n('NEWSLETTERS.ALERT_TITLE_SUBSCRIBE_'+responses[0].toUpperCase()+'_'+responses[1].toUpperCase()), Shin.i18n('NEWSLETTERS.ALERT_MESSAGE_SUBSCRIBE_'+responses[0].toUpperCase()+'_'+responses[1].toUpperCase()),Shin.i18n('NEWSLETTERS.ALERT_ACTION_TEXT'));
					if(responses[0] == "success"){
						$('#box_2').remove();
						$('#box_separator2').remove();
					}
				}
			});
		}	
	},
	
	welcome: function(){
		$('#overlay').show();
		$('#overlay').bind('click',function(){
			$('#welcome_overlay').fadeOut('fast');
			Shin.closeAlert();
		});
		setTimeout(function() {
			$('#welcome_overlay').fadeOut('fast');
			Shin.closeAlert();
		}, 20000);	
	}
	
};
