
   var pout=new Image();  
   var pover=new Image();  
   var mout=new Image();  
   var mover=new Image();  
   pout.src='images/warns/plus_off.gif';  
   pover.src='images/warns/plus_on.gif';    
   mout.src='images/warns/minus_off.gif';  
   mover.src='images/warns/minus_on.gif';    

function viewWarn(object,type) {
	object.src=type.src;
}  

function openNewWindow(theURL,winName,features) {  
  window.open(theURL,winName,features); 
} 
  
function MM_goToURL() { //v3.0 
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false; 
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'"); 
} 

function goToURL(target,Gurl) { 
    if (target=="blank")
		window.open(Gurl); 
    else if (target=="parent")
		parent.location.href=Gurl;
    else if (target=="top")
		top.location.href=Gurl;
    else if (target=="self")
		self.location.href=Gurl;
} 

function MM_confirm(msg, url) { //v1.0 
  if(confirm(msg)) location.replace(url); 
} 

function Cconfirm(msg, Gurl) { 
	var con=confirm(msg);
	if (con) location.replace(Gurl); 
} 

function toggles( targetId ) {
target = document.getElementById( targetId );
	if (target.style.display == "none") {target.style.display = ""; } 
	else { target.style.display = "none"; }
}

var Scroller = function(frameId,contentId,direction,tempo,w,h)
{
	// default parameters
	var thisObj 	= this;
	this.nXlocation 	= 0;
	this.nYlocation 	= 0;
	this.nFrameHeight = h;
	this.nFrameWidth	= w;
	this.nTempo	= tempo;
	this.strDirection	= direction;
	this.scrollerStat	= true;
	this.objFrame	= document.getElementById(contentId);
	
	// frame parameter
	f = document.getElementById(frameId);
	f.style.height = h+'px';
	f.style.width 	= w+'px';

	this.MoveScroller = function()
	{
		switch(this.strDirection)
		{
			case 'u':	// moving up
				this.nXlocation--;
				this.objFrame.style.top=this.nXlocation+"px";
				break;
			case 'd':	// moving sown
				this.nXlocation++;
				this.objFrame.style.top=this.nXlocation+"px";
				break;
			case 'r':	// moving right
				this.nYlocation++;
				this.objFrame.style.left=this.nYlocation+"px";
				break;
			case 'l':	// moving left
				this.nYlocation--;
				this.objFrame.style.left=this.nYlocation+"px";
				break;
		}
	}

	this.CheckScroller = function()
	{
		switch(this.strDirection)
		{
			case 'u':
				if ((0-this.nXlocation) > this.objFrame.offsetHeight)
				this.nXlocation = this.nFrameHeight;
				break;
			case 'd':
				if (this.nXlocation > this.nFrameHeight)
				this.nXlocation = -this.objFrame.offsetHeight;
				break;
			case 'r':
				if (this.nYlocation > this.nFrameWidth)
				this.nYlocation = -this.objFrame.offsetWidth;
				break;
			case 'l':
				if ((0-this.nYlocation) > this.objFrame.offsetWidth)
				this.nYlocation = this.nFrameWidth;
				break;
		}	
	}
	
	this.RunScroll = function()
	{
		if (this.scrollerStat)
		{
			this.MoveScroller();
			this.CheckScroller();
		}
	}
	
	this.StartScroll = function()
	{
		setInterval(function() { thisObj.RunScroll(); },thisObj.nTempo);
	}


	this.StopScroll = function()
	{
	this.scrollerStat = false;
	}

	this.ContinueScroll = function()
	{
	this.scrollerStat = true;
	}
	
}


function Check_Length(str,how,num) {
	if (how="e") {
	     if (str.length==num) {
		return (false);
	     }
	}
	else if (how="b") {
	     if (str.length>num) {
		return (false);
	     }
	}
	else if (how="l") {
	     if (str.length<num) {
		return (false);
	     }
	}
	else if (how="be") {
	     if (str.length>=num) {
		return (false);
	     }
	}
	else if (how="le") {
	     if (str.length<=num) {
		return (false);
	     }
	}
}

function Check_String(str,how,num,chtype) {
//Checking Length
	if (how="e") {
	     if (str.length==num) {
		return (false);
	     }
	}
	else if (how="b") {
	     if (str.length>num) {
		return (false);
	     }
	}
	else if (how="l") {
	     if (str.length<num) {
		return (false);
	     }
	}
	else if (how="be") {
	     if (str.length>=num) {
		return (false);
	     }
	}
	else if (how="le") {
	     if (str.length<=num) {
		return (false);
	     }
	}
//Checking Chars
	for(i=0;i<str.length;i++)
	{
		var tav = str.charAt(i);
		if(chtype.indexOf(tav) == -1)
		{
			return (false);
		}
	}
}

