// Input validation for every field in application

function confirmLinkClick (message, aLink)
{
	if(confirm(message))
	{
		window.location.href=aLink;
	}
}

function confirmFormSubmit (message, form)
{
	if(confirm(message))
	{
		form.submit();
	}
}

function openDiv(divID) 
{
	document.getElementById(divID).style.display = "block";
}
 
function closeDiv(divID) 
{
	document.getElementById(divID).style.display = "none";
} 

function openTerms()
{
	var winW = window.innerWidth;
	if(winW == null)
		winW = document.documentElement.clientWidth;
	if(winW == null)
		winW = document.body.clientWidth;

	var pWindowW = 685;

	var x = winW/2 - pWindowW/2;
	ajaxwin=dhtmlmodal.open('termsofuse', 'iframe', 'termsofuse.jsp', 'Terms of use and Privacy policy', 'width='+pWindowW+'px,height=400px,left='+x+'px,top=100px,resize=0,scrolling=1'); 
	return false;
}


function openModalDiv(name)
{
	var winW = window.innerWidth;
	if(winW == null)
		winW = document.documentElement.clientWidth;
	if(winW == null)
		winW = document.body.clientWidth;

	var pWindowW = 500;

	var x = winW/2 - pWindowW/2;
	modalWin=dhtmlmodal.open('termsofuse', 'div', name, '', 'width='+pWindowW+'px,height=200px,left='+x+'px,top=200px,resize=0,scrolling=1'); 
	return false;
}


function openHelp(url)
{
	var helpWin = window.open(url, 'helpwindow', 'width=680,height=600,menubar=0,location=0,scrollbars=1,resizable=0');
	helpWin.focus();
}


