
function AsetHomepage()
{
 if ( window.external )
    {
        document.body.style.behavior='url(#default#homepage)';
  document.body.setHomePage('http://www.comax.co.il/');
 //this.style.behavior='url(#default#homepage)'; this.setHomePage('http://www.comax.co.il/');
    }
    else if (window.sidebar)
    {
    if(window.netscape)
    {
         try
   {  
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
         }  
         catch(e)  
         {  
    alert("this action was aviod by your browser,if you want to enable,please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true");  
         }
    } 
    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
    prefs.setCharPref('browser.startup.homepage','http://www.asp.net/130.aspx');
 }
}

function addBookmarkForBrowser(title,url) 
{
  if (window.sidebar) 
  { // Mozilla Firefox Bookmark		
	window.sidebar.addPanel(title, url,"");	
  } 
  else 
  {
	if( window.external ) 
	{// IE Favorite		
		window.external.AddFavorite( url, title); 
	}
  }	
}

function openMifrat(url,id)
{
	var i = new String(id);
	var firstN=i.indexOf("t")+1;
	var secondN=i.indexOf("-");

	i=i.slice(firstN,secondN);
	
	var aherf=url+"?IdSub="+id+"&i="+i;
	if (url!=""){document.location.href=aherf;}
}

function openMifratN(url,id,pic,title)
{
	var i = new String(id);
	var firstN=i.indexOf("t")+1;
	var secondN=i.indexOf("-");

	i=i.slice(firstN,secondN);
	title=title.replace("+","^^")
	var aherf="incPages.asp?IdSub="+id+"&i="+i+"&Pic="+pic+"&Title='"+title+"'";
	if (url!=""){document.location.href=aherf;}
}

function onclickk (aherf,id)
{
	if(id!="" && id!=undefined) aherf=aherf+"'"+id+"'";
	if (aherf!=""){document.location.href=aherf;}
}
function onOverT(id,ben)
{
	if (wrkId!=id)
	{
		document.getElementById(id).style.background='url(../images/oribtng.png)';
		document.getElementById(id).style.cursor="pointer";
		document.getElementById(id).style.color="white";
	}
}
function onOutT(id,ben)
{
	if (wrkId!=id)
	{
		document.getElementById(id).style.background='url(../images/oribtn.png)';
		document.getElementById(id).style.cursor="default";
		document.getElementById(id).style.color="black";
	}
}

function onOverN(id)
{
	try
	{
		if (wrkId!=id)
		{
			document.getElementById(id).style.cursor="pointer";
			document.getElementById(id).style.color="orange";
		}
	}
	catch(e){}	
}
function onOutN(id)
{
	try
	{
		if (wrkId!=id)
		{
			document.getElementById(id).style.cursor="default";
			document.getElementById(id).style.color="gray";
		}
	}
	catch(e){}
}
function OnOverRN(c)
{
	if(RgthId!=c)
	{
		//document.getElementById(c).style.background='url(../images/enteron.gif)';
		document.getElementById(c).style.color="orange";
	}
}

function OnOutRN(c)
{
	if(RgthId!=c)
	{
		//document.getElementById(c).style.background='url(../images/enter11.png)';
		document.getElementById(c).style.color="gray";
	}
}

function OnOverR(c)
{
	if(RgthId!=c)
	{
		document.getElementById(c).style.background='url(../images/enteron.gif)';
		document.getElementById(c).style.color="black";
	}
}

function OnOutR(c)
{
	if(RgthId!=c)
	{
		document.getElementById(c).style.background='url(../images/enter11.png)';
		document.getElementById(c).style.color="white";
	}
}

function Responses(Sug)
{
	var url="Response.asp?Sug=" + Sug;
	document.getElementById("FrmNetshit6").style.border="1px solid black";
	document.getElementById("FrmNetshit6").src=url;
}

function chkExp()
{
	eV=window.navigator.appVersion;
	nm=window.navigator.appName;
	
	b=eV.indexOf("MSIE");
	e=eV.indexOf(";",b);
	eV=eV.substring(b+4,e);
	if (parseFloat(eV)<5.01 || nm.indexOf("Explorer")==-1)
	{
		alert("לעבודה במערכת חובה להתקין אקספלורר גירסה 5.01 ומעלה");
		return false;
	}
	return true;
}

function chkExp6()
{
	eV=window.navigator.appVersion;
	nm=window.navigator.appName;
	
	b=eV.indexOf("MSIE");
	e=eV.indexOf(";",b);
	eV=eV.substring(b+4,e);
	if (parseFloat(eV)<6 || nm.indexOf("Explorer")==-1)
	{
		alert("לעבודה במערכת חובה להתקין אקספלורר גירסה 6.00 ומעלה");
		return false;
	}
	return true;
}

function closeState ()
{
	document.getElementById("FrmNetshit6").style.border="0";
	parent.document.getElementById("FrmNetshit6").src="images/netshit6.swf";
}

function Manui(c)
{
	if(c=="Manui"){var Mode="Manui";}
	if(c=="getPass"){var Mode="getPass";}
	if(c=="TzorKesher"){var Mode="TzorKesher";}
	document.getElementById("FrmNetshit6").style.border="1px solid black";
	document.getElementById("FrmNetshit6").src="Manui.asp?Mode="+Mode;
}

