function popupWindow(URL, w, h) {
 
	window.name = "main_window";
	// open the popup window
	var popupURL = URL;
	var popup = window.open(popupURL,"PopUp_FRM",'controlbox=no,toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=2,resizable=0,width='+w+',height='+h);
	popup.focus();
	// set the opener if it's not already set.  it's set automatically
	// in netscape 3.0+ and ie 3.0+.
	if( navigator.appName.substring(0,8) == "Netscape" )
	{
		popup.location = popupURL;
		popup.opener = self;
		popup.focus();
	}
}

function LShow(layerName)
{
var layerRef = "null";
var styleSwitch = "null";

if (navigator.appName=="Netscape")
  {
  layerRef="document.layers";
  styleSwitch="";
  }
else
  {
  layerRef="document.all";
  styleSwitch=".style";
  }

var lState = eval(layerRef + '["' + layerName + '"]' + styleSwitch + '.display');

if (lState == 'block')
  {
  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display = "none"');
  document [layerName+'Img'].src = '/images/elements/+.gif';
  }
  else
  {
  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display = "block"');
  document [layerName+'Img'].src = '/images/elements/-.gif';
  }
}



function initmenu()
{

 if (navigator.appName=="Netscape"){
  layerRef="document.layers";
  styleSwitch="";
 }
 else {
  layerRef="document.all";
  styleSwitch=".style";
 }
load_check=1;
}




function ci(imge,i){if(i==1){ref='#327AA4'}if(i==2){ref='#385190'};im='m'+imge;if(document.layers){document.im.bgColor=ref}else{document.all[im].style.backgroundColor=ref}}
function rp(init){if(init==true)with(navigator){if((appName=="Netscape")&&(parseInt(appVersion)==4)){document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;onresize=rp;}}else if(innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)location.reload();} //reloads the window if Nav4 resized
rp(true);
function fo(n,d){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=fo(n,d.layers[i].document);if(!x && document.getElementById)x=document.getElementById(n);return x;} //v4.0
function SHL(){var i,p,v,obj,a=SHL.arguments;for (i=0; i<(a.length-2); i+=3) if ((obj=fo(a[i]))!=null) { v=a[i+2];if(obj.style){obj=obj.style;v=(v=='show')?'visible':(v='hide')?'hidden':v;}obj.visibility=v;}}  //v3.0
function sr() {var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;} //v3.0
function sw_() {var i,j=0,x,a=sw.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=fo(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}} //v3.0
function sw() {}
var to = new Array();var act = new Array('','LL(1)','LL(2)','LL(3)','LL(4)','LL(5)','LL(6)','LL(7,71,72,73,74)','LL(8)','LL(9)','LL(10)','LL(11)','LL(12)');
Timeout=1000;
function LV(){a=LV.arguments;for(i=0;i<a.length;i++){clearTimeout(to[a[i]]);}} // delay #
function LU(){a=LU.arguments;for(i=0;i<a.length;i++){to[a[i]]=setTimeout(act[a[i]],Timeout);}} // delay #
function LL(){a=LL.arguments;for(i=0;i<a.length;i++){if(a[i]<0){actn='show';a[i]*=-1;}else{actn='hide';}SHL('Lmenu'+a[i],'',actn);}} // layer #
function LH(){a=LH.arguments;for(i=0;i<a.length;i++)SHL('Lmenu'+a[i],'','hide');} // layer #
function HA(){var i,j,pr;var b=new Array(1,2,3,4,5,6,7,8,9,10,11,12,13,14);var a=HA.arguments;for(j=0;j<b.length;j++){pr=false;if(a.length>0){for(i=0;i<a.length;i++){if(b[j]==a[i]){pr=true;}}}if (pr==false){LL(b[j]);}}LL();}

function positionmenu()
{
layerpos('Lmenu1', 396);
layerpos('Lmenu2', 538);
layerpos('Lmenu3', 680);
}




