//-----------------------------------------------------------------------
//- Created by the Agama Web Menus - generator  ver 2.13
//- Copyright MP Software (c)2008
//- Can I use this script? See http://www.agama-menu.com
//-----------------------------------------------------------------------

var tarimmenuMiscFunc = {
	ie  :	true,
	ns2 : false,
	ns3 : false,
	ns4 : false,
	ns4up : false,
  ns5 : false,
  ns5up : false,
  moz7 : false,
  ie3 : false,
  ie4 : false,
  ie5 : false,
  ie55: false,
  ie6 : false,
  op3 : false,
  op4 : false,
  op5 : false,
	op6	: false,
	op6up: false,
	Tmpinit:false,
	
	 
	InitVars	:	function () {
		this.Tmpinit=true;
	  var agt =	navigator.userAgent.toLowerCase();
 		var major = parseInt(navigator.appVersion);
	  var minor =  parseFloat(navigator.appVersion);
	  var navI =  navigator.appVersion.substring(22,25);
		var nav = ((agt.indexOf('mozilla')!=-1)&&(agt.indexOf('spoofer')==-1)&&(agt.indexOf('compatible')==-1)&&(agt.indexOf('opera')==-1)&&(agt.indexOf('webtv')==-1));
		this.ns2 = (nav&&(major==2))?true:false;
	  this.ns3 = (nav&&(major==3))?true:false;
	  this.ns4 = (nav&&(major==4))?true:false;
	  this.ns4up = (nav&&(major>=4))?true:false;
	  this.ns5 = (nav&&(major==5))?true:false;
	  this.ns5up = (nav&&(major>=5))?true:false;
	  this.moz7 = (nav&&(agt.indexOf('netscape6')==-1))?true:false;
	  var ie = (agt.indexOf("msie")!=-1)?true:false;
		this.ie=ie;
	  this.ie3 = (ie&&(major<4))?true:false;
	  this.ie4 = (ie&&(agt.indexOf("msie 4")!=-1))?true:false;
	  this.ie5 = (ie&&navI=='5.0')?true:false;
	  this.ie55 = (ie&&navI=='5.5')?true:false;
	  this.ie6 = (ie&&navI=='6.0')?true:false;
	  var op3 = (agt.indexOf("opera")!=-1)?true:false;
		this.op3=op3;
	  var op4 = (op3&&(agt.indexOf("opera 4")!=-1))?true:false;
		this.op4=op4;
		var op5 = ((op3&&((agt.indexOf("opera 5.11")!=-1)||(agt.indexOf("opera 5.02")!=-1)||(agt.indexOf("opera 5.01")!=-1)))||(op3&&(major>4)))?true:false;
		this.op5=op5;
		var op6 = (op5&&(agt.indexOf("opera 6.0")!=-1))?true:false;
		this.op6=op6;
		var op6up = (op6&&(major>6))?true:false;
		this.op6up=op6up;
		return;
	},
	
	 
	getObjNN4 : function (obj,name)
	{
		if (!this.init){this.InitVars()}
		var x = obj.layers;
		var foundLayer;
		for (var i=0;i<x.length;i++)
		{
			if (x[i].id == name)
			 	foundLayer = x[i];
			else if (x[i].layers.length)
				var tmp = this.getObjNN4(x[i],name);
			if (tmp) foundLayer = tmp;
		}
		return foundLayer;
	},

	 
	getElementHeight : function (Elem) {
		if (!this.init){this.InitVars()}
		if (this.ns4) {
			var elem = this.getObjNN4(document, Elem);
			return elem.clip.height;
		} else {
			if(document.getElementById) {
				var elem = document.getElementById(Elem);
			} else if (document.all){
				var elem = document.all[Elem];
			}
			xPos = elem.offsetHeight;
			return xPos;
		} 
	},
	
	 
	getElementWidth : function(Elem) {
		if (!this.init){this.InitVars()}
		if (this.ns4) {
			var elem = this.getObjNN4(document, Elem);
			return elem.clip.width;
		} else {
			if(document.getElementById) {
				var elem = document.getElementById(Elem);
			} else if (document.all){
				var elem = document.all[Elem];
			}
			xPos = elem.offsetWidth;
			return xPos;
		}
	},
	
	 
	getElementLeft : function (Elem) {
		if (!this.init){this.InitVars()}
		if (this.ns4) {
			var elem = this.getObjNN4(document, Elem);
			return elem.pageX;
		} else {
			var elem;
			if(document.getElementById) {
				var elem = document.getElementById(Elem);
			} else if (document.all){
				var elem = document.all[Elem];
			}
			xPos = elem.offsetLeft;
			tempEl = elem.offsetParent;
			while (tempEl != null)  {	
				xPos += tempEl.offsetLeft;
				if ((tempEl.style.position=='absolute') || (tempEl.style.position=='relative')){break}
		  		tempEl = tempEl.offsetParent;
			}
			return xPos;
		}
	},

	
	 
	getElementTop : function (Elem) {
		if (!this.init){this.InitVars()}
		if (this.ns4) {
			var elem = this.getObjNN4(document, Elem);
			return elem.pageY;
		} else {
			if(document.getElementById) {	
				var elem = document.getElementById(Elem);
			} else if (document.all) {
				var elem = document.all[Elem];
			}
			yPos = elem.offsetTop;
			tempEl = elem.offsetParent;
			while (tempEl != null){
				yPos += tempEl.offsetTop;
				if ((tempEl.style.position=='absolute') || (tempEl.style.position=='relative')){break}
		  		tempEl = tempEl.offsetParent;
	  	}
			return yPos;
		}
	}
};

