function Folder(ID,parentID,Order,Level,SubFolders,EditNav,WebNav,IsUrl,IsSelected,Title,Link,Target,Html,Description,ImageReferens,LinkImageReferens){
	this.name = "folder"+ID	// Id	
	this.id = ID
	this.parentid = parentID
	this.parent =  (ID>0)? eval("folder"+parentID):null;			
	this.order = Order
	this.level = Level
	this.subfolders = SubFolders
	this.editnav = (EditNav==0||EditNav==false)? false:true
	this.webnav = (WebNav==0||WebNav==false)? false:true	
	this.isurl = (IsUrl == 0||IsUrl==false)? false:true
	this.selected = (IsSelected==0||IsSelected==false)? false:true
	this.title = Title
	this.link = Link
	this.target = Target
	this.description = Description
	this.html = Html
	this.imgRef = ImageReferens
	this.linkImgRef = LinkImageReferens		
	this.subfoldercount = 0
	this.subfolderArray = new Array();
	this.selectedfoldersArray = new Array();
	
	this.obj = this.name + "FolderObject"
	eval(this.obj + "=this")
	this.addToParent = FolderAddToParentFolder		
	this.IsParent = FolderIsParent
	this.IsChildren = FolderIsChildren
	this.getParentsArray = FolderParentsArray
	this.getChildrensArray = FolderChildrensArray
	this.getSubFoldersTree = FolderSubFoldersTree
	this.setSelectedFolders = FolderSelectedFolders
	this.getSubFoldersImages = FolderSubFoldersWithImages
	
	this.addToParent();
	this.setSelectedFolders();
	
	//Array global con todos los folder ordenados!!
	
	foldersObjArray[foldersObjArrayCount] = this
	foldersObjArrayCount++
	
	this.subFoldersHTML = ""
	this.getSubFoldersHTML = FolderSubFoldersHTML
	this.getSubFolders = FolderSubFolders	
	
	this.build = FoldersBuild
	this.dropdown = FolderDropDown
	this.setBgColor = FolderSetBgColor	
	this.loadLocation = FolderLoadLocation;
	this.getHistory = FolderHistory;
	this.getPagining = FolderPagining;	
	
	this.show = FolderShow
	this.hide = FolderHide	
	
	this.subFoldersTopHTML = "";
	this.subFoldersSubHTML = "";
	this.getSubFoldersDropDownHTML = FolderSubFoldersDropDownHTML	
	
}

function FolderAddToParentFolder(){
	if(this.parentid>-1 && this.webnav){
		parentFolder = eval('folder'+this.parentid)
		parentFolder.subfolderArray[parentFolder.subfoldercount] = this;
		parentFolder.subfoldercount = parentFolder.subfolderArray.length;
	}
}

function FolderSelectedFolders(){
	if(this.selected==1){
		this.selectedfoldersArray = this.getParentsArray();
		this.selectedfoldersArray[this.selectedfoldersArray.length] = this;
		for(var i=0; i<this.selectedfoldersArray.length;i++){
			this.selectedfoldersArray[i].selected = true;
		}
	}
}

function FolderIsParent(oFolder){
	var vIsTrue = 0
	for (var i = oFolder.level; i > 0; i--){
		if(this.id == oFolder.parentid) {
			vIsTrue = 1;
			break
		} 
		else {
			oFolder = eval('folder'+oFolder.parentid);
		}
	}
	return (vIsTrue == 1)? true:false
}

function FolderIsChildren(oFolder){
	return oFolder.IsParent(this)
}

function FolderParentsArray(){
	var oParentsArray = new Array();
	oFolder = this
	for (var i = this.level; i > 0; i--){
		oFolder	= eval('folder' + oFolder.parentid);
		oParentsArray[i-1] = oFolder;
	} 	
	return oParentsArray;
}

function FolderChildrensArray(){
	var oChildrensArray = new Array();
	oFolder = this;
	iChildrensArrayCount = 0;
	for(var i=0; i<foldersObjArrayCount;i++){
		if(foldersObjArray[i].IsChildren(oFolder)){
			oChildrensArray[iChildrensArrayCount] = foldersObjArray[i];
			iChildrensArrayCount++;
		}
	}
	return oChildrensArray;
}

function FoldersBuild(){
	this.dropdown();
}	

