

if(typeof(sysconfig_client)=='undefined') sysconfig_client="";
sysconfig_centerbody = ( typeof(sysconfig_centerbody)=='undefined' ? 0 : sysconfig_centerbody=="1");


// get params from querystring V0.1
function QueryString(Param)
{
	var params = document.location.href.split("?"), i;
	if(params.length < 2 ) return null; // no parameters
	
	params = params[1].split("&");
	for( i = 0; i < params.length; i++)
		if(params[i].indexOf(Param+'=') == 0)
			return decodeURIComponent(params[i].split('=')[1].split('#')[0]);
	return null;
};


// ===== Function from js.inc =======================================
function openwebcq()
{
	window.open("/scripts/webcq/webcq.asp?commid=196","WebCQWindow","scrollbars,width=150,height=305,resizable=no")
}

function HelpWin()
{
	var l = document.location.href.split("/");
	window.open("/scripts/help/help.asp?path=/scripts/help/"+commLang+"/"+l[l.length-1].split("?")[0],"HelpWindow");
}

//=======================================================================================*/

var _d = document, hshowCase = ","+showcase;
var refto = encodeURIComponent(_d.location.href);
if( flname == " " ) flname = "";

var isnMonths, isnDays, LangObject = new Array();
switch( commLang )
{
	case "hbr":
		isnMonths=new Array(
			'&#1489;&#1497;&#1504;&#1493;&#1488;&#1512;', // beyanuar
			'&#1489;&#1508;&#1489;&#1512;&#1493;&#1488;&#1512;', // befebruar
			'&#1489;&#1502;&#1512;&#1509;', // bemertz
			'&#1489;&#1488;&#1508;&#1512;&#1497;&#1500;', // beapril
			'&#1489;&#1502;&#1488;&#1497;', // bemai
			'&#1489;&#1497;&#1493;&#1504;&#1497;', // beuni
			'&#1489;&#1497;&#1493;&#1500;&#1497;', // beuli
			'&#1489;&#1488;&#1493;&#1490;&#1493;&#1505;&#1496;', // beogust
			'&#1489;&#1505;&#1508;&#1496;&#1502;&#1489;&#1512;', // beseptember
			'&#1489;&#1488;&#1493;&#1511;&#1496;&#1493;&#1489;&#1512;', // beoctober
			'&#1489;&#1504;&#1493;&#1489;&#1502;&#1489;&#1512;', // benovember
			'&#1489;&#1491;&#1510;&#1502;&#1489;&#1512;' // bedetzember
			);
		isnDays=new Array(
			'&#1497;&#1493;&#1501; &#1512;&#1488;&#1513;&#1493;&#1503;', // yom rishon
			'&#1497;&#1493;&#1501; &#1513;&#1504;&#1497;', //yom sheni
			'&#1497;&#1493;&#1501; &#1513;&#1500;&#1497;&#1513;&#1497;', // yom shlishi
			'&#1497;&#1493;&#1501; &#1512;&#1489;&#1497;&#1506;&#1497;', // yom revii
			'&#1497;&#1493;&#1501; &#1495;&#1502;&#1497;&#1513;&#1497;', // yom hamishi
			'&#1497;&#1493;&#1501; &#1513;&#1497;&#1513;&#1497;', // yom shishi
			'&#1497;&#1493;&#1501; &#1513;&#1489;&#1514;' // yom shabat
			);
		LangObject = {
			_left:		"right",
			_right:		"left",
			_rtl:		"ltr",
			_ltr:		"rtl",
			BackHome:	"&#1495;&#1494;&#1512;&#1492; &#1500;&#1513;&#1506;&#1512;", // hazara leshar
			LogIn: "&#1499;&#1504;&#1497;&#1505;&#1492;", // knisa
			LogInTitle: "&#1502;&#1513;&#1514;&#1502;&#1513; &#1511;&#1497;&#1497;&#1501;", // mishtamesh kayam
			SignUp:		"&#1492;&#1512;&#1513;&#1502;&#1492;", // harshama
			SignUpTitle: "&#1502;&#1513;&#1514;&#1502;&#1513; &#1495;&#1491;&#1513;", // mishtamesh hadash
			MyTitle: "&#1492;&#1508;&#1497;&#1504;&#1492; &#1492;&#1488;&#1497;&#1513;&#1497;&#1514; &#1513;&#1500;&#1498;", // hapina haishit shelha
			Edit:		"&#1506;&#1512;&#1497;&#1499;&#1492;", // ariha
			HotLinks:	"",//"&#1511;&#1497;&#1513;&#1493;&#1512;&#1497;&#1501; &#1495;&#1502;&#1497;&#1501;",
			Exit:		"&#1497;&#1510;&#1497;&#1488;&#1492; &gt;",
			Navbar : 	"&#1489;&#1512; &#1504;&#1497;&#1493;&#1493;&#1496;"
			}; 
		break;
	default:
		isnMonths=new Array('JAN','FEB','MAR','APR','MAY','JUNE','JULY','AUG','SEP','OCT','NOV','DEC');
		isnDays=new Array('SUN','MON','TUE','WED','THU','FRI','SAT');
		LangObject = {
			_left:		"left",
			_right:		"right",
			_rtl:		"rtl",
			_ltr:		"ltr",
			BackHome:	"Back to portal",//***
			LogIn: "SIGN IN",
			LogInTitle: "Existing user",
			SignUp:		"REGISTER",
			SignUpTitle: "New user", 
			MyTitle: "Your personal workspace",
			Edit:		"Edit",
			HotLinks:	"",//"HOT LINKS", 
			Exit:		"EXIT &gt;",
			Navbar : 	"navbar"
			};
		break;
		
}


