
 $(document).ready(function() {

    $("img#product_text_more_gfx").click(
      function () {
            showProductDetails();
      }
    );
    
    $("img#product_textclose_gfx").click(
      function () {
            hideProductDetails();
      }
    );

 });
 
  function hideProductDetails(){  
  if (checkBrowserName('MSIE')) {
           //  $("div#product_text_wrapper").css('background', 'url(/images/ui/scrollbar/product_text_nontrans_back.png)');
             
			 $("div.jScrollPaneContainer").animate( { height:"0px"}, 500, function(){
			 	  showProductTextBoxHeader();
				  $("div#product_text").hide();
	                  $("div#productPrepTypeWrap").show();
				
		          $("div#product_text_wrapper").animate( { height:"54px"}, 1500 , function(){
		                showProductOverlayPicsIe();
		                $("div#product_text_wrapper").css('background', 'url(/images/ui/scrollbar/product_text_semitrans_back.png)');
		
		          });       
			});
  
  }else{
    
	            $("div.jScrollPaneContainer").animate( { height:"0px"}, 700, function(){
	                  $("div#product_text").hide();
	                  $("div#productPrepTypeWrap").animate( { opacity:'1.0'}, 1500);
	                  $("div#product_text_wrapper").animate( { height:"54px"}, 1500 , function(){
	                 
                    
					        showProductOverlayPics();
	                        $("div#product_text_wrapper").css('background', 'url(/images/ui/scrollbar/product_text_semitrans_back.png)');
	             $("div.jScrollPaneContainer").css('height', '0px');
	                  });     
					  showProductTextBoxHeader();  
	            });
	  
	  }

 }  
 
  function showProductDetails(){  
        if (checkBrowserName('MSIE')) { 
                $("div#product_text_wrapper").css('background', 'url(/images/ui/scrollbar/product_text_semitrans_back.png)');
                hideProductTextBoxHeader();
               //  DD_belatedPNG.fix('img');
			   height = checkBrowserName('MSIE 6')?'364px':'365px';
                $("div#productPrepTypeWrap").hide();
				$("div#product_text_wrapper").animate( { height:height}, 1500, function(){
                   initScrollPaneIE();
                    $("div#product_text").show();
                    hideProductOverlayPicsIe();                
                } );
                
        }else{
               $("div#product_text_wrapper").css('background', 'url(/images/ui/scrollbar/product_text_semitrans_back.png)');
               //  DD_belatedPNG.fix('img');
			   
                $("div#productPrepTypeWrap").animate( { opacity:'0.0'}, 1500);
                $("div#product_text_wrapper").animate( { height:'365px'}, 1500, function(){
                    initScrollPaneIE();
                    $("div#product_text").show();
                    hideProductOverlayPics();                
                } );
                hideProductTextBoxHeader();
        }
 }

 function hideProductOverlayPics(){  
                      //  $("div#productPropWrap").animate({opacity: 0.0 }, 1500 );
                       // $("img#picPackageDetailSmall").animate({opacity: 0.0 }, 1500 ); 
						
 }  
 function showProductOverlayPics(){  
                      //  $("div#productPropWrap").animate({opacity: 1.0 }, 1500 );
                      //  $("img#picPackageDetailSmall").animate({opacity: 1.0 }, 1500 )					
 }  
 function hideProductOverlayPicsIe(){  
                       // $("div#productPropWrap").hide();
                       // $("img#picPackageDetailSmall").animate({opacity: 0.0 }, 1500 ); 
						
 }  
 function showProductOverlayPicsIe(){  
                       // $("div#productPropWrap").show();
                       // $("img#picPackageDetailSmall").animate({opacity: 1.0 }, 1500 )          		
 }  

 
 function initScrollPaneOther(){  
    if($('div.jScrollPaneTrack').size() < 1){
        $('div#product_text').jScrollPane({showArrows:false, scrollbarWidth: 13}).hide();  
        $("div.jScrollPaneContainer").css('height', '0px');
        $("div.jScrollPaneContainer").animate( { height:"336px", opacity: 1.0}, 1500 );
    }else{
        $("div.jScrollPaneContainer").animate( { height:"336px", opacity: 1.0}, 1500 );
    } 
 }  
 
 function initScrollPaneIE(){  
    if($('div.jScrollPaneTrack').size() < 1){
        $('div#product_text').jScrollPane({showArrows:false, scrollbarWidth: 13});  
        
    }else{
        $("div.jScrollPaneContainer").animate( { height:"328px", opacity: 1.0}, 1500 );
    } 
 }  
 
 function hideProductTextBoxHeader(){  
    if (checkBrowserName('msie 6')) {
    	$("img#product_textclose_gfx").animate({ height: "20px", opacity: 1.0 }, 1500);
	    $("img#product_text_more_gfx").animate({height: "0px", opacity: 0.0 }, 1500);
	    $("div#product_text_wrapper h3").hide();
	    $("div#product_text_wrapper p#product_text_teaser").hide();
    }else{
    	$("img#product_textclose_gfx").animate({ height: "20px", opacity: 1.0 }, 1500);
	    $("img#product_text_more_gfx").animate({height: "0px", opacity: 0.0 }, 1500);
	    $("div#product_text_wrapper h3").animate({ height: "0px", opacity: 0.0 }, 1500 );
	    $("div#product_text_wrapper p#product_text_teaser").animate({ height: "0px", opacity: 0.0 }, 1500 );
    }  
 }  
 
 function showProductTextBoxHeader(){  
	 if (checkBrowserName('msie 6')) {	 
	   $("div#product_text_wrapper p#product_text_teaser").show();
	   $("div#product_text_wrapper h3").show();
	   $("img#product_text_more_gfx").animate({ height: "20px", opacity: 1.0 }, 1500 );
	   $("img#product_textclose_gfx").animate({  height: "0px", opacity: 0.0}, 1500 );
	 }else{
		 $("div#product_text_wrapper p#product_text_teaser").animate({ height: "27px", opacity: 1.0 }, 1500 );
		 $("div#product_text_wrapper h3").animate({ height: "27px", opacity: 1.0 }, 1500 );
		 $("img#product_text_more_gfx").animate({ height: "20px", opacity: 1.0 }, 1500 );
		 $("img#product_textclose_gfx").animate({  height: "0px", opacity: 0.0}, 1500 );
		
	 }

 }  
 



 function checkBrowserName(name){  
    var agent = navigator.userAgent.toLowerCase();  
    if (agent.indexOf(name.toLowerCase())>-1) {  
      return true;  
    }  
    return false;  
 }  

     if (checkBrowserName('msie 6')) {
    	 try{
    		 //DD_belatedPNG.fix('img', 'div');	
	
    	 }catch(e){
    	 	
    	 }

       
    }


