//home page slider
jQuery(document).ready(function(){
jQuery.noConflict();
resize();

/*
if (jQuery("body").attr("id") == "index")
{
jQuery('#news_nolita').addClass('news_position');
jQuery('#news_rare').addClass('news_position');

}
*/

/* if the web page is brands set the nolita black and wite image and the text to be displayed by default. */
if ( jQuery("body").attr("id") == "brands")
{

	/* find the proper box on the left and enable it by putting shadow and changing the image, leaving the others in grey image */
    var boxes= jQuery('#boxes_menu').children();
   jQuery(boxes).each(function(){
					  
	    if(this.id=="nolita"){
			 jQuery("#main_content").removeClass();
			 jQuery("#main_content").addClass(this.id+"-text");
		     jQuery("."+this.id+"-img").attr("src","../images/PNG/"+this.id+"-color.png");
			 jQuery(this).css('-moz-box-shadow','10px 10px 5px #888');
	         jQuery(this).css('-webkit-box-shadow','10px 10px 5px #888');
	         jQuery(this).css('box-shadow','10px 10px 5px #888');
			 jQuery(this).css('behavior','url(../PIE.htc)');
		}
	 });

}


/* boxes on cklick and hover code */
jQuery('.img').click(function(){
	
	/* put grey background on the brands menu option */
	jQuery("a#brands").css('background-color','#989898');
	jQuery("a#brands").css('color','white');
	/* hide the te flash object and the divs thacontain the text */
	jQuery('#nolita-pocket_text').hide();
    jQuery('#rare-thekid_text').hide();
    jQuery("#nolita_text").hide();
    jQuery("#rare_text").hide();
	jQuery("#flash_album").hide();
	jQuery("#polaroid").hide();


	jQuery("#nolita-text-main").hide();
		jQuery("#rare-text-main").hide();
			jQuery("#nolita-pocket-text-main").hide();
				jQuery("#rare-thekid-text-main").hide();
	
	 jQuery("#"+this.id+"-text-main").fadeIn('slow');
	 jQuery("#main_content").removeClass();
	 jQuery("#main_content").addClass(this.id+"-text");
	 jQuery("#"+this.id+"_text").show();
	 
	 jQuery(this).css('-moz-box-shadow','10px 10px 5px #888');
	  jQuery(this).css('-webkit-box-shadow','10px 10px 5px #888');
	   jQuery(this).css('box-shadow','10px 10px 5px #888');
	
	 var active_box=this.id;
	 
	 var boxes= jQuery('#boxes_menu').children();
	 jQuery(boxes).each(function(){
	    if(this.id!=active_box){
			jQuery("."+this.id+"-img").attr("src","../images/PNG/"+this.id+".png");
			jQuery(this).css('-moz-box-shadow','0px 0px 0px #888');
			jQuery(this).css('-webkit-box-shadow','0px 0px 0px #888');
	   jQuery(this).css('box-shadow','0px 0px 0px #888');
		}else{
			jQuery("."+this.id+"-img").attr("src","../images/PNG/"+this.id+"-color.png");
		}
	 });

	 
	 
});



/* news onclick and hover script */
jQuery('#news_nolita').click(function(){
  
	jQuery(this).css('border-color','#e74a99');
	jQuery('#news_rare').css('border-color','#ba4d53');
	jQuery(".rare-twitter").attr("src","../images/PNG/twitter.png");
	jQuery(".nolita-twitter").attr("src","../images/PNG/twitter-de.png");

		 

});

jQuery('#news_rare').click(function(){
	
			
	jQuery(this).css('border-color','#e74a99');
	jQuery('#news_nolita').css('border-color','#ba4d53');
	jQuery(".nolita-twitter").attr("src","../images/PNG/twitter.png");
	jQuery(".rare-twitter").attr("src","../images/PNG/twitter-de.png");

		 
});

/* when clicking on the main iamge display b/w ad text,and enable the brands menu option */
jQuery('.main_img').click(function(){
  
  jQuery("a#brands").css('background-color','');
	jQuery("a#brands").css('color','');
	
  	
	
	
	if(jQuery("#main_content").hasClass("rare-thekid")){
		jQuery("#main_content").removeClass();
		jQuery("#main_content").addClass("rare-thekid-text");
		jQuery('.main_img').attr("src","../images/PNG/rare-thekid-text-main.png");
		jQuery("#rare-thekid_text").fadeIn();
	}
	
	if(jQuery("#main_content").hasClass("nolita-pocket")){	
		jQuery("#main_content").removeClass();
		jQuery("#main_content").addClass("nolita-pocket-text");
		jQuery('.main_img').attr("src","../images/PNG/nolita-pocket-text-main.png");
		jQuery("#nolita-pocket_text").fadeIn();
	}
	if(jQuery("#main_content").hasClass("nolita")){	
		jQuery("#main_content").removeClass();
		jQuery("#main_content").addClass("nolita-text");
		jQuery('.main_img').attr("src","../images/PNG/nolita-text-main.png");
		jQuery("#nolita_text").fadeIn();
	}
	if(jQuery("#main_content").hasClass("rare")){	
		jQuery("#main_content").removeClass();
		jQuery("#main_content").addClass("rare-text");
		jQuery('.main_img').attr("src","../images/PNG/rare-text-main.png");
		jQuery("#rare_text").fadeIn();
	}

});

/* language chooser toggle */

jQuery('.current_lang').click(function(){
									   
	jQuery('.languages').toggle('slow');

});				

/*on click of a languaeg redirect a pag based on the id of each page */
jQuery('.lang').click(function(){
	var page = jQuery("body").attr("id");
	var language = jQuery(this).attr("id");
	jQuery(window.location).attr('href', '../' + language + '/' + page + ".html");
});											   

});




window.onresize=function(){
resize();
}

function resize(){
var width = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
var height = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
jQuery('#sfondo').width(width);
jQuery('#sfondo').height(height);
jQuery('.img_big').height(height);
jQuery('#content').height(height);
};

jQuery(window).load(function(){
jQuery('.all').fadeIn('slow');
setTimeout("resize();",100);
});

function openlook(look){
jQuery('.slideover').show();
jQuery('.slideover li').hide();
jQuery('.slideover li.' + look).show();
jQuery('.slide').css('background','none');
};

function close_look(){
	jQuery('.slideover').hide();
    jQuery('.slide').css('background','url("../images/bg_slide.png") repeat scroll 0 0 transparent');
	}
	
function close_look_big(){
	jQuery('.slideshow_big').hide();
    jQuery('.slide').css('background','url("../images/bg_slide.png") repeat scroll 0 0 transparent');
	}
	
function openlookbig(look){
	jQuery('.slideover').hide();
    jQuery('.slide').css('background','none');
	var height = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
	var width = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
	jQuery('.slideshow_big').show();
	jQuery('.slideshow_big li').hide();
	jQuery('.slideshow_big li.' + look).show();
	jQuery('.slideshow_big').height(height);
	var img_width = jQuery('.slideshow_big .' + look + ' img').attr('width');
    jQuery('.slideshow_big .box_big').css('width',img_width);
	var left_space = (width/2)-(img_width/2);
	var top_space = (height/2)-300;
	jQuery('.slideshow_big .box_big').css('left',left_space);
	jQuery('.slideshow_big .box_big').css('top',top_space);
	jQuery('.cloud-zoom').CloudZoom();
	}
	
function scrollright(){
	var left_px = jQuery('#product_listing ul').css('left');
	
	}
	
	
	

	
	