var today=new Date();



_d.write(
	'<style>'+
	( sysconfig_centerbody ? ' body { text-align:center; background:none; background-color:#F9F9F9; } ' : '' )+
	' .tblHeaderbarMain {width:780px; border-collapse: collapse; background-color: #E7E7E7;}'+
	' .tblHeaderbarMain table {border-collapse:collapse;}'+
	' .tblHeaderbarMain a img {border: none;} .tblHeaderbarMain a {text-decoration: none;}'+
	' .tblHeaderbarLinks { width:100%; margin:0px;} '+
	' .tblHeaderbarLinks td {padding:0px;} '+
	' .tblHeaderbarLinks td img {border: none; margin:0px;} '+
	' .tblHeaderbarLinks td.atext { padding:0 5px; border-right:1px solid #949AD6;} '+
	' .tblHeaderbarLinks td.atext a { white-space:nowrap; text-decoration: none; font-weight:bold; } '+
	' .tblHeaderbarLinks td.atext a:hover { text-decoration: none; } '+
	
	' #tdHeaderbarDate { background-color:#D6CECE; text-align:center;  padding: 0 5px; font-size: 10;} '+
	' .tdHDName { width:100%; background: #D6CECE;  white-space: nowrap;  } '+
	' .tdHDName a {text-decoration:none; font-size: 10pt; font-weight: bold; width:70px;  text-align: right; }'+
	' .myimgLinks { font-weight: bold; background-color:#'+Colors.Menu+'; color:#'+Colors.Main+'; border:0px solid #'+Colors.Main+';  text-align:center;  cursor:default; }'+ 
	' .LogOut { width:45pt; text-align:center;  font-weight: bold; padding-bottom:;  border:2px groove white;background-color:#'+Colors.Menu+'; color:#'+Colors.Main+';  cursor:pointer;} '+
	( commLang == "hbr" ? ' .myimgLinks {font-size:10pt; letter-spacing:3pt;padding-bottom:2pt;line-height:90%; } .LogOut { font-size:10pt; line-height:90%;	padding-bottom:1pt; }' 
						: ' .myimgLinks {font-size:8pt; letter-spacing:1ex;}  .LogOut { font-size:8pt; } ' ) +
	'.tdHDName a img, .tdHDName a:visited img {border: #'+Colors.TitleText+' 1px solid; }'+
	'.Cmenu { position: absolute; display:none; background: #DFDFDE; text-align:' + LangObject["_left"]+'; direction:' + LangObject["_ltr"]+'; ' +( _bType()=='IE' ? 'width:50px;' : 'width:auto;')+ ' }'+
	'.CmenuItem {display:block; border-bottom: black 1px solid; padding:1 5 1 5;' + ( _bType()=='IE' ? 'width:100%;' : '')+'}'+
	' .divMenuLinks { text-align:'+LangObject["_left"] +'; } '+
	' .divMenuLinks .ActiveMenuItem { padding:0px; } '+
	' .divMenuLinks a.mlink, Cmenu  a.mlink { direction:"+LangObject._ltr+"; width:100%; white-space:nowrap; padding:0px 3px;  } '+
	' A.mlink:link,	A.mlink:visited{ white-space:nowrap; color:#'+Colors.Main+';text-decoration:none;font-weight:800;font-size:10pt;font-family:verdana;}'+
	' A.mlink:hover	{ color:#"+Colors.Main+";background:white;text-decoration:none;font-weight:800;font-size:10pt;font-family:verdana;}'+

	'.HdrMenuItem  { border-bottom: #D6CFCE 1px solid; width:100%; }'+
	'.HdrMenuItem a { display:block; padding:1 5 1 5;' + ( _bType()=='IE' ? 'width:100%;' : '')+' }'+
	'.HdrMenuItem .img { width:11px; height:11px; margin-'+ LangObject["_left"] +':3px; border:1px solid #'+Colors.Main+'; back-ground-color:#'+Colors.Main+'; cursor:pointer;} '+

	'</style>');

