<!--
//window.captureEvents(Event.UNLOAD)

//Generic Drag Script- © Dynamic Drive (www.dynamicdrive.com)
//For full source code and terms of usage,
//visit http://www.dynamicdrive.com
var nottoolbar = false
var dom = (document.getElementById) ? true : false;
var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ns4 = (document.layers && !dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

var ie=document.all
var ns6=document.getElementById&&!document.all

var dragapproved=false
var z,x,y

function move(e){

if (dragapproved){
z.style.left=ns6? temp1+e.clientX-x: temp1+event.clientX-x
z.style.top=ns6? temp2+e.clientY-y : temp2+event.clientY-y
return false
}
}

function drags(e){
if (!ie&&!ns6)
return
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "HTML" : "BODY"

while (firedobj.tagName!=topelement&&firedobj.className!="drag"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}

if (firedobj.className=="drag"){
dragapproved=true
z=firedobj
temp1=parseInt(z.style.left+0)
temp2=parseInt(z.style.top+0)
x=ns6? e.clientX: event.clientX
y=ns6? e.clientY: event.clientY
document.onmousemove=move
return false
}
}
//document.onmousedown=drags
//document.onmouseup=new Function("dragapproved=false")
//-->

///////////////////////////////// start windows application//////////////////////////////////


var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

function iecompattest(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? top.document.documentElement : top.document.body
}

function drag_drop(e){
if (ie5&&dragapproved&&event.button==1){
document.getElementById("dwindow").style.left=tempx+event.clientX-offsetx+"px"
document.getElementById("dwindow").style.top=tempy+event.clientY-offsety+"px"
}
else if (ns6&&dragapproved){
document.getElementById("dwindow").style.left=tempx+e.clientX-offsetx+"px"
document.getElementById("dwindow").style.top=tempy+e.clientY-offsety+"px"
}

}

function initializedrag(e){

offsetx=ie5? event.clientX : e.clientX
offsety=ie5? event.clientY : e.clientY
document.getElementById("dwindowcontent").style.display="none" //extra
tempx=parseInt(document.getElementById("dwindow").style.left)
tempy=parseInt(document.getElementById("dwindow").style.top)

dragapproved=true
document.getElementById("dwindow").onmousemove=drag_drop
}

function loadwindow(url,width,height,title){
if (!ie5&&!ns6)
window.open(url,"thepage","width=width,height=height,scrollbars=1")
else{
document.getElementById("dwindow").style.display=''
document.getElementById("dwindow").style.width=initialwidth=width+"px"
document.getElementById("dwindow").style.height=initialheight=height+"px"
document.getElementById("dwindow").style.left="60px"
document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+30+"px" : iecompattest().scrollTop*1+30+"px"
document.getElementById("cframe").src=url
}
document.getElementById("dwindowtitle").innerText = title;
//document.Frames['bottomFrame'].length);

}
function loadHiddenWindow(width,height,title){
if (!ie5&&!ns6)
window.open(url,"thepage","width=width,height=height,scrollbars=1")
else{
document.getElementById("dwindow").style.display=''
document.getElementById("dwindow").style.width=initialwidth=width+"px"
document.getElementById("dwindow").style.height=initialheight=height+"px"
document.getElementById("dwindow").style.left="60px"
document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+30+"px" : iecompattest().scrollTop*1+30+"px"
}
document.getElementById("dwindowtitle").innerText = title;
//document.Frames['bottomFrame'].length);

}
function maximize(){
if (minrestore==0){
minrestore=1 //maximize window
//alert(iecompattest().clientWidth+"px")
document.getElementById("maxname").setAttribute("src","imgsrc/restore.gif")
document.getElementById("dwindow").style.width=ns6? window.innerWidth-20+"px" : iecompattest().clientWidth-30+"px"
document.getElementById("dwindow").style.height=ns6? window.innerHeight-20+"px" : iecompattest().clientHeight-12+"px"
parent.document.getElementById('cframe').style.display=''
}
else{
minrestore=0 //restore window
document.getElementById("maxname").setAttribute("src","imgsrc/max.gif")
document.getElementById("dwindow").style.width=initialwidth
document.getElementById("dwindow").style.height=initialheight
parent.document.getElementById('cframe').style.display=''
}

document.getElementById("dwindow").style.left=ns6? window.pageXOffset+"px" : iecompattest().scrollLeft+"px"
document.getElementById("dwindow").style.top=ns6? window.pageYOffset+"px" : iecompattest().scrollTop+"px"
parent.document.getElementById('cframe').style.display=''
}

function minimize(){
if (minrestore==0){
minrestore=1 //maximize window
//alert(iecompattest().clientWidth+"px")
document.getElementById("maxname").setAttribute("src","imgsrc/restore.gif")
//document.getElementById("dwindow").style.width=ns6? "5px" : "5px"
//document.getElementById("dwindow").style.height=ns6? "0px" : "0px"
//document.getElementById("cframe").style.height=ns6? "0px" : "0px"
document.getElementById("dwindow").style.left=ns6? window.pageXOffset - window.pageXOffset+"px" : iecompattest().scrollLeft - iecompattest().scrollLeft +"px"
document.getElementById("dwindow").style.top=ns6? window.pageYOffset - window.pageYOffset +"px" : iecompattest().scrollTop - iecompattest().scrollTop +"px"
document.getElementById("dwindow").style.height="1px"
parent.document.getElementById('cframe').style.display='none'

}
else{
minrestore=0 //restore window
//document.getElementById("maxname").setAttribute("src","imgsrc/max.gif")
//document.getElementById("dwindow").style.width=initialwidth
//document.getElementById("dwindow").style.height=initialheight
}

//document.getElementById("dwindow").style.left=ns6? window.pageXOffset+"px" : iecompattest().scrollLeft+"px"
//document.getElementById("dwindow").style.top=ns6? window.pageYOffset+"px" : iecompattest().scrollTop+"px"
}

function closeit(){
document.getElementById("dwindow").style.display="none"
document.getElementById("cframe").src = "";
}

function stopdrag(){
dragapproved=false;
document.getElementById("dwindow").onmousemove=null;
document.getElementById("dwindowcontent").style.display="" //extra

}
////////////finish windows application/////////////////////////////
// function ararnge icons
function reloadicon(){
document.getElementById("iconstu").style.top = "20px";
document.getElementById("iconstu").style.right = "20px";
document.getElementById("iconarea").style.top = "40px";
document.getElementById("iconarea").style.right = "20px";

}
//////////////////// start divs menu////////////////////////////
function openstartmenu(nodeId){
//alert(top.frames[0].document.getElementById(nodeName).innerHTML)
	nodeName = "div_" + nodeId ;
	imgnodeName = "img_" + nodeId ;
	top.frames[0].document.getElementById(nodeName).style.display = (top.frames[0].document.getElementById(nodeName).style.display=="none") ? "block" : "none" ;
	//document.getElementById(imgnodeName).src = (top.frames[0].document.getElementById(nodeName).style.display=="none") ? "http://www.ulpanit.org.il/ev/imgsrc/chatchel.jpg" : "http://www.ulpanit.org.il/ev/imgsrc/hatchelclick.jpg" ;
}

function hidemen(nodeId){
//alert(top.frames[0].document.getElementById(nodeName).innerHTML)
	nodeName =  nodeId ;
	document.getElementById(nodeName).style.display = (document.getElementById(nodeName).style.display=="none") ? "block" : "none" ;
	//top.frames[0].document.getElementById(nodeName).style.display = (top.frames[0].document.getElementById(nodeName).style.display=="none") ? "block" : "none" ;
	//document.getElementById(imgnodeName).src = (top.frames[0].document.getElementById(nodeName).style.display=="none") ? "http://www.ulpanit.org.il/ev/imgsrc/chatchel.jpg" : "http://www.ulpanit.org.il/ev/imgsrc/hatchelclick.jpg" ;
}
// for clear the 
function hidebodyclick(){
//document.getElementById("div_4110").style.display = "none";
}
var mouseX, mouseY;
function trackMouse(evt) {
	mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
	mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	}
function showdivs(nodeId){
  nodeName = "div_" + nodeId ;
  document.getElementById(nodeName).style.visibility="visible";
  document.getElementById(nodeName).style.display="";
 document.getElementById(nodeName).style.top= this.event.y - 553
  document.getElementById(nodeName).style.right=154;
}
function hidedivs(nodeId){
  nodeName = "div_" + nodeId ;
  document.getElementById(nodeName).style.display="none";
}

////////////////////////////////////// function right click/////////////////////////////////////////

function showRightClick()
{
  rightClick.style.visibility="visible";
  rightClick.style.display="";
  rightClick.style.top=this.event.y;
  rightClick.style.right=this.event.x;
  hidebodyclick()
}

function hideRightClick()
{
  rightClick.style.display="none";
}	

////////////// back AND farword function///////
function winBack(){
alert(self.window.history.length);
alert(self.window.history.go(-1))
//if(parent.window.history.length > 0){document.getElementById('cframe').src=window.history.back()};
}
function winfarword(){
alert(window.history.length)
}
/////////////////////// function to validated just numbers in forms//////////////
						function justnum(nodeId)
						{
							//nodeName = "form_" + nodeId ;
							var g=document.getElementById(nodeId).value ;
							var anum=/(^\d+$)|(^\d+\.\d+$)/
										if (anum.test(g))
										testresult=true
										else{
										alert("!äæï îñôøéí áìáã")
										document.getElementById(nodeId).value = "";
										document.getElementById(nodeId).focus();
										return false;
										}
						}
if(plus = null){
var plus = 0;
}


function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} 

