// SignIn
function LoadUserDetails()
{	
	if (emptyvalidation(document.menufrm.loginname,"Please enter your login name")==false) 
		return 
	if (charactervalidation(document.menufrm.loginname,"Login name Must be in Characters","c")==false) 
		return
	if (emptyvalidation(document.menufrm.password,"Please enter your password")==false) 
		return 
	document.menufrm.method ="post"
	document.menufrm.action ="login.asp"
	document.menufrm.submit()
}

// Change Password 
function ChangePassword()
{
	if (emptyvalidation(document.menufrm.password,"Please enter your new password")==false) 
		return 
	if (emptyvalidation(document.menufrm.retypepassword,"Please retype your new password to confirm")==false) 
		return 
	if( document.menufrm.password.value != document.menufrm.retypepassword.value){
		alert("Please retype the password correctly")
		document.menufrm.retypepassword.value=""
		document.menufrm.retypepassword.focus()		
		return
	}	
	document.menufrm.mode.value="changepwd"
	document.menufrm.choice.value="store"
	document.menufrm.method ="post"
	document.menufrm.action ="default.asp"
	document.menufrm.submit()
}

// View menu screens
function DisplayMode(mode)
{
	document.menufrm.mode.value=mode
	document.menufrm.method ="post"
	document.menufrm.action ="default.asp"
	document.menufrm.submit()
}

// PredictionsInfo Section
function ProcessPredictionInfo( PID,mode )
{
 document.menufrm.mode.value="predictions"
 document.menufrm.choice.value=mode
 document.menufrm.key.value=PID 

 if( mode=="d"){ 
 	ret = window.confirm("Would you like to remove the selected category of prediction?"); 
	 if( ret==true){
		document.menufrm.method ="post"
		document.menufrm.action ="default.asp"
		document.menufrm.submit()
  	}
 }
 else if( mode=="e"){ 
	document.menufrm.method ="post"
	document.menufrm.action ="default.asp"
	document.menufrm.submit()
 }
 else if( mode=="a"){ 
	document.menufrm.method ="post"
	document.menufrm.action ="default.asp"
	document.menufrm.submit()
 }
}

function SavePredictionsInfo( PID,mode )
{
	document.menufrm.mode.value="predictions"
	
	if (emptyvalidation(document.menufrm.category,"Please enter the category")==false) 
		return 
	if (emptyvalidation(document.menufrm.content,"Please enter the prediction ")==false) 
		return 
	if( mode=="e" ){
		document.menufrm.choice.value="update"
		document.menufrm.key.value=PID 
		document.menufrm.method ="post"
		document.menufrm.action ="default.asp"
		document.menufrm.submit()
	}
	else if( mode=="a" ){
		document.menufrm.choice.value="store"
		document.menufrm.method ="post"
		document.menufrm.action ="default.asp"
		document.menufrm.submit()
	}
}

// DownloadsInfo Section
function ProcessDownloadInfo( downloadID,mode )
{
 document.menufrm.mode.value="downloads"
 document.menufrm.choice.value=mode
 document.menufrm.key.value=downloadID 

 if( mode=="d"){ 
 	ret = window.confirm("Would you like to remove the selected download file?"); 
	 if( ret==true){
		document.menufrm.method ="post"
		document.menufrm.action ="default.asp"
		document.menufrm.submit()
  	}
 }
 else if( mode=="e"){ 
	document.menufrm.method ="post"
	document.menufrm.action ="default.asp"
	document.menufrm.submit()
 }
 else if( mode=="a"){ 
	document.menufrm.method ="post"
	document.menufrm.action ="default.asp"
	document.menufrm.submit()
 }
}

function SaveDownloadsInfo( downloadID,mode )
{
	document.menufrm.mode.value="downloads"
	
	if (emptyvalidation(document.menufrm.filename,"Please enter the downloadable file name")==false) 
		return 
	if (emptyvalidation(document.menufrm.description,"Please enter the description for the file")==false) 
		return 
	if( mode=="e" ){
		document.menufrm.choice.value="update"
		document.menufrm.key.value=downloadID 
		document.menufrm.method ="post"
		document.menufrm.action ="default.asp"
		document.menufrm.submit()
	}
	else if( mode=="a" ){
		document.menufrm.choice.value="store"
		document.menufrm.method ="post"
		document.menufrm.action ="default.asp"
		document.menufrm.submit()
	}
}

// Print Contact Details
function PrintContact()
{
	document.menufrm.method ="post"
	document.menufrm.action ="menu.asp?mode=contact&print=y"
	document.menufrm.submit()
}

function PrintPage()
{
	if (window.print)
	{ 
		window.print()
		var timerID=setTimeout('BackPage()',1)
	}
	else
	{
		//BackPage()
	    window.location.href="menu.asp"
		alert("No Printer has been installed") 
	} 

}
function BackPage()
{
   history.go(-1);
}


function Navigate2Home()
{
	document.location.href="http://vincityastrotemple.com/default.asp"
}

function Navigate2SubMenu( mode, url )
{
	document.menufrm.mode.value=mode
	document.menufrm.method ="post"
	document.menufrm.action =""+url
	document.menufrm.submit()
}


function NavigateUrl( UrlAddress )
{
	window.open( UrlAddress )
}