﻿//<![CDATA[
//AUTHOR:JULLYCAT(ZHANGYANJUN)
$=function(id){
	return document.getElementById(id);
}
namespace = new Object();
namespace.register = function(namespace){
	var nsArray = namespace.split('.');
	var sEval = "";
    var sNS = "";
	for (var i = 0; i < nsArray.length; i++){
        if (i != 0) sNS += ".";
        sNS += nsArray[i];
        sEval += "if (typeof(" + sNS + ") == 'undefined') " + sNS + " = new Object();"
    }
    if (sEval != "") eval(sEval);
}

namespace.register("WB.Utility.QuickService");
WB.Utility.QuickService = {
	/*
	 *method----init
	 *param-----prefix--con-----------nums-----overclassname-----outclassname-----maxheight
	 *Info------前缀----显示内容前缀---tab个数--覆盖tab样式--------离开tab样式------显示内容框高度
	 *Hc.util.setDiv.init("Quick","Hid",6,"cur","",5,50);
	 */
	init:function(prefix,con,nums,overclassname,outclassname,maxheight)
	{
		var arg = new Array();
		for(i=0;i<arguments.length;i++)
		{
			arg[i] = arguments[i];
		}
		for(j=1;j<=parseInt(arg[2]);j++)
		{
			tagBox = $(arg[0] + j);
			hidBox = $(arg[1] + j);
			tagBox.m = j;
			hidBox.m = j;
			tagBox.onmouseover=function(){WB.Utility.QuickService.show(arg,this.m);};
			tagBox.onmouseout=function(){WB.Utility.QuickService.show(arg,this.m);};
			hidBox.onmouseover=function(){WB.Utility.QuickService.show(arg,this.m);};
		}
		WB.Utility.QuickService.show(arg,1);
	},
	show:function(arg,id)
	{
		var curobj = new Array();
		for(j=0;j<arg.length;j++)
		{
			curobj[j] = arg[j];
		}
		var tagBox,hidBox;
		var ctrl = 0;
		for(i=1;i<=parseInt(curobj[2]);i++)
		{
			tagBox = $(curobj[0] + i);
			hidBox = $(curobj[1] + i);
			if(i==id)
			{
				pos=id;
				tagBox.className = curobj[3];
				hidBox.style.display = "block";
				hidBox.style.height = curobj[5] + "px";
			}
			else
			{
				hidBox.style.height = "0px";
				tagBox.className = curobj[4];
				hidBox.style.display = "none";
			}
		}
	}	
}
//]]>

