	var hkuc_selected_index=[],hkuc_org_index=[],hkuc_jQuery_cache=[];
	function hkuc_init_tab(hkuc_tab_id,hkuc_tab_class_name){
		hkuc_jQuery_cache[hkuc_tab_id]=$('#'+hkuc_tab_id+' .'+hkuc_tab_class_name)
		hkuc_selected_index[hkuc_tab_id]=hkuc_jQuery_cache[hkuc_tab_id].index($('#'+hkuc_tab_id+' .dp'));
		hkuc_org_index[hkuc_tab_id]=hkuc_selected_index[hkuc_tab_id];
	}
	function hkuc_tab(hkuc_tab_id,hkuc_tab_class_name,handle){
		hkuc_init_tab(hkuc_tab_id,hkuc_tab_class_name);
		hkuc_jQuery_cache[hkuc_tab_id+'_content']=$('#'+hkuc_tab_id+'_content .'+hkuc_tab_class_name);
		hkuc_jQuery_cache[hkuc_tab_id].hover(
			function(){
				var hkuc_target_id=hkuc_jQuery_cache[hkuc_tab_id].index($(this));
				if(hkuc_target_id==hkuc_selected_index[hkuc_tab_id])return;
				hkuc_jQuery_cache[hkuc_tab_id].eq(hkuc_selected_index[hkuc_tab_id]).toggleClass('dp');
				hkuc_jQuery_cache[hkuc_tab_id+'_content'].eq(hkuc_selected_index[hkuc_tab_id]).toggle();
				hkuc_jQuery_cache[hkuc_tab_id+'_content'].eq(hkuc_target_id).toggle();
				$(this).toggleClass('dp');
				hkuc_selected_index[hkuc_tab_id]=hkuc_target_id;
				if(handle)handle(hkuc_target_id);
			}
		);
	}

	
	var _hkuc=function(){
		var fit_img_arr=[];
		var cache_img_arr=[];
		var back_this=this;
		
		this.imgFit=function (obj,width,height,shrink){
			if(!obj)return;
			var temp_img = new Image();
			temp_img.src=obj.src;
			if(temp_img.width>width || temp_img.height>height)
			{
				imageRate1=temp_img.width/width;
				imageRate2=temp_img.height/height;

				if(imageRate2>imageRate1 && height)
					obj.style.height = temp_img.height/imageRate2+"px";
				else if(imageRate2<imageRate1 && width)
					obj.style.width = temp_img.width/imageRate1 +"px";
			}
			
			if(shrink){
				if(temp_img.height<obj.offsetHeight)
					obj.style.height = temp_img.height+"px";
				if(temp_img.width<obj.offsetWidth)
					obj.style.width = temp_img.width+"px";
			}
		}
		
		this.cacheImg=function (url){
			var temp_img = new Image();
			temp_img.src=url;
			cache_img_arr.push(temp_img);		
		}
	};
	var hkuc=new _hkuc();