/////////////////////////////checking forms all types//////////////


function checkform(FormName){
	//var FormName =  Fn;
	var FormLen = document.getElementById(FormName).length
		for(i=0;i<FormLen;i++){
			var InputName = document.getElementById(FormName).elements[i].name;
			var InputType = document.getElementById(FormName).elements[i].type;
			var InputTitle = document.getElementById(FormName).elements[i].title;
			var InputAlt = document.getElementById(FormName).elements[i].alt;
			if(InputName == null || InputType == null ){
				//alert('i dont knowe what is this...');
				}else{
				if(InputTitle == "email"){
				checkEmail = document.getElementById(FormName).document.getElementById(InputName).value;
					if(checkEmail.length !== 0) {
						if ((checkEmail.indexOf('@') < 0) || ((checkEmail.charAt(checkEmail.length-4) != '.') && (checkEmail.charAt(checkEmail.length-3) != '.'))) 
							{alert("ëúåáú àéîééì àéðä çå÷éú àðà ðñä ùðéú àå äùàø ùãä æä øé÷ îúåëï.");
								document.getElementById(FormName).document.getElementById(InputName).style.backgroundColor = 'red';
								document.getElementById(FormName).document.getElementById(InputName).focus();
							return false;
							}
					} 
				}
				
				if(InputTitle == "must"){
					switch(InputType)
					{
					
					case "select-one":
						//alert("this is a select box" + " "+InputName + " - " + InputType + "-"  + InputTitle);
						select_choose=document.getElementById(FormName).document.getElementById(InputName).selectedIndex
						select_value=document.getElementById(FormName).document.getElementById(InputName)[select_choose].value
							if (select_value=="none")
							{
								if (InputValue.length == 0){
								alert(' çåáä ìáçåø ôøéè îøùéîú ' + InputAlt)
								}else{
								alert('çåáä ìáçåø ôøéè îøùéîä æå')
								}
							//document.getElementById(FormName).document.getElementById(InputName).style.backgroundColor = 'red';
							document.getElementById(FormName).document.getElementById(InputName).focus();
							return false;
							}				
					break;
					case "text":
						//alert("this is a Text box" + " "+InputName + " - " + InputType+ "-"  + InputTitle);
						InputValue = document.getElementById(FormName).document.getElementById(InputName).value;
						if(InputValue.length == 0 && InputAlt.length!==0){
						alert('çåáä ìîìà ùãä ' + InputAlt);
						document.getElementById(FormName).document.getElementById(InputName).focus();
						return false
						}
						if(InputValue.length == 0 && InputAlt.length==0){
						alert('çåáä ìîìà ùãä æä' );
						document.getElementById(FormName).document.getElementById(InputName).focus();
						return false
						}
						//document.getElementById(FormName).document.getElementById(InputName).style.backgroundColor = 'red';
						
						
					
					break;
					case "file":
						//alert("this is a Text box" + " "+InputName + " - " + InputType+ "-"  + InputTitle);
						InputValue = document.getElementById(FormName).document.getElementById(InputName).value;
						if(InputValue.length == 0){
						alert('çåáä ìäòìåú ÷åáõ áàðâìéú åììà øååçéí áùí ä÷åáõ');
						//document.getElementById(FormName).document.getElementById(InputName).style.backgroundColor = 'red';
						document.getElementById(FormName).document.getElementById(InputName).focus();
						return false
						}
						StrStart = InputValue.lastIndexOf("\\");
						StrEnd = InputValue.length;						
						file_name = InputValue.substring(StrStart+1,StrEnd);
						str = InputValue.toLowerCase()
						var ext=str.substring(str.length-4,str.length)	
						var heb = new RegExp("[à,á,â,ã,ä,å,æ,ç,è,é,ë,ê,ì,î,í,ð,ï,ñ,ò,ô,ó,ö,õ,÷,ø,ù,ú]","g");
						if(!(ext==".gif" || ext==".jpg")){
							alert('÷åáõ îñåâ \n <\"'+ext+'\"> \n àéðå îøùä ìòìåú ìùøú');
							document.getElementById(FormName).document.getElementById(InputName).value = "";
							document.getElementById(FormName).document.getElementById(InputName).focus();
							return false
						}

						if(heb.test(file_name) == true){
							alert('àéï äøùàä ìäòìåú ÷áöéí áòáøéú ìùøú, àðà ùðä àú ùí ä÷åáõ\n <\"'+file_name+'\"> \n ìàðâìéú åðñä ìäòìåúå ùðéú');
							document.getElementById(FormName).document.getElementById(InputName).value = '';
							document.getElementById(FormName).document.getElementById(InputName).focus();
							return false
						}
					break;
					case "button":
					// ignore this value at that point
						//alert("this is a Botton input" + " "+InputName + " - " + InputType+ "-"  + InputTitle);
					break;
					
					default:
								
						
					}
				}
			}
		
		}
		//alert("ùåìç èåôñ")
		this.document.getElementById(FormName).submit();
}
function checkform_no_submit(FormName){
	//var FormName =  Fn;
	var FormLen = document.getElementById(FormName).length
		for(i=0;i<FormLen;i++){
			var InputName = document.getElementById(FormName).elements[i].name;
			var InputType = document.getElementById(FormName).elements[i].type;
			var InputTitle = document.getElementById(FormName).elements[i].title;
			var InputAlt = document.getElementById(FormName).elements[i].alt;
			if(InputName == null || InputType == null ){
				//alert('i dont knowe what is this...');
				}else{
				if(InputTitle == "email"){
				checkEmail = document.getElementById(FormName).document.getElementById(InputName).value;
					if(checkEmail.length !== 0) {
						if ((checkEmail.indexOf('@') < 0) || ((checkEmail.charAt(checkEmail.length-4) != '.') && (checkEmail.charAt(checkEmail.length-3) != '.'))) 
							{alert("ëúåáú àéîééì àéðä çå÷éú àðà ðñä ùðéú àå äùàø ùãä æä øé÷ îúåëï.");
								document.getElementById(FormName).document.getElementById(InputName).style.backgroundColor = 'red';
								document.getElementById(FormName).document.getElementById(InputName).focus();
							return false;
							}
					} 
				}
				
				if(InputTitle == "must"){
					switch(InputType)
					{
					
					case "select-one":
						//alert("this is a select box" + " "+InputName + " - " + InputType + "-"  + InputTitle);
						select_choose=document.getElementById(FormName).document.getElementById(InputName).selectedIndex
						select_value=document.getElementById(FormName).document.getElementById(InputName)[select_choose].value
							if (select_value=="none")
							{
								if (InputValue.length == 0){
								alert(' çåáä ìáçåø ôøéè îøùéîú - ' + InputAlt)
								}else{
								alert('çåáä ìáçåø ôøéè îøùéîä æå')
								}
							//document.getElementById(FormName).document.getElementById(InputName).style.backgroundColor = 'red';
							document.getElementById(FormName).document.getElementById(InputName).focus();
							return false;
							}				
					break;
					case "text":
						//alert("this is a Text box" + " "+InputName + " - " + InputType+ "-"  + InputTitle);
						InputValue = document.getElementById(FormName).document.getElementById(InputName).value;
						if(InputValue.length == 0 && InputAlt.length!==0){
						alert('çåáä ìîìà ùãä - ' + InputAlt);
						document.getElementById(FormName).document.getElementById(InputName).focus();
						return false
						}
						if(InputValue.length == 0 && InputAlt.length==0){
						alert('çåáä ìîìà ùãä æä' );
						document.getElementById(FormName).document.getElementById(InputName).focus();
						return false
						}
						//document.getElementById(FormName).document.getElementById(InputName).style.backgroundColor = 'red';
						
						
					
					break;
					case "file":
						//alert("this is a Text box" + " "+InputName + " - " + InputType+ "-"  + InputTitle);
						InputValue = document.getElementById(FormName).document.getElementById(InputName).value;
						if(InputValue.length == 0){
						alert('çåáä ìäòìåú ÷åáõ áàðâìéú åììà øååçéí áùí ä÷åáõ');
						//document.getElementById(FormName).document.getElementById(InputName).style.backgroundColor = 'red';
						document.getElementById(FormName).document.getElementById(InputName).focus();
						return false
						}
						StrStart = InputValue.lastIndexOf("\\");
						StrEnd = InputValue.length;						
						file_name = InputValue.substring(StrStart+1,StrEnd);
						str = InputValue.toLowerCase()
						var ext=str.substring(str.length-4,str.length)	
						var heb = new RegExp("[à,á,â,ã,ä,å,æ,ç,è,é,ë,ê,ì,î,í,ð,ï,ñ,ò,ô,ó,ö,õ,÷,ø,ù,ú]","g");
						if(!(ext==".gif" || ext==".jpg"  || ext==".bmp" || ext==".tif" || ext==".dwg" || ext==".pdf" || ext==".plt" || ext==".doc" || ext==".rtf" || ext==".txt" || ext==".xls" || ext==".mpp" || ext==".htm" || ext==".html" || ext==".ppt" )){
							alert('÷åáõ îñåâ \n <\"'+ext+'\"> \n àéðå îøùä ìòìåú ìùøú');
							document.getElementById(FormName).document.getElementById(InputName).value = "";
							document.getElementById(FormName).document.getElementById(InputName).focus();
							return false
						}

						if(heb.test(file_name) == true){
							alert('àéï äøùàä ìäòìåú ÷áöéí áòáøéú ìùøú, àðà ùðä àú ùí ä÷åáõ\n <\"'+file_name+'\"> \n ìàðâìéú åðñä ìäòìåúå ùðéú');
							document.getElementById(FormName).document.getElementById(InputName).value = '';
							document.getElementById(FormName).document.getElementById(InputName).focus();
							return false
						}
					break;
					case "button":
					// ignore this value at that point
						//alert("this is a Botton input" + " "+InputName + " - " + InputType+ "-"  + InputTitle);
					break;
					
					//case "submit":
					//	document.getElementById(FormName).document.getElementById(InputName).disabled=true;
					//break;
					default:
								
						
					}
				}
			}
		
		}
		//alert("ùåìç èåôñ")
return true;
}