function FolderHistory(vStartLevel, sLinkClass, sSpanClass){
	var sHistoryHtml = "";
	var startlevel = (vStartLevel!=null)? vStartLevel:0;
	var linkClass = (sLinkClass!=null)? sLinkClass:"";
	var spanClass = (sSpanClass!=null)? sSpanClass:"";
	for(var i=vStartLevel; i< this.selectedfoldersArray.length-1; i++) {
		sHistoryHtml = sHistoryHtml + '<a title="'+this.selectedfoldersArray[i].description+'" href="javascript:'+this.selectedfoldersArray[i].name+'.loadLocation()" class="'+linkClass+'">' + this.selectedfoldersArray[i].title + '</a>&nbsp;&raquo; '
	}
	if(this.selectedfoldersArray.length-1>vStartLevel||this.selectedfoldersArray.length-1==vStartLevel) sHistoryHtml = sHistoryHtml + '<span class="'+spanClass+'">' + this.selectedfoldersArray[this.selectedfoldersArray.length-1].title + '</span>'
	return sHistoryHtml;
}

function FolderPagining(vCurrentID, sLinkClass, sSpanClass, sBeforeText, sBeforeImg, sNextText, sNextImg){
	
	var sPaginingHtml = "";
	var iPageID = (vCurrentID!=null)? vCurrentID:0;
	var linkClass = (sLinkClass!=null)? sLinkClass:"";
	var spanClass = (sSpanClass!=null)? sSpanClass:"";
	var beforeText = "";
	var nextText = "";
	var oArray = this.getChildrensArray();
	//alert(oArray)
	var oPaginingArray = new Array();
	var iArrayCount = 0;
	var iCurrentID = 0;
	var iCurrentPageIndex = 1;
	for(i=0;i<oArray.length;i++){
		if(oArray[i].link!=""){
			oPaginingArray[iArrayCount] = oArray[i];
			if(oPaginingArray[iArrayCount].id==iPageID){
				iCurrentID = oPaginingArray[iArrayCount].id;
				iCurrentPageIndex = iArrayCount	
			}  
			iArrayCount++ 
		} 
	}

	beforeText = (sBeforeText!=""&&sBeforeText!=null)? sBeforeText:(iCurrentPageIndex>1)? oPaginingArray[iCurrentPageIndex-1].title:"";
	beforeText = (sBeforeImg!=""&&sBeforeImg!=null&&iCurrentPageIndex>0)? '<img src="'+sBeforeImg+'" border="0" alt="'+beforeText+'" align="absmiddle">':beforeText;
	beforeText = (iCurrentPageIndex>0)? "<a href=\"javascript:folder" +oPaginingArray[iCurrentPageIndex-1].id + ".loadLocation()\" class=\"" + linkClass + "\">" + beforeText + "</a> ":"";
	
	nextText = (sNextText!=""&&sNextText!=null)? sNextText:(iCurrentPageIndex<iArrayCount-1)? oPaginingArray[iCurrentPageIndex+1].title:"";
	nextText = (sNextImg!=""&&sNextImg!=null&&iCurrentPageIndex<oPaginingArray.length-1)? '<img src="'+sNextImg+'" border="0" alt="'+nextText+'" align="absmiddle">':nextText;	
	nextText = (nextText!="")? (iCurrentPageIndex<iArrayCount-1)? " <a href=\"javascript:folder" +oPaginingArray[iCurrentPageIndex+1].id + ".loadLocation()\" class=\"" + linkClass + "\">" + nextText + "</a>":"":"";
	
	sPaginingHtml = '<span class="'+spanClass+'">' + beforeText + (iCurrentPageIndex+1) + " [" + iArrayCount + "]" + nextText + '</span>';
	return sPaginingHtml;	
}

