<!--
theTime = 3000;
var desktop; var theRP = "";
function openWin(url,w,h) {
	if (desktop && desktop.location) desktop.close();
	desktop = window.open(url, "_blank","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width="+w+",height="+h);
}

function addNewOptions(frmName, fldName, txtOption, intValue) {
	document[frmName][fldName].options[document[frmName][fldName].length] = new Option(txtOption,intValue, true, true);
}

function editOption(frmName, fldName, txtOption, intValue) {
	document[frmName][fldName].options[intValue].text = "something";
}

function addProductSelections(pList) {
	document.prospect.ProductIDs.value="";
	document.prospect.ProductIDs.value=pList;
}
function openWindow(thelink)
{
	window.open(thelink, 'PrintablePage','width=600,height=400,toolbar=0,menubar=1,scrollbars=1');
}
function checkDate(day,month,year,formname,dayfield, monthfield, yearfield, allowfuture) {
	var daysinmonth = 31;
	var formDay = eval(day);
	var formMonth = eval(month);
	var formYear = eval(year);

	if ((formMonth == 4) || (formMonth == 6) || (formMonth == 9) || (formMonth == 11)) {
		daysinmonth = 30
	}

	yearby4 = (formYear / 4);
	yearby4mod = parseInt(yearby4);
	if ((formMonth == '2') && (yearby4 == yearby4mod)) {
		daysinmonth = 29;
	}

	if ((formMonth == '2') && (yearby4 != yearby4mod)) {
		daysinmonth = 28;
	}

	if (formDay > daysinmonth) {
		alert ('The date you have selected does not exist. The date will change to the nearest correct date.');
		document[formname].elements[dayfield].value = daysinmonth;
		return false;
	}
	
	if (allowfuture == 0) {
		//checks for future dates
		var passedDate = new Date(formYear, (formMonth -1), formDay, 0,0,0);
		var todayDate = new Date();

		if (passedDate > todayDate) {
			alert("The date that has been supplied is greater than todays date and it invalid for this purpose");
			document[formname].elements[dayfield].value = todayDate.getDate();
			document[formname].elements[monthfield].value = (todayDate.getMonth() + 1);
			document[formname].elements[yearfield].value = todayDate.getYear();
		}
	}	else return true;
}

function validateCompanySelected() {
	var docfrm = document.prospect_company;
	if (docfrm.CompanyID.value == 0) {
		alert("Please select a company");
		docfrm.CompanyID.focus();
		return false;
	}
}
function validateContactSelected() {
	var docfrm = document.prospect_contact;
	if (docfrm.ContactID.value == 0) {
		alert("Please select a contact");
		docfrm.ContactID.focus();
		return false;
	}
}
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 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_showHideLayers() { //v6.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 showText() {
setTimeout("MM_showHideLayers('warning','','show')", theTime);

} 
//-->