
//$.fn.cycle.defaults.speed   = 900;
//$.fn.cycle.defaults.timeout = 6000;
  $(document).ready(function(){
  	$('#slider_left').bxSlider({
		auto: true,
		autoControls: false,
		autoHover: true,
		pager: false,
		speed:500,
		infiniteLoop: true,  
		controls: false,
		pause: 10000	
	});
    $('#slider1').bxSlider({
            auto: true,
            autoControls: false,
            autoHover: true,
            pager: false,
			speed:1000,
			infiniteLoop: true,  
            controls: false,
			pause: 5000, 
			mode:'fade'
			
        });
	$('#slider2').bxSlider({
		auto: true,
		autoControls: false,
		autoHover: true,
		pager: false,
		speed:500,
		infiniteLoop: true,  
		controls: false,
		pause: 10000

		
	});
		$('#slider3').bxSlider({
		auto: true,
		autoControls: false,
		autoHover: true,
		pager: false,
		speed:500,
		infiniteLoop: true,  
		controls: false,
		pause: 10000	
	}); 

/*	$('#slider4').bxSlider({
		auto: true,
		autoControls: false,
		autoHover: true,
		pager: false,
		speed:500,
		infiniteLoop: true,  
		controls: false,
		pause: 10000, 
		     mode: 'vertical',

		
	});
*/	
	$('#slider4').cycle({
	//	fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	//	fx:      'scrollUp',
	//	timeout:  10000,
	//	easing:  'easeInOutBack'

		fx:      'scrollDown', 
		sync: true,
		speedIn:  1000, 
	
		speedOut: 500, 
		easing:  'easeInOutBack',
		easeIn:  'easeInCirc', 
		timeout:  10000,
		easeOut: 'easeOutBounce', 
		delay:   -4000 
	});
	

  });


		$(document).ready(function() {
			$("#various3").fancybox({
				'width'				: 950,
				'height'			: 460,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			
				$("a[rel=lightbox]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});

		$('.dreaptaDET .telefon_off').click(function(){
			$('.dreaptaDET .telefon_on').fadeIn();
			$(this).hide();
		});
		$('.dreaptaDET .email_off').click(function(){
			$('.dreaptaDET .email_on').fadeIn();
			$(this).hide();
		});
		var widthScreen=$(window).width();
	//	$('#sponsori_stanga').css('width',(widthScreen-1004)/2);
	//	$('#sponsori_dreapta').css('width',(widthScreen-1004)/2);
		if(widthScreen>=1280) {
			$("#sponsori_stanga").css({'left':'-139px','width':'135'});
			$("#sponsori_dreapta").css({'right':'-139px','width':'135'});
			$('.sponsori_principali_stanga').css('width','135');
			$('.sponsori_principali_dreapta').css('width','135');
			$('.sponsori_principali_stanga img').css('width','135');
			$('.sponsori_principali_dreapta img').css('width','135');
			$('#sponsori_dreapta h1').css('width','135');
			$('#sponsori_stanga h1').css('width','135');			
		}
		
		
		$('.partener').hover(function(){
			$(this).children().children().css('color','#fff');
			//alert ($(this).children().children().attr('href'));
		},
		function(){
			$(this).children().children().css('color','#303851');
			//$(this).children().find('.nolimitsss').children().css('color','#fff');
		});	
		
	});
	
		function updateEmail(id){
			$.post("telmail.php", { id: id, type: "email" } );
		}
		function updateTel(id){
			$.post("telmail.php", { id: id, type: "tel" } );
		}
		


$(document).ready(function(){
	$("#newsletterEmail").focus(function(){
		if($(this).attr("value") == "Email")
		{
		$(this).attr("value","");
		}
		$("#errorN").text("").css("display","none");
		
	});
	$("#newsletterEmail").blur(function(){
		if($(this).val() == "")
		$(this).attr("value", "Email");
	});
	$("#dezabonare").click(function(){ 
		var	se_email = checkform();
		if(se_email != '')
			$('#newsletterForm').attr('action', 'http://www.vipstyle.ro/register/newsletter?email2='+se_email).submit();

			
		});
	$("#abonare").click(function(){
		var	se_email = checkform();
		if(se_email != '')
			$('#newsletterForm').attr('action', 'http://www.vipstyle.ro/register/newsletter?email='+se_email).submit();

	});
});
function sendForm(textss){
var email = $("#newsletterEmail").val().replace(/^\s\s*/, '').replace(/\s\s*$/, '');
		$.post($("#newsletterForm").attr("action"), { email: email,unsubscribereason: "", unsubscribe: "Dezaboneazã-te", unsubscribeemail : email, htmlemail: "1", 'list[6]' : "signup" , 'listname[6]' : "newsletter VIPstyle" , subscribe : "Abonare"},
			function(data){
			$("#errorN").css("display","none");
			$("#abonat").html(textss).css("display","block");
		}, "html");
}
function checkform() {
	
	var email = $("#newsletterEmail").val().replace(/^\s\s*/, '').replace(/\s\s*$/, '');
	if(email == "Email" ||  email == "")
	{
		$("#errorN").text("Nu ati introdus email-ul.").css("display","block");
		
		return false;
	}
	else if(!email.match(/([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,4})/gi))
	{
	$("#errorN").text("Email-ul nu este valid.").css("display","block");
	return false;
	}
	else
	return email;
	/*
		{
		
		$.post($("#newsletterForm").attr("action"), { email: email, unsubscribeemail : email, htmlemail: "1", 'list[6]' : "signup" , 'listname[6]' : "newsletter VIPstyle" , subscribe : "Abonare"},
			function(data){
			$("#vipstyle_newsletter").html(data);
		}, "html");

		
		
		}
		*/
	return false;
}