function FolderSubFoldersHTML(){
	var tableHeight = 14;
	var tableWidth = 10;
	var tdHeight = 14	
	var sClass = "";
	var sBgImg = "";	
	var sLeftBg = "";
	var sMiddleLeftBg = "";
	var sMiddleRightBg = "";
	var sRightBg = "";	
	var sTarget = "";
	var ifLeft = 1;
	this.subFoldersHTML = "";
	
	if(this.level==0){
		sStartTable = '<table cellpadding="0" cellspacing="0" border="0"><tr>';
		for(var i=0; i< this.subfolderArray.length; i++) {
			if(this.subfolderArray[i].selected==1||this.subfolderArray[i].IsParent(eval("folder"+currentFolderID))){
				this.subFoldersHTML = this.subFoldersHTML + '<td><a href="'+hostPath+this.subfolderArray[i].link+'" style="border: 1px solid #FFFFFF"><img src="'+this.subfolderArray[i].linkImgRef+'" border="0" hspace="2" alt="'+this.subfolderArray[i].description+'" vspace="1" /></a></td>';
			}
			else{
				this.subFoldersHTML = this.subFoldersHTML + '<td><a href="'+hostPath+this.subfolderArray[i].link+'" style="border: 1px solid #457770" onmouseover=" this.style.border = \'1px solid #FFFFFF\'" onmouseout=" this.style.border = \'1px solid #457770\'"><img src="'+this.subfolderArray[i].linkImgRef+'" border="0" hspace="2" alt="'+this.subfolderArray[i].description+'"  vspace="5" /></a></td>';
			}
		}
		sEndTable = "</tr></table>";
		this.subFoldersHTML = sStartTable + this.subFoldersHTML + sEndTable;
		//alert(this.subFoldersHTML)
		
	}
	else{
		if(this.level==1){
			
			sStartTable = '<table cellpadding="0" cellspacing="0" border="0">';
			for(var i=0; i< this.subfolderArray.length; i=i+2) {		
				ifLeft = 1;
				sClass = (this.subfolderArray[i].selected==1||this.subfolderArray[i].IsParent(eval("folder"+currentFolderID)))? 'menuSelected':'menu'; 
				sTDClass = (this.subfolderArray[i].selected==1||this.subfolderArray[i].IsParent(eval("folder"+currentFolderID)))? 'TDMenuSelected':'TDMenu'; 
				sTdMiddle = '<td width="5"><img src="'+emptyImg+'" width="5" alt="" border="0"></td>';
				sTrMiddle = (i< this.subfolderArray.length)? '<tr><td colspan="3" height="5"><img src="'+emptyImg+'" width="5" alt="" border="0"></td></tr>':'';
				sEvent = ' onmouseover="this.style.backgroundColor=\'#890000\'" onmouseout="this.style.backgroundColor=\'\'"'
				if(sTDClass=="TDMenuSelected") this.subFoldersHTML = this.subFoldersHTML + '<tr><td id="'+this.subfolderArray[i].name+'" style="" class="'+sTDClass+'" title="' + this.subfolderArray[i].title + '" onclick="'+this.subfolderArray[i].name+'.loadLocation()">'+this.subfolderArray[i].title+'</td>'+sTdMiddle;
				else this.subFoldersHTML = this.subFoldersHTML + '<tr><td id="'+this.subfolderArray[i].name+'" style="" class="'+sTDClass+'" title="' + this.subfolderArray[i].title + '" onclick="'+this.subfolderArray[i].name+'.loadLocation()" '+sEvent+'>'+ this.subfolderArray[i].title +'</td>'+sTdMiddle;
				if((i+1)<this.subfolderArray.length){
					ifLeft = 0;
					sClass = (this.subfolderArray[i+1].selected==1||this.subfolderArray[i+1].IsParent(eval("folder"+currentFolderID)))? 'menuSelected':'menu'; 
					sTDClass = (this.subfolderArray[i+1].selected==1||this.subfolderArray[i+1].IsParent(eval("folder"+currentFolderID)))? 'TDMenuSelected':'TDMenu'; 
					if(sTDClass=="TDMenuSelected") this.subFoldersHTML = this.subFoldersHTML + '<td id="'+this.subfolderArray[(i+1)].name+'" style="" class="'+sTDClass+'" title="' + this.subfolderArray[(i+1)].title + '" onclick="'+this.subfolderArray[(i+1)].name+'.loadLocation()">'+ this.subfolderArray[i+1].title +'</td></tr>';
					else this.subFoldersHTML = this.subFoldersHTML + '<td id="'+this.subfolderArray[(i+1)].name+'" style="" class="'+sTDClass+'" title="' + this.subfolderArray[(i+1)].title + '" onclick="'+this.subfolderArray[(i+1)].name+'.loadLocation()" '+sEvent+'>'+ this.subfolderArray[i+1].title +'</td></tr>';
				}
				k = i; //(ifLeft==1)? i:i+1
				if(this.subfolderArray[k].subfolders>0&&this.subfolderArray[k].selected){
					this.subFoldersHTML = this.subFoldersHTML + '<tr><td class="TDSubMenuSeparator"></td><td></td><td></td></tr>';
					sAlign = "left";
					this.subFoldersHTML = this.subFoldersHTML + '<tr><td class="TDSubMenus" colspan="3"><table cellpadding="0" cellspacing="0" border="0">';
					for(var j=0; j< this.subfolderArray[k].subfolderArray.length; j=j+2){
						sSubClass = (this.subfolderArray[k].subfolderArray[j].selected==1||this.subfolderArray[k].subfolderArray[j].IsParent(eval("folder"+currentFolderID)))? 'submenuSelected':'submenu';
						this.subFoldersHTML = this.subFoldersHTML + '<tr><td class="TDSubMenu"><a href="'+hostPath+this.subfolderArray[k].subfolderArray[j].link+'" class="'+sSubClass+'">'+this.subfolderArray[k].subfolderArray[j].title+'</a></td>'+sTdMiddle;
						if((j+1)<this.subfolderArray[k].subfolderArray.length){
							sSubClass = (this.subfolderArray[k].subfolderArray[j+1].selected==1||this.subfolderArray[k].subfolderArray[j+1].IsParent(eval("folder"+currentFolderID)))? 'submenuSelected':'submenu';
							this.subFoldersHTML = this.subFoldersHTML + '<td><a href="'+hostPath+this.subfolderArray[k].subfolderArray[j+1].link+'" class="'+sSubClass+'">'+this.subfolderArray[k].subfolderArray[j+1].title+'</a></td>';
						}
					}
					this.subFoldersHTML = this.subFoldersHTML + '</tr></table></td></tr>';
				}
				k = i+1; //(ifLeft==1)? i:i+1
				if(k<this.subfolderArray.length){ 
					if(this.subfolderArray[k].subfolders>0&&this.subfolderArray[k].selected){
						this.subFoldersHTML = this.subFoldersHTML + '<tr><td></td><td></td><td class="TDSubMenuSeparator"></td></tr>';
						sAlign = "right";
						this.subFoldersHTML = this.subFoldersHTML + '<tr><td class="TDSubMenus" colspan="3"><table cellpadding="0" cellspacing="0" border="0">';
						for(var j=0; j< this.subfolderArray[k].subfolderArray.length; j=j+2){
							sSubClass = (this.subfolderArray[k].subfolderArray[j].selected==1||this.subfolderArray[k].subfolderArray[j].IsParent(eval("folder"+currentFolderID)))? 'submenuSelected':'submenu';
							this.subFoldersHTML = this.subFoldersHTML + '<tr><td class="TDSubMenu"><a href="'+hostPath+this.subfolderArray[k].subfolderArray[j].link+'" class="'+sSubClass+'">'+this.subfolderArray[k].subfolderArray[j].title+'</a></td>'+sTdMiddle;
							if((j+1)<this.subfolderArray[k].subfolderArray.length){
								sSubClass = (this.subfolderArray[k].subfolderArray[j+1].selected==1||this.subfolderArray[k].subfolderArray[j+1].IsParent(eval("folder"+currentFolderID)))? 'submenuSelected':'submenu';
								this.subFoldersHTML = this.subFoldersHTML + '<td><a href="'+hostPath+this.subfolderArray[k].subfolderArray[j+1].link+'" class="'+sSubClass+'">'+this.subfolderArray[k].subfolderArray[j+1].title+'</a></td>';
							}
						}
						this.subFoldersHTML = this.subFoldersHTML + '</tr></table></td></tr>';
					}
				}
				this.subFoldersHTML = this.subFoldersHTML + sTrMiddle				
			}
			sEndTable = "</table>";
			this.subFoldersHTML = sStartTable + this.subFoldersHTML + sEndTable;
			//alert(this.subFoldersHTML)	
		}			
		else{
			if(this.level==2){
				sStartTable = '<table cellpadding="0" cellspacing="0" border="0" align="center">';
				for(var i=0; i< this.subfolderArray.length; i++) {		
					sClass = (this.subfolderArray[i].selected==1||this.subfolderArray[i].IsParent(eval("folder"+currentFolderID)))? 'menuSelected':'menu'; 
					sTDClass = (this.subfolderArray[i].selected==1||this.subfolderArray[i].IsParent(eval("folder"+currentFolderID)))? 'TDMenuSelected':'TDMenu'; 
					sTrMiddle = (i< this.subfolderArray.length)? '<tr><td height="11"><img src="'+emptyImg+'" width="11" alt="" border="0"></td></tr>':'';
					sEvent = ' onmouseover="fnToggle(this)" onmouseout="fnToggle(this)"'
					if(sTDClass=="TDMenuSelected") this.subFoldersHTML = this.subFoldersHTML + '<tr><td id="'+this.subfolderArray[i].name+'" height="27" style="" class="'+sTDClass+'" title="' + this.subfolderArray[i].title + '" onclick="'+this.subfolderArray[i].name+'.loadLocation()"><img src="media/site/' + this.subfolderArray[i].linkImgRef + '_hover.gif" width="238" height="28" vspace="2" hspace="2" border="0"/></td></tr>'+sTrMiddle;
					else this.subFoldersHTML = this.subFoldersHTML + '<tr><td id="'+this.subfolderArray[i].name+'" height="27" style="" class="'+sTDClass+'" title="' + this.subfolderArray[i].title + '" onclick="'+this.subfolderArray[i].name+'.loadLocation()"  onmouseover="fnToggle(this, \'image' + this.subfolderArray[i].id + '\', 1)" onmouseout="fnToggle(this, \'image' + this.subfolderArray[i].id + '\', 0)"><img name="image' + this.subfolderArray[i].id + '_0" id="image' + this.subfolderArray[i].id + '_0" src="media/site/' + this.subfolderArray[i].linkImgRef + '.gif" width="238" height="28" vspace="2" hspace="2" border="0" style="display: block;"/><img name="image' + this.subfolderArray[i].id + '_1" id="image' + this.subfolderArray[i].id + '_1" src="media/site/' + this.subfolderArray[i].linkImgRef + '_Hover.gif" width="238" height="28" vspace="2" hspace="2" border="0" style="display: none;"/></td></tr>'+sTrMiddle;
				}
				sEndTable = "</table>";
				this.subFoldersHTML = sStartTable + this.subFoldersHTML + sEndTable;
				//alert(this.subFoldersHTML)	
			}				
			else{
				if(this.level==3){
					if(this.subfolders>0){
						
						sStartTable = '<table cellpadding="0" cellspacing="0" border="0">';
						for(var i=0; i< this.subfolderArray.length; i++) {
							sTdMiddle = '</tr><tr><td height="1" class="lineBGColor" colspan="2"></td>';
							sTdLeft = (this.subfolderArray[i].selected==1||this.subfolderArray[i].IsParent(eval("folder"+currentFolderID)))? '<td width="40" height="16" class="TDSubPil" align="right" valign="middle"><img src="media/site/submenupil.gif" width="8" height="5"></td>':'<td width="40" height="16" class="TDSubPil" align="center" valign="middle"><img src="media/site/submenupil.gif" width="8" height="5"></td>';
							sClass = (this.subfolderArray[i].selected==1||this.subfolderArray[i].IsParent(eval("folder"+currentFolderID)))? 'submenuSelected':'submenu'; 
							sTDClass = (this.subfolderArray[i].selected==1||this.subfolderArray[i].IsParent(eval("folder"+currentFolderID)))? 'TDSubMenuSelected':'TDSubMenu'; 
							if(!is.ns4){
								this.subFoldersHTML = this.subFoldersHTML + '<tr>'+ sTdLeft + '<td id="'+this.subfolderArray[i].name+'" align="left" height="16" style="" width="170" class="'+sTDClass+'" title="' + this.subfolderArray[i].description + '" onmouseover="fnToggle(this)" onmouseout="fnToggle(this)" onclick="'+this.subfolderArray[i].name+'.loadLocation()">' + this.subfolderArray[i].title + '</td>'+sTdMiddle+'</tr>';
							}
							else{
								this.subFoldersHTML = this.subFoldersHTML + '<tr>'+ sTdLeft + '<td align="left" height="16" width="170" class="'+sTDClass+'">' + this.subfolderArray[i].title + '</td></td>'+sTdMiddle+sTdRight+'</tr>';
							}
						}
						sEndTable = "</tr></table>";
						this.subFoldersHTML = sStartTable + this.subFoldersHTML + sEndTable;
					}
				}
			}	
		}
	}
	//alert(this.subFoldersHTML)
	return this.subFoldersHTML
}	

