	jQuery(document).ready(function(){
		var z_out = jQuery('#zoom-out');
		var z_in = jQuery('#zoom-in');
		var img = jQuery('#details-img');
		var defImg = img.width();
		var defImg = img.height();
		var point = 0;
		z_out.live('click',function(){
			var newwidth = img.find('img').width();
			var newheight = img.find('img').height();
			if(point!=0){
				//z_out.css({});
				z_in.css({color:'',cursor:'pointer','text-decoration':''});
				img.find('img').eq(0).css('width',newwidth/1.1+'px');
				img.find('img').eq(0).css('height',newheight/1.1+'px');
				point--;	
			}
			else{
				z_out.css({cursor:'default',color:'#000','text-decoration':'none'});
			}
				
		})
		z_in.live('click',function(){
			var newwidth = img.find('img').width();
			var newheight = img.find('img').height();
			if(point<7){
				//z_in.css({});
				z_out.css({color:'',cursor:'pointer','text-decoration':''});
				img.find('img').eq(0).css('width',newwidth*1.1+'px');
				img.find('img').eq(0).css('height',newheight*1.1+'px');
				point++;
			}
			else{
				z_in.css({cursor:'default',color:'#000','text-decoration':'none'});
			}
		})
		
		/*event control*/
		var slide = jQuery('#slide');
		var total_width =0;
		for(var i = 0; i< slide.find('>li').length; i++ ){
			total_width = total_width+slide.find('>li').eq(i).width();
		}
		slide.css('width',total_width+'px');
		var thum = jQuery('#thum');
		thum.find('li').bind('click',function(){
			jQuery('#details-img >img').attr('src',jQuery(this).find('img').attr('rel'))
		})
		
		var slider = jQuery('#slider');
		//alert(slider.find('>a').attr('class'))
		slider.find('>a').mousedown(function(){
			jQuery(this).mousemove(function(){
				slide.css('left',-((slide.width()-jQuery('#img').width())*parseInt(slider.find('>a').css('left'))/slider.width())+'px')										  
			})
			//alert(parseInt(slider.find('>a').css('left'))/slider.width())									 
		})
		
		/* navigation */
		if (jQuery("#leftnav").length > 0)
		{
			$("#leftnav").addNavigationLeft(
			{
				event : "click", effect : true, activeSection : activesidenav,
				callback : function ()
				{
					showActive()
				}
			})
		}
		function showActive()
		{
			$("#leftnav").find(".Hilite").addClass("Active");
			$("#leftnav").find(".Hilite").each(function ()
			{
				var a = $(this);
				a.find("ul:first").show()
			})
		};
		
		/* search */
		var sea = jQuery('#search');
		var defval = sea.find('>input').eq(0).val();
		sea.find('>input').eq(0).focus(function(){
			if(jQuery(this).val()=='search')	{
				jQuery(this).val('');
			}
		})
		sea.find('>input').eq(0).blur(function(){
			if(jQuery(this).val()=='')	{
				jQuery(this).val(defval);
			}									
		})
		
})