function checkMultiform(Fn){
	var FormName =  Fn
	var FormLen = document.getElementById(FormName).length
		for(i=0;i<FormLen;i++){
			var InputName = document.getElementById(FormName).elements[i].name;
			var InputId = document.getElementById(FormName).elements[i].id;
			var InputType = document.getElementById(FormName).elements[i].type;
			var InputTitle = document.getElementById(FormName).elements[i].title;
			if(InputName == null || InputType == null ){
				//alert('i dont knowe what is this...');
				}else{
				if(InputTitle == "must"){
					switch(InputType)
					{
					case "select-one":
						//alert("this is a select box" + " "+InputName + " - " + InputType + "-"  + InputTitle);
						select_choose=document.getElementById(FormName).document.getElementById(InputId).selectedIndex
						select_value=document.getElementById(FormName).document.getElementById(InputId)[select_choose].value
							if (select_value=="none")
							{
							alert('çåáä ìáçåø ôøéè îøùéîä æå')
							document.getElementById(FormName).document.getElementById(InputId).style.backgroundColor = 'red';
							document.getElementById(FormName).document.getElementById(InputId).focus();
							return false;
							}				
					break;
					case "text":
						//alert("this is a Text box" + " "+InputName + " - " + InputType+ "-"  + InputTitle);
						InputValue = document.getElementById(FormName).document.getElementById(InputId).value;
						if(InputValue.length == 0){
						alert('çåáä ìîìà ùãä æä');
						document.getElementById(FormName).document.getElementById(InputId).style.backgroundColor = 'red';
						document.getElementById(FormName).document.getElementById(InputId).focus();
						return false
						}
					
					break;
					case "button":
					// ignore this value at that point
						//alert("this is a Botton input" + " "+InputName + " - " + InputType+ "-"  + InputTitle);
					break;
					
					default:
								
						
					}
				}
			}
		
		}
		//alert("ùåìç èåôñ")
		this.document.getElementById(FormName).submit();
}