function FolderSubFolders(){
	if(this.subfolders>0){
		tdHeight = 16;
		sStartTable = '<table cellpadding="0" cellspacing="0" border="0" height="'+tdHeight+'"><tr>';
		for(var i=0; i< this.subfolderArray.length; i++) {
			sRightBg = '<td><img src="media/site/pixel.gif" width="10" height="1"></td>';
			sClass = (this.subfolderArray[i].selected==1||this.subfolderArray[i].IsParent(eval("folder"+currentFolderID)))? 'GalleryMenuSelected':'GalleryMenu'; 
			this.subFoldersHTML = this.subFoldersHTML + '<td id="'+this.subfolderArray[i].name+'" nowrap align="left" height="'+tdHeight+'" class="TD'+sClass+'" onclick="'+this.subfolderArray[i].name+'.loadLocation()" onmouseover="this.style.backgroundColor=\'#034EA2\'" onmouseout="this.style.backgroundColor=\'\'"><a href="javascript:'+this.subfolderArray[i].name+'.loadLocation()" class="'+sClass+'">&nbsp;&raquo;' + this.subfolderArray[i].title + '&nbsp;</a></td>';
		}
		sEndTable = "</tr></table>";
		this.subFoldersHTML = sStartTable + this.subFoldersHTML + sEndTable;
	}
}	