//--------- ioda gif heading
_d.write(
	'<style> .tblHeaderbarMain {border-collapse: collapse; width: 780; background-color: #E7E7E7;}'+
	' .tblHeaderbarMain a img {border: none;} .tblHeaderbarMain a {text-decoration: none;}'+
	' .tdHDName {background: #D6CECE; text-align: center; white-space: nowrap; } '+
	' .tdHDName a {font-size: 10pt; font-weight: bold; }'+
	'</style>');

_d.write(
'<TABLE class=tblHeaderbarMain>' +
'	<TR><TD dir='+LangObject._ltr+' align='+LangObject._left+' style="color:#'+Colors.Main+'; padding: 0 0 0 0;">'+
'			<img src="/img/2/15/eng/heading.gif" />'+ 
'		</TD></tr></table>');
//------------ end ioda gif heading


	_d.write("<table class='tblHeaderbarLinks' style='background-color:#D6CFCE;width:780px;' >");
	_d.write("<tr>");
	_d.write("<td id='tdHeaderbarDate' class='tdHeaderbarDate atext'  style='width:146px;' ><!-- Date must be added by javascript --></td>");
	//_d.write("<td class='atext' style='width:100%;'></td>");
	_d.write("<td id='tdHeaderbarLinks' ></td>");
	
		_d.write(
			'<td dir="rtl" class="tdHDName"'+
			((flname=='')?
				(	' style=" text-align: right; padding: 0px 5px 0px 5px; ">'+
					'<a href="/scripts/manage/editusers.asp?commid='+commid+
						'&refto='+refto + '" title="'+LangObject["LogInTitle"]+
						'" style="height: 20px; padding-top: 2px; color: #'+Colors.TitleText+';">'+
					'<img height="6" width="6" src="'+imgPath+'pixel.gif" '+
						'style="background-color: #'+Colors.TitleText+';"/> ' + LangObject["LogIn"]+'</a>'+
					'<a href="/scripts/manage/editusers1.asp?commid='+commid+
						'&refto='+refto+'" title="'+LangObject["SignUpTitle"]+
						'" style="border-right: #949ad6 1px solid; margin-right: 10px; height: 20px; padding: 2px 5px 0px 5px; color: #'+Colors.TitleText+';">'+
					'<img height="6" width="6" src="'+imgPath+'pixel.gif" /> ' + LangObject["SignUp"]):
				'><a title="'+LangObject["MyTitle"]+'" class="ourlink" href="/scripts/my/my.asp"'+
					'style=" color:#'+Colors.Main+'; ">' + flname)+
				'</a></td>');					
	_d.write("</tr>");
	_d.write("</table>");


	loadHeaderbarXml();

	function loadHeaderbarXml()
	{
		var req;
		if (window.XMLHttpRequest) 
			req = new XMLHttpRequest();
		else if (window.ActiveXObject) 
			req = new ActiveXObject("Microsoft.XMLHTTP");
		
		if(typeof(req)!='undefined'	)
		{
			try{
				var url = "/scripts/HeaderBar/HeaderBarService.asmx/GetHeaderBarXml?commID="+commid+"&rand="+Math.floor(Math.random()*1000001);
				req.onreadystatechange = function(){
					xmlLoaded(req)				
				}; 
				req.open("GET", url, true);
				req.send(null);
					
			}catch(e){alert('Navbar Links Problem:\n'+e.message)}				

			/*
			if(req.status==200)// only if "OK"
			{
				var XML = req.responseXML; 
				if( XML && XML.documentElement )
				{
			}		
			*/
		}
	}
	
	function xmlLoaded(req)
	{
		//	alert(req.readyState+"\n"+req.status)
		try{ 
			if( req.readyState == 4 && req.status==200) buildHeaderbar(req.responseXML) 
		}catch(e){alert('Navbar Links Problem:\n'+e.message);}	

	}	
	

	function buildHeaderbar(XML)
	{
		if(getEl("tdHeaderbarDate")) //-- may be in future date will be taken from server side
		{
			getEl("tdHeaderbarDate").innerHTML = 
				'<a href="/scripts/events/calendar.asp?commid='+commid+'" style="width:146px;" >'+
					'<b>'+isnDays[today.getDay()]+", "+today.getDate()+" "+isnMonths[today.getMonth()]+" "+today.getFullYear()+'</b>'+
				'</a>'	
		}	

		if( XML && XML.documentElement )
		{
				try
				{
					var bShow, linkHref, linkContent, className, linkOnOver, nextLinkEl;
					var lnkCounter = 1; 
					var bFirst = true;
					var hdrStr = "", lnkStyleExt;

					//-- init iterate functions
					var getFirstEl = function(oXml){ if( oXml && oXml.documentElement ) return oXml.documentElement.firstChild; else return null; };
					var getNextEl = function(el){ if(el) return el.nextSibling; else return null; };
					
					if( commLang == "hbr")
					{
						getFirstEl = function(oXml){ if( oXml && oXml.documentElement ) return oXml.documentElement.lastChild; else return null; };
						getNextEl = function(el){ if(el) return el.previousSibling; else return null; };
					}
					
					var menuesHtml = "";
					var hdrBarHtml = "";
					
					var linkEl = getFirstEl(XML);
					while(linkEl)
					{
						if(linkEl.nodeType!=1) //-- if node is an element
						{
							linkEl = getNextEl(linkEl); 
							continue;
						}
						bShow = ( linkEl.getAttribute("show") == "1");
						linkHref = linkContent = "";
						className = "";
						linkOnOver = "";
						linkOnOut = "";
						
						switch( linkEl.nodeName )
						{

							case "home": 
									linkHref = "/scripts/comm.asp?commid="+ commid;
									linkContent = "<img src='"+imgPathL+"shaaroff.gif' class=''/>";
								break;

							case "manage": 
									if(pclass!="master" && userroll!="show")
										bShow = false;
									linkHref = "/scripts/manage/admin.asp?commid="+ commid;
									linkContent = "<img src='"+imgPathL+"nihul.gif' class=''/>";


								break;

							case "add": 
									linkHref = "javascript: oPopup.docs.Open(); if(typeof(hrdAddBtnTimer)!=\"undefined\") clearTimeout(hrdAddBtnTimer);";
									linkContent = "<img src='"+imgPathL+"addoff.gif' class='' />";
									//linkOnOver = "moveElTo('divMenuAdd',this);switchMenu('divMenuAdd',true,event,1500);";
									linkOnOver = "var oThis=this; hrdAddBtnTimer=setTimeout(function(){showHdrMenuFor(oThis, 'divMenuAdd', 'bottom_"+LangObject["_ltr"]+"' )},1000);"
									linkOnOut = "if(typeof(hrdAddBtnTimer)!=\"undefined\") clearTimeout(hrdAddBtnTimer);";
									
									menuesHtml += ('<div class="Cmenu" id="divMenuAdd" style="z-index:300;" >'+ menu_add_list()+ '</div>');

								break;

							case "new": 
									linkHref = "/scripts/new/ShowNew.aspx?commid="+ commid;
									linkContent = "<img src='"+imgPathL+"new.gif' class='' />";
									//linkOnOver = "moveElTo('divMenuNew',this);switchMenu('divMenuNew',true,event,1500);";
									linkOnOver = "showHdrMenuFor(this, 'divMenuNew', 'bottom_"+LangObject["_ltr"]+"' );"
									
									menuesHtml += ('<div class="Cmenu" id="divMenuNew" style="z-index:300;" >'+menu_new_list()+'</div>');		
									
								break;
							case "navbar": 
								if(bShow)
								{
									linkHref = "javascript:";
									linkContent = linkEl.getAttribute("title") || LangObject["Navbar"];
									linkOnOver = "showHdrNBMenu(this); ";
									className = "atext";
									if(!linkEl.getAttribute("color"))
										linkEl.setAttribute("color","#"+Colors.Main);

									menuesHtml += ("<link type='text/css' rel='stylesheet' href='/scripts/navbar/NBStyles.css' />");
									menuesHtml += ("<table id='tblHdrNBMenu' class='Cmenu' style='z-index:300; width:150px;' ><tr>");
									menuesHtml += (" <td id='NBHeaderbarMenu' class='divNavAll divNav' style='padding:2px;  width:150px;' ></td>");
									menuesHtml += ("</tr></table>");									
									
									navbarJSLoaded = 0;
									bHdrNBMenuOnly = 0;
									
									showHdrNBMenu = function(el)
									{	
										//-- check if the script is already loaded
										if(!navbarJSLoaded)
										{
											bHdrNBMenuOnly = 1;
											loadScript("/scripts/navbar/navbar.js");
											navbarJSLoaded=1;
										}
										showHdrMenuFor(el, "tblHdrNBMenu", "bottom_"+LangObject["_ltr"]);
									}									
									
									//addEvent( window, "load", function(){loadScript("/scripts/navbar/navbar.js");} );
								}
								break;	
							case "contactus": 
									linkHref = "/scripts/manage/WriteUs.asp?commid="+ commid;
									linkContent = "<img src='"+imgPathL+"ktov.gif' class=''/>";
								break;
								
							case "link":
									bShow = true;
									linkHref = linkEl.getAttribute("href");
									linkContent = linkEl.getAttribute("title");
									className = "atext";
									
									if( getFirstChild(linkEl) != null )
									{//-- Build menu for link
										linkOnOver = "showHdrMenuFor(this, 'divMenu4Link"+linkEl.getAttribute("id")+"', 'bottom_"+LangObject["_ltr"]+"' );"
										
										menuesHtml +=("<table class='Cmenu'  id='divMenu4Link"+ linkEl.getAttribute("id") +"' style='z-index:300;'  >");
											menuesHtml +=("<tr><td class=''>");		
												menuesHtml += buildHdrLinkMenu(linkEl, 0);
											menuesHtml +=("</td></tr>");	
										menuesHtml +=("</table>");
									}							

									break;
						}
						
						if(bShow)
						{
							hdrBarHtml += ("<td "+ ( className=="" ? "" : " class='"+ className +"' " ) );
								if( bFirst )
								{
									//hdrStr = hdrStr.concat(" style='width:100%; text-align:right;' ");
									bFirst = false;
								}
								if( linkOnOver != "")
									hdrBarHtml += (" onmouseover=\""+ linkOnOver +"\" ");
								//-- contact us image has border on the left and right sides, so we need remove border for sibling
								if( (nextLinkEl = getNextEl(linkEl)) && nextLinkEl.nodeName=="contactus" && nextLinkEl.getAttribute("show")=="1" )
									lnkStyleExt = "border-right:0;"
								else
									lnkStyleExt = "";
								
								//-- highlight the link if it has the same href as current page	
								if( linkRefer2CurrPage(linkHref)	)
									lnkStyleExt += " background-color:#FFC363; " ;
									
							hdrBarHtml += ( " style='"+ lnkStyleExt +"' ");	
							hdrBarHtml += (" >");
							
							hdrBarHtml += ( "<a href='"+ (linkHref!="" ? linkHref.replace(/'/gi,"&apos;") : "javascript:") +"' ");
							hdrBarHtml += ( 	" style='color:"+linkEl.getAttribute("color")+"; "+ (linkHref!=""? "" : "text-decoration:none;")+"' ");
								if( linkEl.getAttribute("id")+"" == "" ) 
									hdrBarHtml += (" id='hdrLnk"+ linkEl.getAttribute("id").replace(/'/gi,"apos;") +"' ");
								if( linkEl.getAttribute("target")=="_blank" && linkHref!="") 
									hdrBarHtml += (" target='_blank' ");
								if( linkOnOut != ""	)
									hdrBarHtml += (" onmouseout='"+ linkOnOut +"' ");
							hdrBarHtml += (	" >");
							hdrBarHtml += (  linkContent);
							hdrBarHtml += ( "</a>");
							hdrBarHtml += ("</td>");
						}						

						//linkEl = linkEl.nextSibling; 
						linkEl = getNextEl(linkEl);
						lnkCounter++;
					}
					
					
					hdrBarHtml = 
						("<table class='' style='' >")+
						("<tr>")+
							hdrBarHtml +
						("</tr>")+
						("</table>");					
					
				
					getEl('tdHeaderbarLinks').innerHTML = hdrBarHtml + menuesHtml;

				}catch(e){alert('Navbar Links Problem:\n'+e.message)}				
		}
	}
	
	function buildHdrLinkMenu(linkEl, level, opened )
	{
		if(getFirstChild(linkEl) == null) return; //-- if no child elements then exit
		
		var menuHtml = "";
		var bHasChilds, imgOnClick, imgSrc, id;
		level = level || 0;
			
		for(var i=0; i<linkEl.childNodes.length; i++)
		{
			childLinkEl = linkEl.childNodes[i];
			if(childLinkEl.nodeType!=1) continue;
			
			id = childLinkEl.getAttribute("id");
			childLinkHref = childLinkEl.getAttribute("href").replace(/'/g,"&apos;")
			
			//-- highlight the link if it has the same href as current page	
			lnkStyleExt = "";
			if( linkRefer2CurrPage(childLinkHref)	)
				lnkStyleExt += " background-color:#FFC363; " ;				
			
			bHasChilds = (getFirstChild(childLinkEl) != null );
			imgSrc = ( bHasChilds ? imgPath +"NBNode-.gif" : imgPath + "pixel.gif" )
			
			showmnu = "setTimeout( function(){ showHdrMenuFor(null, \'divMenu4Link"+linkEl.getAttribute("id")+"\', \'bottom_"+LangObject["_ltr"]+"\' ); } , 10);"
			showmnu=""
			imgOnClick = ( !bHasChilds ? '' : ' onclick="switchHdrNode(\'hdrNdImg_'+id +'\',\'hdrCh_'+id +'\');'+ showmnu +'" ' );
			
			menuHtml += ( '<table class="HdrMenuItem" id="hdrn_'+linkEl.getAttribute('id')+'" style="'+lnkStyleExt+'" >'+
				'<tr><td width="1%" style="padding-'+ LangObject._left+':'+(level*12)+';" >');
				
				menuHtml += ('<img class="img" id="hdrNdImg_'+id +'" '+imgOnClick+'" src="'+ imgSrc +'" style="background-color:'+childLinkEl.getAttribute("color")+'; border-color:'+ childLinkEl.getAttribute('color') +';" />');
				menuHtml += ('</td><td>');
				menuHtml += ( "<a class=' mlink' href='"+ (childLinkHref!="" ? childLinkHref.replace(/'/gi,"&apos;") : "javascript:") +"' " );
					if( childLinkEl.getAttribute("target")=="_blank"  && childLinkHref!="" ) 
						menuHtml += (  " target='_blank' "  );
				menuHtml += (   " style='color:"+childLinkEl.getAttribute("color")+";' >");
				menuHtml += (  childLinkEl.getAttribute("title").replace(/</g, "&lt;"));
				menuHtml += ( "</a>");

				menuHtml += ("</td></tr>");	
			menuHtml += ("</table>");
			
			if( bHasChilds )
			{
				menuHtml += ('<div style="'+(opened?'':'display:')+'" id="hdrCh_'+childLinkEl.getAttribute('id')+'" >');
					menuHtml +=  buildHdrLinkMenu(childLinkEl, level+1)//, opened )
				menuHtml += ('</div>');
			}
			
		}
		return menuHtml;
	}
	
	function linkRefer2CurrPage(linkHref)
	{
		var result = false;
			if( linkHref!="" && linkHref!="/" && linkHref!="http://" )
			{
				var i = location.href.toLowerCase().indexOf(linkHref.toLowerCase());
				if(i>-1 && (i+linkHref.length) == location.href.length)
					result = true;
			}	
			
		return result;
	}	
	
	function getFirstChild(xmlEl)
	{
		var firstChild = xmlEl.firstChild;
			while(firstChild && firstChild.nodeType!=1) firstChild=firstChild.nextSibling;
		return firstChild;
	}	
	
	function switchHdrNode( ndImg, childsEl)
	{
		ndImg = getEl(ndImg);
		if(ndImg) 
		{	
			if( ndImg.src.indexOf("NBNode-")>-1)
				ndImg.src = ndImg.src.replace(/NBNode-/i,"NBNode+");
			else
				ndImg.src = ndImg.src.replace(/NBNode\+/i,"NBNode-");
		}
		
		childsEl = getEl(childsEl);
		if(childsEl)
		{
			childsEl.style.display = (childsEl.style.display == "none" ? "block" : "none");
		}
	}
	
	openedHdrMenu=null;
	function showHdrMenuFor(destEl, menuEl, side, type)
	{
		if(typeof(hrdAddBtnTimer)!="undefined") clearTimeout(hrdAddBtnTimer);
		
		hideTimeout = 1000;
		showMenuFor(destEl, menuEl, side, type, hideTimeout);
		if(openedHdrMenu && openedHdrMenu!=menuEl) 
			hideMenuNow(openedHdrMenu);
		openedHdrMenu = menuEl;
	}
	
	
// menu my Friends
_d.write(
'<div class="Cmenu" id="divMenuHaverim">'+
((flname=='')?
	'<A class="CmenuItem mlink" href="/scripts/manage/editusers.asp?commid='+commid+'&refto=/scripts/my/myfrends.asp">':
	'<A class="CmenuItem mlink" href="/scripts/my/myfrends.asp">')+
LangObject["Edit"]+'</a> </div>');

_d.write("</td></tr></table>");

// menu new
function type_view( channel_type )
{
	var type;
	switch ( channel_type )           
	{                               
		case "docs":    
		case "fid":	
		case "db" :  	
		case "brd": 	 
		case "ind": 	 
		case "faq":	     
		case "lex":		 
		case "evnt": return 1;  break;  
		default:     return 0;  break; 
	}
	return 0;
}

var arr_channels = showcase.split(',');

function menu_new_list()
{
	var i, type, type_list , arr_channels = showcase.split(',');
	type_list = '<table  style="width:100%; " >'
	for( i=0; i<arr_channels.length; i++ )
	{
		type =  arr_channels[i];

		if ( type_view(type) == 1 )
			type_list += '<tr><td><a class="CmenuItem mlink" href="/scripts/new/ShowNew.aspx?commid='+commid+
				'&type='+ type +'">'+ eval('itemName.'+type) +'</a></td></tr>';
	}
	type_list += '</table>'
	return type_list;
}

//_d.write(
//	'<div class="Cmenu" id="divMenuNew" style="z-index:300;" >'+menu_new_list()+'</div>'
//);

// menu Add
var AuthLnk = '"/scripts/manage/editusers.asp?commid='+commid+'&refto='+refto;

function menu_add_list()
{
	var type, i, type_list = '', arr_channels = showcase.split(',');
	
	for( i=0; i<arr_channels.length; i++ )
	{
		type =  arr_channels[i];

		if ( type_view(type) == 1 )
			type_list += 	'<a class="CmenuItem mlink" href='+
				((flname=='')?	AuthLnk+escape('&popup='+type)+'">':
							'"javascript:oPopup.'+ type +'.Open()">')+
				eval('itemName.'+type)+'</a>';

		if ( type == 'pll' )
			type_list += '<a class="CmenuItem mlink" href='+
				((flname=='')? '"/scripts/manage/editusers.asp?commid='+commid+'&refto='+
							escape('/scripts/polls/user_polls.asp?commid='+commid)+'">':
				'"/scripts/polls/user_polls.asp?commid='+commid+'">')+
				itemName.pll+'</a>';
	}
	
	return type_list;
}

//_d.write( '<div class="Cmenu" id="divMenuAdd" style="z-index:300;" >'+ menu_add_list()+ '</div>' )

function HotLinks()
{
	try
	{
		document.write(yhoutputstr);
	}
	catch(e)
	{
		var r;
		if (window.XMLHttpRequest) 
			r = new XMLHttpRequest();
		else if (window.ActiveXObject) 
			r = new ActiveXObject("Microsoft.XMLHTTP");
		r.open("GET", "/go/InnerLinksInc.js", false);
		r.send(null);
		if(r.status == 200) 
		{
			try
			{
				document.write(r.responseText);
			}catch(e){alert('Hot Links Problem')}
		}
		else
		{
			document.write('<div id=divMenuLinks style="visibility:hidden;"><img width="1" height="1" /></div>')
		}
	}
	setTimeout( 'var e = document.getElementById("divMenuLinks");e.style.visibility="visible";e.style.display="none";e.style.background="#DEDFDE";', 1 );
}

HotLinks();


function loadScript( path )
{
	//-- check if the script is already loaded
		var i, scripts = document.getElementsByTagName('script')
		for( i = 0; i < scripts.length; i++ )
			if( scripts[i].src.toLowerCase().indexOf(path)>=0) return;
			
	//-- add script
		var scr = document.createElement('script');
			scr.type = 'text/javascript';
			scr.src = path;
			scr.defer = 'defer';
		document.getElementsByTagName('head')[0].appendChild(scr);		
}