function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} 

function clearRedForm(Fn,In){
var FormName =  Fn
var InputName = In
document.getElementById(FormName).document.getElementById(InputName).style.backgroundColor = '';
}
//////////////////////////////// show / hide  function simple /////////////
function show_hide(msg_id){
msg_id.style.display=msg_id.style.display=="none" ? "" : "none"
}
//////////////////////////////// show / hide  function multipile /////////////			  
	lastMess=0;
	lastMess2=0;
	lastMess3=0;
	function clicked(nodeId)
{
	nodeName = "div_" + nodeId ;
	imgnodeName = "img_" + nodeId ;
//	document.getElementById(nodeName).style.display = (document.getElementById(nodeName).style.display=="none") ? "block" : "none" ;
	document.getElementById(imgnodeName).src = (document.getElementById(nodeName).style.display=="none") ? "imgsrc/expand.gif" : "imgsrc/collapse.gif" ;
}
	function clickHelp(nodeId)
{
	nodeName = "div_" + nodeId ;
	imgnodeName = "img_" + nodeId ;
	document.getElementById(nodeName).style.display = (document.getElementById(nodeName).style.display=="none") ? "block" : "none" ;
	document.getElementById(imgnodeName).src = (document.getElementById(nodeName).style.display=="none") ? "imgsrc/help.gif" : "imgsrc/help_o.gif" ;
}
function msg(num){
//clicked(num);
var forum = "";
var cCloseMess = "1";
		var msgID;
		msgID=document.getElementById("div_"+num);
		var imgID
		imgID=document.getElementById("img_"+num);
		var tdID
		tdID=document.getElementById("td_"+num);
		if((msgID.style.display=="none")&&(lastMess==0)){
			if(cCloseMess)
				lastMess=msgID;
				lastIMG = imgID;
				lastTD=tdID;
			msgID.style.display="block";
			
			}
		else if((msgID.style.display=="none")&&(lastMess!=0)){
			msgID.style.display="block";
			//imgID.src = "imgsrc/expand.gif"
			if((cCloseMess)&&(lastMess>"")&&(lastMess!=msgID)){
				lastIMG.src ="imgsrc/collapse.gif"
				lastMess.style.display="none";
				lastTD.style.backgroundColor='';
				lastMess=msgID;
				lastIMG=imgID;
				lastTD=tdID;
			}
		}
		else
			msgID.style.display="none";
			imgID.src = (msgID.style.display=='none') ? 'imgsrc/collapse.gif' : "imgsrc/expand.gif";
			tdID.style.backgroundColor = (msgID.style.display=='none') ? "" : "#FFFFFF";
			if(msgID.style.display!=='none'){
			
			//document.getElementById("tbl1").style.display = '';
			//document.getElementById("tbl2").style.display = 'none';
			
				//edit
			if(nottoolbar == false){
				document.getElementById("editsub").style.display = '';
				document.getElementById("newarea").style.display = '';
			}				
			document.formadd.ObjectID.value = num;
			
			}else{
			//document.getElementById("tbl2").style.display = 'none';
			//document.getElementById("tbl1").style.display = '';
				//edit
			if(nottoolbar == false){
				document.getElementById("editsub").style.display = 'none';
				document.getElementById("newarea").style.display = 'none';				
				document.getElementById("editarea").style.display = 'none';
				document.getElementById("newcompanent").style.display = 'none';
				document.getElementById("companentedit").style.display = 'none';
			}
			}
}
function msg2(num1,num2){
num = num1+""+num2;
var forum = "";
var cCloseMess = "1";
		var msgID;
		msgID = document.getElementById("div_"+num);
		var imgID
		imgID = document.getElementById("img_"+num);
		var tdID
		tdID = document.getElementById("td_"+num);
		if((msgID.style.display=="none")&&(lastMess2==0)){
			if(cCloseMess)
				lastMess2 = msgID;
				lastIMG2 = imgID;
				lastTD2=tdID;
			msgID.style.display="block";
			}
		else if((msgID.style.display=="none")&&(lastMess2!=0)){
			msgID.style.display="block";
			if((cCloseMess)&&(lastMess2>"")&&(lastMess2!=msgID)){
				lastIMG2.src ="imgsrc/collapse.gif"
				lastTD2.style.backgroundColor='';
				lastMess2.style.display="none";
				lastMess2=msgID;
				lastIMG2=imgID;
				lastTD2=tdID;
			}
		}
		else
			msgID.style.display="none";
			imgID.src = (msgID.style.display=='none') ? 'imgsrc/collapse.gif' : "imgsrc/expand.gif"
			tdID.style.backgroundColor = (msgID.style.display=='none') ? "" : "#FFFFFF";
			if(msgID.style.display!=='none'){
				if(nottoolbar == false){
				document.getElementById("editarea").style.display = '';
				document.getElementById("newcompanent").style.display = '';
				}
			document.formsec.ObjectID.value = num1;
			document.formsec.AreaID.value = num2;
			}else{
				if(nottoolbar == false){
				document.getElementById("editarea").style.display = 'none';
				document.getElementById("newcompanent").style.display = 'none';
				document.getElementById("companentedit").style.display = 'none';
				}
			}
}
lastComId = 0
function msg3(num1,num2,num3){
num = "tdcom_"+num3;
var cCloseMess = "1";
		var tdcomID
		tdcomID = document.getElementById(num);
		therange = tdcomID.innerHTML;
		
		//alert(tdcomID.innerHTML)
		if((tdcomID.style.backgroundColor=="")&&(lastComId==0)){
			if(cCloseMess)
				lastComId = tdcomID;
				tdcomID.style.backgroundColor="#FFFFFF";
				}
		else if((tdcomID.style.backgroundColor=="")&&(lastComId!=0)){
			tdcomID.style.backgroundColor="#FFFFFF";
			if((cCloseMess)&&(lastComId>"")&&(lastComId!=tdcomID)){
				lastComId.style.backgroundColor='';
				lastComId=tdcomID;
			}
		}
		else
		tdcomID.style.backgroundColor  = (tdcomID.style.backgroundColor == "") ? '#FFFFFF' : "";
			if(nottoolbar == false){
				document.getElementById("companentedit").style.display = (tdcomID.style.backgroundColor == "") ? 'none' : ""; 
				if (document.getElementById("companentedit").style.display ==''){
				document.form3.AreaID.value = num1;
				document.form3.ComponentID.value = num2;
				}
			}
		}