function positionmenuru()
{
layerpos('Lmenu1', 396);
layerpos('Lmenu2', 538);
layerpos('Lmenu3', 680);
}




function layerpos(layerName, LayerLeftPos)
{
var lLeftPos;

if(navigator.appName=='Netscape')
	{
		var bWidth = document.width;
	}
	else
	{
		var bWidth = document.body.clientWidth;
	}
if(bWidth < 900)
	{
		bWidth = 900;
	}

lLeftPos=Math.abs(LayerLeftPos + (bWidth-900)/2);

var xobj = document.getElementById(layerName)
xobj.style.left=lLeftPos;
}



function fncAddPro()
{
	document.formCV.ProCount.value = Number(document.formCV.ProCount.value) + 1;
	oTRProCopy = oTRPro0.cloneNode(true);
	oTRPro0.parentNode.appendChild(oTRProCopy);
	oTRProCopy.id = 'oTRPro' + document.formCV.ProCount.value;

	oTRProCopy.childNodes[0].childNodes[0].name = 'ProDateStart' + document.formCV.ProCount.value;
	oTRProCopy.childNodes[0].childNodes[0].value = document.formCV.ProMonthStart.item(document.formCV.ProMonthStart.selectedIndex).value + '/' +
		document.formCV.ProYearStart.item(document.formCV.ProYearStart.selectedIndex).value;
	oTRProCopy.childNodes[0].childNodes[1].name = 'ProDateEnd' + document.formCV.ProCount.value;
	oTRProCopy.childNodes[0].childNodes[1].value = document.formCV.ProMonthEnd.item(document.formCV.ProMonthEnd.selectedIndex).value + '/' +
		document.formCV.ProYearEnd.item(document.formCV.ProYearEnd.selectedIndex).value;

	var oDate = document.createElement("DIV");
	oTRProCopy.childNodes[0].appendChild(oDate);
	oDate.innerHTML = document.formCV.ProMonthStart.item(document.formCV.ProMonthStart.selectedIndex).value + '/' +
		document.formCV.ProYearStart.item(document.formCV.ProYearStart.selectedIndex).value + ' - ' +
		document.formCV.ProMonthEnd.item(document.formCV.ProMonthEnd.selectedIndex).value + '/' +
		document.formCV.ProYearEnd.item(document.formCV.ProYearEnd.selectedIndex).value;

	oTRProCopy.childNodes[1].childNodes[0].name = 'Project' + document.formCV.ProCount.value;
	oTRProCopy.childNodes[1].childNodes[0].value = document.formCV.Project.value;
	oTRProCopy.childNodes[1].childNodes[1].name = 'Location' + document.formCV.ProCount.value;
	oTRProCopy.childNodes[1].childNodes[1].value = document.formCV.Location.value;

	var oDate = document.createElement("DIV");
	oTRProCopy.childNodes[1].appendChild(oDate);
	oDate.innerHTML = document.formCV.Project.value + "<br>" + document.formCV.Location.value;
	
	oTRProCopy.childNodes[2].childNodes[0].name = 'ProObjects' + document.formCV.ProCount.value;
	oTRProCopy.childNodes[2].childNodes[0].value = document.formCV.ProObjects.value;

	var oDate = document.createElement("DIV");
	oTRProCopy.childNodes[2].appendChild(oDate);
	var rep = document.formCV.ProObjects.value;
	while (rep.search('\n') > 0) rep = rep.replace('\n', '<br>');
	oDate.innerHTML = rep;
	
	document.formCV.ProMonthStart.selectedIndex = 0;
	document.formCV.ProYearStart.selectedIndex = 0;
	document.formCV.ProMonthEnd.selectedIndex = 0;
	document.formCV.ProYearEnd.selectedIndex = 0;
	document.formCV.Project.value = "";
	document.formCV.Location.value = "";
	document.formCV.ProObjects.value = "";
}