//---------------------------------------------------------------------------------------------------------------------------------------------
function DoIn()
{  
	var x1=250;
	var y1=332;
	var L1=(window.screen.availWidth-x1)/2;
	var T1=(window.screen.availHeight-y1)/2;
	var r= "";
	if (HTTP_HOST=="www.comax.co.il")
	{
		r="https://"+HTTP_HOST;
	}
	if (HTTP_HOST=="comax.native-data.co.il")
	{
		r="http://"+HTTP_HOST;
	}
	else r="../..";
	var url=r+"/Max2000/LogInWEB/LogInWeb.asp?date="+Date();
	window.open(url,"","status=no,menubar=no,toolbar=no,location=no,top="+T1+",left="+L1+",height="+y1+",width="+x1);
}

function InLog()
{
	document.getElementById("log").style.background='url(images/enteron.gif)';
	
}
function OutLog()
{
	document.getElementById("log").style.background='url(images/enter11.png)';
	document.getElementById("log").style.color="white";
}

function Right(str, n)
{
      if (n <= 0)
          return "";
      else if (n > String(str).length)
          return str;
      else
   {
          var iLen = String(str).length;
          return String(str).substring(iLen, iLen - n);
      }
}

function Left(str, n)
{
   if (n <= 0)
         return "";
   else if (n > String(str).length)
         return str;
   else
         return String(str).substring(0,n);
}


function Trim(str)
{
	return LTrim(RTrim(str));
}

function LTrim(str) 
{
	for (var i=0; ((str.charAt(i)<=" ")&&(str.charAt(i)!="")); i++);
	return str.substring(i,str.length);
}

function RTrim(str)
{
	for (var i=str.length-1; ((str.charAt(i)<=" ")&&(str.charAt(i)!="")); i--);
	return str.substring(0,i+1);
}


	
/*

function getYPosition( oElement )
{
	var iReturnValue = 0;
	while( oElement != null )
	{
	iReturnValue += oElement.offsetTop;
	oElement = oElement.offsetParent;
	}
return iReturnValue;
}

function getXPosition( oElement )
{
	var iReturnValue = 0;
	while( oElement != null )
	{
	iReturnValue +=oElement.offsetLeft;
	oElement = oElement.offsetParent;
	}
return iReturnValue;
}

function ActivateFlash (se)
{
	str="";
	str +='	<TABLE  WIDTH="825" HEIGHT="535" BORDER="0" style="position:absolute;z-index:999;top:5;left:-15">';
	str +='				<TR align="center" valign="middle">';
	str +='					<TD>';
	str +='					<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
	str +='						WIDTH=825 HEIGHT=535 id=ShockwaveFlash1>';
	str +='						<param name="movie" value="images/flash/selected_animation.swf" />';
	str +='						<param name="quality" value="high" />';
	str +='						<param name="wmode" value="transparent" />';
	str +='						<PARAM NAME=FlashVars VALUE="slct_cat='+se+'">';
	str +='						<param name="bgcolor" value="#ffffff" />';
	str +='						<EMBED src="images/flash/selected_animation.swf" quality="high" wmode="transparent" bgcolor="#ffffff"  WIDTH=825 HEIGHT=535 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>';
	str +='					</OBJECT>';
	str +='					</TD>';
	str +='				</TR>';
	str +='				</TABLE>';
	DoFlash.innerHTML=str;
	window.setTimeout ("closeFlash()",2000)
}
function closeFlash()
{
	DoFlash.innerHTML="";
}	

*/

function OpenMe(Pic)
{
	var x1=(window.screen.availWidth-10);
	var y1=(window.screen.availHeight-10);
	var url="WindowOpenMe.asp?Pic="+Pic;
	window.open(url,"","scrollbars=yes,menubar=no,toolbar=no,location=no,top=0,left=0,height="+y1+",width="+x1);
}

function setMenu(wrkId,RgthId,ErpSltId,swEng)
{
//alert(document.getElementById(wrkId).className +"-"+ document.getElementById(wrkId).childNodes.length +"-"+ document.getElementById(wrkId).childNodes.item(0).className );

	if (document.getElementById(wrkId)!=null) 	document.getElementById(wrkId).childNodes.item(0).className=" DivSubjects_on";

	s1="",s2=""; 
	if (swEng==1) { s1="linkTop_e"; s2="linkTop_on_e"; }
//	if (document.getElementById(wrkId)!=null) 	document.getElementById(wrkId).className="menu menu_on";
	if (document.getElementById(RgthId)!=null) 	document.getElementById(RgthId).className="linkTop "+s1+" linkTop_on "+s2;
	if (ErpSltId!= undefined && document.getElementById(ErpSltId)!=null)
		document.getElementById(ErpSltId).className="ErpMenu_on";
}

 //function sfHover() {
//		var sfEls = document.getElementById("TopNav").getElementsByTagName("LI");
//		for (var i=0; i<sfEls.length; i++) {
//			sfEls[i].onmouseover=function() {
//				this.className+=" sfhover";
//			}
//			sfEls[i].onmouseout=function() {
//				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
//			}
//		}
//	}
	
//if (window.attachEvent) window.attachEvent("onload", sfHover);