//iecompattest().clientWidth = top.window.iecompattest().clientWidth
function pick(page,idTo,FindName,Tbl,Just,w,h){
if(w==''){
w = 300;
}
if(h==''){
h=400;
}
//openwin = window.open('pick.asp?page='+page+'&idTo='+idTo+'&FindName='+FindName+'&Tbl='+Tbl+'&Just='+Just,"choose_item","resizable=yes,width="+w+",height="+h+",toolbar=no,scrollbars=yes")
openwin = showModalDialog('pick.php?page='+page+'&idTo='+idTo+'&FindName='+FindName+'&Tbl='+Tbl+'&Just='+Just, window, "dialogWidth:"+w+"px; dialogHeight:"+h+"px; status:no; help:no");
}
function pickValue(page,idTo,FindName,Tbl,Just,el,w,h){
if(w==''){
w = 300;
}
if(h==''){
h=400;
}
//openwin = window.open('pickValue.asp?page='+page+'&idTo='+idTo+'&FindName='+FindName+'&Tbl='+Tbl+'&Just='+Just+'&el='+el,"choose_item","resizable=yes,width="+w+",height="+h+",toolbar=no,scrollbars=yes")
openwin = showModalDialog('pickValue.php?page='+page+'&idTo='+idTo+'&FindName='+FindName+'&Tbl='+Tbl+'&Just='+Just+'&el='+el, window, "dialogWidth:"+w+"px; dialogHeight:"+h+"px; status:no; help:no");
}
function openDialog(page,parentpage,action,w,h){
if(w==''){
w = 300;
}
if(h==''){
h=400;
}

//openwin = window.open(page+'&parentpage='+parentpage+'&action='+action,"choose_item","resizable=yes,width="+w+",height="+h+",toolbar=no,scrollbars=yes")
openwin = showModalDialog(page+'&parentpage='+parentpage+'&action='+action, window, "dialogWidth:"+w+"px; dialogHeight:"+h+"px; status:no; help:no");
}

