$(document).ready(function(){
  $('#login_link').click(function(){
    $.modal($('.login').html().replace(/start_submit/g,'start_submit1'), {overlayClose:true} );    
    //, {overlayClose:true;}        
    return false;
  });
  $('select[name=categories_id]').change(function(){
    findFromprice();
  });
//$("#carousel_wrap").carousel({autoSlide: true, autoSlideInterval: 5000, loop: true});
  $(".main-carousel").jCarouselLite({
      btnNext: ".carousel-next",
      circular:true,
      auto: 8000,
      speed: 1500,
      mouseWheel: false,
      btnPrev: ".carousel-previous"
  });
  $("#carousel_wrap1").carousel({pagination: true, dispItems: 5});
  $('.carousel-pagination a span').html('');
  //center-wrap
  $('#carousel_wrap1 .center-wrap').prependTo('#carousel_wrap1');
  
  $('.parent_hot_banner a').hover(function(){
				$(this).find('img').animate({top:'-152px'},{queue:false,duration:500});
	}, function(){
		$(this).find('img').animate({top:'0px'},{queue:false,duration:500});
	});
	$('.parent_new_product img').each(function(){
	  $(this).addClass('placeholder_new').attr('lang', $(this).parent().attr('lang'));
	});
	
	$('.placeholder_new').each(function(){	  
	  w = parseInt($(this).height()/2.5);
	  html='<div class="new_placeholder_div"><img class="new" width="'+w+'" src="./images/new'+$(this).attr('lang')+'.png" alt="new">'+$(this).outerHTML()+'</div>';	  	  $(this).replaceWith(html);
	});
	$('.parent_new_a').each(function(){	  
	  w = parseInt($(this).height()/2.5);
	  html='<img class="new" style="position:absolute;" width="'+w+'" src="./images/new'+$(this).attr('lang')+'.png" alt="new">';
	  $(this).prepend(html);
	});
	$("#main-nav td:gt(5)").addClass('left-position');
//	var HEighTLogiN = $('#simplemodal-container').height();
//	$('#simplemodal-container').css({height: HEighTLogiN});
});


















(function($){$.fn.extend({outerHTML:function(value){if(typeof value==="string"){var $this=$(this),$parent=$this.parent();var replaceElements=function(){var $img=$this.find("img");if($img.length>0){$img.remove();}
var element;$(value).map(function(){element=$(this);$this.replaceWith(element);})
return element;}
return replaceElements();}else{return $("<div />").append($(this).clone()).html();}}});})(jQuery);
