<!--
var g_win;
function OpenUrl()
{
 iLeft = (screen.width-540)/2
 iTop  = (screen.height-540)/2;
  if (g_win==null || g_win.closed) {
    g_win = window.open("http://www.iforum.com/benefits/recommendation.asp?SiteID=ix23klsd3z3&SiteTitle=www.novakassoc.com", null,"toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,top="+iTop+",left="+iLeft+",width=540,height=540")
  }
  else 
    if (g_win!=null) g_win.close();

  return
}
function mailAddressIsValid(mailAddress)
{
	var atPresent = false;
	var dotPresent = false;
	var c;
	for (var i=0; i < mailAddress.length; i++)
	{
		var c=mailAddress.substring(i, i+1);
		if (c == "@")
			atPresent = true;
		if (c == ".")
			dotPresent = true;
	}
	if (atPresent == true && dotPresent == true)
		return true;
	else
		return false;
}
function isInput(value)
{
	var p;
	value = delSpace(value);
	for (i=0;i<value.length;i++)
	{
		p = false;
		for (j=0;j<10;j++)
		{
			if (parseInt(value.substring(i,i+1)) == j)
			{p = true;}
		}
		if (!p) {return false;}
	}
	return true;
}
function delSpace(text)
{
	var cut, i;
	cut = text;
	i = 0;
	do
	{
		if (text.substring(i,i+1) == ' ')
		{
			if (i != parseInt(text.length-1)) 
				{cut = text.substring(i+1,text.length);}
		}
		i++;
	}
	while ((i<text.length) && (text.substring(i-1,i) == ' '));
	if (cut == ' ') {cut = '';}
	return cut;
}
function CompareDates(date1, date2)
{
	var d1, d2, sd1, sd2;
	d1 = CDateP(date1);
	d2 = CDateP(date2);
	sd1 = d1.substring(0,4)+d1.substring(5,7)+d1.substring(8,10)
	sd2 = d2.substring(0,4)+d2.substring(5,7)+d2.substring(8,10)
	if (sd1 > sd2) {return false;}
	else {return true;}
}
function y2k(number) { return (number < 1000) ? number + 1900 : number; }
function isValidDate(myDate)
{
	var sep, c, j1, j2, j3, k, day, month, year;
	sep = '-';
	day = '';
	month = '';
	year = '';
	
		j1 = 0;
		j2 = 0;
		j3 = 0;
		for (i=0;i<myDate.length;i++)
		{
			c = myDate.substring(i, i+1);
			if (c == '-') { j1++; };
			if (c == '/') { j2++; };
			if (c == '.') { j3++; };
		}
		if ((j1==2) && (j2==0) && (j3==0)) {k=1;} else
		if ((j1==0) && (j2==2) && (j3==0)) {k=1;} else
		if ((j1==0) && (j2==0) && (j3==2)) {k=1;} else
		{return false;}

	if (j1==2)
	{
		for (i=0;i<myDate.length;i++)
		{
			c = myDate.substring(i, i+1);
			if (c=='-') {k=k+1;}
			else
			{
				if (k == 1) { year = year + c;} else
				if (k == 2) { month = month + c;} else
				if (k == 3) { day = day + c;} else
				{return false;}
			}
		}
	}
	if ((j2==2) || (j3==2))
	{
		for (i=0;i<myDate.length;i++)
		{
			c = myDate.substring(i, i+1);
			if ((c == '.') || (c == '/')){ k=k+1; }
			else
			{
				if (k == 1) { month = month + c;} else
				if (k == 2) { day = day + c;} else
				if (k == 3) { year = year + c;} else
				{return false;}
			}
		}
	}

	if ((year.length==3) || (year.length>4)) {return false;}
	if (year.length<2) {year = '200' + year;}
	if (year.length<4) {year = '20' + year;}

	var test = new Date(year,month-1,day);
	if ((year == y2k(test.getYear())) && (month-1 == test.getMonth()) && (day == test.getDate()))
		{return true;}
	else {return false;}
	
	return;
}
function CDateP(myDate)
{
	var sDate, j1, j2, j3, k, day, month, year;
	
	day = '';
	month = '';
	year = '';
	k = 1;
	
	j1 = 0;
	j2 = 0;
	j3 = 0;
	for (i=0;i<myDate.length;i++)
	{
		c = myDate.substring(i, i+1);
		if (c == '/') { j2++; };
		if (c == '.') { j3++; };
		if (c == '-') { j1++; };
	}
	if ((j2==2) || (j3==2))
	{
		for (i=0;i<myDate.length;i++)
		{
			c = myDate.substring(i, i+1);
			if ((c == '.') || (c == '/')){ k=k+1; }
			else
			{
				if (k == 1) { month = month + c;} else
				if (k == 2) { day = day + c;} else
				if (k == 3) { year = year + c;} else
				{return false;}
			}
		}
		if (year.length<2) {year = '200' + year;}
		if (year.length<4) {year = '20' + year;}
		if (month.length<2) {month = '0' + month;}
		if (day.length<2) {day = '0' + day;}

		sDate = year+'-'+month+'-'+day;
		//return sDate;
	}
	if (j1==2)
	{
		for (i=0;i<myDate.length;i++)
		{
			c = myDate.substring(i, i+1);
			if (c == '-') { k=k+1; }
			else
			{
				if (k == 1) { year = year + c;} else
				if (k == 2) { month = month + c;} else
				if (k == 3) { day = day + c;} else
				{return false;}
			}
		}
		if (year.length<2) {year = '200' + year;}
		if (year.length<4) {year = '20' + year;}
		if (month.length<2) {month = '0' + month;}
		if (day.length<2) {day = '0' + day;}

		sDate = year+'-'+month+'-'+day;
		//return sDate;

	}
	return sDate;
}
function EmptyAlert(obj, objName)
{
        if (obj.value=='')
        {
                alert('"' + objName+ '" is required');
                obj.focus();
                return false;
        }
        else
	{
                return true;
	}
}

function EmailAlert(obj)
{
	if (!isEmail(obj.value))
	{
		alert('Enter a valid email')
		obj.focus()
		return false
	}
	else
		return true
}

function isEmail(str)
{
        for (j=1; j<str.length; j++) if ((str.charAt(j)==',') || (str.charAt(j)=='"') || (str.charAt(j)=="'")) return false;
        return ((str != "") && (str.indexOf("@") != -1) && (str.indexOf(".") != -1));
}
//-->