function FolderSubFoldersTree(oFolder){}

function FolderFoldersTree(oFolder, vStartLevel){}

function FolderSubFoldersWithImages(){}

//DropDown Metoder
function FolderDropDown(){
	if (is.ns) {
		if (is.ns4) {
			this.css = eval("document.Box_"+this.parentid+".document.Ilayer_"+this.id+".document."+this.name)
			this.elm = this.event = this.css
			this.doc = this.css.document
		}
		else {
			this.elm = document.getElementById(this.name)
			this.css = this.elm.style
			this.doc = document
		}
		this.x = (is.ns4)? this.css.left:parseInt(this.css.left)
		this.absx = (is.ns4)? this.css.pageX:parseInt(this.elm.offsetLeft)+parseInt(this.elm.offsetParent.offsetLeft)+ parseInt(this.elm.offsetParent.offsetParent.offsetLeft);
		
		this.y = (is.ns4)? this.css.top:parseInt(this.css.top)
		this.absy = (is.ns4)? this.css.pageY:parseInt(this.elm.offsetTop)
		this.w = (is.ns5)? this.elm.offsetWidth:this.css.clip.width
		this.h = (is.ns5)? this.elm.offsetHeight:this.css.clip.height
	}
	else {
		this.elm = this.event = document.all[this.name]
		this.css = (is.ie4)? document.all[this.name].style:document.getElementById(this.name).style
		this.doc = document
		this.x = this.elm.offsetLeft
		this.absx = (is.ie4)? this.elm.offsetLeft+ this.elm.offsetParent.offsetLeft + this.elm.offsetParent.offsetParent.offsetLeft:this.elm.offsetLeft + this.elm.offsetParent.offsetLeft+ this.elm.offsetParent.offsetParent.offsetLeft;
		this.y = this.elm.offsetTop
		this.absy = (is.ie4)? this.elm.offsetTop+ this.elm.offsetParent.offsetTop + this.elm.offsetParent.offsetParent.offsetTop:this.elm.offsetParent.offsetParent.offsetParent.offsetTop;
		this.cy = this.elm.clientTop
		this.p = 	this.elm.offsetParent
		this.w = (is.ie4)? this.css.pixelWidth : this.elm.offsetWidth
		this.h = (is.ie4)? this.css.pixelHeight : this.elm.offsetHeight
	}
}