tarimmenuMiscFunc.InitVars();

 
 
 
var tarimmenuMenuGroupHandler = {
	 
	MenuTimeout : 500,	
	ObjectsCount : 0, 
  ObjectsArray : Array(),  
	idCounter : 0,  
	idPrefix  : "menu_group_", 
	TimerCloseAllGroupID : 0,  
	TimerAnimateID : 0,  
	TmpGroupToShow	: '',  
	LC : '2709262605', 

  
 
	GetId:function() {  
							return this.idPrefix + this.idCounter++; 
						}, 
	
	FindGroup:function(id){  
              for (i=1; i<= this.ObjectsCount; i++){
                if (this.ObjectsArray[i].id==id) {
		              return(this.ObjectsArray[i]);
		 					  }
				      }
            },
							 
	DoOnMouseOver:function(id){ 
									window.clearTimeout(this.TimerCloseAllGroupID); 
									 
									gr=this.FindGroup(id);
									if (gr){
										if (gr.RefererItem){
											if (gr.RefererItem.OwnerGroup){
												for (i=1; i<= gr.RefererItem.OwnerGroup.Count; i++){
													if (gr.RefererItem.OwnerGroup.Items[i]==gr.RefererItem)
													{
														gr.RefererItem.OwnerGroup.Items[i].SetItemState(1);
													} 
														else
													{
														gr.RefererItem.OwnerGroup.Items[i].SetItemState(0);
													}
											 	}
											}
										}
									}
								},

	DoOnMouseOut:function(id){  
										window.clearTimeout(this.TimerCloseAllGroupID);  
                    
											this.TimerCloseAllGroupID = window.setTimeout("tarimmenuMenuGroupHandler.CloseAllGroup()", tarimmenuMenuGroupHandler.MenuTimeout); 
                    
									},

  DoOnMouseMove:function(id){return},
	DoOnMouseDown:function(id){return},
	DoOnMouseUp:function(id){return},

	FlipDropDown:function(id){  
										gr=this.FindGroup(id.substring(8));
										if (gr){
											gr.FlipDropDown();
										}
									},

  CloseGroup:function(id){ 
                
									gr=this.FindGroup(id);
									if (gr!=null){
										gr.CloseGroupRecurse();
									}
                
             },

  CloseAllGroup:function(){ 
												this.TmpGroupToShow=null;
												window.clearTimeout(this.TimerAnimateID);
                        for (i=1; i<= this.ObjectsCount; i++){
                          if (this.ObjectsArray[i]){
														if (this.ObjectsArray[i].IsMainGroup ==0){
														  this.ObjectsArray[i].HideGroup();
															this.ObjectsArray[i].AnimationControlValue = this.ObjectsArray[i].AnimationTo;  
               		          }
															else
														{	
			                        for (n=1; n<= this.ObjectsArray[i].Count; n++){
																this.ObjectsArray[i].Items[n].SetItemState(0);
															}
														}
                  	      }
												}
                      },

	

	ShowWithTargetOpacity:function(){  
													if (this.TmpGroupToShow != null){
                  					gr=this.FindGroup(this.TmpGroupToShow);
                  					if (gr){
															if (gr.AnimationType==100){
																gr.AnimationControlValue= gr.AnimationTo;
																obj=document.getElementById(gr.id);
													   		obj.style.MozOpacity = gr.Opacity;
														  	obj.style.filter = 'alpha(opacity=' + gr.Opacity + ')';
																obj.style.opacity=gr.Opacity;
															}
														}
													}
								},

  DoAnimation:function(){ 
                if (this.TmpGroupToShow != null){
                  gr=this.FindGroup(this.TmpGroupToShow);
                  if (gr){
										obj=document.getElementById(gr.id);
										objt=document.getElementById(gr.id+'_table');

										if ((gr.AnimationType>0) && (!tarimmenuMiscFunc.ie)){ 
											gr.AnimationType=100;
										}

                    switch (gr.AnimationType){
      							   
										  case 0:{ 
												  obj.style.visibility='visible';
													objt.style.visibility='visible';

													 
												  for (this.i=1; this.i<= gr.Count; this.i++){ 
														gr.Items[this.i].ShowOrphans();
													}

													 
													if (gr.OnGroupShowJS!=''){
														eval(gr.OnGroupShowJS);
													}

													return;
											} 

										  case 100:{ 
											 		
														if (gr.AnimationControlValue==20){
															 
													  	for (this.i=1; this.i<= gr.Count; this.i++){ 
												  	  	gr.Items[this.i].ShowOrphans();
															}
														}

													 if ((gr.AnimationControlValue <= gr.AnimationTo) && (gr.AnimationControlValue<=gr.Opacity)){
														 obj.style.visibility='visible';															
														 objt.style.visibility='visible';
													   obj.style.MozOpacity = (gr.AnimationControlValue / gr.AnimationTo );
														 obj.style.filter = 'alpha(opacity=' + gr.AnimationControlValue + ')';
														 obj.style.opacity=(gr.AnimationControlValue / gr.AnimationTo );
													
											        
													   gr.AnimationControlValue=gr.AnimationControlValue+(gr.AnimationStep);
														 this.TimerAnimateID = window.setTimeout("tarimmenuMenuGroupHandler.DoAnimation()",gr.AnimationTimeout * (gr.AnimationTo/(gr.Opacity/2)));
														 return;	
												   } 

													  
													 if (gr.OnGroupShowJS!=''){
														 eval(gr.OnGroupShowJS);
													 }

												   return;
										  } 
									  } 
									 
									   

										 
									  for (this.i=1; this.i<= gr.Count; this.i++){ 
								  	  gr.Items[this.i].ShowOrphans();
										}

									  if (obj.filters) {
											dur=(gr.AnimationTimeout * (gr.AnimationTo / gr.AnimationStep)) / 1500;
											obj.style.filter='revealTrans(duration='+dur+', transition='+gr.AnimationType+')';
									    obj.filters.revealTrans.apply(); 
											obj.style.visibility='visible';  
											objt.style.visibility='visible';
									    obj.filters.revealTrans.play();
									  } 
											else
									  { obj.style.visibility='visible';}

										 
										if (gr.OnGroupShowJS!=''){
											eval(gr.OnGroupShowJS);
										} 
								 } 
						  } 
            }

};  

	

 
 
 
var tarimmenuMenuItemHandler = {
    ObjectsCount : 0, 
    ObjectsArray : Array(),  
		idCounter : 0,
		idPrefix  : "menu_item_",

		GetId     : function() {  
									return this.idPrefix + this.idCounter++; 
								},
	
		FindItem  : function(id) { 
                  for (i=1; i<= this.ObjectsCount; i++){
                    if (this.ObjectsArray[i].id==id) {
	                    return(this.ObjectsArray[i]);
	                  }
                  }
                },

    FindItemByGroup: function(GroupID){ 
                       for (i=1; i<= this.ObjectsCount; i++){
                         if (this.ObjectsArray[i].Group.id==GroupID) {
                           return(this.ObjectsArray[i]);
                         }
                       }
                     },

		DoOnMouseOver :  function(id){ 
                       mi=this.FindItem(id);
											 mi.SetItemState(1);
                       
												 
                       for (i=1; i<= mi.OwnerGroup.Count; i++){
													if (mi.OwnerGroup.Items[i]!=mi){
														mi.OwnerGroup.Items[i].SetItemState(0);
													} 
											 }

                       if (mi.Group != null){
			 	  					      
                         for (i=1; i<= mi.OwnerGroup.Count; i++){
                           if ((mi.OwnerGroup.Items[i]!=mi) && (mi.OwnerGroup.Items[i].Group!=null)){
                             obj=document.getElementById(mi.OwnerGroup.Items[i].Group.id);
                             if ((obj != null) && (obj.style.visibility=='visible')){
												       tarimmenuMenuGroupHandler.CloseGroup(obj.id);
                             }
                           }
                         }
												 
												  
												 tarimmenuMenuGroupHandler.ShowWithTargetOpacity();
												  
												 
												 	 mi.Group.ShowGroup(); 
												 
           				     }
                     },

			DoOnMouseMove: function(id) {},             
			DoOnMouseOut : function (id) {},
			DoOnMouseDown: function(id){
												mi=this.FindItem(id);
												mi.SetItemState(2); 
										 },

			DoOnMouseUp: function(id){
										 mi=this.FindItem(id);
										 mi.SetItemState(1); 
						  		 },

			Navigate: function(id){  
									
									mi=this.FindItem(id);
									eval(mi.OnClickJS); 
									if (mi.URL>''){
									if (mi.URLTarget==''){self.location.href= mi.URL} else  
										if (mi.URLTarget=='_top'){top.location.href = mi.URL;} else  
											if (mi.URLTarget=='_parent'){parent.location.href= mi.URL;}else
												if (mi.URLTarget=='_self'){self.location.href= mi.URL} else
												{
													if (top.frames[mi.URLTarget]){top.frames[mi.URLTarget].location.href= mi.URL}	else
														if (self.frames[mi.URLTarget]){self.frames[mi.URLTarget].location.href= mi.URL} else
														{ 
															window.open(mi.URL,mi.URLTarget);
														}
												}
									}	
								}


    };  

	
	

 
 
 
 
 

 
 
 
