﻿<!--
// common javascript functions for use throughout the application

function JSConfirm(message)
{
    var ConfirmOK = confirm(message);
    return (ConfirmOK);
}

function JSOpenPrintWindow(WindowURL)
{
    var decs = "top=20,left=20,width=600,height=450,resizable=1,scrollbars=1";
    window.open(WindowURL, "printwindow", decs);
    return(false);
}


var NewWindowModal = "directories=0, location=0, menubar=0, resizable=0, scrollbars=1, status=0, toolbar=0, left=5, top=5, ";
var NewWindowResizeable = "directories=0, location=0, menubar=0, resizable=1, scrollbars=1, status=0, toolbar=0, left=5, top=5, ";

// opens a new window with the specified settings
function OpenNewWindow(PageURL, WindowHeight, WindowWidth, WindowDecs, WindowName)
{
	var win_width = WindowWidth;
	var win_height = WindowHeight;
	var win_decs = WindowDecs;
	
	
	if(win_height > (window.screen.height - 25))
	{
		win_height = (window.screen.height - 25);
	}

	if(win_width > (window.screen.width - 25))
	{
		win_width = (window.screen.width - 25);
	}
	window.open(PageURL, WindowName, win_decs + "width=" + win_width + ", height=" + win_height);
	
}


function show_hi_res(ImageRef, ImageUrl)
{
    OpenNewWindow("/showhires.aspx?imageref=" + ImageRef, 860, 860, NewWindowModal, "hires");
}

function getCMS_Toggle(id)
{
    $('#'+id).toggle();
}


function open_map_display(centertype, centerobjectref)
{
    OpenNewWindow("/mapdisplay.aspx?type=" + centertype + "&ref=" + centerobjectref, 700, 650, NewWindowModal, "mapwindow");
}

function rememberthis(Type, ObjectRef)
{
    OpenNewWindow("/remember.aspx?type=" + Type + "&ref=" + ObjectRef, 300, 300, NewWindowModal, "remember");
}

function removethis(Type, ObjectRef)
{
    document.location = "/mysogogolfing/remove.aspx?type=" + Type + "&ref=" + ObjectRef;
}


//-->


