function FoldersBuild(){

}		

function FolderSubFoldersHTML(){
	var sClass;
	var sImg = "" 
	var sStartTable;
	var sEndTable;
	if(this.level==0||this.level==1){
		sStartTable = '<table cellpadding="0" cellspacing="0" border="0"><tr>';
		for(var i=0; i< this.subfolderArray.length; i++) {
			sClass = (this.subfolderArray[i].selected==1||this.subfolderArray[i].IsParent(eval("folder"+currentFolderID)))? "actmenu":"menu";
			this.subFoldersHTML = (!is.ns4)? 
				this.subFoldersHTML + '<td id="'+this.subfolderArray[i].name+'" align="center" class="'+sClass+'TD" height="14" title="'+this.subfolderArray[i].title+'"><a href="javascript:'+this.subfolderArray[i].name+'.loadLocation()" class="'+sClass+'"><img src="media/site/'+this.subfolderArray[i].linkImgRef+'.gif" border="1" alt="'+this.subfolderArray[i].title+'"></a></td>':
					this.subFoldersHTML + '<td id="'+this.subfolderArray[i].name+'" align="center" class="'+sClass+'TD" height="14"><a href="javascript:'+this.subfolderArray[i].name+'.loadLocation()" class="'+sClass+'">&nbsp;'+this.subfolderArray[i].title+'&nbsp;</a></td>';
			if(i<this.subfolderArray.length-1) this.subFoldersHTML = this.subFoldersHTML + '<td width="10"><img src="'+hostPath+'/images/pixel.gif" border="0" width="10" height="1"></td>';
		}
		sEndTable = '</tr><tr><td colspan="5" height="4"><img src="'+hostPath+'/images/pixel.gif" border="0" width="1" height="4"></td></tr></table>';
		this.subFoldersHTML = sStartTable + this.subFoldersHTML + sEndTable;
	}
	if(this.level==3){
		sStartTable = '<table cellpadding="0" cellspacing="0" border="0"><tr>';
		for(var i=0; i< this.subfolderArray.length-1; i++) {
			sTopTDClass = (this.subfolderArray[i].selected==1||this.subfolderArray[i].IsParent(eval("folder"+currentFolderID)))? "acttopmenu":"topmenu";
			if(i==0) this.subFoldersHTML = this.subFoldersHTML + '<td width="15"><img src="'+hostPath+'/images/pixel.gif" border="0" width="15" height="1"></td>';	
			this.subFoldersHTML = (!is.ns4)? 
				(sTopTDClass=='acttopmenu')? this.subFoldersHTML + '<td nowrap id="'+this.subfolderArray[i].name+'" align="left" height="18" onclick="'+this.subfolderArray[i].name+'.loadLocation()" class="'+sTopTDClass+'" title="'+this.subfolderArray[i].description+'"><span>' + this.subfolderArray[i].title + '</span></td>':this.subFoldersHTML + '<td nowrap id="'+this.subfolderArray[i].name+'" align="center" onclick="'+this.subfolderArray[i].name+'.loadLocation()" class="'+sTopTDClass+'" title="'+this.subfolderArray[i].description+'" onmouseover="this.className=\'acttopmenu\'" onmouseout="this.className=\'topmenu\'"><span>' + this.subfolderArray[i].title + '</span></td>':
					this.subFoldersHTML + '<td nowrap><ilayer name="Ilayer_'+this.subfolderArray[i].id+'" height="20"><layer name="'+this.subfolderArray[i].name+'" left="0" top="0" height="20" class="tm"><a href="javascript:'+this.subfolderArray[i].name+'.loadLocation()" class="'+sClass+'">&nbsp;&nbsp;&nbsp;' + this.subfolderArray[i].title + '&nbsp;&nbsp;&nbsp;</a></layer></ilayer></td>';
			this.subFoldersHTML = this.subFoldersHTML + '<td width="15"><img src="'+hostPath+'/images/pixel.gif" border="0" width="15" height="1"></td>';	
		}
		sEndTable = "</tr></table>";
		this.subFoldersHTML = sStartTable + this.subFoldersHTML + sEndTable;
		//alert(this.subFoldersHTML)
	}
	if(this.level==2){
		var sClass;
		var sImg = "" 
		var sStartTable = "";
		var sEndTable = "";	
		
		sStartTable = '<table cellpadding="0" cellspacing="0" border="0" align="center">';
		this.subFoldersHTML = '<tr><td background="'+hostPath+'/media/site/menuTopBG.gif" colspan="6" height="22"><p class="menu"><img src="images/pixel.gif" width="7" height="1" alt="" border="0">'+this.title+'</p></td></tr>';
		for(var i=0; i< this.subfolderArray.length; i++) {
			sClass = (this.subfolderArray[i].selected==1||this.subfolderArray[i].IsParent(eval("folder"+currentFolderID)))? 'rightmenuBold':'rightmenu';
			this.subFoldersHTML = this.subFoldersHTML + '<tr bgcolor="#CFDAE8" onclick="'+this.subfolderArray[i].name+'.loadLocation()" class="'+sClass+'" title="'+this.subfolderArray[i].description+'" onmouseover="this.className=\'rightmenuBold\'"  onmouseout="this.className=\''+sClass+'\'"><td width="1" class="menuLine"></td><td width="8" bgcolor="#45A5D7"></td><td width="145" colspan="2" bgcolor="#45A5D7"><p>'+this.subfolderArray[i].title+'</p></td><td width="5" bgcolor="#45A5D7"></td><td width="1" class="menuLine"></td></tr>';
			if(this.subfolderArray[i].subfolders>0&&this.subfolderArray[i].selected) {
				this.subFoldersHTML = this.subFoldersHTML + '<tr><td height="1" bgcolor="#1735B3" colspan="6"></td></tr>'
				for(var j=0; j< this.subfolderArray[i].subfolderArray.length; j++) {
					sClass = (this.subfolderArray[i].subfolderArray[j].selected==1||this.subfolderArray[i].subfolderArray[j].IsParent(eval("folder"+currentFolderID)))? 'rightmenuBold':'rightmenu';
					this.subFoldersHTML = this.subFoldersHTML + '<tr onclick="'+this.subfolderArray[i].subfolderArray[j].name+'.loadLocation()" class="'+sClass+'" onmouseover="this.className=\'rightmenuBold\'"  onmouseout="this.className=\''+sClass+'\'" title="'+this.subfolderArray[i].subfolderArray[j].description+'"><td width="1" class="menuLine"></td><td width="16" colspan="2"></td><td width="134"><p>'+this.subfolderArray[i].subfolderArray[j].title+'</p></td><td width="5"></td><td width="1" class="menuLine"></td></tr>';
					this.subFoldersHTML = this.subFoldersHTML + '<tr><td height="1" bgcolor="#1735B3" colspan="6"></td></tr>'
				}
			}
			else{
				if(i< (this.subfolderArray.length-1)) this.subFoldersHTML = this.subFoldersHTML + '<tr><td height="1" bgcolor="#1735B3" colspan="6"></td></tr>'
			}
			
		}	
		this.subFoldersHTML = this.subFoldersHTML + '<tr><td colspan="6"><img src="'+hostPath+'/media/site/menuBottomBG.gif" border="0"></td></tr>';
		this.subFoldersHTML = this.subFoldersHTML + '<tr><td width="1"><img src="'+hostPath+'/images/pixel.gif" width="1" border="0"></td><td width="8"><img src="'+hostPath+'/images/pixel.gif" width="8" border="0"></td><td width="8"><img src="'+hostPath+'/images/pixel.gif" width="8" border="0"></td><td width="137"><img src="'+hostPath+'/images/pixel.gif" width="137" height="1" border="0"></td><td width="5"><img src="'+hostPath+'/images/pixel.gif" width="5" border="0"></td><td width="1"><img src="'+hostPath+'/images/pixel.gif" width="1" border="0"></td></tr>'
		sEndTable = "</table>";
		this.subFoldersHTML = sStartTable + this.subFoldersHTML + sEndTable;
		//alert(this.subFoldersHTML)
	}	
}		