function openFrameDialog(page,w,h){
if(w==''){
w = 300;
}
if(h==''){
h=400;
}

//openwin = window.open(page+'&parentpage='+parentpage+'&action='+action,"choose_item","resizable=yes,width="+w+",height="+h+",toolbar=no,scrollbars=yes")
openwin = showModalDialog('dialog.php?ModalContent='+page, window, "dialogWidth:"+w+"px; dialogHeight:"+h+"px; status:no; help:no");
}

function FromIdToVal(sel,inputTxt,newTxt){
if(sel== 0){
}else{
document.getElementById(inputTxt).value = newTxt
}


//document.formname.id.selectedIndex
//document.getElementById(inputTxt).value = document.formname.id[pick_choose].text
}
//////////////////////// print issue ///////////////////////////////////////////////////
function takeShot(){
  if(event.keyCode!=112){return;}
  var w=document.body.scrollLeft+document.body.offsetWidth;
  var h=document.body.scrollTop+document.body.offsetHeight;
  var t=-document.body.scrollTop;
  var l=-document.body.scrollLeft;

  var win=window.open("","","left=0,top=0,width="+w+",height=" +h+ ",status=no,scroll=no,menubar=yes, toolbar=no,location=no,directories=no,resizable=no");
  win.document.open();
  str = document.getElementById("printable").innerHTML ;
  //document.body.innerHTML
  win.document.write("<div style='overflow:hidden;width:"+w+"px;height:" +h+ "px;position:absolute;top:"+t+";left:"+l+";' dir=rtl>"+str+"<p align=center><input id=printpage  type=button value=print style='display:' onclick='javascript:window.print()'></p></div>");
  win.document.close();
  win.document.body.style.margin=0;
}
//document.onkeypress=takeShot;


