<!--
function set_flag() {} //to disable js errors with image menu
function e() {}

function fixSize() {
	if (document.all) {
		window.parent.document.all['include'].height= window.document.body.scrollHeight;
	}
}

function testTime (date) {
	var s;
	var t;
	var MinMilli = 1000 *60;
	var HrMilli = MinMilli * 60;
	var DyMilli = HrMilli * 24
	t = Date.parse(date);
	s = Math.round(Math.abs(t/DyMilli));
	return(s);
}
function IsNumber(n) {
	var str=new String(n);
	return ( (str.search(/[^0-9.]/)==-1) && !isNaN(parseFloat(str)) );
}
function set_dealteam(newdtObj) {
	if (newdtObj && newdtObj.Names != 'Cancel') {
		document.forms[0].deal_team.value=newdtObj.Names;
		document.forms[0].deal_teamIDs.value=newdtObj.IDs;
		document.forms[0].responsibleID.value=newdtObj.Responsible;
		//	alert("Names:"+newdtObj.Names+"\nIDs:"+newdtObj.IDs+"\nResponsible:"+newdtObj.Responsible);				
	}
}
function blank(url){ // open links in new window from modal with iframe
	window.top.open(url);
}

//////////////// <a href="#" onclick="removeSelected('eventlist','objectID','event','delete');return false;">
function removeSelected(formname, elmname, objname, action) {
	var oForm=document.forms[formname];
	var oObjects;
	if (document.all) {
		oObjects=oForm.elements(elmname);
	}else {
		oObjects=oForm.elements[elmname];
	}
	var AllOK=false;
	var num=0;
	var i;
	if (oObjects) {
		if (oObjects.checked) {
			num=1;
			AllOK=true;
		} else {
			for (i=0;i<oObjects.length;i++) {
				if (oObjects[i].checked) {
					AllOK=true;
					num++;
				}
			}
		}
	} else {
		alert('There is no '+ objname + '(s) available to select.');
		return false;
	}
	if (AllOK) {
		var msgStr; // for request a hard copy in investor portal
		if(action=='request a hard copy')
			msgStr = 'The system will send e-mail request for hard copies of '+num+' document(s). Would you like to proceed?';
		else
			msgStr = 'Are you sure you want to ' + action +' '+num+' '+objname+'(s)?';
		if (confirm(msgStr)) {
			if ((objname== "contact" || objname== "company") && action == "delete") {
				oForm.elements['a'].value='del';
			}		
			oForm.submit();
			return false;
		}
	} else
		if(action=='request a hard copy')
			alert('Please select at least one '+ objname + '.');
		else
			alert('Please select at least one '+ objname + ' to '+action+'.');
	return false;
}
////////////////
function removeItem(loc,objname,action) {
	if (confirm('Are you sure you want to '+action+' this '+objname+'?')) {
		window.location = loc;
		return true;
	}
	return false;
}
function clearFrm() {
	if (confirm('Are you sure you want to clear all data in the form?'))
		window.location=window.location;
}
function checkValidDate(dt,msg) {
	if (msg == "") msg = "date";
	if (dt.value != 0) {
		var re=/^((0?\d)|(1[0-2]))\/(([0-2]?\d)|(3[0-1]))(\/(\d{1,4}))?$/;
		if (dt.value.search(re)==-1) {
			alert("Please enter a valid "+msg+".");
			dt.value="";
			dt.focus();
			return false;
		}
		return true;
	}
	return true;
}
function checkDate(dt,msg) {
	if (msg == "") msg = "date";
	if (dt.value == 0) {
		alert("Please enter "+msg+".")
	    dt.focus();
	    return false;
	} else {
		var re=/^((0?\d)|(1[0-2]))\/(([0-2]?\d)|(3[0-1]))(\/(\d{1,4}))?$/;
		if (dt.value.search(re)==-1) {
			alert("Please enter a valid "+msg+".");
			dt.value="";
			dt.focus();
			return false;
		}
		return true;
	}
	return false;
}
function checkEmail(eml) {
	if (eml.value == 0) {
		alert("Please enter e-mail address.")
	    eml.focus();
	    return false;
	} else {
		var re=/^['%\w\.\+-]*@[\w\+-]+(\.[\w\+-]+)*\.[\w\+-]+$/;
		if (eml.value.search(re)==-1) {
			alert("Please enter a valid e-mail address.");
			eml.focus();
			return false;
		}
		return true;
	}
	return false;
}

// from document_edit
function AttachReminder() {
	frm = document.forms[0];
	if (fCheck(frm)) {
		if (frm.elements['attachment'].value != 0){
			if (confirm('You have selected a file that hasn\'t been attached yet.\n\rDo you want to attach it?')) {
				return false;
			}
		}
		if ((frm.elements['URL'].value != 'http://') && (frm.elements['URL'].value != 0)){
			if (confirm('You have entered a link that hasn\'t been attached yet.\n\rDo you want to attach it?')) {
				return false;
			}
		}
		return true;
    }
    return false;
}

function AddAttachment(actstring) {
	form = document.forms[0];
	if (form.elements['attachment'].value == 0) {
		alert('Please select file.');
		return false;
	}
	else {
		if (fCheck(form)) {
			form.action = actstring;
			form.submit();
			return true;
		}
	}
	return false;
}
function DeleteAttachment(actstring) {
	if (confirm('Are you sure you want to delete this file?')) {
		form = document.forms[0];
		form.action = actstring;
		form.submit();
		//return true;
	}
	//return false;
}
function AddLink(actstring) {
	form = document.forms[0];
	if (form.elements['URL'].value == 0) {
		alert('Please enter link.');
		return false;
	}
	else {
		if (fCheck(form)) {
			form.action = actstring;
			form.submit();
			return true;
		}
	}
	return false;
}
function DeleteLink(actstring) {
	if (confirm('Are you sure you want to delete this link?')) {
		form = document.forms[0];
		form.action = actstring;
		form.submit();
		return true;
	}
	return false;
}
//------------------


function hideall() {
	MM_showHideLayers('general','','hide','companies','','hide','contacts','','hide','notes','','hide','documents','','hide','diligence','','hide','products','','hide','referrals','','hide','events','','hide','publish','','hide','pfrequests','','hide','irequests','','hide','requests','','hide','rating','','hide','funds','','hide','my','','hide','hpage','','hide','prefs','','hide','portfolio','','hide','investors','','hide');
}

function print_pager(){
	if (document.all) { 
		print();
	}
	else { 
		window.print();
	}
}

function modalwin(url, param, wid, hei, lft, tp) {
	return window.showModalDialog(url,param,"dialogWidth:"+wid+"px;dialogHeight:"+hei+"px;dialogLeft:"+lft+"px;dialogTop:"+tp+"px;status:no;");
}
/*
function modup(url, param, wid, hei, lft, tp) {
	var bwinmod ; 
	if (bwinmod = window.showModalDialog(url,param,"dialogWidth:"+wid+"px;dialogHeight:"+hei+"px;dialogLeft:"+lft+"px;dialogTop:"+tp+"px;status:no;")
		if (bwinmod) {
			window.location.reload();
		}
	return bwinmod;
}*/
function modup(url, param, wid, hei, lft, tp) {
	if (document.all) {
		var bwinmod ;
		bwinmod = window.showModalDialog(url,param,"dialogWidth:"+wid+"px;dialogHeight:"+hei+"px;dialogLeft:"+lft+"px;dialogTop:"+tp+"px;status:no;");
		if (bwinmod) {
			var url=new String(window.location.href);
			var re=/changed=[^&?]*/;
			if (url.indexOf('changed=')>-1) {
				url=url.replace(re,'changed=1');
			} else {
				url=url + '&changed=1';
			}
			window.location=url;	}
		return bwinmod;
	}
	else {
		id = Math.random();
		id = id.toString();
		re_d = /\.|,/g;
		id = id.replace(re_d,'');
		wname = 'NetageVC'+id;
		var newWindow;
		newWindow = window.open(url, wname, 'toolbar=no,menubar=no,scrollbars=yes,resizable=no,status=no,location=no,height='+hei+',width='+wid+',screenX='+lft+',screenY='+tp);
//		window.open(url, wname, "toolbar=no,menubar=no,scrollbars=yes,resizable=no,status=no,location=no,height="+hei+",width="+wid+",screenX="+lft+",screenY="+tp+",dependent=yes");
//////////////////////////////// cyrilic :)
		if (document.layers) newWindow.document.open(charset=windows-1251);
////////////////////////////////
		newWindow.focus();
	}
}

function modup_tab(url, param, wid, hei, lft, tp, tab, pg) {
	if (document.all) {
		var bwinmod ; 
		if (bwinmod = window.showModalDialog(url,param,"dialogWidth:"+wid+"px;dialogHeight:"+hei+"px;dialogLeft:"+lft+"px;dialogTop:"+tp+"px;status:no;")){
			var url=new String(window.location.href);
			var re=/tab=[^&?]*/;
			if (url.indexOf('tab=')>-1) {
				url=url.replace(re,'tab='+tab);
			} else {
				url=url + '&tab='+ tab;
			}
			if (pg > 0) {
				re = /page=[^&?]*/;
				if (url.indexOf('page=')>-1) {
					url=url.replace(re,'page='+pg);
				} else {
					url=url + '&page='+ pg;
				}
			}
			re=/changed=[^&?]*/;
			if (url.indexOf('changed=')>-1) {
				url=url.replace(re,'changed=1');
			} else {
				url=url + '&changed=1';
			}
			window.location=url;
		}
		return bwinmod;
	}
	else {
		id = Math.random();
		id = id.toString();
		re_d = /\.|,/g;
		id = id.replace(re_d,'');
		wname = 'NetageVC'+id;
		newWindow = window.open(url, wname, 'toolbar=no,menubar=no,scrollbars=yes,resizable=no,status=no,location=no,height='+hei+',width='+wid+',screenX='+lft+',screenY='+tp);
//		window.open(url, wname, "toolbar=no,menubar=no,scrollbars=yes,resizable=no,status=no,location=no,height="+hei+",width="+wid+",screenX="+lft+",screenY="+tp+",dependent=yes");
//////////////////////////////// cyrilic :)
		if (document.layers) newWindow.document.open(charset=windows-1251);
////////////////////////////////
		newWindow.focus();
	}
}

function fileview(url) {
	if (window.showModalDialog(url,'',"dialogWidth:200px;dialogHeight:600px;status:no;resizable:yes;unadorned:yes")){
		window.location.reload();
	}
}

function popup(url, winname, wid, hei, lft, tp) {
//	if (winname == "") {
		id = Math.random();
		id = id.toString();
		re_d = /\.|,/g;
		id = id.replace(re_d,'');
		wname = winname+'NetageVC'+id;
//	}
	if (document.all) {
		newWindow = window.open(url, wname, "toolbar=no,menubar=no,scrollbars=yes,resizable=no,status=no,location=no,height="+hei+",width="+wid+",left="+lft+",top="+tp+",dependent=yes");
	}
	if (document.layers) {
		newWindow = window.open(url, wname, "toolbar=no,menubar=no,scrollbars=yes,resizable=no,status=no,location=no,height="+hei+",width="+wid+",screenX="+lft+",screenY="+tp+"");
//////////////////////////////// cyrilic :)
		newWindow.document.open(charset=windows-1251);
////////////////////////////////
	}
	newWindow.focus();
}
/* used for demo only until now
function modupnn (url, param, wid, hei, lft, tp) {
	if (document.layers) {
		modup(url, param, wid, hei, lft, tp);
	}
}
*/
///////////////////////// checkbox selector
function SelectAll(fname) {
	for (var i=0;i<document.forms[fname].elements.length;i++) {
		var e = document.forms[fname].elements[i];
		if ((e.name != 'selector') && (e.type=='checkbox'))
			e.checked = document.forms[fname].selector.checked;
	}
}

function CheckSelected(fname) {
	var TotalBoxes = 0;
	var TotalSelected = 0;
	for (var i=0;i<document.forms[fname].elements.length;i++) {
		var e = document.forms[fname].elements[i];
		if ((e.name != 'selector') && (e.type=='checkbox')) {
			TotalBoxes++;
			if (e.checked) {
				TotalSelected++;
			}
		}
	}
	if (TotalBoxes==TotalSelected) {
		document.forms[fname].selector.checked=true;
	}
	else {
		document.forms[fname].selector.checked=false;
	}
}
///////////////////////// checkbox selector

///////////////////////// paging
	function gotoPage(intNumber,strLink, iMaxPage){
		var minPage=1;
		var maxPage=iMaxPage;
		
		
		if ((intNumber<= maxPage) && (intNumber >= minPage)){
			//window.location.replace(strLink+ '&page='+intNumber);
			window.location = strLink+ '&page='+intNumber;
		}
	}
///////////////////////// paging

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_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_showHideLayers() { //v3.0
  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 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];}}
}

