
/*EIMS_CC_10控件*/
jQuery().ready(function($){
    //放大镜效果
    $.fn.EIMS_C_10_1_imageLens = function (options) {
        var defaults = {
            lensSize: 400,
            borderSize: 1,
            borderColor: "#888",
            widthRatio:4,//宽度放大比例
            heightRatio:4,//高度放大比例
            ImageLeft:0,
            ImageTop:0
        };
        
        if(document.all)
        {//IE浏览器
            document.execCommand("BackgroundImageCache",false,true)
        }
            
        var options = $.extend(defaults, options);
        var LeftPosition=options.ImageLeft
        var TopPosition=options.ImageTop
        
        var lensStyle = "background-position: 0px 0px;width: " + String(options.lensSize) + "px;height: " + String(options.lensSize)
            + "px;float: left;display: none;"
            + "px;border: " + String(options.borderSize) + "px solid " + options.borderColor 
            + ";background-repeat: no-repeat;position: absolute;";

        return this.each(function () {
            obj = $(this);

            var offset = $(this).offset();

            // Creating lens
            var target = $("<div style='" + lensStyle + "' class='" + options.lensCss + "'>&nbsp;</div>").appendTo($(this).parent());
            var MouseCurrent=$("<div class=\"EIMS_C_10_1_MouseArea\"></div>").appendTo($(this).parent())//放大位置

            // Calculating actual size of image
            var imageSrc = options.imageSrc ? options.imageSrc : $(this).attr("src");
            var imageTag = "<img style='display:none;' src='" + imageSrc + "' />";

            var widthRatio = options.widthRatio;//宽度比例
            var heightRatio = options.heightRatio;//高度比例

            $(imageTag).load(function () {
                //widthRatio = $(this).width() / obj.width();
                //heightRatio = $(this).height() / obj.height();
            }).appendTo($(this).parent());

            target
                .css({ backgroundImage: "url('" + imageSrc + "')" })
                
            MouseCurrent.mousemove(setPosition);
            target.mousemove(setPosition);
            $(this).mousemove(setPosition);

            function setPosition(e) {
                $(this).css('cursor', 'crosshair')
                
                var leftPos = parseInt(e.pageX - offset.left);
                var topPos = parseInt(e.pageY - offset.top);

                if (leftPos < 0 || topPos < 0 || leftPos > obj.width() || topPos > obj.height()) {
                    target.hide();
                    MouseCurrent.hide();
                }
                else {
                    target.show();
                     
                    MouseCurrent.show();
                    var MouseleftPos= String(e.pageX - MouseCurrent.width() / 2);
                    var MousetopPos=String(e.pageY - MouseCurrent.height() / 2);
                    
                    leftPos = String(((e.pageX - offset.left) * widthRatio - target.width() / 2) * (-1));
                    topPos = String(((e.pageY - offset.top) * heightRatio - target.height() / 2) * (-1));
                    
                    target.css({ backgroundPosition: leftPos + 'px ' + topPos + 'px' });

                    leftPos = String(e.pageX - target.width() / 2);
                    topPos = String(e.pageY - target.height() / 2);

                    target
                        //.css({ left: leftPos + 'px', top: topPos + 'px' })//放大镜跟随鼠标移动
                        .css("z-index","1000")
                        .css("left",LeftPosition+"px")//固定放大镜左边距
                        .css("top",TopPosition+"px")//固定放大镜上边距
                        
                    MouseCurrent
                        .css({ left: (MouseleftPos) + 'px', top: (MousetopPos) + 'px' })
                        .css("z-index","999")
                }
            }
            
            $(this).mouseout(function(){    
                            MouseCurrent.hide()
                            target.hide()
                                      })
        });
    };


    if(document.getElementById("EIMS_C_10_1_Paras")==null) {return;}//没有EIMS_C_10_1控件退出

    var EIMS_C_10_1_Interval            =setInterval(EIMS_C_10_1_DISPLAYME,1)//禁止隐藏
    var EIMS_C_10_1_movingSpeed            =100;//动画速度
    var EIMS_C_10_1_AutoRoll            =true;//是否自动滚动
    var EIMS_C_10_1_SHeigth                =1024//原图宽度
    var EIMS_C_10_1_SWidth                =768//原图高度
    var EIMS_C_10_1_RollRepeat            =true;//是否重复滚动
    var EIMS_C_10_1_BigHeight            =300
    var EIMS_C_10_1_Bigwidth            =300
    var EIMS_C_10_1_TopPosition            =0//放大镜上偏移
    var EIMS_C_10_1_leftPosition        =0//放大镜左偏移
    var EIMS_C_10_1_timer//滚动图片鼠标事件timer
    var EIMS_C_10_1_ImageSpace            =10//图片之间间隔
    var EIMS_C_10_1_Display                ="block"//记录是否隐藏
    var EIMS_C_10_1_Parent                =$("#EIMS_C_10_1_Panel")//记录隐藏的节点
    
    var EIMS_C_10_1_Dirction            =$("#EIMS_C_10_1_Paras").attr("RellPosition")=="上" || $("#EIMS_C_10_1_Paras").attr("RellPosition")=="下"? "H":"V"
	var EIMS_C_10_1_IsShowHandLens		=true//是否显示放大镜
	
        
    //初始化参数
    EIMS_C_10_1_movingSpeed=parseInt($("#EIMS_C_10_1_Paras").attr("RollSpeed"))
    EIMS_C_10_1_AutoRoll=$("#EIMS_C_10_1_Paras").attr("AutoRoll")=="true"?true:false
    EIMS_C_10_1_SHeigth=parseInt($("#EIMS_C_10_1_Paras").attr("SHeight"))
    EIMS_C_10_1_SWidth=parseInt($("#EIMS_C_10_1_Paras").attr("SWidth"))
    EIMS_C_10_1_RollRepeat=$("#EIMS_C_10_1_Paras").attr("RunRepeat")=="true"?true:false
    EIMS_C_10_1_TopPosition=parseInt($("#EIMS_C_10_1_Paras").attr("TopPosition"))
    EIMS_C_10_1_leftPosition=parseInt($("#EIMS_C_10_1_Paras").attr("LeftPosition"))
    EIMS_C_10_1_ImageSpace=parseInt($("#EIMS_C_10_1_Paras").attr("ImgeSpace"))
    EIMS_C_10_1_IsShowHandLens=$("#EIMS_C_10_1_Paras").attr("IsShowHandLens")=="true"?true:false
	
    //还原焦点图片效果
    function FocuedImage(Index) {    
        $("#EIMS_C_10_1_BigImageDiv")
            .children()
            .remove()
            
            var bigImage=$("#EIMS_C_10_1_IMG"+Index)
            .clone()
            .removeClass()
            .appendTo($("#EIMS_C_10_1_BigImageDiv"))

			if(EIMS_C_10_1_IsShowHandLens){
				bigImage
					.EIMS_C_10_1_imageLens({
								widthRatio:EIMS_C_10_1_SWidth/EIMS_C_10_1_Bigwidth,
								heightRatio:EIMS_C_10_1_SHeigth/EIMS_C_10_1_BigHeight,
								ImageLeft:EIMS_C_10_1_leftPosition,
								ImageTop:EIMS_C_10_1_TopPosition,
								ImageHeight:parseInt($("#EIMS_C_10_1_BigImageDiv>img").css("height")),
								ImageWidth:parseInt($("#EIMS_C_10_1_BigImageDiv>img").css("width"))
					})
			}
        
        EIMS_C_10_1_BigHeight=parseInt($("#EIMS_C_10_1_BigImageDiv>img")
            .css("height"))
        EIMS_C_10_1_Bigwidth=parseInt($("#EIMS_C_10_1_BigImageDiv>img")
            .css("width"))
    }
    

    
    //初始化当前焦点图片
    FocuedImage(0);    
        
    //点击左右移动方向键
    $("#EIMS_C_10_1_ScrollButtonsLeft").click(function(){EIMS_C_10_1_Glide.Move("left");})
    $("#EIMS_C_10_1_ScrollButtonsRight").click(function(){EIMS_C_10_1_Glide.Move("right");})
    

    $("#EIMS_C_10_1_ScrollButtonsLeft").hover(function(){EIMS_C_10_1_Glide.Stop();},function(){EIMS_C_10_1_Glide.Played();})
    $("#EIMS_C_10_1_ScrollButtonsRight").hover(function(){EIMS_C_10_1_Glide.Stop();},function(){EIMS_C_10_1_Glide.Played();})
    
    //添加图片单击事件
    $("#EIMS_C_10_1_ShowPanel"+EIMS_C_10_1_Dirction).children("div")
        .each(function(i){
                    $(this).children("img").addClass("EIMS_C_10_1_IMG_MouseOut"+EIMS_C_10_1_Dirction);//初始化图片添加样式
                    var index=i
                    //鼠标进入
                    $(this).hover(function(){
                            clearTimeout(EIMS_C_10_1_timer)
                            EIMS_C_10_1_Glide.Stop()
                            
                            FocuedImage(index)
                            $(this).children("img").removeClass("EIMS_C_10_1_IMG_MouseOut"+EIMS_C_10_1_Dirction)
                            $(this).children("img").addClass("EIMS_C_10_1_IMG_MouseOver"+EIMS_C_10_1_Dirction);
                    },function(){
                        $(this).children("img").addClass("EIMS_C_10_1_IMG_MouseOut"+EIMS_C_10_1_Dirction)
                        $(this).children("img").removeClass("EIMS_C_10_1_IMG_MouseOver"+EIMS_C_10_1_Dirction);
                        
                        EIMS_C_10_1_timer=setTimeout(function(){
                                EIMS_C_10_1_Glide.Played()
                            },100)
                    })
        })
    

    //键盘移动事件
    $(window).keydown(function(event){
      switch (event.keyCode) {
            case 13: //回车
                $("#EIMS_C_10_1_ScrollButtonsRight").click();
                break;
            case 32: //空格
                $("#EIMS_C_10_1_ScrollButtonsRight").click();
                break;
        case 37: //向左
                $("#EIMS_C_10_1_ScrollButtonsLeft").click();
                break;
            case 39: //向右
                $("#EIMS_C_10_1_ScrollButtonsRight").click();
                break;
      }
    });

    
    function EIMS_C_10_1_DISPLAYME(){
        if(EIMS_C_10_1_Parent.css("display")!=EIMS_C_10_1_Display){
                EIMS_C_10_1_Glide.layerGlide(EIMS_C_10_1_AutoRoll,'EIMS_C_10_1_ShowPanel'+EIMS_C_10_1_Dirction,1,EIMS_C_10_1_movingSpeed,EIMS_C_10_1_Dirction,'left',EIMS_C_10_1_RollRepeat,EIMS_C_10_1_ImageSpace);
                clearInterval(EIMS_C_10_1_Interval)
        }
    }

    //图片展示滚动效果
    /*
     *glide.layerGlide((oEventCont,oSlider,sSingleSize,sec,fSpeed,point);
     *@param auto type:bolean 是否自动滑动 当值是true的时候 为自动滑动
     *@param oEventCont type:object 包含事件点击对象的容器
     *@param oSlider type:object 滑动对象集
     *@param second type:number 自动滑动的延迟时间  单位/秒
     *@param fSpeed type:float   速率 取值在5--100之间 当取值是100时  没有滑动效果
     *@param movetype type:string   H or V
     *@param repeat type:boolean   true or false
     *@param oDirect type:boolean   left or right
     */
    var EIMS_C_10_1_Glide =new function(){
        var sum = 0
        var sSingleSize=100
        var interval=new Array(),timeout,oslideRange=new Array();
        var time=2; 
        var speed = 50
        var point="left"
        
        var index=1;
        var delay=1000; 

        var HOrV="Left"
        var direct="left"
        var AutoPlay=true
        var moveType="H"
        var moveRepeat=true;
            
        function $id(id){return document.getElementById(id);};
        
        var setValLeft=function(Target,i){
            return function(){
                oslideRange[i] = Math.abs(parseInt($id(Target).style[point]));
                $id(Target).style[point] =Math.ceil(oslideRange[i]+(parseInt(sSingleSize) - oslideRange[i])*speed) +'px';
                if(oslideRange[i].oslideRange==[(sSingleSize)]){
                    clearInterval(interval[i]);
                }
            }
        };
        
        var setValRight=function(Target,i){
            return function(){
                oslideRange[i] = Math.abs(parseInt($id(Target).style[point]));
                $id(Target).style[point] =-Math.ceil(oslideRange[i]+(parseInt(sSingleSize)- oslideRange[i])*speed) +'px';
                if(oslideRange[i].oslideRange==[(sSingleSize)]){
                    clearInterval(interval[i]);
                }
            }
        }
        
        //自动播放
        this.Played=function(){
            if(!AutoPlay){return}
            Glide()
        }
        
        function Glide(){
            Play(direct)
            if(AutoPlay){timeout = setTimeout(Glide,delay);};
        }
        
        this.Stop=function(){
            clearTimeout(timeout);
            for(var a_i=1;a_i<=sum;a_i++){
                clearInterval(interval[a_i])
            }
        }
        
        this.Move=function(Direct){
            Play(Direct)
        }
        
        
        function directLeft(){
            var a_j
            var a_x=0
            for(a_j=index;a_j<=sum;a_j++){
                clearInterval(interval[a_j])
                var cc="EIMS_C_10_1_Panel_"+a_j
                $id(cc).style[point]="0px"
                $id(cc).style["margin"+HOrV]=sSingleSize*(a_x)+"px"
                a_x++
            }
            
            if(a_j-1==sum){a_j=1}
            
            for(a_j;a_j<index;a_j++){
                clearInterval(interval[a_j])
                var cc="EIMS_C_10_1_Panel_"+a_j
                $id(cc).style[point]="0px"
                $id(cc).style["margin"+HOrV]=sSingleSize*(a_x)+"px"
                a_x++
            }
        }
        
        //重排向右或向下
        function directRight(){
            var a_z=0
            if(index>1){a_z=index-1}
            else if(index==1){a_z=sum}
            
            //if(parseInt($id("EIMS_C_10_1_Panel_"+a_z).style["margin"+HOrV])<parseInt($id("EIMS_C_10_1_Panel_"+index).style["margin"+HOrV])){return;}
            
            var a_j
            var a_x=0
            
            for(a_j=a_z;a_j<=sum;a_j++){
                clearInterval(interval[a_j])
                var cc="EIMS_C_10_1_Panel_"+a_j
                $id(cc).style[point]="0px"
                $id(cc).style["margin"+HOrV]=sSingleSize*(a_x-1)+"px"
                a_x++
            }
            
            for(a_j=1;a_j<=a_z-1;a_j++){
                clearInterval(interval[a_j])
                var cc="EIMS_C_10_1_Panel_"+a_j
                $id(cc).style[point]="0px"
                $id(cc).style["margin"+HOrV]=sSingleSize*(a_x-1)+"px"
                a_x++
            }
        }
        
        //播放
        var Play=function(direct){
            //图片总宽度小于列表窗口宽度时不能播放
            if(moveType=="H" && $id("EIMS_C_10_1_ImageList").style["width"]>sum*sSingleSize){return}
            if(moveType=="V" && $id("EIMS_C_10_1_ImageList").style["height"]>sum*sSingleSize){return}
        
            var offset=0
            if(moveType=="H"){offset=$id("EIMS_C_10_1_ImageList").offsetWidth}
            else{offset=$id("EIMS_C_10_1_ImageList").offsetHeight}
            
            //不能重复滚动且图片列表宽度大于等于乘余图片宽度时退出
            if(!moveRepeat && direct=="right" && (sum-index+1)*sSingleSize-offset<=0) {return}
            else if(!moveRepeat && direct=="left" && index==1) {return}
            //图片宽度总多出窗口的宽度小于单个图片的1/4时退出
            if((sum*sSingleSize-parseInt(offset))<sSingleSize/4){return;}
            
            clearTimeout(timeout);
            if(direct=="right"){
                directRight()
                for(var a_i=1;a_i<=sum;a_i++){
                    var cc="EIMS_C_10_1_Panel_"+a_i
                    interval[a_i]=setInterval(setValLeft(cc,a_i),time);
                }
                
                if(index<=1){index=sum}else{index--;}
                
            }else if(direct=="left"){
                directLeft()
                for(var a_i=1;a_i<=sum;a_i++){
                    var cc="EIMS_C_10_1_Panel_"+a_i
                    interval[a_i]=setInterval(setValRight(cc,a_i),time);
                }
                if(index>=sum){index=1}else{index++;}
            }
        }

        //初始化数据
        this.layerGlide=function(auto,oSlider,second,fSpeed,movetype,oDirect,repeat,ImageSpace){
            sum = $id(oSlider).getElementsByTagName("div").length
            if(sum==0){return}
            
            sSingleSize=movetype=="H"?$id(oSlider).getElementsByTagName("div")[0].offsetWidth+ImageSpace:$id(oSlider).getElementsByTagName("div")[0].offsetHeight+ImageSpace
            time=2; 
            speed = fSpeed/100
            point=movetype=="H"?"left":"top"
        
            delay=second * 1000; 

            HOrV=movetype=="H"?"Left":"Top"
            direct=oDirect
            AutoPlay=auto
            moveType=movetype
            moveRepeat=repeat
        
            for(var a_i=1;a_i<=sum;a_i++){
                var cc="EIMS_C_10_1_Panel_"+a_i
                $id(cc).style[point]="0px"
                $id(cc).style["margin"+HOrV]=sSingleSize*(a_i-1)+"px"
            }
                        
            if(AutoPlay){timeout = setTimeout(Glide,delay);};
        }
    }
    
    //判断被隐藏的节点
    var a_i=0
    try{
        while(true){
            EIMS_C_10_1_Parent=EIMS_C_10_1_Parent.parent()
            if(EIMS_C_10_1_Parent.css("display")=="none"){
                EIMS_C_10_1_Display=EIMS_C_10_1_Parent.css("display")
                return
            }
            if(a_i==10){
                break}
            a_i++
        }
    }catch(ea){}
    
	try{
		if(EIMS_C_10_1_Display!="none"){
			EIMS_C_10_1_Glide.layerGlide(EIMS_C_10_1_AutoRoll,'EIMS_C_10_1_ShowPanel'+EIMS_C_10_1_Dirction,1,EIMS_C_10_1_movingSpeed,EIMS_C_10_1_Dirction,'left',EIMS_C_10_1_RollRepeat,EIMS_C_10_1_ImageSpace);
			clearInterval(EIMS_C_10_1_Interval)
		}
	}catch(ea){}
});
//** Smooth Navigational Menu- By Dynamic Drive DHTML code library: http://www.dynamicdrive.com
//** Script Download/ instructions page: http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/
//** Menu created: Nov 12, 2008
//** Download by http://sc.xueit.com
//** Dec 12th, 08" (v1.01): Fixed Shadow issue when multiple LIs within the same UL (level) contain sub menus: http://www.dynamicdrive.com/forums/showthread.php?t=39177&highlight=smooth