function ProjectFolderSubFoldersHTML(){
	var sClass;
	var sImg = "" 
	var sStartTable = "";
	var sEndTable = "";	
	
	sStartTable = '<table cellpadding="0" cellspacing="0" border="0">';
	this.subFoldersHTML = '<tr><td background="'+hostPath+'/media/site/menuTopBG.gif" colspan="6" height="22"><p class="menu"><img src="images/pixel.gif" width="7" height="1" alt="" border="0">'+this.title+'</p></td></tr>';
	for(var i=0; i< this.subfolderArray.length; i++) {
		sClass = (this.subfolderArray[i].selected==1||this.subfolderArray[i].IsParent(eval("folder"+currentFolderID)))? 'rightmenuBold':'rightmenu';
		this.subFoldersHTML = this.subFoldersHTML + '<tr bgcolor="#CFDAE8" onclick="'+this.subfolderArray[i].name+'.loadLocation()" class="'+sClass+'" title="'+this.subfolderArray[i].description+'" onmouseover="this.className=\'rightmenuBold\'"  onmouseout="this.className=\''+sClass+'\'"><td width="1" class="menuLine"></td><td width="8"></td><td width="185" colspan="2"><p>'+this.subfolderArray[i].title+'</p></td><td width="5"></td><td width="1" class="menuLine"></td></tr>';
		if(this.subfolderArray[i].subfolders>0&&this.subfolderArray[i].selected) {
			this.subFoldersHTML = this.subFoldersHTML + '<tr><td height="1" bgcolor="#1735B3" colspan="6"></td></tr>'
			for(var j=0; j< this.subfolderArray[i].subfolderArray.length; j++) {
				sClass = (this.subfolderArray[i].subfolderArray[j].selected==1||this.subfolderArray[i].subfolderArray[j].IsParent(eval("folder"+currentFolderID)))? 'rightmenuBold':'rightmenu';
				this.subFoldersHTML = this.subFoldersHTML + '<tr onclick="'+this.subfolderArray[i].subfolderArray[j].name+'.loadLocation()" class="'+sClass+'" onmouseover="this.className=\'rightmenuBold\'"  onmouseout="this.className=\''+sClass+'\'" title="'+this.subfolderArray[i].subfolderArray[j].description+'"><td width="1" class="menuLine"></td><td width="16" colspan="2"></td><td width="134"><p>'+this.subfolderArray[i].subfolderArray[j].title+'</p></td><td width="5"></td><td width="1" class="menuLine"></td></tr>';
				this.subFoldersHTML = this.subFoldersHTML + '<tr><td height="1" bgcolor="#1735B3" colspan="6"></td></tr>'
			}
		}
		else{
			if(i< (this.subfolderArray.length-1)) this.subFoldersHTML = this.subFoldersHTML + '<tr><td height="1" bgcolor="#1735B3" colspan="6"></td></tr>'
		}
		
	}	
	this.subFoldersHTML = this.subFoldersHTML + '<tr><td colspan="6"><img src="'+hostPath+'/media/site/menuBottomBG.gif" border="0"></td></tr>';
	this.subFoldersHTML = this.subFoldersHTML + '<tr><td width="1"><img src="'+hostPath+'/images/pixel.gif" width="1" border="0"></td><td width="8"><img src="'+hostPath+'/images/pixel.gif" width="8" border="0"></td><td width="8"><img src="'+hostPath+'/images/pixel.gif" width="8" border="0"></td><td width="177"><img src="'+hostPath+'/images/pixel.gif" width="177" height="1" border="0"></td><td width="5"><img src="'+hostPath+'/images/pixel.gif" width="5" border="0"></td><td width="1"><img src="'+hostPath+'/images/pixel.gif" width="1" border="0"></td></tr>'
	sEndTable = "</table>";
	this.subFoldersHTML = sStartTable + this.subFoldersHTML + sEndTable;
	//alert(this.subFoldersHTML)
}