function FolderSubFoldersTopHTML(){}

function FolderSubFoldersDropDownHTML(sCase){
	TopFolderStartTop = document.getElementById("mainTable").offsetTop + 119;		
	if(sCase=="top"){
		sTable = '<table border="0" cellpadding="0" cellspacing="0" height="18"><tr><td width="5"></td>'
		for(var i=0; i< this.subfolderArray.length; i++) {
			this.subFoldersSubHTML = this.subFoldersSubHTML + '<td height="18" width="'+(this.subfolderArray[i].w)+'" class="TopDDTD" onclick="javascript:'+this.subfolderArray[i].name+'.loadLocation()" onmouseover="fnToggle(\''+this.subfolderArray[i].name+'\'); " onmouseout="fnToggle(\''+this.subfolderArray[i].name+'\'); "><img src="'+emptyImg+'" border="0" alt="'+this.subfolderArray[i].title+'" width="'+(this.subfolderArray[i].w)+'" height="18"></td><td width="2"></td>'
		}
		var eTable = '</table>';
		sLayer = '<div id="'+this.name+'DDBox" style="position: absolute; left: 0px; top: '+(TopFolderStartTop)+'px; height: 20px;">';
		sEndLayer = '</div>'
		this.subFoldersSubHTML = sLayer + sTable + this.subFoldersSubHTML + eTable + sEndLayer;
		//alert(this.subFoldersSubHTML)
	}
	else{
		var sLayer = '<div id="'+this.name+'DDBox" style="position:absolute;  left: 0px; top: '+(TopFolderStartTop+19)+'px; visibility: hidden;">';
		var sEndLayer = '</div>';
		var sTable = sLayer + '<table cellpadding="0" cellspacing="2" border="0" class="DDTable" width="'+SubFoldersSubWidth+'"></tr>';
		for(var i=0; i< this.subfolderArray.length; i++) {
			if(this.subfolderArray[i]!=null){
				sBgColor = (this.subfolderArray[i].selected==1)? SubFoldersSubBGSelected:SubFoldersSubBGNormal;
				sClass = (this.subfolderArray[i].selected==1)? 'MenuSelected':'Menu';
				this.subFoldersSubHTML = this.subFoldersSubHTML + '<tr><td id="'+this.subfolderArray[i].name+'" class="SubTD'+sClass+'" height="16" onmouseover="if('+this.subfolderArray[i].name+'.selected!=1) this.className=\'SubTDMenuSelected\'" onmouseout="if('+this.subfolderArray[i].name+'.selected!=1) this.className=\'SubTDMenu\'" onclick="'+this.subfolderArray[i].name+'.loadLocation()"><span class="Item'+sClass+'">' + this.subfolderArray[i].title + '</span></td></tr>';
			}
		}
		var eTable = '</table>' + sEndLayer;
		this.subFoldersSubHTML = sTable + this.subFoldersSubHTML + eTable;
	}
	return this.subFoldersSubHTML;
}

	var foldersObjArray = new Array();
	var foldersObjArrayCount = 0;
	
	var currentTopFolderID = "";
	var emptyImg = hostPath + "/images/pixel.gif"
	var sHTML = "";	
	
	// BrowserCheck Object
	function BrowserCheck() {
		var u = navigator.userAgent.toLowerCase();
		this.u = u
		var b = navigator.appName
		if (b=="Netscape") this.b = "ns"
		else if (b=="Microsoft Internet Explorer") this.b = "ie"
		else this.b = b
		if(this.b=="ie" && this.u.indexOf('opera')!=-1) 
		this.b = "op"
		this.version = navigator.appVersion
		this.v = parseInt(this.version)
		this.op = (this.b=="op")
		//alert(this.op)
		this.op4 = (this.b=="op" && this.v==4)
		this.ns = (this.b=="ns" && this.v>=4)
		this.ns4 = (this.b=="ns" && this.v==4)
		this.ns5 = (this.b=="ns" && this.v==5)
		this.ie = (this.b=="ie" && this.v>=4)
		this.ie4 = (this.version.indexOf('MSIE 4')>0)
		this.ie5 = (this.version.indexOf('MSIE 5')>0)
		this.ie6 = (this.version.indexOf('MSIE 6')>0)			
		this.min = (this.ns||this.ie)
	}
	is = new BrowserCheck();
	//alert(is.b)
	
	//Netscape
	function setBgColorNS(oLayer,id,vColor){
		if(!eval("folder"+id).selected) oLayer.bgColor = vColor;
	}

