function filter_bs() {
	//if ( event.keyCode = 8 )
	//{
		event.returnValue = false;
	//}	
}

function restrict(ctrl) {
	var dateout = ctrl.value;
	
	if ( event.keyCode < 47 || event.keyCode > 57 )
	{
		event.returnValue = false;
	}	
	if ( event.keyCode == 47 && (dateout.length == 0 || dateout.length == 3 || dateout.length > 5) )
	{
		event.returnValue = false;
	}	
	return;
}

function formatdate(ctrl) {
	var dateout = ctrl.value;
	var tmp = dateout.substr(dateout.length - 1, 1);

	if ( (event.keyCode < 47 || event.keyCode > 57 )
             && (event.keyCode < 96 || event.keyCode > 105) && tmp != "/" )
	{
		return;
	}

	if ( tmp == "/" && dateout.length == 2 )
	{
		ctrl.value = "0" + dateout;
		return;
	}
	if ( tmp == "/" && dateout.length == 5 )
	{
		//tmp = dateout.substr(0, 3) 
		ctrl.value = dateout.substr(0, 3) + "0" + dateout.substr(3);
		return;
	}
			
	// format it	
	if (dateout.length == 2) 
	{
		ctrl.value = dateout + "/";
	} 
	else if (dateout.length == 5) 
	{
		ctrl.value = dateout + "/";
	}
	
	return;
}


function add_date(ctrl) 
{
	var s = "";
	var datein = new Date(ctrl.value);
	
	if ( !isNaN(datein) && document.frmPolicyIssue.ReturnDate.disabled )
	{
		//datein.setYear(datein.getFullYear() + 1);
		s += datein.getDate() + "/";
		s += (datein.getMonth() + 1) + "/";
		s += datein.getFullYear() + 1;
		document.frmPolicyIssue.ReturnDate.value = s; 
	}
	return;
}

function PopupWindow(filename) {
    PopWin = window.open(filename,'News','height=300,width=620,left=60,top=60,menubar=no,toolbar=no,location=no,status=yes,scrollbars=yes');
    PopWin.focus()
}

function PopupLargeWindow(filename) {
    PopWin = window.open(filename,'News','height=800,width=700,left=60,top=60,menubar=no,toolbar=no,location=no,status=yes,scrollbars=yes');
    PopWin.focus()
}

function loadRight(filename)
{
	if(parent != self)
	{
		if(filename != '')
		{
			parent.parentcols(2);
			parent.frames[2].location.replace(filename);
		} else {
			parent.parentcols(1);
		}
	}  
}

function clear_date(ctrl) 
{
	ctrl.value = "";
	return;
}