function tarimmenuMenuGroupAncestor () {
	this.Width = 300; 
	this.Height= 1;
	this.Opacity=100;
	this.Embedding='absolute';
	this.Drifting=0;  
	this.OnGroupShowJS='';
	this.OnGroupHideJS='';
  this.BgColor= '#FFFFFF';
	this.BgImage='';
	this.BgImgPos='center';
	this.BgImgRep='no-repeat';
	this.Border='solid';
	this.BorderWidth='1';
	this.BorderColor='#000000';
	this.ShadowWidth=0;   
	this.ShadowColor='#999999'; 
	this.ShadowTransparency=50; 
  this.ItemsSpacing=0;
	this.ItemsPadding_L=2;
	this.ItemsPadding_R=2;
	this.ItemsPadding_T=2;
	this.ItemsPadding_B=2;
	this.HeaderText='';
	this.HeaderTextAlign='center';
	this.HeaderTextOffsetX=0;
	this.HeaderTextOffsetY=0;
	this.HeaderHeight=0;
	this.HeaderBgColor='#125500';
	this.HeaderIcon='';
	this.HeaderIconOffsetX=10;
	this.HeaderIconOffsetY=0;
	this.HeaderBgImage='';
	this.HeaderBgImgPos='';
	this.HeaderBgImgRep='';
	this.FontFamily='';
	this.FontColor='';
	this.FontSize='';
	this.FontDecoration='';
	this.FontWeight='';
	this.FontStyle='';
	this.MenuGroupAlign=0;
	this.z=1000; 
	this.Visibility='hidden';
	this.AnimationTimeout=20;  
	this.AnimationType=100;  
	this.ShowDropDownControl=false;
	this.InitDropdownState=1;
	this.DropdownImageExpand='';
	this.DropdownImageCollapse='';
}
	

 
 
 
 
 

 
 
 
tarimmenuMenuGroup.prototype = new tarimmenuMenuGroupAncestor;	

 
 
 
function tarimmenuMenuGroup(ShiftX,ShiftY,Lay) {
	this.Layout= Lay || 'V';  
	this.x=ShiftX || 0;
	this.y=ShiftY || 0;
	 
	 
   
	this.Tmp1=0; 
	this.AnimationStep=4;  
	this.AnimationFrom=0;  
	this.AnimationTo=100;  
	this.AnimationControlValue=20; 
	this.TmpMainDivStyle=''; 
	this.TargetPosX=this.x;  
	this.TargetPosY=this.y;  
	this.DefaultTop=0;
	this.DefaultLeft=0;
	this.Count=0;
	this.IsMainGroup=0;
	this.Items  = [];
	this.id     = tarimmenuMenuGroupHandler.GetId();
	this.RefererItem = null;
	this.Preload_DropdownImageExpand=new Image();
	this.Preload_DropdownImageCollapse=new Image();
	tarimmenuMenuGroupHandler.ObjectsCount=tarimmenuMenuGroupHandler.ObjectsCount+1;
	tarimmenuMenuGroupHandler.ObjectsArray[tarimmenuMenuGroupHandler.ObjectsCount]=this;
}

 
 
 
tarimmenuMenuGroup.prototype.Assign=function Assign(Source)
{
	this.Width= 						Source.Width;
	this.Height=						Source.Height;
	this.Opacity=						Source.Opacity;
	this.Embedding=					Source.Embedding;
	this.Drifting=					Source.Drifting;
	this.OnGroupShowJS=			Source.OnGroupShowJS;
	this.OnGroupHideJS=			Source.OnGroupHideJS;
  this.BgColor=						Source.BgColor;
	this.BgImage=						Source.BgImage;
	this.BgImgPos=					Source.BgImgPos;
	this.BgImgRep=					Source.BgImgRep;
	this.Border=						Source.Border;
	this.BorderWidth=				Source.BorderWidth;
	this.BorderColor=				Source.BorderColor;
	this.ShadowWidth=				Source.ShadowWidth;
	this.ShadowColor=				Source.ShadowColor;
	this.ShadowTransparency=Source.ShadowTransparency;
  this.ItemsSpacing=			Source.ItemsSpacing;
	this.ItemsPadding_L=		Source.ItemsPadding_L;
	this.ItemsPadding_R=		Source.ItemsPadding_R;
	this.ItemsPadding_T=		Source.ItemsPadding_T;
	this.ItemsPadding_B=		Source.ItemsPadding_B;
	this.HeaderText=				Source.HeaderText;
	this.HeaderTextAlign=		Source.HeaderTextAlign;
	this.HeaderTextOffsetX=	Source.HeaderTextOffsetX;
	this.HeaderTextOffsetY=	Source.HeaderTextOffsetY;
	this.HeaderHeight=			Source.HeaderHeight;
	this.HeaderBgColor=			Source.HeaderBgColor;
	this.HeaderIcon=				Source.HeaderIcon;
	this.HeaderIconOffsetX=	Source.HeaderIconOffsetX;
	this.HeaderIconOffsetY=	Source.HeaderIconOffsetY;
	this.HeaderBgImage=			Source.HeaderBgImage;
	this.HeaderBgImgPos=		Source.HeaderBgImgPos;
	this.HeaderBgImgRep=		Source.HeaderBgImgRep;
	this.FontFamily=				Source.FontFamily;
	this.FontColor=					Source.FontColor;
	this.FontSize=					Source.FontSize;
	this.FontDecoration=		Source.FontDecoration;
	this.FontWeight=				Source.FontWeight;
	this.FontStyle=					Source.FontStyle;
	this.MenuGroupAlign=		Source.MenuGroupAlign;
	this.z=									Source.z;
	this.Visibility=				Source.Visibility;
	this.AnimationTimeout=	Source.AnimationTimeout;
	this.AnimationType=			Source.AnimationType;
	this.ShowDropDownControl=Source.ShowDropDownControl;
	this.InitDropdownState=Source.InitDropdownState;
	this.DropdownImageExpand=Source.DropdownImageExpand;
	this.DropdownImageCollapse=Source.DropdownImageCollapse;
	this.MenuAlign=Source.MenuAlign;
};

 
 
 
tarimmenuMenuGroup.prototype.PreloadImages= function PreloadImages() {
	this.Preload_DropdownImageExpand.src=this.DropdownImageExpand;
	this.Preload_DropdownImageCollapse.src=this.DropdownImageCollapse;
};

 
 
 
tarimmenuMenuGroup.prototype.AddItem= function AddItem(Item) {
  this.Count++;
  this.Items[this.Count]=Item;
  Item.OwnerGroup=this;
};


 
 
 
tarimmenuMenuGroup.prototype.Preset= function Preset(ItemIndex,State) {
	if ((ItemIndex >=1) && (ItemIndex <= this.Count)){
		for (i=1; i<= this.Count; i++){
	    if (i==ItemIndex){
				this.Items[i].IsPreset=true;
				this.Items[i].PresetState=State;
				this.Items[i].SetItemState(State);
			}
				else
			{
				this.Items[i].IsPreset=false;
				this.Items[i].SetItemState(0);
			}
		}
	} 
};


 
 
 
tarimmenuMenuGroup.prototype.ExpandDropDown= function ExpandDropDown() {
	dropimg=document.getElementById('dropimg_'+this.id);
	bodydiv=document.getElementById(this.id+'_itemtablecover');
	if(bodydiv)
	{
		if ((bodydiv.style.visibility!='visible')&&(bodydiv.style.visibility!=''))
		{
			bodydiv.style.display='block';
			bodydiv.style.visibility='visible';
			if(dropimg){
				dropimg.src=this.Preload_DropdownImageCollapse.src;
			}
		}
	}
};


 
 
 
tarimmenuMenuGroup.prototype.CollapseDropDown= function CollapseDropDown() {
	dropimg=document.getElementById('dropimg_'+this.id);
	bodydiv=document.getElementById(this.id+'_itemtablecover');
	if(bodydiv)
	{
		if ((bodydiv.style.visibility=='visible')||(bodydiv.style.visibility==''))
		{  
			bodydiv.style.display='none';
			bodydiv.style.visibility='hidden';
			if(dropimg){
				dropimg.src=this.Preload_DropdownImageExpand.src;
			}
		}
	}
};


 
 
 
tarimmenuMenuGroup.prototype.FlipDropDown= function FlipDropDown() {
	dropimg=document.getElementById('dropimg_'+this.id);
	bodydiv=document.getElementById(this.id+'_itemtablecover');
	if(bodydiv)
	{
		if ((bodydiv.style.visibility=='visible')||(bodydiv.style.visibility==''))
		{  
			bodydiv.style.display='none';
			bodydiv.style.visibility='hidden';
			if(dropimg){
				dropimg.src=this.Preload_DropdownImageExpand.src;
			}
		}
			else
		{  
			bodydiv.style.display='block';
			bodydiv.style.visibility='visible';
			if(dropimg){
				dropimg.src=this.Preload_DropdownImageCollapse.src;
			}
		}
	}
};



 
 
 
tarimmenuMenuGroup.prototype.ToStr= function ToStr(){
	 
	this.PreloadImages();

   
	 
	if (this.Layout=='H') 
	{	
		maxwidth=0;
		widthsum=0;
		
		for (i=1; i<= this.Count; i++){ 
			if (this.Items[i].Width>maxwidth){
				maxwidth=this.Items[i].Width;
			}
			widthsum=widthsum+this.Items[i].Width;
		}
		this.Width=widthsum;
	}

  if (document.compatMode && document.compatMode != "BackCompat"){
		MainDivWidth=this.Width;
		HeaderWidth=MainDivWidth;
		TableWidth=this.Width-this.ItemsPadding_L-this.ItemsPadding_R; 
	}
		else
	{
		MainDivWidth=this.Width-this.ItemsPadding_L-this.ItemsPadding_R;
		HeaderWidth=this.Width;
		TableWidth=MainDivWidth; 
	}

	 
	SetPosition=true;
	if (this.Embedding=='default'){this.Embedding='absolute'; SetPosition=false}
	if (this.IsMainGroup==0){this.Embedding='absolute'}

   
	if (SetPosition){
		this.TmpMainDivStyle='position: '+this.Embedding+'; left: '+this.TargetPosX+'px; top: '+this.TargetPosY+'px; '; 
  } 
		else
	{
		this.TmpMainDivStyle='position: '+this.Embedding+'; '; 
	}

	this.TmpMainDivStyle=this.TmpMainDivStyle+'z-index: '+this.z+'; visibility: '+this.Visibility+'; ';  
  this.TmpMainDivStyle=this.TmpMainDivStyle+'width: '+MainDivWidth+'px; '; 
  this.TmpMainDivStyle=this.TmpMainDivStyle+'border-width: '+this.BorderWidth+'px; border-style: '+this.Border+'; border-color: '+this.BorderColor+'; ';  
	this.TmpMainDivStyle=this.TmpMainDivStyle+'background-color: '+this.BgColor+'; '; 
	this.TmpMainDivStyle=this.TmpMainDivStyle+'background-image: url('+this.BgImage+'); background-position: '+this.BgImgPos+'; background-repeat: '+this.BgImgRep+'; ';  
	if (this.Opacity<100){this.TmpMainDivStyle=this.TmpMainDivStyle+'filter:alpha(opacity='+this.Opacity+'); -moz-opacity:'+this.Opacity+'; opacity:'+(this.Opacity/100)+'; '};  
   
	 
	this.TmpHedStyle=' padding:0px; margin:0px; height: '+this.HeaderHeight+'px; ';
	this.TmpHedStyle=this.TmpHedStyle+'width: '+HeaderWidth+'px; ';
	this.TmpHedStyle=this.TmpHedStyle+'background-color: '+this.HeaderBgColor+'; ';
	this.TmpHedStyle=this.TmpHedStyle+'background-image: url('+this.HeaderBgImage+'); background-position: '+this.HeaderBgImgPos+'; background-repeat: '+this.HeaderBgImgRep+'; ';

	 
	this.TmpSubHedStyle='position: relative; left: '+this.HeaderTextOffsetX+'px; top: '+this.HeaderTextOffsetY+'px; ';  
	this.TmpSubHedStyle=this.TmpSubHedStyle+'font-family: '+this.FontFamily+' ; font-style: '+this.FontStyle+'; font-size: '+this.FontSize+'px; font-weight: '+this.FontWeight+'; ';  
	this.TmpSubHedStyle=this.TmpSubHedStyle+'color: '+this.FontColor+' ; text-decoration: '+this.FontDecoration+'; '; 

   
  this.TmpTableCover=	'padding-top: '+this.ItemsPadding_T+'px; padding-left: '+this.ItemsPadding_L+'px; padding-right: '+this.ItemsPadding_R+'px; padding-bottom: '+this.ItemsPadding_B+'px; '; 

   
	this.TableAttr='width="'+TableWidth+'" cellpadding="0" cellspacing="0" border="0"'; 

	 
	if(this.ShowDropDownControl)
	{
	  this.TmpDropDown='<img onclick="tarimmenuMenuGroupHandler.FlipDropDown(this.id);" id="dropimg_'+this.id+'" hspace="5" src="';
		if (this.InitDropdownState==1){
			this.TmpDropDown=this.TmpDropDown+this.Preload_DropdownImageCollapse.src; 
		}	else{
			this.TmpDropDown=this.TmpDropDown+this.Preload_DropdownImageExpand.src; 
			this.TmpTableCover=this.TmpTableCover+' visibility: hidden; display: none; ';
		}
		this.TmpDropDown=this.TmpDropDown+'" >';
	}
		else {
			this.TmpDropDown=(this.HeaderText)?'&nbsp;':'';
	}

	 
	TmpStr='<DIV style="'+this.TmpMainDivStyle+'" id="'+this.id+'" onmousedown="tarimmenuMenuGroupHandler.DoOnMouseDown(this.id)" onmouseup="tarimmenuMenuGroupHandler.DoOnMouseUp(this.id)" onmouseover="tarimmenuMenuGroupHandler.DoOnMouseOver(this.id)" onmouseout="tarimmenuMenuGroupHandler.DoOnMouseOut()">';

	 
  if (this.HeaderIcon){
  	TmpStr=TmpStr+'<img align="left" style="position: absolute; left:'+this.HeaderIconOffsetX+'px; top: '+this.HeaderIconOffsetY+'px; z-index: 1;" src="'+this.HeaderIcon+'">';  
  };

   
  TmpStr=TmpStr+'<div style="' + this.TmpHedStyle + '"><div><table  border="0" align="center" height="100%" cellpadding="0" cellspacing="0"><tr><td valign="middle" align="'+this.HeaderTextAlign+'"  width="99%"><span style="'+this.TmpSubHedStyle+'">' +this.HeaderText+'</span></td><td width="1%" valign="middle">'+this.TmpDropDown+'</td></tr></table></div></div>';  

	 
  TmpStr=TmpStr+'<div id="'+this.id+'_itemtablecover" style="'+this.TmpTableCover+'">'; 
	
	 
  if (this.Layout=='H') {
    TmpStr=TmpStr+'<TABLE '+this.TableAttr+' id="'+this.id+'_table"><TR>';  
		 
		TmpEndStr='</TR valign="top"></TABLE>';
  }
    else  
  {
    TmpStr=TmpStr+'<TABLE '+this.TableAttr+' id="'+this.id+'_table">';
		TmpEndStr='</TABLE>';
  }
  

   
  for (i=1; i<= this.Count; i++){ 
		this.Items[i].LastItem=false;
		if (i==this.Count){
			this.Items[i].LastItem=true; 
		}
		TmpStr=TmpStr+this.Items[i].ToStr(this.Layout);
  }	

   
  TmpStr=TmpStr+TmpEndStr;

	 
  TmpStr=TmpStr+'</div>'; 

	 
	TmpStr=TmpStr+'</DIV>';

	 
  for (this.i=1; this.i<= this.Count; this.i++){ 
		if (this.Items[this.i].Group != null){
		  TmpStr=TmpStr+this.Items[this.i].Group.ToStr(); 
		}  
  }	

	 
	if ((this.OnGroupShowJS!='') && (this.Visibility) && (this.IsMainGroup)){
		eval(this.OnGroupShowJS);
	}

	 
  return(TmpStr);	
};



 
 
 
tarimmenuMenuGroup.prototype.CloseGroupRecurse=function CloseGroupRecurse(){
	this.HideGroup();
  for (this.i=1; this.i<= this.Count; this.i++){ 
    if (this.Items[this.i].Group != null){
      this.Items[this.i].Group.CloseGroupRecurse();
    }
  }
};

 
 
 
tarimmenuMenuGroup.prototype.ShowGroupRecurse= function ShowGroupRecurse(){
 	obj=document.getElementById(this.id);
  if (obj){
	  obj.style.visibility='visible';
 	}

	if (this.IsMainGroup==0){
		this.ShowGroup();
	}

  for (this.i=1; this.i<= this.Count; this.i++){ 
    if (this.Items[this.i].Group != null){
		  this.Items[this.i].Group.ShowGroupRecurse();
    }
  }
};


 
 
 
tarimmenuMenuGroup.prototype.HideGroup= function HideGroup(){
	 
	window.clearTimeout(tarimmenuMenuGroupHandler.TimerAnimateID);		
	this.AnimationControlValue=20;
  obj=document.getElementById(this.id);
	objt=document.getElementById(this.id+'_table');

	if (obj!=null)
	{
	   
		for (this.i=1; this.i<= this.Count; this.i++){ 
  	  this.Items[this.i].HideOrphans();
		}

		if (obj.style.visibility!='hidden')
		{
			 
			objt.style.visibility='hidden';

			 
			obj.style.visibility='hidden';

			 
			if (this.OnGroupHideJS!=''){
				eval(this.OnGroupHideJS);
			}
		}
  }




};



 
 
 
tarimmenuMenuGroup.prototype.ShowGroup= function ShowGroup(){
	obj=document.getElementById(this.id);
  if (obj!=null){
		
		 
		switch (this.MenuGroupAlign){
		case 0: { 

								if (this.RefererItem.OwnerGroup.Layout=='V'){  
									this.TargetPosX = tarimmenuMiscFunc.getElementLeft(this.RefererItem.id) +  
																		tarimmenuMiscFunc.getElementWidth(this.RefererItem.OwnerGroup.id) -  
																		this.RefererItem.OwnerGroup.ItemsPadding_L+ 
																		this.x;  
									this.TargetPosY = tarimmenuMiscFunc.getElementTop(this.RefererItem.id) +  
																		this.y;  

								}
								else 
								{  
									this.TargetPosX = tarimmenuMiscFunc.getElementLeft(this.RefererItem.id) +  
																		this.x;  
									
									this.TargetPosY = tarimmenuMiscFunc.getElementTop(this.RefererItem.id) +  
																		tarimmenuMiscFunc.getElementHeight(this.RefererItem.id) +  
																		this.y ;  
								}

								break;
						}

		case 1:	{ 
								this.TargetPosX = tarimmenuMiscFunc.getElementLeft(this.RefererItem.id) +  
																	tarimmenuMiscFunc.getElementWidth(this.RefererItem.OwnerGroup.id) -  
																	this.RefererItem.OwnerGroup.ItemsPadding_L+ 
																	this.x;  
								this.TargetPosY = tarimmenuMiscFunc.getElementTop(this.RefererItem.id) -  
																	tarimmenuMiscFunc.getElementHeight(this.id) +  
																	this.y ;  
								break;
						}

		case 2:	{ 
								this.TargetPosX = tarimmenuMiscFunc.getElementLeft(this.RefererItem.id) +  
																	tarimmenuMiscFunc.getElementWidth(this.RefererItem.OwnerGroup.id) -  
																	this.RefererItem.OwnerGroup.ItemsPadding_L+ 
																	this.x;  
								this.TargetPosY = tarimmenuMiscFunc.getElementTop(this.RefererItem.id) -  
																	(tarimmenuMiscFunc.getElementHeight(this.id) / 2) +  
																	this.y ;  
								break;
						}

		case 3:	{ 
								this.TargetPosX = tarimmenuMiscFunc.getElementLeft(this.RefererItem.id) +  
																	tarimmenuMiscFunc.getElementWidth(this.RefererItem.OwnerGroup.id) -  
																	this.RefererItem.OwnerGroup.ItemsPadding_L+ 
																	this.x;  
								this.TargetPosY = tarimmenuMiscFunc.getElementTop(this.RefererItem.id) +  
																	this.y;  
								break;
						}

		case 4:	{ 
								this.TargetPosX = tarimmenuMiscFunc.getElementLeft(this.RefererItem.id) -  
																	tarimmenuMiscFunc.getElementWidth(this.id) -  
																	this.RefererItem.OwnerGroup.ItemsPadding_L - 
																	this.x;  
								this.TargetPosY = tarimmenuMiscFunc.getElementTop(this.RefererItem.id) -  
																	tarimmenuMiscFunc.getElementHeight(this.id) +  
																	this.y ;  
								break;
						}

		case 5:	{ 
								this.TargetPosX = tarimmenuMiscFunc.getElementLeft(this.RefererItem.id) -  
																	tarimmenuMiscFunc.getElementWidth(this.id) -  
																	this.RefererItem.OwnerGroup.ItemsPadding_L - 
																	this.x;  
								this.TargetPosY = tarimmenuMiscFunc.getElementTop(this.RefererItem.id) -  
																	(tarimmenuMiscFunc.getElementHeight(this.id) / 2) +  
																	this.y ;  
								break;
						}

		case 6:	{ 
								this.TargetPosX = tarimmenuMiscFunc.getElementLeft(this.RefererItem.id) -  
																	tarimmenuMiscFunc.getElementWidth(this.id) -  
																	this.RefererItem.OwnerGroup.ItemsPadding_L - 
																	this.x;  
								this.TargetPosY = tarimmenuMiscFunc.getElementTop(this.RefererItem.id) +  
																	this.y;  
								break;
						}

		case 7:	{ 
								this.TargetPosX = tarimmenuMiscFunc.getElementLeft(this.RefererItem.OwnerGroup.id) +  
																	this.x;  
								this.TargetPosY = tarimmenuMiscFunc.getElementTop(this.RefererItem.id) +  
																	tarimmenuMiscFunc.getElementHeight(this.RefererItem.id) +  
																	this.y ;  

								break;
						}
		}

		 
		obj.style.left = this.TargetPosX+'px';
		obj.style.top = this.TargetPosY+'px';

    

		if (obj.style.visibility=='hidden'){
       
    	window.clearTimeout(tarimmenuMenuGroupHandler.TimerAnimateID);
			 
			this.AnimationControlValue=20; 
			 
			tarimmenuMenuGroupHandler.TmpGroupToShow=obj.id;
			 
			for (this.i=1; this.i<= this.Count; this.i++){ 
				if (this.Items[this.i].LastItemState==1){
					this.Items[this.i].SetItemState(0);
				}
			}
			 
			tarimmenuMenuGroupHandler.TimerAnimateID = window.setTimeout("tarimmenuMenuGroupHandler.DoAnimation()",0);
		} 
	}
};



 
 
 
 
 

 
 
 
function tarimmenuMenuItemAncestor()
{
	this.Text_o='';	
	this.Text_c='';	
	this.URL='';
	this.URLTarget='';
	this.Hint='';
	this.OnLeaveJS='';
	this.OnOverJS='';
	this.OnClickJS='';
	this.TextAlign='center';
	this.TextVAlign='middle';
	this.Cursor='default';
	this.PaddingLeft=0;
	this.PaddingLeft_o=0;
	this.PaddingTop=0;
	this.PaddingTop_o=0;
	this.PaddingRight=0;
	this.PaddingRight_o=0;
	this.PaddingBottom=0;
	this.PaddingBottom_o=0;
	this.FontColor='';
	this.FontColor_o='';
	this.FontColor_c='';
	this.FontFamily='';
	this.FontFamily_o='';
	this.FontFamily_c='';
	this.FontSize=10;
	this.FontSize_o='';
	this.FontSize_c='';
	this.FontDecoration='';
	this.FontDecoration_o='';
	this.FontDecoration_c='';
	this.FontWeight='';
	this.FontWeight_o='';
	this.FontWeight_c='';
	this.FontStyle='';
	this.FontStyle_o='';
	this.FontStyle_c='';
	this.LeftIcon='';
	this.LeftIcon_o='';
	this.LeftIcon_c='';
	this.LeftIconOffsetX=0;
	this.LeftIconOffsetX_o=0;
	this.LeftIconOffsetX_c=0;
	this.LeftIconOffsetY=0;
	this.LeftIconOffsetY_o=0;
	this.LeftIconOffsetY_c=0;
	this.LeftIconIsIndicator=false;
	this.RightIcon='';
	this.RightIcon_o='';
	this.RightIcon_c='';
	this.RightIconOffsetX=0;
	this.RightIconOffsetX_o=0;
	this.RightIconOffsetX_c=0;
	this.RightIconOffsetY=0;
	this.RightIconOffsetY_o=0;
	this.RightIconOffsetY_c=0;
	this.RightIconIsIndicator=true;
	this.BgColor='';
	this.BgColor_o='#44AA22';
	this.BgColor_c='';
	this.BgImage='';
	this.BgImage_o='';
	this.BgImage_c='';
	this.BgImgPos='';
	this.BgImgPos_o='';
	this.BgImgPos_c='';
	this.BgImgRep='';
	this.BgImgRep_o='';
	this.BgImgRep_c='';
	this.LeftPartBgImgPos='';
	this.LeftPartBgImage='';
	this.LeftPartBgImage_o='';
	this.LeftPartBgImage_c='';
	this.RightPartBgImgPos='';
	this.RightPartBgImage='';
	this.RightPartBgImage_o='';
	this.RightPartBgImage_c='';
	this.Border='solid';
	this.Border_o='solid';
	this.Border_c='solid';
	this.BorderWidth='1';
	this.BorderWidth_o='1';
	this.BorderWidth_c='1';
	this.BorderColor='#0';
	this.BorderColor_o='#0';
	this.BorderColor_c='#0';
	this.BorderLeft=true;
	this.BorderRight=true;
	this.BorderTop=true;
	this.BorderBottom=true;
	this.Height=10;
	this.Width=100;
	this.SeparatorSize=0;
	this.SeparatorColor='Gray';
};



 
 
 
 
 


 
 
 
tarimmenuMenuItem.prototype = new tarimmenuMenuItemAncestor;	

 
 
 
function tarimmenuMenuItem(Text) {
	this.Text=Text;	
	 
	 
   
	this.id = tarimmenuMenuItemHandler.GetId();
	this.Group = null;
  this.OwnerGroup=null;
	this.Preload_BgImage=new Image();
	this.Preload_BgImage_o=new Image();
	this.Preload_BgImage_c=new Image();
	this.Preload_BgImageLeft=new Image();
	this.Preload_BgImageLeft_o=new Image();
	this.Preload_BgImageLeft_c=new Image();
	this.Preload_BgImageRight=new Image();
	this.Preload_BgImageRight_o=new Image();
	this.Preload_BgImageRight_c=new Image();
	this.Preload_LeftIcon=new Image();
	this.Preload_LeftIcon_o=new Image();
	this.Preload_LeftIcon_c=new Image();
	this.Preload_RightIcon=new Image();
	this.Preload_RightIcon_o=new Image();
	this.Preload_RightIcon_c=new Image();
	this.LastItemState=-1;
	this.IsPreset=false;
	this.PresetState=2;
	tarimmenuMenuItemHandler.ObjectsCount=tarimmenuMenuItemHandler.ObjectsCount+1;
	tarimmenuMenuItemHandler.ObjectsArray[tarimmenuMenuItemHandler.ObjectsCount]=this;

};	



 
 
 
tarimmenuMenuItem.prototype.Assign=function Assign(Source)
{
	this.URL=									Source.URL;	
	this.URLTarget=						Source.URLTarget;	
	this.Hint=								Source.Hint;	
	this.OnLeaveJS=						Source.OnLeaveJS;	
	this.OnOverJS=						Source.OnOverJS;	
	this.OnClickJS=						Source.OnClickJS;	
	this.TextAlign=						Source.TextAlign;	
	this.TextVAlign=					Source.TextVAlign;	
	this.Cursor=							Source.Cursor;	
	this.PaddingLeft=					Source.PaddingLeft;	
	this.PaddingLeft_o=				Source.PaddingLeft_o;	
	this.PaddingTop=					Source.PaddingTop;	
	this.PaddingTop_o=				Source.PaddingTop_o;	
	this.PaddingRight=				Source.PaddingRight;	
	this.PaddingRight_o=			Source.PaddingRight_o;	
	this.PaddingBottom=				Source.PaddingBottom;	
	this.PaddingBottom_o=			Source.PaddingBottom_o;	
	this.FontColor=						Source.FontColor;	
	this.FontColor_o=					Source.FontColor_o;	
	this.FontColor_c=					Source.FontColor_c;	
	this.FontFamily=					Source.FontFamily;	
	this.FontFamily_o=				Source.FontFamily_o;	
	this.FontFamily_c=				Source.FontFamily_c;	
	this.FontSize=						Source.FontSize;	
	this.FontSize_o=					Source.FontSize_o;	
	this.FontSize_c=					Source.FontSize_c;	
	this.FontDecoration=			Source.FontDecoration;	
	this.FontDecoration_o=		Source.FontDecoration_o;	
	this.FontDecoration_c=		Source.FontDecoration_c;	
	this.FontWeight=					Source.FontWeight;	
	this.FontWeight_o=				Source.FontWeight_o;	
	this.FontWeight_c=				Source.FontWeight_c;	
	this.FontStyle=						Source.FontStyle;	
	this.FontStyle_o=					Source.FontStyle_o;	
	this.FontStyle_c=					Source.FontStyle_c;	
	this.LeftIcon=						Source.LeftIcon;	
	this.LeftIcon_o=					Source.LeftIcon_o;	
	this.LeftIcon_c=					Source.LeftIcon_c;	
	this.LeftIconOffsetX=			Source.LeftIconOffsetX;	
	this.LeftIconOffsetX_o=		Source.LeftIconOffsetX_o;	
	this.LeftIconOffsetX_c=		Source.LeftIconOffsetX_c;	
	this.LeftIconOffsetY=			Source.LeftIconOffsetY;	
	this.LeftIconOffsetY_o=		Source.LeftIconOffsetY_o;	
	this.LeftIconOffsetY_c=		Source.LeftIconOffsetY_c;	
	this.LeftIconIsIndicator=	Source.LeftIconIsIndicator;	
	this.RightIcon=						Source.RightIcon;	
	this.RightIcon_o=					Source.RightIcon_o;	
	this.RightIcon_c=					Source.RightIcon_c;	
	this.RightIconOffsetX=		Source.RightIconOffsetX;	
	this.RightIconOffsetX_o=	Source.RightIconOffsetX_o;	
	this.RightIconOffsetX_c=	Source.RightIconOffsetX_c;	
	this.RightIconOffsetY=		Source.RightIconOffsetY;	
	this.RightIconOffsetY_o=	Source.RightIconOffsetY_o;	
	this.RightIconOffsetY_c=	Source.RightIconOffsetY_c;	
	this.RightIconIsIndicator=Source.RightIconIsIndicator;	
	this.BgColor=							Source.BgColor;	
	this.BgColor_o=						Source.BgColor_o;	
	this.BgColor_c=						Source.BgColor_c;	
	this.BgImage=							Source.BgImage;	
	this.BgImage_o=						Source.BgImage_o;	
	this.BgImage_c=						Source.BgImage_c;	
	this.BgImgPos=						Source.BgImgPos;	
	this.BgImgPos_o=					Source.BgImgPos_o;	
	this.BgImgPos_c=					Source.BgImgPos_c;	
	this.BgImgRep=						Source.BgImgRep;	
	this.BgImgRep_o=					Source.BgImgRep_o;	
	this.BgImgRep_c=					Source.BgImgRep_c;	
	this.LeftPartBgImgPos=		Source.LeftPartBgImgPos;	
	this.LeftPartBgImage=			Source.LeftPartBgImage;	
	this.LeftPartBgImage_o=		Source.LeftPartBgImage_o;	
	this.LeftPartBgImage_c=		Source.LeftPartBgImage_c;	
	this.RightPartBgImgPos=		Source.RightPartBgImgPos;	
	this.RightPartBgImage=		Source.RightPartBgImage;	
	this.RightPartBgImage_o=	Source.RightPartBgImage_o;	
	this.RightPartBgImage_c=	Source.RightPartBgImage_c;	
	this.Border=							Source.Border;	
	this.Border_o=						Source.Border_o;	
	this.Border_c=						Source.Border_c;
	this.BorderWidth=					Source.BorderWidth;	
	this.BorderWidth_o=				Source.BorderWidth_o;	
	this.BorderWidth_c=				Source.BorderWidth_c;	
	this.BorderColor=					Source.BorderColor;	
	this.BorderColor_o=				Source.BorderColor_o;	
	this.BorderColor_c=				Source.BorderColor_c;	
	this.BorderLeft=					Source.BorderLeft;	
	this.BorderRight=					Source.BorderRight;	
	this.BorderTop=						Source.BorderTop;	
	this.BorderBottom=				Source.BorderBottom;	
	this.Height=							Source.Height;	
	this.Width=								Source.Width;	
	this.SeparatorSize=				Source.SeparatorSize;	
	this.SeparatorColor=			Source.SeparatorColor;	
};



 
 
 
 