function FolderSubFoldersTree(oFolder){
	var tableWidth = 190;
	var tdHight = 18;
	var extraTDHeight = 6; 
	var tdWidth = 5;
	var sStyle = ' style="padding-top: 2px;	padding-bottom: 2px; font-weight: bold; font-size: 10px;"'
	var sStyle2 = ' style="padding-top: 2px; font-weight: bold; font-size: 10px;"'
	oFolder = (oFolder==null)? this:oFolder
	if(oFolder.subfolders>1){
		sStartTable = '<table border="0" cellpadding="0" cellspacing="0" align="center" width="'+tableWidth+'">';
			for(var i=0; i< oFolder.subfolderArray.length; i++) {
				if(oFolder.subfolderArray[i]!=null){
					sClass = (oFolder.subfolderArray[i].selected)? 'acttopmenu':'topmenu';
					sTDClass = (oFolder.subfolderArray[i].selected)? "actsubtd":"subtd";	
					
					if(oFolder.subfolderArray[i].selected) oFolder.subFoldersHTML = oFolder.subFoldersHTML + '<tr class="'+sTDClass+'" style="cursor: pointer; cursor: hand;" onclick="'+oFolder.subfolderArray[i].name+'.loadLocation()"><td width="10"></td><td width="'+(tableWidth-20)+'" colspan="4" '+sStyle+'><span style="color:#800000">'+oFolder.subfolderArray[i].title+'</span></td></tr>';											
					else oFolder.subFoldersHTML = oFolder.subFoldersHTML + '<tr class="'+sTDClass+'" onmouseover="this.style.backgroundColor = \'#D2DDF8\'" onmouseout="this.style.backgroundColor = \'\'"style="cursor: pointer; cursor: hand;" onclick="'+oFolder.subfolderArray[i].name+'.loadLocation()"><td width="10"></td><td width="'+(tableWidth-20)+'" colspan="4" '+sStyle+'><span>'+oFolder.subfolderArray[i].title+'</span></td></tr>';																						
					
					subTDClass = (oFolder.subfolderArray[i].selected&&oFolder.subfolderArray[i].subfolders>0)? "actsubtd":"";
					if(oFolder.subfolderArray[i].order!=eval("folder"+oFolder.subfolderArray[i].parentid).subfolders) oFolder.subFoldersHTML = oFolder.subFoldersHTML + '<tr><td height="1" class="'+subTDClass+'"></td><td height="1" class="menuBG" colspan="4"></td></tr>';
					else oFolder.subFoldersHTML = oFolder.subFoldersHTML + '<tr><td height="1" class="'+subTDClass+'" colspan="1"><td height="1" class="menuBG" colspan="4"></td></tr>';
				}
				if(oFolder.subfolderArray[i].subfolders>0&&oFolder.subfolderArray[i].selected) {
					for(var j=0; j< oFolder.subfolderArray[i].subfolderArray.length; j++) {
						if(oFolder.subfolderArray[i].subfolderArray[j]!=null){
							sClass = (oFolder.subfolderArray[i].subfolderArray[j].selected)? 'acttopmenu':'topmenu';
							sTDClass = (oFolder.subfolderArray[i].subfolderArray[j].selected)? "actsubtd":"subtd";	
							if(oFolder.subfolderArray[i].subfolderArray[j].selected) oFolder.subFoldersHTML = oFolder.subFoldersHTML + '<tr class="'+sTDClass+'" style="cursor: pointer; cursor: hand;" align="left" height="'+tdHight+'"  onclick="'+oFolder.subfolderArray[i].subfolderArray[j].name+'.loadLocation()"><td width="10" class="actsubtd"></td><td width="10" class="actsubtd"></td><td width="'+(tableWidth-30)+'" colspan="3" '+sStyle+'><span style="color:#800000">'+oFolder.subfolderArray[i].subfolderArray[j].title+'</span></td></tr>';
							else oFolder.subFoldersHTML = oFolder.subFoldersHTML + '<tr class="'+sTDClass+'" style="cursor: pointer; cursor: hand;" align="left" height="'+tdHight+'" onmouseover="this.style.backgroundColor = \'#D2DDF8\'" onmouseout="this.style.backgroundColor = \'\'" onclick="'+oFolder.subfolderArray[i].subfolderArray[j].name+'.loadLocation()"><td width="10" class="actsubtd"></td><td width="10"></td><td width="'+(tableWidth-30)+'" colspan="3" '+sStyle+'><span>'+oFolder.subfolderArray[i].subfolderArray[j].title+'</span></td></tr>';
																												
							subTDClass = (oFolder.subfolderArray[i].subfolderArray[j].selected&&oFolder.subfolderArray[i].subfolderArray[j].subfolders>0)? "actsubtd":"";
							if(oFolder.subfolderArray[i].subfolderArray[j].order!=eval("folder"+oFolder.subfolderArray[i].subfolderArray[j].parentid).subfolders) oFolder.subFoldersHTML = oFolder.subFoldersHTML + '<tr><td height="1" class="actsubtd"></td><td height="1" class="'+subTDClass+'"></td><td height="1" class="menuBG" colspan="3"></td></tr>';
							else oFolder.subFoldersHTML = oFolder.subFoldersHTML + '<tr><td height="1" class="'+subTDClass+'" colspan="2"><td height="1" class="menuBG" colspan="3"></td></tr>';
						}
						
						if(oFolder.subfolderArray[i].subfolderArray[j].subfolders>0&&oFolder.subfolderArray[i].subfolderArray[j].selected) {
							for(var k=0; k< oFolder.subfolderArray[i].subfolderArray[j].subfolderArray.length; k++) {
								if(oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k]!=null){
									sClass = (oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].selected)? 'acttopmenu':'topmenu';
									sTDClass = (oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].selected)? "actsubtd":"subtd";	
																		
									if(oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].selected){
										oFolder.subFoldersHTML = oFolder.subFoldersHTML + '<tr class="'+sTDClass+'" style="cursor: pointer; cursor: hand;" align="left" height="'+tdHight+'" onclick="'+oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].name+'.loadLocation()"><td width="10" class="actsubtd"></td><td width="10" class="actsubtd"></td><td width="10" class="actsubtd"></td><td width="'+(tableWidth-40)+'" colspan="2" '+sStyle+'><span style="color:#800000">'+oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].title+'</span></td></tr>';
									}											
									else{
										oFolder.subFoldersHTML = oFolder.subFoldersHTML + '<tr class="'+sTDClass+'" style="cursor: pointer; cursor: hand;" align="left" height="'+tdHight+'" onmouseover="this.style.backgroundColor = \'#D2DDF8\'" onmouseout="this.style.backgroundColor = \'\'" onclick="'+oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].name+'.loadLocation()"><td width="10" class="actsubtd"></td><td width="10" class="actsubtd"></td><td width="10"></td><td width="'+(tableWidth-40)+'" colspan="2" '+sStyle+'><span>'+oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].title+'</span></td></tr>';
									}																					
									subTDClass = (oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].selected&&oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].subfolders>0)? "actsubtd":"";
									if(oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].order!=eval("folder"+oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].parentid).subfolders) oFolder.subFoldersHTML = oFolder.subFoldersHTML + '<tr><td height="1" class="actsubtd"></td><td height="1" class="actsubtd"></td><td height="1" class="menuBG"></td><td height="1" class="menuBG" colspan="2"></td></tr>';
									else oFolder.subFoldersHTML = oFolder.subFoldersHTML + '<tr><td height="1" class="actsubtd" colspan="1"></td><td height="1" class="'+subTDClass+'" colspan="1"></td><td height="1" class="'+subTDClass+'" colspan="1"></td><td height="1" class="menuBG" colspan="2"></td></tr>';								
								}
								if(oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].subfolders>0&&oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].selected) {
									for(var l=0; l< oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].subfolderArray.length; l++) {
										if(oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].subfolderArray[l]!=null){
											sClass = (oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].subfolderArray[l].selected)? 'acttopmenu':'topmenu';
											sTDClass = (oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].subfolderArray[l].selected)? "actsubtd":"subtd";	
																				
											if(oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].subfolderArray[l].selected){
												oFolder.subFoldersHTML = oFolder.subFoldersHTML + '<tr class="'+sTDClass+'" style="cursor: pointer; cursor: hand;" align="left" height="'+tdHight+'" onclick="'+oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].subfolderArray[l].name+'.loadLocation()"><td width="10" class="actsubtd"></td><td width="10" class="actsubtd"></td><td width="10" class="actsubtd"></td><td width="10"></td><td width="'+(tableWidth-40)+'" '+sStyle+'><span style="color:#800000">'+oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].subfolderArray[l].title+'</span></td></tr>';
											}											
											else{
												oFolder.subFoldersHTML = oFolder.subFoldersHTML + '<tr class="'+sTDClass+'" style="cursor: pointer; cursor: hand;" align="left" height="'+tdHight+'" onmouseover="this.style.backgroundColor = \'#D2DDF8\'" onmouseout="this.style.backgroundColor = \'\'" onclick="'+oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].subfolderArray[l].name+'.loadLocation()"><td width="10" class="actsubtd"></td><td width="10" class="actsubtd"></td><td width="10" class="actsubtd"></td><td width="10"></td><td width="'+(tableWidth-40)+'" '+sStyle+'><span>'+oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].subfolderArray[l].title+'</span></td></tr>';
											}																					
											subTDClass = (oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].subfolderArray[l].selected&&oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].subfolderArray[l].subfolders>0)? "actsubtd":"";
											if(oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].subfolderArray[l].order!=eval("folder"+oFolder.subfolderArray[i].subfolderArray[j].subfolderArray[k].subfolderArray[l].parentid).subfolders) oFolder.subFoldersHTML = oFolder.subFoldersHTML + '<tr><td height="1" class="actsubtd"><td height="1" class="actsubtd"></td><td height="1" class="actsubtd"></td><td height="1" class="menuBG" ></td><td height="1" class="menuBG" colspan="1"></td></tr>';
											else oFolder.subFoldersHTML = oFolder.subFoldersHTML + '<tr><td height="1" class="actsubtd" colspan="1"></td><td height="1" class="'+subTDClass+'" colspan="1"></td><td height="1" class="'+subTDClass+'" colspan="1"></td><td height="1" class="menuBG" colspan="1"><td height="1" class="menuBG" colspan="1"></td></td></tr>';								
										}
										
									}
								}									
							}
						}			
					}
				}
			}
			var sEndTable = '</table>';
			oFolder.subFoldersHTML = sStartTable + oFolder.subFoldersHTML + sEndTable;
			//alert(oFolder.subFoldersHTML)
	}
	return oFolder.subFoldersHTML
}