//////////////////////// print End //////////////////////////////////////////////////////


function BreakItUp()
{
  //Set the limit for field size.
  var FormLimit = 102399

  //Get the value of the large input object.
  var TempVar = new String
  TempVar = document.form1.preview.value

  //If the length of the object is greater than the limit, break it
  //into multiple objects.
  if (TempVar.length > FormLimit)
  {
    document.form1.preview.value = TempVar.substr(0, FormLimit)
    TempVar = TempVar.substr(FormLimit)

    while (TempVar.length > 0)
    {
      var objTEXTAREA = document.createElement("TEXTAREA")
      objTEXTAREA.name = "preview"
      objTEXTAREA.value = TempVar.substr(0, FormLimit)
      document.form1.appendChild(objTEXTAREA)
      
      TempVar = TempVar.substr(FormLimit)
    }
  }
}
//////////////////////////////////// tab function /////////////////////////

<!--
//=======================================================
     //detect browser settings for showing and hiding DIVs
     isNS4 = (document.layers) ? true : false;
     isIE4 = (document.all && !document.getElementById) ? true : false;
     isIE5 = (document.all && document.getElementById) ? true : false;
     isNS6 = (!document.all && document.getElementById) ? true : false;
//=======================================================

function switchDiv(strBottonName,strDivName,bolVisible){
 //identify the element based on browser type
 if (isNS4) {
   objElement = document.layers[strDivName];
   objElementBotton = document.layers[strBottonName];
 } else if (isIE4) {
   objElement = document.all[strDivName].style;
   objElementBotton = document.all[strBottonName].style;
 } else if (isIE5 || isNS6) {
   objElement = document.getElementById(strDivName).style;
   objElementBotton = document.getElementById(strBottonName).style;
 }
 
 if(isNS4){
     if(!bolVisible) {
       objElement.visibility ="hidden"
	   objElementBotton.borderTop= "1px buttonhighlight outset";
     } else {
       objElement.visibility ="visible"
	   objElementBotton.borderTop= "1px buttonhighlight inset";
     }     
 }else if(isIE4){
     if(!bolVisible) {
       objElement.visibility = "hidden";
	   objElementBotton.borderTop= "1px buttonhighlight outset";
     } else {
       objElement.visibility = "visible";
	   objElementBotton.borderTop= "1px buttonhighlight inset";
     }
 } else if (isIE5 || isNS6) {
      if(!bolVisible){
         objElement.display = "none";
		 //objElementBotton.borderTop= "1px buttonhighlight inset";
		 //objElementBotton.borderRight= "1px buttonhighlight inset";
		 //objElementBotton.borderLeft= "1px buttonhighlight inset";
		 //objElementBotton.borderBottom= "1px buttonhighlight inset";
		 //objElementBotton.backgroundColor = ""
		 objElementBotton.backgroundImage = "";
      } else {
        objElement.display = "";
		 //objElementBotton.borderTop= "1px buttonhighlight outset";
		 //objElementBotton.borderRight= "1px buttonhighlight outset";
		 //objElementBotton.borderLeft= "1px buttonhighlight outset";
		 //objElementBotton.borderBottom= "";
		 //objElementBotton.backgroundColor = "#FFFFFF";
		 objElementBotton.backgroundImage='URL(imgsrc/tabBgSel.gif)';
        }
      }
}

