var DocumentRoot = "http://www.cambridgebingo.com/";

function MM_preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function CallHelpWindow(HelpFile) {
	HelpWindow=window.open(DocumentRoot + 'Functions/Help.php?File=' + HelpFile,'HelpWindow','toolbar=no,status=no,width=400,height=400');
}

function DescribeLink(LinkName) {
	
	switch (LinkName) {
		case "Jackpots":
			document.getElementById('Notification').innerHTML = '<p class="Notification"><a href="Jackpots.php" class="DescriptionLink">Jackpots</a>: </p>';		
		break;
		
		case "Programs":
			document.getElementById('Notification').innerHTML = '<p class="Notification"><a href="Programs.php" class="DescriptionLink">Programs:</a> Click on this link to see a list of our programs and upcoming events!</p>';
		break;		
		
		case "SpecialAnnouncements":
			document.getElementById('Notification').innerHTML = '<p class="Notification"><a href="SpecialAnnouncements.php" class="DescriptionLink">Special Announcements:</a> Click on this link to visit our calendar of special announcements.</p>';
		break;
		
		case "Map":
			document.getElementById('Notification').innerHTML = '<p class="Notification"><a href="Map.php" class="DescriptionLink">Map:</a> Click on this link to view a map of our location. You can also get driving directions, bus schedules, or information on our Bingo Bus service.</p>';
		break;
		
		case "Contact":
			document.getElementById('Notification').innerHTML = '<p class="Notification"><a href="Contact.php" class="DescriptionLink">Contact:</a> Click on this link for our full address , contact phone numbers jackpot hotline, or to contact us via a convenient form.</p>';
		break;
		
		case "Sponsors":
			document.getElementById('Notification').innerHTML = '<p class="Notification"><a href="Sponsors.php" class="DescriptionLink">Sponsors:</a> Click on this link to visit the list of our generous sponsors.</p>';
		break;
		
		case "PhotoGallery":
			document.getElementById('Notification').innerHTML = '<p class="Notification"><a href="Gallery.php" class="DescriptionLink">Photo Gallery:</a> Click on this link see a gallery of bingo patrons as well as our helpful staff.</p>';
		break;		
		
		case "PlayersClub":
			document.getElementById('Notification').innerHTML = '<p class="Notification"><a href="PlayersClub.php" class="DescriptionLink">Players Club:</a> Click here to see a list of our weekly and monthly <span class="Emphasis">Players Club Winners</span>, and to get more information on joining the <span class="Emphasis">Players Club</span>!</p>';
		break;		
		
	}

}

function GalleryWindow(PictureID) {
	HelpWindow=window.open(DocumentRoot + 'Functions/GalleryWindow.php?Picture=' + PictureID,'GalleryWindow','toolbar=no,status=no,width=760,height=510');
}

function LightButton(ButtonID) {
	document.getElementById(ButtonID).style.color = "#006400";
	document.getElementById(ButtonID).style.borderColor = "#006400";
}

function LinkInParent(url) {
	window.opener.location=url;
}

function Logout() {
	LogoutWindow=window.open(DocumentRoot + 'Admin/Logout.php','Logout','toolbar=no,status=no,width=400,height=130');
}

function LogoutCompletion() {
	LogoutCompletionWindow=window.open(DocumentRoot+ '/Admin/LogoutCompletion.php','LogoutCompletion','toolbar=no,status=no,width=1,height=1');
	opener.document.location.href=DocumentRoot;
	
}

function JumpTo(url) { 
	document.location.href = url;
}

function OpenLegalWindow(url) {
	LegalWindow=window.open(url,'LegalWindow','scrollbars=yes,toolbar=no,status=no,width=700,height=500');
}

function SenseKeys(e,Input) {
   if(!document.all) { 
        var keyCode=e.which; 
   } else { 
        var keyCode=window.event.keyCode; 
   } 
   
   if (keyCode==13) {
   		if (Input == "password") {
   			document.forms['Login'].elements[Input].focus();
   		} else {
   			document.Login.submit();
   		}
   }
}

function SenseYesOrNo(e) {
   if(!document.all) { 
        var keyCode=e.which; 
   } else { 
        var keyCode=window.event.keyCode; 
   } 
   
   if (keyCode==89) {
		// yes
		LogoutCompletion();
		window.close();
   } 
   
   if (keyCode==78) {
   		window.close();
   }
}

function ShadowButton(ButtonID) {
	document.getElementById(ButtonID).style.color = "grey";
	document.getElementById(ButtonID).style.borderColor = "black";
}

function SwapImage(image1,imageName) {
	document.images[imageName].src=image1;
}

function SwapImageBack(image2,imageName) {
	document.images[imageName].src=image2;
}

function SwitchImage(ImageName,Image) {
	document.images[ImageName].src=Image;
}

function UnshadowButton(ButtonID) {
	document.getElementById(ButtonID).style.color = "black";
	document.getElementById(ButtonID).style.borderColor = "#006400";
}


