function select_fix_ie(el) {
	var isOpen = $(el).data("isOpen");
	if (isOpen != null) {
		return;
	}

	$(el).mousedown(function() {
				var isOpen = $(this).data("isOpen");
				if (isOpen) {
					return;
				}
				$(this).data("isOpen", true);

				var clone_selection = $(this).data("clone");
				if (clone_selection == null) {
					clone_selection = $("<div></div>").get(0);
					$(clone_selection).insertAfter(this);
					$(clone_selection).css("display", "block");
					$(clone_selection).css("width", $(this).css("width"));
					$(clone_selection).css("height", "20px");
					$(clone_selection).css("position", $(this).css("position"));
					$(clone_selection).css("z-index", $(this).css("z-index"));
					$(this).data("clone", clone_selection);
				}

				$(clone_selection).show();
				$(clone_selection).css("visibility", "hidden");

				var position = $(this).position();
				var oldWidth = $(this).width();
				$(this).css("width", "auto");
				var newWidth = $(this).width();
				if (oldWidth >= newWidth) {
					$(this).css("width", $(clone_selection).css("width"));
				}
				$(this).css("top", position.top + "px");
				$(this).css("left", position.left + "px");
				$(this).css("position", "absolute");
				$(this).css("z-index", "1000");
			}).blur(function() {
				select_fix_ie_close(this);
			}).change(function() {
				select_fix_ie_close(this);
			})

	$(el).data("isOpen", false);
}

function select_fix_ie_close(el) {
	var isOpen = $(el).data("isOpen");
	if (isOpen) {
		var clone_selection = $(el).data("clone");
		$(clone_selection).css("display", "none");
		$(el).css("position", "");
		$(el).css("width", $(clone_selection).css("width"));
		$(el).css("top", "");
		$(el).css("left", "");
		$(el).css("z-index", $(clone_selection).css("z-index"));
		$(el).data("isOpen", false);
	}
}

//for read more in product detail
	var sliderHeight = ""; 

	if(BrowserDetect.browser == "Explorer") {
		sliderHeight = "240";
	} else {
		sliderHeight = "200";
	}
	
	function setProductSlider() {	
	  return 0;
	  /*
		if (document.getElementById('product-slider-menu-id'))
		{
	    	rd = true;
			var theHeight = 0;
	    	$('.inner-product-desc').each(function () {
						var current = $(this);
						current.attr("box_h", current.height());
						theHeight = current.height();
					}
			 );			
			 
			if ( (theHeight - 10) > sliderHeight ) {

				$(".inner-product-desc").css("height", sliderHeight+"px");

				$(".inner-product-desc").css("overflow", "hidden");
				$(".productDetailContentMore").html('<a href="javascript:undefined;">Read More</a>');
				$(".productDetailContentMore a").click(function() { openProductSlider() });

			} else {
				$(".inner-product-desc").css("height", "auto");
			}
			
		}
		*/
		/*
		var removeSubmit =document.getElementById("removeSubmit");
		if(removeSubmit){
			document.getElementById("additionalInfo").innerHTML="";
		}
		*/
    }
      
	function openProductSlider()
	{
		var open_height = $(".inner-product-desc").attr("box_h") + "px";
		$(".inner-product-desc").animate({"height": open_height}, {duration: "slow" });
		
		$(".productDetailContentMore").html('<a href="javascript:undefined;">Close</a>');
		$(".productDetailContentMore a").click(function() { closeProductSlider() })
	}
	
	var timer;
	function closeProductSlider()
	{
		if(navigator.userAgent.indexOf("Safari")>-1){
			$(".inner-product-desc").css("overflow", "hidden");
			timer = setInterval("changeHeight()",10);
		}else{
			$(".inner-product-desc").animate({"height": sliderHeight}, {duration: "slow" });
		}
		
		$(".productDetailContentMore").html('<a href="javascript:undefined;">Read More</a>');
		$(".productDetailContentMore a").click(function() { openProductSlider() })
	}
	function changeHeight(){
		var addHeight = $(".inner-product-desc").height()-5;
		if(addHeight<200){
			clearInterval(timer);
		}
		$(".inner-product-desc").css("height", addHeight+"px");
	}
	
//for read more in search facet
	var sliderHeight4Search = "130";
	if (jQuery.browser.msie){
		sliderHeight4Search = "135";
	}
	var facetContentClass = ".search_facet_content";
	var readMoreClass = ".search_facet_read_more_class";
	var facetContentBase = "#facet_";
	var readMoreLinkBase="#link_";
	var readMoreBase="#more_";
	function setProductSlider4Search() {
		if ($(facetContentClass))
		{
			var theHeight = 0;
	    	$(facetContentClass).each(function () {
						var current = $(this);
						current.attr("box_h", current.height());
						theHeight = current.height();
						currentId = current.attr('id');
						id=currentId.split('_')[1];
						
						if ( (theHeight - 10) > sliderHeight4Search ) {
							current.css("height", sliderHeight4Search+"px");
							current.css("overflow", "hidden");
							$(readMoreBase+id).html('<a href="javascript:undefined;" id=link_'+id+' onclick="javascript:openSearchFacetSlider('+id+')">More...</a>');
						} else {
							current.css("height", "auto");
						}
					}
			 );			
		}
    }
      
	function openSearchFacetSlider(id)
	{
		var open_height = $(facetContentBase+id).attr("box_h") + "px";
		$(facetContentBase+id).animate({"height": open_height}, {duration: "slow" });
		
		$(readMoreBase+id).html('<a href="javascript:undefined;" id=link_'+id+' onclick="javascript:closeSearchFacetSlider('+id+')">Less...</a>');
	}
	var timer;
	function closeSearchFacetSlider(id)
	{
		if(navigator.userAgent.indexOf("Safari")>-1){
			$(facetContentBase+id).css("overflow", "hidden");
			timer = setInterval("changeHeight4Search("+id+")",10);
		}else{
			$(facetContentBase+id).animate({"height": sliderHeight4Search}, {duration: "slow" });
		}
		
		$(readMoreBase+id).html('<a href="javascript:undefined;" id=link_'+id+' onclick="javascript:openSearchFacetSlider('+id+')">More...</a>');
		//$(readMoreLinkBase+id).click(function() { openSearchFacetSlider() })
	}
	function changeHeight4Search(id){
		var addHeight = $(facetContentBase+id).height()-5;
		if(addHeight<130){
			clearInterval(timer);
		}
		$(facetContentBase+id).css("height", addHeight+"px");
	}
	