	var onMenuLink = '';
	var fromMenuLink = '';
	
	var defaultOrigCol = '#cc6600';	// Orange
	var defaultHlitCol = '#cc9900';	// Golden
	
	var offsetTOP = 5;
	var offsetLFT = 0;
	
	/** Define Color Shades as per requirments. **/
	/** Code will check these if you need default color for any of in between slots then simply leave them empty i.e. '' **/
	var origColors = new Array('#006699', '#003399');
	var hlitColors = new Array('#003399', '#cc6600');
	/** END **/

	ns = 0
	if(!document.all) {
		ns = 1
	}

	var intrval = null;
	var intrval01 = null;
	
	function showSubMenu(str) {
		
		tbl = document.getElementById('mainLinksTable')
		if(str.indexOf('_') == -1)
			normalizeAll(tbl)		
			
		for(s=0; s<tbl.rows[0].cells.length; s++) {
			if(str.indexOf('_') != -1)
				chk = str.substr(0,str.indexOf('_')).substr(3)
			else
				chk = str.substr(3)
				
			if(chk != s) {
				t = document.getElementById(tbl.rows[0].cells[s].id + '_')
				if(t)
					removeAll(t, 0);
			}
		}
		
		showWithDelay(str);
	}
	function showWithDelay(str) {
		onMenuLink = str;
		obj = document.getElementById(str)

		var arr = new Array();
		if(obj) {
				subObj = document.getElementById(obj.id+'_')
			
				if(str.indexOf('_') != -1) {
					arr = str.split('_')
					howMany = arr.length
				}
				else {
					howMany = 1;
					arr[0] = str
				}
				
				colIndx = howMany - 1
				obj.style.backgroundColor = (hlitColors[colIndx])?((hlitColors[colIndx] != '')?hlitColors[colIndx]:defaultHlitCol):defaultHlitCol;

				if(subObj) {
					objDIV = document.getElementById('scrollLinksTable')
					for(i=0; i<howMany; i++) {
						if(i == 0) {
							obj.style.backgroundColor = (hlitColors[i])?((hlitColors[i] != '')?hlitColors[i]:defaultHlitCol):defaultHlitCol;
							if(subObj) {
								if(ns == 1)
									subObj.style.left = obj.offsetLeft + objDIV.offsetLeft
								else
									subObj.style.left = obj.offsetLeft 
									
								if(ns == 1)
									subObj.style.top = obj.offsetTop + obj.offsetHeight + objDIV.offsetTop
								else
									subObj.style.top = obj.offsetTop + obj.offsetHeight// + objDIV.offsetTop //- 2; 
									
								subObj.style.display = 'block'
							}
						}
						else {
							s = ''
							sParent = ''
							
							for(j=0; j<=i; j++) {
								s += (j==0)?arr[j]:('_'+arr[j])
								sParent = s.substr(0,(s.length-1)); 
	
								o = document.getElementById(s)
								if(o) {
									if(o.style.display == 'none')
										o.style.display = 'block'
									o.style.backgroundColor = (hlitColors[j])?((hlitColors[j] != '')?hlitColors[j]:defaultHlitCol):defaultHlitCol;
								}
							}
							if(subObj) {
								parentObj = document.getElementById(sParent);
								subObj.style.top = o.offsetTop + parentObj.offsetTop + offsetTOP
								if(subObj.style.display == 'none')
									subObj.style.display = 'block'
									
								mesDIV = document.getElementById('measureScreen')
								maxWidth = mesDIV.offsetWidth
								//alert((parseInt(parentObj.offsetLeft) +" : " + parseInt(parentObj.offsetWidth)) +" :<: " + (maxWidth +" : " + parseInt(subObj.offsetWidth)))
								
								if(ns == 1) {
									if((parseInt(parentObj.offsetLeft) + parseInt(parentObj.offsetWidth)) < (maxWidth - parseInt(subObj.offsetWidth))) { 	// SHOW ON RIGHT.
										subObj.style.left = parseInt(parentObj.offsetLeft) + parseInt(subObj.offsetWidth) - offsetLFT
									}
									else {
										subObj.style.left = parseInt(parentObj.offsetLeft) - parseInt(subObj.offsetWidth) + offsetLFT
									}
								}
								else {
									if((parseInt(parentObj.offsetLeft) + parseInt(parentObj.offsetWidth) + parseInt(objDIV.offsetLeft)) < (maxWidth - parseInt(subObj.offsetWidth))) { 	// SHOW ON RIGHT.
										subObj.style.left = parseInt(parentObj.offsetLeft) + parseInt(subObj.offsetWidth) - offsetLFT
									}
									else {
										subObj.style.left = parseInt(parentObj.offsetLeft) - parseInt(subObj.offsetWidth) + offsetLFT
									}
								}
							}
						}
					}
				}
			}
	}
		
	function hideWithDelay(str) {

		obj = document.getElementById(str)

		if(obj) {
			if(str.indexOf('_') != -1) {
				tmpArr = str.split('_');
				len = tmpArr.length
			}
			else {
				tmpArr = new Array(str);
				len = 1
			}
			
			colIndx = len - 1

			var srch1 = new RegExp(obj.id, "ig");
			var srch2 = new RegExp(onMenuLink, "ig");

			if(onMenuLink.length == 0) {	// Going Totally Out.
				if(fromMenuLink.indexOf('_') == -1)
					goingTotallyOut(tmpArr);
				else
					intrval01 = setTimeout("goingTotallyOut(tmpArr)", 100);
			}
			else {
			ss=''
				prnCel = document.getElementById(str.substr(0,str.lastIndexOf('_')));
				prnTbl = document.getElementById(str.substr(0,(str.lastIndexOf('_')+1)));
				
				pLnk = count_2getHierarchyOfMenu(fromMenuLink)
				cLnk = count_2getHierarchyOfMenu(onMenuLink)
				
				if(str.indexOf('_') == -1 && onMenuLink.search(srch1) == -1) { // Moved from Main menu Link to other Main Link.
					//document.getElementById('measureScreen').innerHTML += obj.innerText + '<br>'
					obj.style.backgroundColor = (origColors[colIndx])?((origColors[colIndx] != '')?origColors[colIndx]:defaultOrigCol):defaultOrigCol;
					//Tbl = document.getElementById('mainLinksTable')
					//normalizeAll(Tbl)
					//alert(obj.id + ' : ' + Tbl.id)
					if(obj) {
						//normalizeAll(Tbl)
						removeAll(obj, obj.id.substr(3))
					}
				}
				
				if(str.indexOf('_') != -1 && fromMenuLink.search(srch2) == -1 && (fromMenuLink != onMenuLink)) { // Moved from Sub menu Link to further different Sub Menu.
					sTmp = ''
					
					
					tm = fromMenuLink.split('_')
					for(h=0; h<=cLnk; h++) {
						if(h == cLnk)
							tmpS = sTmp + tm[h]
						sTmp += tm[h]+'_'
					}
					subTbl = document.getElementById(sTmp)
					if(document.getElementById(tmpS))
						document.getElementById(tmpS).style.backgroundColor = (origColors[cLnk])?((origColors[cLnk] != '')?origColors[cLnk]:defaultOrigCol):defaultOrigCol;
					if(subTbl)
						removeAll(subTbl, 0)
				}
				
				if(str.indexOf('_') != -1 && fromMenuLink.search(srch2) != -1 && (fromMenuLink != onMenuLink)) { // Moved from Sub menu Link to further it's family above Sub Menu.
					//alert(fromMenuLink.substr(0, fromMenuLink.lastIndexOf('_')) +" : "+ onMenuLink)
					if(fromMenuLink.substr(0, fromMenuLink.lastIndexOf('_')) != onMenuLink) {	// family sub menu is not first parent of this sub menu then hide the sub menu.
						//alert('kk')
						//chk = fromMenuLink.substr(0, fromMenuLink.lastIndexOf('_'))
						//tb = document.getElementById(chk.substr(0, (chk.lastIndexOf('_')+1)))
						chk = fromMenuLink.substr(onMenuLink.length+1)
						cel =  document.getElementById(onMenuLink+'_'+chk.substr(0, chk.indexOf('_')))
						clIdx = count_2getHierarchyOfMenu(cel.id)
						cel.style.backgroundColor = (origColors[clIdx])?((origColors[clIdx] != '')?origColors[clIdx]:defaultOrigCol):defaultOrigCol;
						
						tb = document.getElementById(cel.id+'_')
						
						//alert(chk + " : " + onMenuLink + " : " + fromMenuLink + " : " + tb.id)
						//alert(tb.id)
						if(tb)
							removeAll(tb, 0, 'Leave1stTable')
					}
				
				}
				
				if(str.indexOf('_') != -1 && onMenuLink.search(srch1) == -1 ){ //&& onMenuLink.indexOf('_') != -1) {//&& (count_2getHierarchyOfMenu(fromMenuLink) != count_2getHierarchyOfMenu(onMenuLink))) { // Moved from Sub menu Link to up/dwn Sub Menu Link.
					obj.style.backgroundColor = (origColors[colIndx])?((origColors[colIndx] != '')?origColors[colIndx]:defaultOrigCol):defaultOrigCol;
					subTbl = document.getElementById(str+'_')
					if(subTbl)
						removeAll(subTbl, 0)
				}
				
				if(fromMenuLink.indexOf('_') != -1 && onMenuLink.indexOf('_') == -1 &&  fromMenuLink.search(srch1) == -1) {	// Moving from sub menu to Main menu.
					tmpArr = fromMenuLink.split('_');
					removeAll2(tmpArr);
				}
			}
		}

		if(intrval != null)
			clearInterval(intrval);
			intrval = null;
	}
	
	function goingTotallyOut(tmpArr) {
		//alert(tmpArr.length);
		var s = ''
		var sp =''
	
		for(i=0; i<tmpArr.length; i++) {
			s += (i==0)?tmpArr[i]:('_'+tmpArr[i]);
			o = document.getElementById(s)
			o.style.backgroundColor = (origColors[i])?((origColors[i] != '')?origColors[i]:defaultOrigCol):defaultOrigCol;
			
			if(i != 0) {
				sp = s.substr(0,(s.lastIndexOf('_')+1));
				o = document.getElementById(sp)
				o.style.display = 'none'
				normalizeAll(o);
				removeAll(o, 0)
			}
			else {
				removeAll(o, o.id.substr(3))
			}
		}
	
		if(intrval01 != null)
			clearInterval(intrval01);
		intrval01 = null;
	
	}
	
	function removeAll(subTbl, indx) {
		
		if(subTbl.id.indexOf('_') != -1) {
			tmArr = subTbl.id.split('_');
			ln = tmArr.length - 1
		}
		else {
			ln = 0
		}
		
		if(subTbl)
			if(ln != 0) {
				if(subTbl.rows) {
					while(subTbl.rows[indx]) { 
						//if(!arguments[2]) {
							subTbl.style.display = 'none'
							normalizeAll(subTbl);
						//}
						//else {
							//alert(arguments[2])
							//subTbl.rows[indx].cells[0].style.backgroundColor = (origColors[ln])?((origColors[ln] != '')?origColors[ln]:defaultOrigCol):defaultOrigCol;
						//}
						sub_Tbl = document.getElementById(subTbl.rows[indx].cells[0].id+'_')
						indx += 1;
						idx = 0;
						if(sub_Tbl) { 
							removeAll(sub_Tbl, idx);
						}
					}
				}
			}
			else {
				////subTbl.style.backgroundColor = (origColors[ln])?((origColors[ln] != '')?origColors[ln]:defaultOrigCol):defaultOrigCol;
				sub_Tbl = document.getElementById(subTbl.id+'_')
				idx = 0;
				if(sub_Tbl) { 
					removeAll(sub_Tbl, idx);
				}
			}
	}

	function hideSubMenu(str) {
		onMenuLink = ''
		fromMenuLink = str
		//hideWithDelay(str)
		intrval = setTimeout("hideWithDelay('"+str+"')", 2);
	}
	
	function removeAll2(tmpArr) {
		s = ''
		//alert(tmpArr)
		for(i=0; i<tmpArr.length; i++) {
			s += (i==0)?tmpArr[i]:('_'+tmpArr[i]);
			o = document.getElementById(s)
			o.style.backgroundColor = (origColors[i])?((origColors[i] != '')?origColors[i]:defaultOrigCol):defaultOrigCol;
			
			if(i != 0) {
				sp = s.substr(0,(s.lastIndexOf('_')+1));
				o = document.getElementById(sp)
				o.style.display = 'none'
				normalizeAll(o);
				removeAll(o, 0)
			}
			else {
				//normalizeAll(o);
				//alert(o.id)
				removeAll(o, o.id.substr(3))
			}
		}
	}
	
	function normalizeAll(oo) {
	//alert('pp')
		if(oo.tagName == 'TABLE' && oo.style.display == 'none') {
			if(oo.id.indexOf('_') != -1) {
				tmArr = oo.id.split('_');
				ln = tmArr.length - 1
			}
			if(oo.rows)
				for(m=0; m<oo.rows.length; m++) {
					oo.rows[m].cells[0].style.backgroundColor = (origColors[ln])?((origColors[ln] != '')?origColors[ln]:defaultOrigCol):defaultOrigCol;
				}
		}
		
		
		if(oo.tagName == 'TABLE' && oo.id == 'mainLinksTable') {
			//alert(oo.id)
			
			if(oo.rows)
				for(m=0; m<oo.rows[0].cells.length; m++) {
					oo.rows[0].cells[m].style.backgroundColor = (origColors[0])?((origColors[0] != '')?origColors[0]:defaultOrigCol):defaultOrigCol;
				}

		}
		
	}

	function count_2getHierarchyOfMenu(id) {
		
		var tmp = id.split('_')
		
		var o = document.getElementById(id)
	
		if(tmp.length == 1)
			return 0;
		if(tmp.length == 2)
			return 1;
		return (tmp.length - 1);
	}

	
	function verifyemail_check(str) { 
	   if(!str.match(/^[\w]{1}[\w\.\-_]*@[\w]{1}[\w\-_\.]*\.[\w]{2,6}$/i)) { 
			   return false; 
		   } else { 
			   return true; 
		   } 
	}
	function newWindow(str) {
		var w = window.open(str, '', '');
	}