function Check_Mail(tmail) {
     if (tmail.split("@").length!=2) { //יותר או פחות מ-@ 1
		return (false);
     }
     else {
	var email1 = tmail.split("@")[0];
	var email2 = tmail.split("@")[1];
	var valid=true;
	for (i=0;i<email1.length;i++)
	{
           if (valid==true) 
	   {
		if (!((email1.charAt(i)>='a' && email1.charAt(i)<='z') || (email1.charAt(i)>='A' && email1.charAt(i)<='Z') || (email1.charAt(i)>='0' && email1.charAt(i)<='9') || email1.charAt(i)=='_' || email1.charAt(i)=='-' || email1.charAt(i)=='.')) 
		{
		valid=false;
		}
           }
	}
	for (i=0;i<email2.length;i++) 
	{
           if (valid==true) 
	   {
		if (!((email2.charAt(i)>='a' && email2.charAt(i)<='z') || (email2.charAt(i)>='A' && email2.charAt(i)<='Z') || (email2.charAt(i)>='0' && email2.charAt(i)<='9') || email2.charAt(i)=='_' || email2.charAt(i)=='-' || email2.charAt(i)=='.')) 
		{
		valid=false;
		}
           }
	}
	     if (valid==false) {
		return (false);
		}
     }
}

function Check_Date(day,month,year,MaxY,MinY) {
	if(year < MinY || year > MaxY) {
		return (false);
	}
	else if(month < 1 || month > 12) {
		return (false);
	}
	else if(month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12)  {
		if(day < 1 || day > 31) {
		return (false);
		}
	}
	else if(month==4 || month==6 || month==9 || month==11)  {
		if(day < 1 || day > 30) {
		return (false);
		}
	}
	else if(month==2)  {
		if (year%4==0) {
			if(day < 1 || day > 29) {
			     return (false);
			}
		}
		else {
			if(day < 1 || day > 28) {
			     return (false);
			}
		}
	}
}

function OnlyDigits(str) {
	valid=true;
	for(i=0;i<str.length;i++)
	{
		if (str.charAt(i)<'0' || str.charAt(i)>'9')
			return false;
	}
}

function Toggle (id) { 
    if (document.getElementById("ToggleRow_" + id).style.visibility=="hidden") { 
        document.getElementById("ToggleImg_" + id).src = "images/icons/collapse.gif"; 
        document.getElementById("ToggleRow_" + id).style.visibility="visible";
        document.getElementById("ToggleImg_" + id).alt = "הסתר"; 
        document.getElementById("ToggleText_" + id).innerHTML = "הסתר"; 
    } 
    else { 
        document.getElementById("ToggleImg_" + id).src = "images/icons/expand.gif"; 
        document.getElementById("ToggleRow_" + id).style.visibility="hidden";
        document.getElementById("ToggleImg_" + id).alt = "קרא עוד"; 
        document.getElementById("ToggleText_" + id).innerHTML = "קרא עוד"; 
    } 
} 

function SelectAll2() { 
    for(var x=0;x<document.form.elements.length;x++) { 
        var y=document.form.elements[x]; 
        if(y.name!='ALL') y.checked=document.form.ALL.checked; 
    } 
} 

function SelectAll() { 
    for(var x=0;x<document.getElementById("form").elements.length;x++) { 
        var y=document.getElementById("form").elements[x]; 
        if(y.name!='ALL') y.checked=document.getElementById("form").ALL.checked; 
    } 
} 

function DeleteNotDigits(objF)
{
	v=objF.value;
	var NewStr="";
	for (i=0;i<v.length;i++)
	{
		if (v.charAt(i)>=0 && v.charAt(i)<=9)
			NewStr+=v.charAt(i)
	}
	objF.value=NewStr;
}

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}

// CSS by BROWSER
var brow_name = navigator.appName;
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
function CheckBrowser() {
	if (brow_name == "Microsoft Internet Explorer" && version < 7.0)
	{
		document.getElementById('css').href = "ie.css";
		correctPNG();
	}
	else
		document.getElementById('css').href = "default.css";
}
//END CSS by BROWSER