tarimmenuMenuItem.prototype.HideOrphans=function HideOrphans(){
	objRightIcon=document.getElementById(this.id+'_right_Icon_img');	
	objLeftIcon=document.getElementById(this.id+'_left_Icon_img');
	if (objRightIcon){
		objRightIcon.style.visibility='hidden';
		objRightIcon.style.display='none';
	}
	if (objLeftIcon){
		objLeftIcon.style.visibility='hidden';
		objLeftIcon.style.display='none';
	}

	objRightIcon=document.getElementById(this.id+'_right_bg_img');	
	objLeftIcon=document.getElementById(this.id+'_left_bg_img');		
	if (objRightIcon){
		objRightIcon.style.visibility='hidden';
		objRightIcon.style.display='none';
	}
	if (objLeftIcon){
		objLeftIcon.style.visibility='hidden';
		objLeftIcon.style.display='none';
	}
}; 

 
 
 
 
tarimmenuMenuItem.prototype.ShowOrphans=function ShowOrphans(){
	objRightIcon=document.getElementById(this.id+'_right_bg_img');	
	objLeftIcon=document.getElementById(this.id+'_left_bg_img');		

	if ((objRightIcon) && (this.RightPartBgImage>'')){
		objRightIcon.style.visibility='visible';
		objRightIcon.style.display='block';
	}
	if ((objLeftIcon) && (this.LeftPartBgImage>'')){
		objLeftIcon.style.visibility='visible';
		objLeftIcon.style.display='block';
	}

	objRightIcon=document.getElementById(this.id+'_right_Icon_img');	
	objLeftIcon=document.getElementById(this.id+'_left_Icon_img');		
	if ((objRightIcon) && (this.RightIcon > '')){
		if (((this.RightIconIsIndicator) && (this.Group)) || (!this.RightIconIsIndicator)){		
			objRightIcon.style.visibility='visible';
			objRightIcon.style.display='block';
		}
	}
	if ((objLeftIcon) && (this.LeftIcon>'')){
		if (((this.LeftIconIsIndicator) && (this.Group)) || (!this.LeftIconIsIndicator)){		
			objLeftIcon.style.visibility='visible';
			objLeftIcon.style.display='block';
		}
	}
}; 



 
 
 
tarimmenuMenuItem.prototype.PreloadImages= function PreloadImages() {
  this.Preload_BgImage.src=this.BgImage;
	this.Preload_BgImage_o.src=this.BgImage_o;
	this.Preload_BgImage_c.src=this.BgImage_c;
	this.Preload_BgImageLeft.src=this.LeftPartBgImage;
	this.Preload_BgImageLeft_o.src=this.LeftPartBgImage_o;
	this.Preload_BgImageLeft_c.src=this.LeftPartBgImage_c;
	this.Preload_BgImageRight.src=this.RightPartBgImage;
	this.Preload_BgImageRight_o.src=this.RightPartBgImage_o;
	this.Preload_BgImageRight_c.src=this.RightPartBgImage_c;
	this.Preload_LeftIcon.src=this.LeftIcon;
	this.Preload_LeftIcon_o.src=this.LeftIcon_o;
	this.Preload_LeftIcon_c.src=this.LeftIcon_c;
	this.Preload_RightIcon.src=this.RightIcon;
	this.Preload_RightIcon_o.src=this.RightIcon_o;
	this.Preload_RightIcon_c.src=this.RightIcon_c;
};



 
 
 
tarimmenuMenuItem.prototype.ToStr= function ToStr(Layout) {
	var TmpStr='';  
	var TmpTDAttr=''; 
	var ItemCore=''; 
	var TmpTDCSS='';  
	var TmpCoreCentreTDStyle=''; 
	this.Cursor=((this.URL)&&(this.Cursor=='auto'))?'pointer':this.Cursor;

	 
	this.PreloadImages();

	 
  if (Layout=='H') {
		TmpTDAttr=TmpTDAttr+' height=' +'"'+ this.Height + '" width="'+this.Width+'" valign="top" ' ;  
	}
		else
	{
		TmpTDAttr=TmpTDAttr+' height=' +'"'+ this.Height + '" valign="top" ' ;
	}

	 
	TmpTDCSS=' ';

	 
	TmpCoreTableCSS=' style="background-color: '+this.BgColor+'; color:'+this.FontColor+'; ';
	TmpCoreTableCSS=TmpCoreTableCSS+' cursor : '+this.Cursor+'; ';

	if (this.BorderLeft){TmpCoreTableCSS=TmpCoreTableCSS+' border-left-width: '+this.BorderWidth+'px; border-left-style:'+this.Border+'; border-left-color:'+this.BorderColor+'; ';}
	if (this.BorderRight){TmpCoreTableCSS=TmpCoreTableCSS+' border-right-width: '+this.BorderWidth+'px; border-right-style:'+this.Border+'; border-right-color:'+this.BorderColor+'; ';}
	if (this.BorderTop){TmpCoreTableCSS=TmpCoreTableCSS+' border-top-width: '+this.BorderWidth+'px; border-top-style:'+this.Border+'; border-top-color:'+this.BorderColor+'; ';}
	if (this.BorderBottom){TmpCoreTableCSS=TmpCoreTableCSS+' border-bottom-width: '+this.BorderWidth+'px; border-bottom-style:'+this.Border+'; border-bottom-color:'+this.BorderColor+'; ';}
	TmpCoreTableCSS=TmpCoreTableCSS+'" ';

	 
	if (this.BgImgPos=='stretch'){
		TmpCoreCentreTDStyle='style="';
	} 
		else
	{
	  TmpCoreCentreTDStyle='style="background-image: url('+this.BgImage+'); background-position: '+this.BgImgPos+'; background-repeat: '+this.BgImgRep+'; ';
	}
	TmpCoreCentreTDStyle=TmpCoreCentreTDStyle+'text-decoration: '+this.FontDecoration+'; font-family: '+this.FontFamily+'; font-size: '+this.FontSize+'px; font-style: '+this.FontStyle+'; font-weight: '+this.FontWeight+'; ';
  TmpCoreCentreTDStyle=TmpCoreCentreTDStyle+'padding-left: '+this.PaddingLeft+'px; padding-top: '+this.PaddingTop+'px; padding-right: '+this.PaddingRight+'px; padding-bottom: '+this.PaddingBottom+'px;  "';

	
	 
	if (((this.RightIconIsIndicator) && (!this.Group)) || (!this.RightIcon)) {
		TmpRimgVis='visibility : hidden; ';
	} else {TmpRimgVis='';}

	if (((this.LeftIconIsIndicator) && (!this.Group)) || (!this.LeftIcon)){
		TmpLimgVis='visibility : hidden; ';
	} else {TmpLimgVis='';}
	
	if ((this.LeftIcon > '')||(this.LeftIcon_o > '')||(this.LeftIcon_c > '')) {
		TmpLeftIconSource='<img id="'+this.id+'_left_Icon_img"  border="0" src="'+this.LeftIcon+'" style="'+TmpLimgVis+' vertical-align: middle; position: absolute; margin-left: '+this.LeftIconOffsetX+'px; margin-top: '+this.LeftIconOffsetY+'px;">';  
	} else {TmpLeftIconSource='';}

	if ((this.RightIcon > '')||(this.RightIcon_o > '')||(this.RightIcon_c > '')){
		TmpRightIconSource='<img id="'+this.id+'_right_Icon_img"  border="0" src="'+this.RightIcon+'" style="'+TmpRimgVis+' vertical-align: middle; position: absolute; margin-left: '+this.RightIconOffsetX+'px; margin-top: '+this.RightIconOffsetY+'px;">';  
	} else {TmpRightIconSource='';}


	 
	TmpLeftBgSource='';
	TmpRightBgSource='';
	LeftBgImgVis='';
	RightBgImgVis='';

  if ((this.LeftPartBgImage > '')||(this.LeftPartBgImage_o > '')||(this.LeftPartBgImage_c > ''))
	{
	  if ((this.LeftPartBgImage >'')&&(this.OwnerGroup.IsMainGroup==1)) {LeftBgImgVis='visible';}else {LeftBgImgVis='hidden';};
  	TmpLeftBgSource='<img style="visibility: '+LeftBgImgVis+'; display:block;" id="'+this.id+'_left_bg_img" border="0" align="'+this.LeftPartBgImgPos+'" vspace="0" hspace="0" src="'+this.LeftPartBgImage+'">';
	}
            
  if ((this.RightPartBgImage > '')||(this.RightPartBgImage_o > '')||(this.RightPartBgImage_c > ''))
	{
  	if ((this.RightPartBgImage>'')&&(this.OwnerGroup.IsMainGroup==1)){RightBgImgVis='visible';}	else {RightBgImgVis='hidden';};
  	TmpRightBgSource='<img style="visibility: '+RightBgImgVis+';  display:block;" id="'+this.id+'_right_bg_img" border="0" align="'+this.RightPartBgImgPos+'" vspace="0" hspace="0"  src="'+this.RightPartBgImage+'">';
	}


	 
	ItemCore='<table '+TmpCoreTableCSS+' id="'+this.id+'_core_table" cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">'; 
	ItemCore=ItemCore+'<tr>'; 
  ItemCore=ItemCore+'<td width="0" valign="middle">'+TmpLeftIconSource+'</td><td width="0" align="right" valign="'+this.LeftPartBgImgPos+'" >'+TmpLeftBgSource+'</td>';  
	ItemCore=ItemCore+'<td id="'+this.id+'_core_table_td" '+TmpCoreCentreTDStyle+' width="100%" align="'+this.TextAlign+'">' + this.Text + '</td>';  
	ItemCore=ItemCore+'<td width="0" align="left" valign="'+this.RightPartBgImgPos+'">'+TmpRightBgSource+'</td><td width="0" valign="middle">'+TmpRightIconSource+'</td>';  
	ItemCore=ItemCore+'</tr>'; 
	ItemCore=ItemCore+'</table>'; 


   
  if (Layout=='H') {  
    TmpStr='<TD '+TmpTDAttr+' '+TmpTDCSS+' id="'+this.id+'" onmouseover="tarimmenuMenuItemHandler.DoOnMouseOver(this.id)" onmouseout="tarimmenuMenuItemHandler.DoOnMouseOut(this.id)" onmousemove="tarimmenuMenuItemHandler.DoOnMouseMove(this.id)" onmousedown="tarimmenuMenuItemHandler.DoOnMouseDown(this.id)" onmouseup="tarimmenuMenuItemHandler.DoOnMouseUp(this.id)" onclick="tarimmenuMenuItemHandler.Navigate(this.id)">';
    TmpStr=TmpStr+ItemCore;
		TmpStr=TmpStr+'</TD>';

		 
		if (this.LastItem==false){
			if (this.SeparatorSize > 0){
				TmpStr=TmpStr+'<TD width="'+(this.OwnerGroup.ItemsSpacing /2) +'"></TD>';
				TmpStr=TmpStr+'<TD bgcolor="'+this.SeparatorColor+'" width="'+this.SeparatorSize+'"></TD>';				
				TmpStr=TmpStr+'<TD width="'+(this.OwnerGroup.ItemsSpacing/2)+'"></TD>';
			}
				else
			{
				if (this.OwnerGroup.ItemsSpacing>0){
					TmpStr=TmpStr+'<TD width="'+this.OwnerGroup.ItemsSpacing+'"></TD>';
				}
			}
		}
  }
    else  
  {  
		TmpStr='<TR valign="top"><TD '+TmpTDAttr+' '+TmpTDCSS+' id="'+this.id+'" onmouseover="tarimmenuMenuItemHandler.DoOnMouseOver(this.id)" onmouseout="tarimmenuMenuItemHandler.DoOnMouseOut(this.id)" onmousemove="tarimmenuMenuItemHandler.DoOnMouseMove(this.id)" onmousedown="tarimmenuMenuItemHandler.DoOnMouseDown(this.id)" onmouseup="tarimmenuMenuItemHandler.DoOnMouseUp(this.id)" onclick="tarimmenuMenuItemHandler.Navigate(this.id)">';
		
		TmpStr=TmpStr+ItemCore;
		TmpStr=TmpStr+'</TD></TR>';
		 
		if (this.LastItem==false){
			TmpHRAttr='';
			if (this.SeparatorSize > 0){
				TmpHRAttr='<div style="margin-top: 0px; margin-bottom: 0px; color: '+this.SeparatorColor+'; background-color: '+this.SeparatorColor+'; border-width: 0px; height: '+this.SeparatorSize+'px;"><hr noshade style="display: none;"></div>';
			}
			TmpStr=TmpStr+'<TR valign="middle"><TD height="'+this.OwnerGroup.ItemsSpacing+'">'+TmpHRAttr+'</TD></TR>';
		}
  }
  return(TmpStr); 
};


 
 
 
tarimmenuMenuItem.prototype.AddGroup= function AddGroup(SubGroup){
	this.Group=SubGroup;
	SubGroup.RefererItem=this;
};


 
 
 
 
 
 
 
tarimmenuMenuItem.prototype.SetItemState= function SetItemState(State){

	if (this.LastItemState==State)
	{
		return;
	}
		else
	{
		this.LastItemState=State;
	}

	if (this.IsPreset){
		State=this.PresetState;
	}

	objCoreTable=document.getElementById(this.id+'_core_table');	
	objCoreTableTD=document.getElementById(this.id+'_core_table_td');	
	objLeftBgImg=document.getElementById(this.id+'_left_bg_img');
	objRightBgImg=document.getElementById(this.id+'_right_bg_img');
	objLeftIcon=document.getElementById(this.id+'_left_Icon_img');	
	objRightIcon=document.getElementById(this.id+'_right_Icon_img');	

	switch (State){
		case 0:{ 

			if (objCoreTableTD){
				objCoreTableTD.innerHTML = this.Text;
			}

			if (objCoreTable){ 
				 
				objCoreTable.style.backgroundColor=this.BgColor;	
				objCoreTable.bgColor=this.BgColor;	

				 
				if (this.BorderLeft){
					objCoreTable.style.borderLeftWidth=this.BorderWidth;
				} else {objCoreTable.style.borderLeftWidth=0;} 

				if (this.BorderRight){
					objCoreTable.style.borderRightWidth=this.BorderWidth;
				} else {objCoreTable.style.borderRightWidth=0;}
			
				if (this.BorderTop){
					objCoreTable.style.borderTopWidth=this.BorderWidth;					
				} else {objCoreTable.style.borderTopWidth=0;}
			
				if (this.BorderBottom){
					objCoreTable.style.borderBottomWidth=this.BorderWidth;					
				} else {objCoreTable.style.borderBottomWidth=0;}

				objCoreTable.style.borderStyle=this.Border;
				objCoreTable.style.borderColor=this.BorderColor;
			}

			if (objCoreTableTD){ 
				 
				objCoreTableTD.style.color=this.FontColor;
				objCoreTableTD.style.fontFamily=this.FontFamily;
				objCoreTableTD.style.fontSize=this.FontSize;
				objCoreTableTD.style.textDecoration=this.FontDecoration;
				objCoreTableTD.style.fontWeight=this.FontWeight;
				objCoreTableTD.style.fontStyle=this.FontStyle;
				 
				objCoreTableTD.style.paddingLeft=this.PaddingLeft;
				objCoreTableTD.style.paddingRight=this.PaddingRight;
				objCoreTableTD.style.paddingTop=this.PaddingTop;
				objCoreTableTD.style.paddingBottom=this.PaddingBottom;
				 
				if (this.BgImage>''){
					objCoreTableTD.style.backgroundImage='url('+this.Preload_BgImage.src+')';
					objCoreTableTD.style.backgroundPosition=this.BgImgPos;
					objCoreTableTD.style.backgroundRepeat=this.BgImgRep;
				}
					else
				{
					objCoreTableTD.style.backgroundImage='none';
				}

			}


			if (objLeftBgImg){ 
				if (this.LeftPartBgImage>''){
					objLeftBgImg.src=this.Preload_BgImageLeft.src;
					objLeftBgImg.style.visibility='visible';
					objLeftBgImg.style.display='block';
				} 
					else 
				{
					objLeftBgImg.style.visibility='hidden';
				}
			}


			if (objRightBgImg){ 
				if (this.RightPartBgImage>''){
					objRightBgImg.src=this.Preload_BgImageRight.src;
					objRightBgImg.style.visibility='visible';
					objRightBgImg.style.display='block';
				} 
					else 
				{
					objRightBgImg.style.visibility='hidden';
				}
			}


			if (objRightIcon){  
				if (this.RightIcon>''){
					objRightIcon.src=this.Preload_RightIcon.src;
					if ((this.RightIconIsIndicator) && (!this.Group)){
						objRightIcon.style.visibility='hidden';
					} 
						else
					{
						objRightIcon.style.visibility='visible';
						objRightIcon.style.display='block';
					}
				} 
					else {objRightIcon.style.visibility='hidden';
				}

				objRightIcon.style.marginLeft=this.RightIconOffsetX;
				objRightIcon.style.marginTop=this.RightIconOffsetY;
			}


			if (objLeftIcon){  
				if (this.LeftIcon > ''){
					objLeftIcon.src=this.Preload_LeftIcon.src;
					if ((this.LeftIconIsIndicator) && (!this.Group)){
						
					} 
						else
					{
						objLeftIcon.style.visibility='visible';
						objLeftIcon.style.display='block';
					}
				} else {objLeftIcon.style.visibility='hidden';
							}
				
				objLeftIcon.style.marginLeft=this.LeftIconOffsetX;
				objLeftIcon.style.marginTop=this.LeftIconOffsetY;
			}

			eval(this.OnLeaveJS); 
			break;		
		}




		case 1:{ 

			if ((objCoreTableTD)&&(this.Text_o>'')){
				objCoreTableTD.innerHTML = this.Text_o;
			}

			if (objCoreTable != null)  
			{
				 
				if (this.BgColor_o){
					objCoreTable.style.backgroundColor=this.BgColor_o;	
					objCoreTable.bgColor=this.BgColor_o;	
				}

				 
				if (this.BorderWidth_o!=null){
					if (this.BorderLeft){
						objCoreTable.style.borderLeftWidth=this.BorderWidth_o;
						if (this.Border_o>'')	{objCoreTable.style.borderLeftStyle=this.Border_o;}
					} 

					if (this.BorderRight){
						objCoreTable.style.borderRightWidth=this.BorderWidth_o;
						if (this.Border_o>'')	{objCoreTable.style.borderRightStyle=this.Border_o;}
					}
				
					if (this.BorderTop){
						objCoreTable.style.borderTopWidth=this.BorderWidth_o;					
						if (this.Border_o>'')	{objCoreTable.style.borderTopStyle=this.Border_o;}
					}
				
					if (this.BorderBottom){
						objCoreTable.style.borderBottomWidth=this.BorderWidth_o;					
						if (this.Border_o>'')	{objCoreTable.style.borderBottomStyle=this.Border_o;}
					}
				}

				if (this.BorderColor_o>''){objCoreTable.style.borderColor=this.BorderColor_o};
			}

			if (objCoreTableTD){ 
				 
				if (this.FontColor_o){objCoreTableTD.style.color=this.FontColor_o;}
				if (this.FontFamily_o){objCoreTableTD.style.fontFamily=this.FontFamily_o;}
				if (this.FontSize_o){objCoreTableTD.style.fontSize=this.FontSize_o;}
				if (this.FontDecoration_o){objCoreTableTD.style.textDecoration=this.FontDecoration_o;}
				if (this.FontWeight_o){objCoreTableTD.style.fontWeight=this.FontWeight_o;}
				if (this.FontStyle_o){objCoreTableTD.style.fontStyle=this.FontStyle_o;}
				 
				if (this.PaddingLeft_o!=null){objCoreTableTD.style.paddingLeft=this.PaddingLeft_o};
				if (this.PaddingRight_o!=null){objCoreTableTD.style.paddingRight=this.PaddingRight_o;}
				if (this.PaddingTop_o!=null){objCoreTableTD.style.paddingTop=this.PaddingTop_o;}
				if (this.PaddingBottom_o!=null){objCoreTableTD.style.paddingBottom=this.PaddingBottom_o;}
				 
				if (this.BgImage_o>''){
					objCoreTableTD.style.backgroundImage='url('+this.Preload_BgImage_o.src+')';
					objCoreTableTD.style.backgroundPosition=this.BgImgPos_o||this.BgImgPos;
					objCoreTableTD.style.backgroundRepeat=this.BgImgRep_o||this.BgImgRep;
				}
			}

			if (objLeftBgImg){ 
				if (this.LeftPartBgImage_o>''){
					objLeftBgImg.src=this.Preload_BgImageLeft_o.src;
					objLeftBgImg.style.visibility='visible';
					objLeftBgImg.style.display='block';
				} 
					else 
				{
					 
				}
			}


			if (objRightBgImg){ 
				if (this.RightPartBgImage_o>''){
					objRightBgImg.src=this.Preload_BgImageRight_o.src;
					objRightBgImg.style.visibility='visible';
					objRightBgImg.style.display='block';
				} 
					else 
				{
					 
				}
			}


			if (objRightIcon){  
				if (this.RightIcon_o > ''){
					objRightIcon.src=this.Preload_RightIcon_o.src;
					if ((this.RightIconIsIndicator) && (!this.Group)){
						objRightIcon.style.visibility='hidden';
					} 
						else
					{
						objRightIcon.style.visibility='visible';
						objRightIcon.style.display='block';
					}
				}
				if (this.RightIconOffsetX_o){objRightIcon.style.marginLeft=this.RightIconOffsetX_o};
				if (this.RightIconOffsetY_o){objRightIcon.style.marginTop=this.RightIconOffsetY_o};
			}

			if (objLeftIcon){  
				if (this.LeftIcon_o > ''){
					objLeftIcon.src=this.Preload_LeftIcon_o.src;
					if ((this.LeftIconIsIndicator) && (!this.Group)){
						objLeftIcon.style.visibility='hidden';
					} 
						else
					{
						objLeftIcon.style.visibility='visible';
						objLeftIcon.style.display='block';			
					}
				}
				if (this.LeftIconOffsetX_o){objLeftIcon.style.marginLeft=this.LeftIconOffsetX_o;}
				if (this.LeftIconOffsetY_o){objLeftIcon.style.marginTop=this.LeftIconOffsetY_o};
			}

			eval(this.OnOverJS); 
			break;
		}



		case 2:{ 
			if ((objCoreTableTD)&&(this.Text_c>'')){
				objCoreTableTD.innerHTML = this.Text_c;
			}

			if (objCoreTable != null)  
			{
				 
				if (this.BgColor_c){
					objCoreTable.style.backgroundColor=this.BgColor_c;	
					objCoreTable.style.bgColor=this.BgColor_c;	
				}

				 
				if (this.BorderWidth_c!=null)
				{
					if (this.BorderLeft){
						objCoreTable.style.borderLeftWidth=this.BorderWidth_c;
						if (this.Border_c>'')	{objCoreTable.style.borderLeftStyle=this.Border_c;}
					} 

					if (this.BorderRight){
						objCoreTable.style.borderRightWidth=this.BorderWidth_c;
						if (this.Border_c>'')	{objCoreTable.style.borderRightStyle=this.Border_c;}
					}
				
					if (this.BorderTop){
						objCoreTable.style.borderTopWidth=this.BorderWidth_c;					
						if (this.Border_c>'')	{objCoreTable.style.borderTopStyle=this.Border_c;}
					}
				
					if (this.BorderBottom){
						objCoreTable.style.borderBottomWidth=this.BorderWidth_c;					
						if (this.Border_c>'')	{objCoreTable.style.borderBottomStyle=this.Border_c;}
					}
				}

				if (this.BorderColor_c>''){objCoreTable.style.borderColor=this.BorderColor_c};
			}
		}


		if (objCoreTableTD){ 
			 
			if (this.FontColor_c){objCoreTableTD.style.color=this.FontColor_c;}
			if (this.FontFamily_c){objCoreTableTD.style.fontFamily=this.FontFamily_c;}
			if (this.FontSize_c){objCoreTableTD.style.fontSize=this.FontSize_c;}
			if (this.FontDecoration_c){objCoreTableTD.style.textDecoration=this.FontDecoration_c;}
			if (this.FontWeight_c){objCoreTableTD.style.fontWeight=this.FontWeight_c;}
			if (this.FontStyle_c){objCoreTableTD.style.fontStyle=this.FontStyle_c;}
			 
			if (this.BgImage_c>''){
				objCoreTableTD.style.backgroundImage='url('+this.Preload_BgImage_c.src+')';
				objCoreTableTD.style.backgroundPosition=this.BgImgPos_c||this.BgImgPos;
				objCoreTableTD.style.backgroundRepeat=this.BgImgRep_c||this.BgImgRep;
			}
		}


		if (objLeftBgImg){ 
			if (this.LeftPartBgImage_c>''){
				objLeftBgImg.src=this.Preload_BgImageLeft_c.src;
				objLeftBgImg.style.visibility='visible';
				objLeftBgImg.style.display='block';
			} 
				else 
			{
				 
			}
		}


		if (objRightBgImg){ 
			if (this.RightPartBgImage_c>''){
				objRightBgImg.src=this.Preload_BgImageRight_c.src;
				objRightBgImg.style.visibility='visible';
				objRightBgImg.style.display='block';
			} 
				else 
			{
				 
			}
		}


		if (objRightIcon){  
			if (this.RightIcon_c > ''){
				objRightIcon.src=this.Preload_RightIcon_c.src;
				if ((this.RightIconIsIndicator) && (!this.Group)){
					objRightIcon.style.visibility='hidden';
				} 
					else
				{
					objRightIcon.style.visibility='visible';
					objRightIcon.style.display='block';
				}
			}
			if (this.RightIconOffsetX_c){objRightIcon.style.marginLeft=this.RightIconOffsetX_c};
			if (this.RightIconOffsetY_c){objRightIcon.style.marginTop=this.RightIconOffsetY_c};
		}

		if (objLeftIcon){  
			if (this.LeftIcon_c > ''){
				objLeftIcon.src=this.Preload_LeftIcon_c.src;
				if ((this.LeftIconIsIndicator) && (!this.Group)){
					objLeftIcon.style.visibility='hidden';
				} 
					else
				{
					objLeftIcon.style.visibility='visible';					
					objLeftIcon.style.display='block';
				}
			}
			if (this.LeftIconOffsetX_c){objLeftIcon.style.marginLeft=this.LeftIconOffsetX_c;}
			if (this.LeftIconOffsetY_c){objLeftIcon.style.marginTop=this.LeftIconOffsetY_c};
		}
		break;
	}  
};
