// JavaScript Document

$(document).ready(function() {
		if( $(".product-list li img:first-child").length > 0 ){
				var src = $(".product-list li img:first-child").attr("src");
				//var alt = $(".product-list li img:first-child").attr("alt");
				//var title = $(".product-list li img:first-child").attr("title");
				//var description = '<b>'+title+'</b><br/>'+alt;
				var description = $(".product-list li img:first-child").next().html();
				var img='<img src="'+src+'"/>';
				var text = '<div id="image"></div><div id="description"></div';
				
				$("#product-review").html(text);		
				$("#product-review").show();
				$("#product-review #image").html(img);
				$("#product-review #description").html(description);
		}		
		
		// Press
		if( $("#thumbs img:first-child").length > 0 ){
				var src = $(".press-thumbs img:first-child").attr("src");
				var alt = $(".press-thumbs img:first-child").attr("alt");
				var img='<img src="'+src+'"/>';

				$("#full-image").html(img);
				$("#full-image-title").html(alt);
				$("#full-image").show();
				$("#full-image-title").show();
		}	
		
		
		if( $(this).attr("title") == 'Untitled Document'){
			$(this).attr("title", "Fashion accessories store and hair wholesale franchise - Azade");
		}
});


$(document).ready(function() {
	$("#thumbs img").click(function(){
		var src = $(this).attr("src");
		var alt = $(this).attr("alt");
		src=src.replace('thumbs/','');
		var img='<img src="'+src+'"/>';
		$("#full-image").html(img);
		$("#full-image-title").html(alt);
	})
	

	$(".product-list li img").click(function(){
		var src = $(this).attr("src");
		//var title = $(this).attr("title"); 
		//var alt = $(this).attr("alt");
		//var description = '<b>'+title+'</b><br/>'+alt;
		var description = $(this).next().html();
		var img='<img src="'+src+'"/>';
		var text = '<div id="image"></div><div id="description"></div';

		$("#product-review").html(text);		
		$("#product-review").show();
		$("#product-review #image").html(img);
		$("#product-review #description").html(description);
		
		
	})
	
	
  jQuery('.product-list').jcarousel({
  		vertical: true,
      scroll: 2
  });
	
});