function FolderSubFoldersSelectBox(strName, strOption0, intSelectedOption){
	var subFoldersSelectBox = "";
	var sSelected = "";
	subFoldersSelectBox = '<select name="'+strName+'" size="1" style="width: 160px; font-size: 10px;">';
	subFoldersSelectBox = subFoldersSelectBox + '<option value="0" title="">'+strOption0+'</option>';
	if(this.subfolders>1){
		for(var i=0; i< this.subfolderArray.length; i++) {
			if(this.subfolderArray[i]!=null){
				sSelected = (this.subfolderArray[i].id==intSelectedOption)? " selected":"";
				subFoldersSelectBox = subFoldersSelectBox + '<option value="'+this.subfolderArray[i].id+'"'+sSelected+'>'+this.subfolderArray[i].title+'</option>';
			}
			if(this.subfolderArray[i].subfolders>1){
				for(var j=0; j< this.subfolderArray[i].subfolderArray.length; j++) {
					if(this.subfolderArray[i].subfolderArray[j]!=null){
						sSelected = (this.subfolderArray[i].subfolderArray[j].id==intSelectedOption)? " selected":"";
						subFoldersSelectBox = subFoldersSelectBox + '<option value="'+this.subfolderArray[i].subfolderArray[j].id+'"'+sSelected+'>&nbsp;&nbsp;'+this.subfolderArray[i].subfolderArray[j].title+'</option>';
					}		
					if(this.subfolderArray[i].subfolderArray[j].subfolders>1){
						for(var k=0; k< this.subfolderArray[i].subfolderArray[j].subfolderArray.length; k++) {
							if(this.subfolderArray[i].subfolderArray[j].subfolderArray[k]!=null){
								sSelected = (this.subfolderArray[i].subfolderArray[j].subfolderArray[k].id==intSelectedOption)? " selected":"";
								subFoldersSelectBox = subFoldersSelectBox + '<option value="'+this.subfolderArray[i].subfolderArray[j].subfolderArray[k].id+'"'+sSelected+'>&nbsp;&nbsp;&nbsp;&nbsp;'+this.subfolderArray[i].subfolderArray[j].subfolderArray[k].title+'</option>';
							}		
						}		
					}		
				}
			}
		}
	}
	subFoldersSelectBox = subFoldersSelectBox + '</select>';
	//alert(subFoldersSelectBox)
	return subFoldersSelectBox
}



function FolderLoadLocation(){
	if(this.link!=""){
		document.location.href =  hostPath+this.link;
		
	}
}

function FolderSetBgColor(vColor){
	if(!this.selected){
		if (is.ns){
			if (is.ns4) this.css.bgColor = vColor;
			else this.css.backgroundColor = vColor;
		} 
		else{
			this.css.backgroundColor = vColor;
		}
	}
}

function FoldersActivate(){
	if (is.ns) {
		if (is.ns4) {
			this.css = eval("document.Ilayer_"+this.id+".document."+this.name)
			this.elm = this.event = this.css
			this.doc = this.css.document
		}
		else if (is.ns5) {
			this.elm = document.getElementById(this.name)
			this.css = this.elm.style
			this.doc = document
		}
	}
	else {
		this.elm = this.event = (is.ie4)? document.all[this.name]:document.getElementById(this.name)
		this.css = this.elm.style;
		this.doc = document
	}
}

	var foldersObjArray = new Array();
	var foldersObjArrayCount = 0;
	
	var sHTML = "";
	var currentTopFolderID = "";
	// 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();
	
	//Netscape
	function setBgColorNS(oLayer,id,vColor){
		if(!eval("folder"+id).selected) oLayer.bgColor = vColor;
	}
	