function FolderSetBgColor(vColor){
	if(this.selected!=1){
		if (is.ns){
			if (is.ns4) this.css.bgColor = vColor;
			else this.css.backgroundColor = vColor;
		} 
		else{
			this.css.backgroundColor = vColor;
		}
	}
}	
	
function FolderLoadLocation(){
	if(this.link!=""){
		var sHostPath = (this.link.slice(0,7)=="http://"||this.link.slice(0,4)=="www."||this.link.slice(0,6)=="mailto:")? "":hostPath; 
		if(this.target!=""){
			switch(this.target){
				case "_blank":
					window.open(sHostPath+this.link)
				break	
				case "_top":
					top.document.location.href =  sHostPath+this.link;
				break	
				case  "_self":
					self.document.location.href =  sHostPath+this.link;
				break	
				case "_parent":
					parent.document.location.href =  sHostPath+this.link;
				break	
				default:
					document.location.href =  sHostPath+this.link;
				break																	
			}
		}
		else document.location.href =  hostPath+this.link;
	}
}

	
function FolderShow(){
	if (is.ns){
		if (is.ns4){
			eval("document.Box_"+this.id+".left = "+this.absx);
			eval("document.Box_"+this.id+".visibility = 'show'");
		}
		else {
			document.getElementById(this.name+'DDBox').style.left = (this.absx+5)+'px';
			document.getElementById(this.name+'DDBox').style.visibility = "visible";
		}
	} 
	else{
		if(is.ie4){
			eval(this.name+'DDBox').style.visibility = "visible";
			eval(this.name+'DDBox').style.left = this.absx;
		}
		else {
			//alert(this.absy)
			document.getElementById(this.name+'DDBox').style.left = this.absx + 5;
			document.getElementById(this.name+'DDBox').style.visibility = "visible";
		}
	}
	 if (is.ns){
	 	if(is.ns4) document.hideLayer.visibility = "show"
		else document.getElementById('hideLayer').style.visibility = "visible"
	}
	 else document.all['hideLayer'].style.visibility = "visible"
 }