//** Feb 11th, 09" (v1.02): The currently active main menu item (LI A) now gets a CSS class of ".selected", including sub menu items.

//** May 1st, 09" (v1.3):
//** 1) Now supports vertical (side bar) menu mode- set "orientation" to 'v'
//** 2) In IE6, shadows are now always disabled

//** July 27th, 09" (v1.31): Fixed bug so shadows can be disabled if desired.


var EIMS_C_22_1_ddsmoothmenu={

//Specify full URL to down and right arrow images (23 is padding-right added to top level LIs with drop downs):
arrowimages: {down:['EIMS_C_22_1_downarrowclass', 'images/control/EIMS_CI_22_down.gif'], right:['EIMS_C_22_1_rightarrowclass', 'images/control/EIMS_CI_22_right.gif']},

transition: {overtime:300, outtime:300}, //duration of slide in/ out animation, in milliseconds
shadow: {enable:true, offsetx:5, offsety:5},

///////Stop configuring beyond here///////////////////////////

detectwebkit: navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1, //detect WebKit browsers (Safari, Chrome etc)
detectie6: document.all && !window.XMLHttpRequest,

getajaxmenu:function($, setting){ //function to fetch external page containing the panel DIVs
	var $menucontainer=$('#'+setting.contentsource[0]) //reference empty div on page that will hold menu
	$menucontainer.html("Loading Menu...")
	$.ajax({
		url: setting.contentsource[1], //path to external menu file
		async: true,
		error:function(ajaxrequest){
			$menucontainer.html('Error fetching content. Server Response: '+ajaxrequest.responseText)
		},
		success:function(content){
			$menucontainer.html(content)
			EIMS_C_22_1_ddsmoothmenu.buildmenu($, setting)
		}
	})
},


buildmenu:function($, setting){
	var smoothmenu=EIMS_C_22_1_ddsmoothmenu
	var $mainmenu=$("#"+setting.mainmenuid+">ul") //reference main menu UL
	$mainmenu.parent().get(0).className=setting.classname || "EIMS_C_22_1_ddsmoothmenu"
	var $headers=$mainmenu.find("ul").parent()
	$headers.hover(
		function(e){
			$(this).children('a:eq(0)').addClass('selected')
		},
		function(e){
			$(this).children('a:eq(0)').removeClass('selected')
		}
	)
	$headers.each(function(i){ //loop through each LI header
		var $curobj=$(this).css({zIndex: 100-i}) //reference current LI header
		var $subul=$(this).find('ul:eq(0)').css({display:'block'})
		this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}
		this.istopheader=$curobj.parents("ul").length==1? true : false //is top level header?
		$subul.css({top:this.istopheader && setting.orientation!='v'? this._dimensions.h+"px" : 0})
		$curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: smoothmenu.arrowimages.down[2]} : {}).append( //add arrow images
			'<img src="'+ (this.istopheader && setting.orientation!='v'? smoothmenu.arrowimages.down[1] : smoothmenu.arrowimages.right[1])
			+'" class="' + (this.istopheader && setting.orientation!='v'? smoothmenu.arrowimages.down[0] : smoothmenu.arrowimages.right[0])
			+ '" style="border:0;" />'
		)
		if (smoothmenu.shadow.enable){
			this._shadowoffset={x:(this.istopheader?$subul.offset().left+smoothmenu.shadow.offsetx : this._dimensions.w), y:(this.istopheader? $subul.offset().top+smoothmenu.shadow.offsety : $curobj.position().top)} //store this shadow's offsets
			if (this.istopheader)
				$parentshadow=$(document.body)
			else{
				var $parentLi=$curobj.parents("li:eq(0)")
				$parentshadow=$parentLi.get(0).$shadow
			}
			this.$shadow=$('<div class="EIMS_C_22_1_ddshadow'+(this.istopheader? ' EIMS_C_22_1_toplevelshadow' : '')+'"></div>').prependTo($parentshadow).css({left:this._shadowoffset.x+'px', top:this._shadowoffset.y+'px'})  //insert shadow DIV and set it to parent node for the next shadow div
		}
		$curobj.hover(
			function(e){
				var $targetul=$(this).children("ul:eq(0)")
				this._offsets={left:$(this).offset().left, top:$(this).offset().top}
				var menuleft=this.istopheader && setting.orientation!='v'? 0 : this._dimensions.w
				menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader && setting.orientation!='v'? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft //calculate this sub menu's offsets from its parent
				if ($targetul.queue().length<=1){ //if 1 or less queued animations
					$targetul.css({left:menuleft+"px", width:this._dimensions.subulw+'px'}).animate({height:'show',opacity:'show'}, EIMS_C_22_1_ddsmoothmenu.transition.overtime)
					if (smoothmenu.shadow.enable){
						var shadowleft=this.istopheader? $targetul.offset().left+EIMS_C_22_1_ddsmoothmenu.shadow.offsetx : menuleft
						var shadowtop=this.istopheader?$targetul.offset().top+smoothmenu.shadow.offsety : this._shadowoffset.y
						if (!this.istopheader && EIMS_C_22_1_ddsmoothmenu.detectwebkit){ //in WebKit browsers, restore shadow's opacity to full
							this.$shadow.css({opacity:1})
						}
						this.$shadow.css({overflow:'', width:this._dimensions.subulw+'px', left:shadowleft+'px', top:shadowtop+'px'}).animate({height:this._dimensions.subulh+'px'}, EIMS_C_22_1_ddsmoothmenu.transition.overtime)
					}
				}
			},
			function(e){
				var $targetul=$(this).children("ul:eq(0)")
				$targetul.animate({height:'hide', opacity:'hide'}, EIMS_C_22_1_ddsmoothmenu.transition.outtime)
				if (smoothmenu.shadow.enable){
					if (EIMS_C_22_1_ddsmoothmenu.detectwebkit){ //in WebKit browsers, set first child shadow's opacity to 0, as "overflow:hidden" doesn't work in them
						this.$shadow.children('div:eq(0)').css({opacity:0})
					}
					this.$shadow.css({overflow:'hidden'}).animate({height:0}, EIMS_C_22_1_ddsmoothmenu.transition.outtime)
				}
			}
		) //end hover
	}) //end $headers.each()
	$mainmenu.find("ul").css({display:'none', visibility:'visible'})
},

init:function(setting){
	if (typeof setting.customtheme=="object" && setting.customtheme.length==2){ //override default menu colors (default/hover) with custom set?
		var mainmenuid='#'+setting.mainmenuid
		var mainselector=(setting.orientation=="v")? mainmenuid : mainmenuid+', '+mainmenuid
		document.write('<style type="text/css">\n'
			+mainselector+' ul li a {background:'+setting.customtheme[0]+';}\n'
			+mainmenuid+' ul li a:hover {background:'+setting.customtheme[1]+';}\n'
		+'</style>')
	}
	this.shadow.enable=(document.all && !window.XMLHttpRequest)? false : this.shadow.enable //in IE6, always disable shadow
	jQuery(document).ready(function($){ //ajax menu?
		if (typeof setting.contentsource=="object"){ //if external ajax menu
			EIMS_C_22_1_ddsmoothmenu.getajaxmenu($, setting)
		}
		else{ //else if markup menu
			EIMS_C_22_1_ddsmoothmenu.buildmenu($, setting)
		}
	})
}

} //end EIMS_C_22_1_ddsmoothmenu variable

//Initialize Menu instance(s):


