function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


var NS4 = (document.layers) ? true : false;
var IE4 = (document.all) ? true : false;
var siteMapRun = false;



if (NS4) 
{	document.captureEvents(Event.CLICK);	}
document.onclick = MOUSECLICK;


function MOUSECLICK(e)
{
if(typeof(siteMap)!='undefined')
{
if (NS4)
{
var retval = routeEvent(e);
}
if(siteMap.goNOgo)
{
	var x = (NS4) ? e.pageX : event.x+document.body.scrollLeft;
	var y = (NS4) ? e.pageY : event.y+document.body.scrollTop;

	siteMap.turnMapOn(y);
	siteMap.goNOgo = false;
	siteMap.showMap != siteMap.showMap;
	return false;

}}}


onError=null


function MM_showHideLayers() { //v3.0

	if(document.all){
	var aDivs = document.body.all.tags("DIV");
	for (i=0;i<aDivs.length;i++) 
			{
			eval('document.all["'+aDivs[i].id+'"].style.visibility = "hidden"');
			}	
	}
	else
	{
	var aDivs = document.layers;
	for (i=0;i<aDivs.length;i++) 
			{
			eval('document.layers["'+aDivs[i].id+'"].visibility = "hidden"');
			}

	}


  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}


function gotoURL(){
document.URL = document.forms['form1'].membersList.value;

}

function neoArea(objName,txtName,btnName,frmName,editH,editW)
{
this.txtName = txtName;
this.objName = objName;
this.editH = editH;
this.editW = editW;
if(btnName!='')	this.buttons = document.all[btnName].style;
this.varDo = true;
this.frmName = frmName;
this.doIt = doIt;
}


function sitemapconstr(frontLayer,bg)
{
if (NS4) 
{	
this.thediv = eval('document.layers["'+frontLayer+'"]');	
this.background = document.layers[bg]	
}
else if (IE4) {	
this.thediv = eval('document.all["'+frontLayer+'"].style');
this.background = eval('document.all["'+bg+'"].style');
}
this.name = 'siteMap';
this.thediv.ypos = 0;
this.turnMapOn = turnMapOn;
this.showMap = false;
this.goNOgo = false;
this.slideup = slideup;
this.slided = slided;
this.clipTop = 0;
this.clipBtm = 150;
this.runTop = 0;
this.moveLayer = false;


}
function turnMapOn(y){
visibleStr = this.showMap ? 'hidden' : 'visible';
this.clipTop = 0;
this.clipBtm = 150;
this.thediv.clip.top = this.clipTop;
this.thediv.clip.bottom = this.clipBtm;
this.thediv.clip = 'rect('+this.clipTop+',244,'+this.clipBtm+',0)';


this.thediv.ypos = y - 280;
this.thediv.top = this.thediv.ypos;
this.background.ypos = y - 330;
this.background.top = this.background.ypos;

this.runTop = y - 420;
this.runBtm = this.thediv.ypos;

this.background.visibility = visibleStr;
this.thediv.visibility = visibleStr;


this.showMap = !this.showMap;
}




function slideup(){
if(this.moveLayer){

	if (this.thediv.ypos > this.runTop) 
		{
		this.thediv.ypos -= 5;
		this.thediv.top = this.thediv.ypos;
		this.thediv.clip.top += 5;
		this.thediv.clip.bottom += 5;
		if(IE4)	
			{
			this.clipTop +=5;	
			this.clipBtm +=5;	
			this.thediv.clip = 'rect('+this.clipTop+',244,'+this.clipBtm+',0)';
			}
		setTimeout(this.name + ".slideup()",1)
		}
}	

}

function slided() {

if(this.moveLayer){
	if (this.thediv.ypos < this.runBtm) 
		{

		this.thediv.ypos += 5
		this.thediv.top = this.thediv.ypos
		this.thediv.clip.top -= 5;
		this.thediv.clip.bottom -= 5;
		if(IE4)	
			{
			this.clipTop -=5;	
			this.clipBtm -=5;	
			this.thediv.clip = 'rect('+this.clipTop+',244,'+this.clipBtm+',0)';
			}
		setTimeout(this.name + ".slided()",1)
		}
}
}


function doIt(x){
if(x==1){
var allon = eval('document.all[\''+this.txtName+'\']');
showRng = allon.createTextRange();
showTxt = showRng.text;

while (showTxt.search('\'')!='-1')	showTxt = showTxt.replace('\'','&#146;');
while (showTxt.search(/\r\n\r\n/)!='-1')	showTxt = showTxt.replace(/\r\n\r\n/,'<p>');
while (showTxt.search(/\r\n/)!='-1')	showTxt = showTxt.replace(/\r\n/,'<br>');

theStr = 'document.all[\''+this.txtName+'\'].outerHTML = \'<div id="'+this.txtName+'" style="position:static; width:'+this.editW+'px; height:'+(this.editH-30)+'px; z-index:1; overflow: auto; left: 149px; border:1px solid black;background-color:white;" class="neoEditor">' + showTxt + '</div>\'';
eval(theStr);
eval(this.objName+'.doIt(4)');
}
else if(x==2)
{
eval('theStr = document.all[\''+this.txtName+'\'].innerHTML');

while (theStr.search(/\r\n/)!='-1')	theStr = theStr.replace(/\r\n/,'');
while (theStr.search(/<P>/)!='-1')	{theStr = theStr.replace(/<P>/,"\\n " + "\\n ");}
while (theStr.search(/<\/P>/)!='-1'){theStr = theStr.replace(/<\/P>/," ");}
while (theStr.search(/<BR>/)!='-1')	{theStr = theStr.replace(/<BR>/,"\\n ");}

theStr = 'document.all[\''+this.txtName+'\'].outerHTML = \'<textarea rows=\"10\" id=\"'+this.txtName+'\" name=\"'+this.frmName+'\" style=\"font-family:arial;width:'+this.editW+'px;height:'+this.editH+'px;\" class=\"adminForm\">' + theStr + '</textarea>\'';
eval(theStr);
eval(this.objName+'.doIt(4)');
}
else if(x==3)
{
selectTxt = document.selection;
selectRng = selectTxt.createRange();
var bsucc = selectRng.execCommand('bold');
//var bsucc = selectRng.execCommand('createLink',true);
}
else if(x==4)
{
testVar = this.varDo ? 30 : 0;
this.buttons.height = testVar;
this.varDo = !this.varDo
}
else if(x==5)
{
selectTxt = document.selection;
selectRng = selectTxt.createRange();
var bsucc = selectRng.execCommand('italic');
}
else if(x==6)
{
selectTxt = document.selection;
selectRng = selectTxt.createRange();
var bsucc = selectRng.execCommand('createLink',true);
}
}

function submitUpdateForm(doStr)
	{
		if(typeof(first)!='undefined'){	if(!first.varDo) first.doIt(2);	}
		if(typeof(second)!='undefined'){	if(!second.varDo) second.doIt(2); }
		if(typeof(third)!='undefined'){	if(!third.varDo) third.doIt(2); }
	}


function MM_validateForm() { //v3.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=args[i+1]; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (val!=''+num) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') 
		{
		if(nm=='market_id') errors += '* A Yozma Investment Market must be chosen from the list.\n';
		 else { errors += '* '+nm+' must be entered.\n'; 	
		
//		styleObj = eval('document.all.'+args[i]+'.style'); 
//		styleObj.borderBottomWidth = 25;
//		styleObj.borderBottomColor = 'red';
//		styleObj.backgroundColor = 'red';
		}
		}		
		}

		
  } 
  if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');

 }


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);



