// JavaScript Document

var negozio = "";
function setDefaultColors() {
	jQuery('#appia_link').css('color', '#ffffff');
	jQuery('#tuscolana_link').css('color', '#ffffff');
	jQuery('#ojetti_link').css('color', '#ffffff');
	jQuery('#outlet_link').css('color', '#ffffff');
}

function hideWindows() {
	jQuery('img#punti_vendita_title1').hide();
	jQuery('img#punti_vendita_title1a').hide();
	jQuery('img#punti_vendita_title1b').hide();
	jQuery('img#punti_vendita_title1c').hide();
	jQuery('img#punti_vendita_title1d').hide();
	
	jQuery('img#punti_vendita_title2').hide();
	jQuery('img#punti_vendita_title2a').hide();
	jQuery('img#punti_vendita_title2b').hide();
	jQuery('img#punti_vendita_title2c').hide();
	jQuery('img#punti_vendita_title2d').hide();
	
	jQuery('img#punti_vendita_title3').hide();
	jQuery('img#punti_vendita_title3a').hide();
	jQuery('img#punti_vendita_title3b').hide();
	jQuery('img#punti_vendita_title3c').hide();
	jQuery('img#punti_vendita_title3d').hide();
	
	jQuery('img#punti_vendita_title4').hide();
	jQuery('img#punti_vendita_title4a').hide();
	jQuery('img#punti_vendita_title4b').hide();
	jQuery('img#punti_vendita_title4c').hide();
	jQuery('img#punti_vendita_title4d').hide();
}


function showWinNegozio(NewNegozio) {
	switch(negozio) {
		case "appia":
			jQuery('img#punti_vendita_title1a').fadeIn('fast', function() {
			
				jQuery('img#punti_vendita_title2a').fadeIn('fast', function() {
				
					jQuery('img#punti_vendita_title3a').fadeIn('fast', function() {
					
						jQuery('img#punti_vendita_title4a').fadeIn('fast');
					});
				});
			});
		break;
		
		case "tuscolana":
			jQuery('img#punti_vendita_title1b').fadeIn('fast', function() {
			
				jQuery('img#punti_vendita_title2b').fadeIn('fast', function() {
				
					jQuery('img#punti_vendita_title3b').fadeIn('fast', function() {
					
						jQuery('img#punti_vendita_title4b').fadeIn('fast');
					});
				});
			});
		break;
		
		case "ojetti":
			jQuery('img#punti_vendita_title1c').fadeIn('fast', function() {
			
				jQuery('img#punti_vendita_title2c').fadeIn('fast', function() {
				
					jQuery('img#punti_vendita_title3c').fadeIn('fast', function() {
					
						jQuery('img#punti_vendita_title4c').fadeIn('fast');
					});
				});
			});
		break;
		
		case "outlet":
			jQuery('img#punti_vendita_title1d').fadeIn('fast', function() {
			
				jQuery('img#punti_vendita_title2d').fadeIn('fast', function() {
				
					jQuery('img#punti_vendita_title3d').fadeIn('fast', function() {
					
						jQuery('img#punti_vendita_title4d').fadeIn('fast');
					});
				});
			});
		break;
	}
}