function MM_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v3.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    if ((nbArr = document[grpName]) != null)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = args[i+1];
      nbArr[nbArr.length] = img;
  } }
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

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);


//Acorn Campus Only
function helpwin(URL){	
	var sName,sWidth,sHeight,sXpos,sYpos,sScroll,sResize;
	sName = 'Help';
	sWidth = '330';
	sHeight = screen.availHeight - 250;
//	sXpos = '20';
//	sYpos = '40';
	sXpos = '3000';
	sYpos = '3000';
	sScroll = 'yes';
	sResize = 'yes';
	
	//handled agruments if they are left blank
	if (helpwin.arguments.length > 1){
		sName = helpwin.arguments[1];
		sWidth = helpwin.arguments[2];
		sHeight = helpwin.arguments[3];
		sXpos = helpwin.arguments[4];
		sYpos = helpwin.arguments[5];
		sScroll = helpwin.arguments[6];
		sResize = helpwin.arguments[7];
	}

	var winBars = 'directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no';
	var winOptions = 'scrollbars='+ sScroll + ',resizable='+ sResize;
	var winSize = 'height=' + sHeight + ',width=' + sWidth;
	var winPosition = 'left=' + sXpos + ',top=' + sYpos;
	var winFeatures = winBars + ',' + winOptions + ',' + winSize + ',' + winPosition;
				
	newWindow = window.open(URL,sName,winFeatures);
	pixleft = screen.availWidth-340;
	pixtop = 140;
	newWindow.moveTo(pixleft, pixtop);
	newWindow.focus();
}
//-->