/*
CheckNotEmpty	( Control, Message )	
ValidEmail		( Control, Message )
showFocus				(Control)
ScreenWidth()
ImageClick()			disable right click
printit()
refresh() 
SelfClose()	
*/
//-----------------------------------
function CheckNotEmpty( Control, Message )	{
	if( Control.value == "" )	{
		alert ( Message );
		Control.focus();
		return false;
		}	return true;	}
//---------------------------????--------
//------------------------------
function ValidEmail ( Control, Message )
{
	var theInput  = Control.value;
	var theLength = theInput.length;
	var goodEmail  = true;
	if (theLength == 0 )	{
			goodEmail = false;
		}	else { 
			if (theInput.indexOf('@', 0)==-1){
					goodEmail = false;
		}		}
	if ( goodEmail == false )
		{		alert ( Message );
				Control.focus();
				return false;
		}	else	{	return true;
}		}

//----------------------------------
function ValidEmail_1 ( Control )
{
	var theInput  = Control.value;
	var theLength = theInput.length;
	var goodEmail  = true;
	if (theLength == 0 )	{
			goodEmail = false;
		}	else { 
			if (theInput.indexOf('@', 0)==-1){
					goodEmail = false;
		}		}
	if ( goodEmail == false )
		{		alert ( "This does NOT look like a valid Email!" );
				Control.focus();
				return false;
		}	else	{	return true;
}		}

//------------------
function showFocus( Control ) {
	Control.focus();	}
//----------------------------------------
	
function evalcat_on(imgName) {
	if (window.document.images) {
		window.document.images[imgName].src = eval(imgName + "2.src"); }	}
// -------------------------------
function evalcat_off(imgName) {
	if (window.document.images) {
		window.document.images[imgName].src = eval(imgName + "1.src"); }	}
// -------------------------------
//----------------------------------------
function  changeLocation() 
{
var a = (window.document.QuickLinkForm.Quick_Links.selectedIndex);
b = window.document.QuickLinkForm.Quick_Links.options[a].value; 
parent.location.href=("/AllPhoto-Service/"+b);
}
//------------------
function SelfClose()	{
		self.close();	}
//-------------------------------
//-------------------------------
function ScreenWidth()	{
	var w = screen.width;
//alert(w)

	if (w<800)
	{alert('Our site optimized for resolution 800x640 pixels. We recommend you to increase the resolution of your monitor if it is possible.');
	}
	}
//----------------------------------------
//-------------------------------
	
function NewSchedOptionWindow(page) {
	windowprops = " height=680,width=600,location=no, scrollbars=no,menubars=no,"
	+ "toolbars=no,resizable=no,screenX=10,screenY=5,left=10,top=5";
//		alert(windowprops);

	window.open(page, "Schedule", windowprops);	}
//-------------------------------
function newFAQWindow(page) {
	windowprops = " height=600,width=550,location=no, scrollbars=no,menubars=no,"
	+ "toolbars=no,resizable=no,screenX=10,screenY=5,left=10,top=5";
//		alert(windowprops);

	window.open(page, "FAQ", windowprops);	}
	
//-------------------------------
	
function newDirectionWindow(page) {
	windowprops = " height=750,width=800,location=no, scrollbars=yes,menubars=yes,"
	+ "toolbars=yes,resizable=yes,screenX=10,screenY=5,left=10,top=5";
//		alert(windowprops);

	window.open(page, "Directions", windowprops);	}
//-------------------------------
//-------------------------------
	
function newBookRequstWindow(page) {
	windowprops = " height=780,width=600,location=no, scrollbars=yes,menubars=yes,"
	+ "toolbars=yes,resizable=yes,screenX=10,screenY=5,left=10,top=5";
//		alert(windowprops);

	window.open(page, "Directions", windowprops);	}
//-------------------------------
//----------------------------------------
function newScheduleWindow(page) {
	windowprops = " height=600,width=550,location=no, scrollbars=no,menubars=no,"
	+ "toolbars=no,resizable=no,screenX=10,screenY=5,left=10,top=5";
//		alert(windowprops);

	window.open(page, "FAQ", windowprops);	}
	
//-------------------------------
//-------------------------------
function backgrWindow(page) {
	windowprops = " height=750,width=660,location=no, scrollbars=yes,menubars=no,"
	+ "toolbars=no,resizable=yes,screenX=10,screenY=5,left=10,top=5";

	window.open(page, "", windowprops);	}
	
//-------------------------------
function NewPrivacyWindow(page) {
	windowprops = " height=450,width=550,location=no, scrollbars=yes,menubars=no,"
	+ "toolbars=no,resizable=yes,screenX=10,screenY=5,left=10,top=5";

	window.open(page, "", windowprops);	}
	
//-------------------------------
function NewBuddyWindow(page) {
	windowprops = " height=400,width=420,location=no, scrollbars=no,menubars=no,"
	+ "toolbars=no,resizable=no,screenX=10,screenY=5,left=10,top=5";

	window.open(page, "", windowprops);	}
	
//----------------------------------------
function NewClassSpecWindow(page) {
	windowprops = " height=600,width=550,location=no, scrollbars=no,menubars=no,"
	+ "toolbars=no,resizable=no,screenX=10,screenY=5,left=10,top=5";

	window.open(page, "", windowprops);	}
	
//----------------------------------------
NewClassSpecWindow
/*
This script is written by Eric (Webcrawl@usa.net)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/

function printit(){  
if (window.print) {
    window.print() ;  
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
}
}
//----------------------------------------

/*
Add-to-favorites Script
Created by David Gardner (toolmandav@geocities.com)
No warranty of any kind comes with this script!
Permission granted to Dynamic Drive (http://dynamicdrive.com) 
to post and feature this script on their DHTML archive
*/

//configure the two variables below to match yoursite's own info

var bookmarkurl="http://www.midatlanticscubacenter.com"
var bookmarktitle="MID-ATLANTIC SCUBA CENTER"

function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