jQuery(document).ready(function() {
	
	// Carousel.
	jQuery(function() {
		jQuery("#carousel").jCarouselLite({
			btnNext: ".next",
			btnPrev: ".prev",
			visible: 1,
			speed: 500
		});
	});
	
	// Shadowbox
	Shadowbox.init();
	

	/*
	| ------------------------------------------
	| APPIA
	| ------------------------------------------
	*/
	
	jQuery('a#pv_appia').click(function(){
		negozio = "appia";
		hideWindows();
		showWinNegozio(negozio);
		setDefaultColors();
		jQuery('#appia_link').css('color', '#f6e49f');
		return false;
	});
	

	jQuery('a#pv_appia').mouseover(function(){
		if (negozio != "appia") {
			jQuery('#appia_link').css('color', '#f6e49f');
		}
	});
	
	jQuery('a#pv_appia').mouseout(function(){
		if (negozio != "appia") {
			jQuery('#appia_link').css('color', '#ffffff');
		}
	});
	
	jQuery('a#appia_link').click(function(){
		negozio = "appia";
		hideWindows();
		showWinNegozio(negozio);
		setDefaultColors();
		jQuery('#appia_link').css('color', '#f6e49f');
		return false;
	});
	
	jQuery('a#appia_link').mouseover(function(){
		if (negozio != "appia") {
			jQuery('#appia_link').css('color', '#f6e49f');
		}
	});
	
	jQuery('a#appia_link').mouseout(function(){
		if (negozio != "appia") {
			jQuery('#appia_link').css('color', '#ffffff');
		}
	});
	
	
	
	
	/*
	| ------------------------------------------
	| TUSCOLANA
	| ------------------------------------------
	*/
	
	jQuery('a#pv_tuscolana').click(function(){
		negozio = "tuscolana";
		hideWindows();
		showWinNegozio(negozio);
		setDefaultColors();
		jQuery('#tuscolana_link').css('color', '#f6e49f');
		return false;
	});
	
	jQuery('a#pv_tuscolana').mouseover(function(){
		if (negozio != "tuscolana") {
			jQuery('#tuscolana_link').css('color', '#f6e49f');
		}
	});
	
	jQuery('a#pv_tuscolana').mouseout(function(){
		if (negozio != "tuscolana") {
			jQuery('#tuscolana_link').css('color', '#ffffff');
		}
	});
	
	jQuery('a#tuscolana_link').click(function(){
		negozio = "tuscolana";
		hideWindows();
		showWinNegozio(negozio);
		setDefaultColors();
		jQuery('#tuscolana_link').css('color', '#f6e49f');
		return false;
	});
	
	jQuery('a#tuscolana_link').mouseover(function(){
		if (negozio != "tuscolana") {
			jQuery('#tuscolana_link').css('color', '#f6e49f');
		}
	});
	
	jQuery('a#tuscolana_link').mouseout(function(){
		if (negozio != "tuscolana") {
			jQuery('#tuscolana_link').css('color', '#ffffff');
		}
	});
	
	
	/*
	| ------------------------------------------
	| OJETTI
	| ------------------------------------------
	*/
	
	jQuery('a#pv_ojetti').click(function(){
		negozio = "ojetti";
		hideWindows();
		showWinNegozio(negozio);
		setDefaultColors();
		jQuery('#ojetti_link').css('color', '#f6e49f');
		return false;
	});
	
	jQuery('a#pv_ojetti').mouseover(function(){
		if (negozio != "ojetti") {
			jQuery('#ojetti_link').css('color', '#f6e49f');
		}
	});
	
	jQuery('a#pv_ojetti').mouseout(function(){
		if (negozio != "ojetti") {
			jQuery('#ojetti_link').css('color', '#ffffff');
		}
	});
	
	jQuery('a#ojetti_link').click(function(){
		negozio = "ojetti";
		hideWindows();
		showWinNegozio(negozio);
		setDefaultColors();
		jQuery('#ojetti_link').css('color', '#f6e49f');
		return false;
	});
	
	jQuery('a#ojetti_link').mouseover(function(){
		if (negozio != "ojetti") {
			jQuery('#ojetti_link').css('color', '#f6e49f');
		}
	});
	
	jQuery('a#ojetti_link').mouseout(function(){
		if (negozio != "ojetti") {
			jQuery('#ojetti_link').css('color', '#ffffff');
		}
	});
	
	
	/*
	| ------------------------------------------
	| OUTLET
	| ------------------------------------------
	*/
	
	jQuery('a#pv_outlet').click(function(){
		negozio = "outlet";
		hideWindows();
		showWinNegozio(negozio);
		setDefaultColors();
		jQuery('#outlet_link').css('color', '#f6e49f');
		return false;
	});
	
	jQuery('a#pv_outlet').mouseover(function(){
		if (negozio != "outlet") {
			jQuery('#outlet_link').css('color', '#f6e49f');
		}
	});
	
	jQuery('a#pv_outlet').mouseout(function(){
		if (negozio != "outlet") {
			jQuery('#outlet_link').css('color', '#ffffff');
		}
	});
	
	jQuery('a#outlet_link').click(function(){
		negozio = "outlet";
		hideWindows();
		showWinNegozio(negozio);
		setDefaultColors();
		jQuery('#outlet_link').css('color', '#f6e49f');
		return false;
	});
	
	jQuery('a#outlet_link').mouseover(function(){
		if (negozio != "outlet") {
			jQuery('#outlet_link').css('color', '#f6e49f');
		}
	});
	
	jQuery('a#outlet_link').mouseout(function(){
		if (negozio != "outlet") {
			jQuery('#outlet_link').css('color', '#ffffff');
		}
	});
	
	// Negozi
	
	var gmap_appia = "<iframe width=\"814\" height=\"300\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" src=\"http://maps.google.it/maps?q=soho+store+appia&amp;hl=it&amp;cd=1&amp;ei=Yj6jS9WuNsOg_gablfiGCA&amp;sll=41.895466,12.482324&amp;sspn=1.643716,3.56781&amp;ie=UTF8&amp;view=map&amp;cid=2960429683770823599&amp;ved=0CBwQpQY&amp;hq=soho+store+appia&amp;hnear=&amp;ll=41.883061,12.512376&amp;spn=0.004793,0.017445&amp;z=16&amp;iwloc=A&amp;output=embed\"></iframe><br /><small><a href=\"http://maps.google.it/maps?q=soho+store+appia&amp;hl=it&amp;cd=1&amp;ei=Yj6jS9WuNsOg_gablfiGCA&amp;sll=41.895466,12.482324&amp;sspn=1.643716,3.56781&amp;ie=UTF8&amp;view=map&amp;cid=2960429683770823599&amp;ved=0CBwQpQY&amp;hq=soho+store+appia&amp;hnear=&amp;ll=41.883061,12.512376&amp;spn=0.004793,0.017445&amp;z=16&amp;iwloc=A&amp;source=embed\" style=\"color:#0000FF;text-align:left\">Visualizzazione ingrandita della mappa</a></small>";
	
	var gmap_tuscolana = "<iframe width=\"814\" height=\"300\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" src=\"http://maps.google.it/maps?q=soho+store+tuscolana&amp;hl=it&amp;cd=5&amp;ei=TT-jS5n2MoeH_AaArpXzBw&amp;sll=41.887071,12.509471&amp;sspn=0.008242,0.008105&amp;ie=UTF8&amp;view=map&amp;cid=16644467151487793550&amp;ved=0CBsQpQY&amp;hq=soho+store+tuscolana&amp;hnear=&amp;ll=41.859046,12.558489&amp;spn=0.004794,0.017445&amp;z=16&amp;iwloc=A&amp;output=embed\"></iframe><br /><small><a href=\"http://maps.google.it/maps?q=soho+store+tuscolana&amp;hl=it&amp;cd=5&amp;ei=TT-jS5n2MoeH_AaArpXzBw&amp;sll=41.887071,12.509471&amp;sspn=0.008242,0.008105&amp;ie=UTF8&amp;view=map&amp;cid=16644467151487793550&amp;ved=0CBsQpQY&amp;hq=soho+store+tuscolana&amp;hnear=&amp;ll=41.859046,12.558489&amp;spn=0.004794,0.017445&amp;z=16&amp;iwloc=A&amp;source=embed\" style=\"color:#0000FF;text-align:left\">Visualizzazione ingrandita della mappa</a></small>";
	
	var gmap_ojetti = "<iframe width=\"814\" height=\"300\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" src=\"http://maps.google.it/maps?q=soho+store+ugo+ojetti&amp;hl=it&amp;cd=1&amp;ei=qT-jS-niJ5Kh_AbQgIXcBA&amp;sll=41.901949,12.554776&amp;sspn=0.101588,0.008912&amp;ie=UTF8&amp;view=map&amp;cid=13659895096984329850&amp;ved=0CBoQpQY&amp;hq=soho+store+ugo+ojetti&amp;hnear=&amp;ll=41.944282,12.551064&amp;spn=0.004788,0.017445&amp;z=16&amp;iwloc=A&amp;output=embed\"></iframe><br /><small><a href=\http://maps.google.it/maps?q=soho+store+ugo+ojetti&amp;hl=it&amp;cd=1&amp;ei=qT-jS-niJ5Kh_AbQgIXcBA&amp;sll=41.901949,12.554776&amp;sspn=0.101588,0.008912&amp;ie=UTF8&amp;view=map&amp;cid=13659895096984329850&amp;ved=0CBoQpQY&amp;hq=soho+store+ugo+ojetti&amp;hnear=&amp;ll=41.944282,12.551064&amp;spn=0.004788,0.017445&amp;z=16&amp;iwloc=A&amp;source=embed\" style=\"color:#0000FF;text-align:left\">Visualizzazione ingrandita della mappa</a></small>";
	
	var gmap_outlet = "<iframe width=\"814\" height=\"300\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" src=\"http://maps.google.it/maps?q=soho+store+ugo+ojetti&amp;hl=it&amp;cd=2&amp;ei=-D-jS_fJB4We_AbfyPzlBw&amp;sll=41.901949,12.554776&amp;sspn=0.101588,0.008912&amp;ie=UTF8&amp;view=map&amp;cid=8401402181177619766&amp;ved=0CBoQpQY&amp;hq=soho+store+ugo+ojetti&amp;hnear=&amp;ll=41.944489,12.551708&amp;spn=0.004788,0.017445&amp;z=16&amp;iwloc=A&amp;output=embed\"></iframe><br /><small><a href=\"http://maps.google.it/maps?q=soho+store+ugo+ojetti&amp;hl=it&amp;cd=2&amp;ei=-D-jS_fJB4We_AbfyPzlBw&amp;sll=41.901949,12.554776&amp;sspn=0.101588,0.008912&amp;ie=UTF8&amp;view=map&amp;cid=8401402181177619766&amp;ved=0CBoQpQY&amp;hq=soho+store+ugo+ojetti&amp;hnear=&amp;ll=41.944489,12.551708&amp;spn=0.004788,0.017445&amp;z=16&amp;iwloc=A&amp;source=embed\" style=\"color:#0000FF;text-align:left\">Visualizzazione ingrandita della mappa</a></small>";
	
	
	
	var img1 = 1;
	var img2 = 0;
	var img3 = 0;
	var img4 = 0;
	
	if ( (img1 == 1) && (img2 == 0) && (img3 == 0) && (img4 == 0) ) {
		jQuery('div#negozi_map').html(gmap_appia);
		jQuery('#negozi_foto2').css('opacity',0.3);
		jQuery('#negozi_foto3').css('opacity',0.3);
		jQuery('#negozi_foto4').css('opacity',0.3);
	}
	


	jQuery('a#negozi_foto1').mouseover(function(){
		if (img1 == 0) {
			jQuery('#negozi_foto1').fadeTo("fast", 1);
		}
	});
	
	jQuery('a#negozi_foto1').mouseout(function(){
		if (img1 == 0) {
			jQuery('#negozi_foto1').fadeTo("fast", 0.33);
		}
	});

	
	
	jQuery('a#negozi_foto2').mouseover(function(){
		if (img2 == 0) {
			jQuery('#negozi_foto2').fadeTo("fast", 1);
		}
	});
	
	jQuery('a#negozi_foto2').mouseout(function(){
		if (img2 == 0) {
			jQuery('#negozi_foto2').fadeTo("fast", 0.33);
		}
	});
	
	
	jQuery('a#negozi_foto3').mouseover(function(){
		if (img3 == 0) {
			jQuery('#negozi_foto3').fadeTo("fast", 1);
		}
	});
	
	jQuery('a#negozi_foto3').mouseout(function(){
		if (img3 == 0) {
			jQuery('#negozi_foto3').fadeTo("fast", 0.33);
		}
	});
	
	
	jQuery('a#negozi_foto4').mouseover(function(){
		if (img4 == 0) {
			jQuery('#negozi_foto4').fadeTo("fast", 1);
		}
	});
	
	jQuery('a#negozi_foto4').mouseout(function(){
		if (img4 == 0) {
			jQuery('#negozi_foto4').fadeTo("fast", 0.33);
		}
	});
	
	
	jQuery('a#negozi_foto1').click(function(){
		jQuery('div#negozi_map').empty();
		jQuery('html, body').animate({
			scrollTop: jQuery("#negozi_map").offset().top
		}, 1000);
		jQuery('div#negozi_map').html(gmap_appia);
		jQuery('#negozi_foto2').css('opacity',0.3);
		jQuery('#negozi_foto3').css('opacity',0.3);
		jQuery('#negozi_foto4').css('opacity',0.3);
		img1 = 1;
		img2 = 0;
		img3 = 0;
		img4 = 0;
    });
	
	jQuery('a#negozi_foto2').click(function(){
		jQuery('div#negozi_map').empty();
		jQuery('html, body').animate({
			scrollTop: jQuery("#negozi_map").offset().top
		}, 1000);
		jQuery('div#negozi_map').html(gmap_tuscolana);
		jQuery('#negozi_foto1').css('opacity',0.3);
		jQuery('#negozi_foto3').css('opacity',0.3);
		jQuery('#negozi_foto4').css('opacity',0.3);
		img1 = 0;
		img2 = 1;
		img3 = 0;
		img4 = 0;
	});
	
	jQuery('a#negozi_foto3').click(function(){
		jQuery('div#negozi_map').empty();
		jQuery('html, body').animate({
			scrollTop: jQuery("#negozi_map").offset().top
		}, 1000);
		jQuery('div#negozi_map').html(gmap_ojetti);
		jQuery('#negozi_foto1').css('opacity',0.3);
		jQuery('#negozi_foto2').css('opacity',0.3);
		jQuery('#negozi_foto4').css('opacity',0.3);
		img1 = 0;
		img2 = 0;
		img3 = 1;
		img4 = 0;
    });
	
	jQuery('a#negozi_foto4').click(function(){
		jQuery('div#negozi_map').empty();
		jQuery('html, body').animate({
			scrollTop: jQuery("#negozi_map").offset().top
		}, 1000);
		jQuery('div#negozi_map').html(gmap_outlet);
		jQuery('#negozi_foto1').css('opacity',0.3);
		jQuery('#negozi_foto2').css('opacity',0.3);
		jQuery('#negozi_foto3').css('opacity',0.3);
		img1 = 0;
		img2 = 0;
		img3 = 0;
		img4 = 1;
    });

});