function toggleTabs(intVisible,toggleNum){

     for(i=1;i<toggleNum+1;i++){
          if(i==intVisible){
               switchDiv("BottonTab" +i,"divTab" +i,true);
          }else{
               switchDiv("BottonTab" +i,"divTab" +i,false);
          }
     }
}
var togg = 1;
function nexttogg(){
	if(togg<5){
		togg++;
		toggleTabs(togg)
	}
}
function pretoggle(){
	if(togg>=2){
		togg-- ;
		toggleTabs(togg)
	}
}
//-->
/////////////////////////////////// end tab function //////////////////////
/////////////////////////////////// fast edit 2 feilds tables //////////////
function PlusButtonActivate(fldIdName,fldTextName,tblName,wintext){
document.PlusButton.fldIdName.value = fldIdName;
document.PlusButton.fldTextName.value = fldTextName;
document.PlusButton.tblName.value = tblName;
document.PlusButton.submit()
loadHiddenWindow(450,350,wintext)
}
/////////////////////////////////// End fast edit 2 feilds tables //////////////
function chk(){
str = document.form1.filetoc.value ;
	if(str.length!==0){
		StrStart = str.lastIndexOf("\\")
		StrEnd = str.length
		file_name = str.substring(StrStart+1,StrEnd)
		var heb = new RegExp("[à,á,â,ã,ä,å,æ,ç,è,é,ë,ê,ì,î,í,ð,ï,ñ,ò,ô,ó,ö,õ,÷,ø,ù,ú]","g")
			if(heb.test(file_name) == false){
			checkform('form1');
			}else{
			alert('àéï äøùàä ìäòìåú ÷áöéí áòáøéú ìùøú, àðà ùðä àú ùí ä÷åáõ\n <\"'+file_name+'\"> \n ìàðâìéú åðñä ìäòìåúå ùðéú')
			return false
			}
	}else{
	checkform('form1');
	}
}
function noheb(dateObj) {
  if(event.keyCode>1487 && event.keyCode<1515) return false;
}
function trimnoheb(dateObj) {
  if(event.keyCode>1487 && event.keyCode<1515 ||  event.keyCode==32) return false;
}
function noletter(dateObj) {
  if(event.keyCode>57 || event.keyCode<48) return false;
}
function confirmdel(confirmstr,reffer){
if (confirm(confirmstr)){document.location.replace(reffer)}
}
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}