
window.onload=function(){document.getElementById("loading").style.display="none";}

function confirmDeleteSchedule(idnumber) {
	var answer = confirm("CONFIRMATION... Are you sure you want to permanently delete this schedule?")
	if (answer){
		document.deletescheduleform.idtodelete.value=idnumber;
		document.deletescheduleform.submit();
	}
}

function confirmDelete(deleteidnumber) {
	var answer = confirm("CONFIRMATION... Are you sure you want to permanently delete this advertisement?")
	if (answer){
		document.deleteform.deleteid.value=deleteidnumber;
		document.deleteform.submit();
	}
}

// Function to select Google Search target	also used to enable a player for a game sheet
function change(a,b){show(a);hide(b);}
function show(a){document.getElementById(a).style.display="block";}
function hide(b){document.getElementById(b).style.display="none";}
// Function to select Google Search target


// Function to show players stats when hover over game summary
var _elementID;
var _xOffset = 15;
var _yOffset = 15;

function GetMouseX( event )
{
    if ( !event )
    {
        event = window.event;
    }

    if ( event.pageX )
    {
        return event.pageX;
    }
    else if ( event.clientX )
    {
        return event.clientX + ( document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft );
    }
    else
    {
        return 0;
    }
}

function GetMouseY( event )
{
    if ( !event )
    {
        event = window.event;
    }

    if ( event.pageY )
    {
        return event.pageY;
    }
    else if ( event.clientY )
    {
        return event.clientY + ( document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop );
    }
    else
    {
        return 0;
    }
}

function Follow( event )
{
    if ( document.getElementById )
    {
        var element = document.getElementById( _elementID );

        if ( element != null )
        {
            var style = element.style;
            style.left = ( parseInt( GetMouseX( event ) ) + _xOffset ) + 'px';
            style.top = ( parseInt( GetMouseY( event ) ) + _yOffset ) + 'px';
            style.visibility = 'visible';
        }
    }
}

function Show( elementID )
{
    if ( document.getElementById )
    {
        _elementID = elementID;

        document.onmousemove = Follow;
    }
}

function Hide( elementID )
{
    if ( document.getElementById )
    {
        _elementID = elementID;

        var divStyle = document.getElementById( _elementID ).style;
        divStyle.visibility = 'hidden';

        document.onmousemove = '';
    }
}
// Function to show players stats when hover over game summary


// Function to Create a Page Formatted for Printing
function printPage()
{
	if (document.getElementById != null){
		var html = '<HTML>\n<HEAD>\n';
		if (document.getElementsByTagName != null)
		{
			var headTags = document.getElementsByTagName("head");
			if (headTags.length > 0){
				html += headTags[0].innerHTML;
			}
			html += '\n</HE' + 'AD>\n<BODY style="margin-top:0px; background-image:none; background-color:#fff;">\n';
			html += '<div id="printPage">';
			html += '<table width="650" height="100%" align="center" valign="top" bgcolor="ffffff">';
			html += '<tr><td align="left" valign="top">';
			html += '<table width="100%" valign="top">';
			html += '<tr><td align="right"><A href="javascript:window.close();"><img src="http://northriverflames.ca/graphics/clipart/buttons/close_button.gif" alt="Close this page" border="0" title="Close this page"/></'+'A><br /></t'+'d></t'+'r>';
			html += '<tr><td align="right"><A href="javascript:window.print();"><img src="http://northriverflames.ca/graphics/clipart/buttons/print_button.gif" alt="Print this page" border="0" title="Print this page"/></'+'A><br /></t'+'d></t'+'r>';
			html += '</ta'+'ble>';
		}
		var printReadyElem = document.getElementById("printPage");
		if (printReadyElem != null){
			html += printReadyElem.innerHTML;
		}
		else{
			alert("This page has not been configured for printing.");
			return;
		}

		var pageLocation=document.location+'';
		
		html += '<!--<table align="center" valign="top" bgcolor="ffffff">';
		html +=  '<tr>';
		html +=  '<td><div align="center">';
		html +=  '<br /><br /><br /><hr><br /><p>North River Minor Hockey Association</'+'P>';
		html +=  '<p>Cornwall, PE Canada C0A 1H0<br /><br />';
		html +=  '</'+'p>';
		html +=  '<p><a href="mailto:nrmha.ca@gmail.com?subject=Email from nrmha.ca">nrmha.ca@gmail.com</'+'a></'+'p>';
		html +=  '<br />';
		html += '</d'+'iv>\n</'+'td>';
		html += '</'+'tr>';
		html += '</ta'+'ble>-->';
		html += '</'+'td>';
		html += '</'+'tr>';
		html += '</ta'+'ble>';
		html += '</d'+'iv>';
		html += '\n</BO' + 'DY>\n</HT' + 'ML>';
		var printWin = window.open("","printPage");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
	}
	else{
		alert("Sorry, the print ready feature requires javascript.");
	}
}
// Function to Create a Page Formatted for Printing

// Book mark this page
 function CreateBookmarkLink(title,url) {
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"http://www.google.com");
		alert("Firefox users: This bookmark you are creating will open in your Sidebar\nrather than the main page!\nTo prevent this please right click the bookmark and choose\n'Properties' and then uncheck the box marked:\n'Load This Bookmark in the Sidebar'\n\nSorry about this, but it is unavoidable with Firefox");
		//window.external.AddFavorite( url, title);
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
 }
 // Book mark this page




  // Slider
//var sliderAPI;
//function formatSliderText(index, panel) {
//  return index + "";
//}
//$(document).ready(function() {
//    $(".nav ul li").hover(function(){
//        $(this).find("ul").show();
//    }, function(){
//        $(this).find("ul").hide();
//    });
//	if (jQuery.browser.msie && jQuery.browser.version <= 6){
//		jQuery.getScript("/javascripts/DD_belatedPNG_0.0.8a-min.js", function(){DD_belatedPNG.fix('#content, #footer');});
//       $(".nav li.spacer").hide();
//        $("#id_no_pad").css('padding',0);
//	}
//});
  // Slider