function FolderHide(){
	if (is.ns){
		if (is.ns4) eval("document.Box_"+this.name+".visibility = 'hide'");
		else document.getElementById(this.name+'DDBox').style.visibility = "hidden";
	} 
	else{
		if(is.ie4)	eval(this.name+'DDBox').style.visibility = "hidden";
		else document.getElementById(this.name+'DDBox').style.visibility = "hidden";
	}
}

function DynLayerGetRelativeX() {
	return (is.ns)? this.css.pageX : this.elm.offsetLeft
}

function DynLayerGetRelativeY() {
	return (is.ns)? this.css.pageY : this.elm.offsetTop
}	

	var Folder0StartTop = 20;
	var Folder0StartLeft = 300;
	var TopFolderStartTop = 148;
	var TopFolderStartLeft = 200;
	var TopFoldersHeight = 12;	
	var TopFoldersSubBGNormal = "#013366";	
	var SubFoldersSubTop = 186;
	var SubFoldersSubWidth = 160;
	var SubFoldersSubHeight = 16;
	var SubFoldersSubBorderColor = "#000000";
	var SubFoldersSubBorderWidth = 1;
	var subDivHTML = "";

	var SubFoldersSubBGNormal = "#F4F4F4";
	var SubFoldersSubBGHover = "#9ACCFF";
	var SubFoldersSubBGSelected = "#6799CC";	
	var emptyImg = hostPath + "/images/pixel.gif"
	var TopFolderWidthsArray = new Array('50','56','74','66','76','110','120','120','100');
	var SubFolderLeftsArray = new Array();
	var SubFoldersSubClass = "smPadding";

	function hideFolder(){
		if(currentTopFolderID!=""){
			eval('folder'+currentTopFolderID+'.hide()');
			currentTopFolderID = "";
			if (is.ns){
			 	if(is.ns4) document.hideLayer.visibility = "hide"
				else document.getElementById('hideLayer').style.visibility = "hidden"
			}
			 else document.all['hideLayer'].style.visibility = "hidden"
		}
	}	
	
	function showSubMenu(id){
		eval('folder'+id+'.show()');
	}