//
//  Add extra functionality to javascript data types
//
Date.prototype.addDays = function (days) {return new Date(this.getTime() + (days * 24 * 60 * 60 * 1000));}
Date.prototype.toYYYYMMDD = function () {return String((this.getFullYear() * 100 + this.getMonth() + 1) * 100 + this.getDate());}
Date.prototype.toYYYY_MM_DD = function () 
{
	strDate = this.toYYYYMMDD();
	return strDate.substring(0,4) + "_" + strDate.substring(4,6) + "_" + strDate.substring(6,8);
}    

Boolean.prototype.fromString = function (value) {
	if (value.toUpperCase() == "TRUE") {return true;}
	if (value.toUpperCase() == "FALSE") {return false;}
	if (value == 0) {return false;}
	if (value != 0) {return true;}
}
//
//  Silverlight Error Trapping
//
var SilverlightMode = false;

function onSilverlightError(sender, args) {

    var appSource = "";
    if (sender != null && sender != 0) {
        appSource = sender.getHost().Source;
    } 
    var errorType = args.ErrorType;
    var iErrorCode = args.ErrorCode;
    
    var errMsg = "Unhandled Error in Silverlight 2 Application " +  appSource + "\n" ;

    if (errorType == "ParserError")
    {
        errMsg += "File: " + args.xamlFile + "     \n";
        errMsg += "Line: " + args.lineNumber + "     \n";
        errMsg += "Position: " + args.charPosition + "     \n";
    }
    else if (errorType == "RuntimeError")
    {           
        if (args.lineNumber != 0)
        {
            errMsg += "Line: " + args.lineNumber + "     \n";
            errMsg += "Position: " +  args.charPosition + "     \n";
        }
    }
    try
    {
        window.location.href = "error/error.aspx?number=" + iErrorCode + " " + errorType + "&source=" + args.methodName + "&message=" + args.ErrorMessage + "&data=" + errMsg;
    }
    catch (e)
    {
        alert(e);
    }
}

// set this flag if using Junior
var isJunior=false;

// 
// Set this flag for debugging messages
//
var IsDebugging = true;

//
//  Global variables
//
var DialogCount=0;
var Snap1_Left = 0;
var Snap2_Left = 0;
var Snap3_Left = 0;
var Snap4_Left = 0;
var CurrentPage = null;
var Dialog_BaseID = "ctl00_";


function ShowProcessing()
{
	if (window.parent != window)
	{
		window.parent.ShowProcessing();
		return;
	}
	
	eval(Dialog_BaseID + "Busy.Show();");

//	ctl00_Busy.Show();
}

function DialogOpen(strPage, strParameters, strBasePath, blnEnableScrollBars)
{
	var Dialog = null;
	if (window.parent != window)
	{
		window.parent.DialogOpen(strPage,strParameters,strBasePath);
		return;
	}

	if (SilverlightMode) 
	{
		if (objSilverlight.JSBridge.DialogOpen(strPage, strParameters, strBasePath)) 
		{
			return;
		}
	}

	if (DialogCount == 4)
	{
      alert("Cannot open any more windows.  Maximum number already open");
      return;    
  }
    
	var Page = Pages[strPage];
  if (Page==null)
  {
      alert("The page '" + strPage + "' doesn't exist.");
      return;
  }
  
  if (strBasePath==null)
  {
      strBasePath="";
  }
  
  if (strParameters==null)
  {
      strParemeters="";
  }

	if (document.getElementById("DialogWindow" + (DialogCount + 1)).readyState != "complete")
	{
		setTimeout("DialogOpen('" + strPage + "','" + strParameters + "','" + strBasePath + "');",100);
		return;
	}
    
	DialogCount++;

	eval("Dialog = " + Dialog_BaseID + "Dialog" + DialogCount + ";");

	DialogSetTitle("");

	Dialog.set_width(Page.width + 20);
	Dialog.set_height(Page.height);
	Dialog.set_x((ScreenWidth() - Page.width) / 2)
	Dialog.set_y(((ScreenHeight() - Dialog.scrollTop) / 2) - 25)
	Dialog.set_modal(true);
	Dialog.show();

	o=document.getElementById('DialogContent' + DialogCount);
	o.style.width = Page.width + "px";
	o.style.height = Page.height + "px";

 	document.getElementById("DialogWindow" + DialogCount).src = Path_App + strBasePath + Page.src + "?" + strParameters;
	document.getElementById("DialogWindow" + DialogCount).OriginalURL = Path_App + strBasePath + Page.src + "?" + strParameters;
	document.getElementById("DialogWindow" + DialogCount).Page = Page;
	document.getElementById("DialogWindow" + DialogCount).HiddenElements = HideElements();
}

function MLSInitilise() {
    window.status = 'MLSInitilise()';
}
//deprecated
function MLSInitiliase() {
    window.status = 'MLSInitilise()';
}

function DialogClose(Result)
{
//
	//  See if we are allowed to close the dialog
  //
	if (DialogCount == 0)
	{
		try {
		  blnResult = DialogAllowClose();
		}
		catch (e)
		{
			blnResult=true;
		}
	}
	else
	{
	    try {
	        blnResult = document.getElementById("DialogWindow" + DialogCount).contentWindow.DialogAllowClose();
		 } catch (e) {
		   blnResult = true
		 }
	}

    if (blnResult)
    {
		//
		//  Process a dialogs result
		//
		if (Result)
		{
		  DialogReturnResult(Result);
		}
		document.getElementById("DialogWindow" + DialogCount).src = "about:blank";
	    
		eval("Dialog = " + Dialog_BaseID + "Dialog" + DialogCount + ";");

		ShowElements(document.getElementById("DialogWindow" + DialogCount).HiddenElements);

		Dialog.close();
		DialogCount--;

		// When adding new Resources, once the user has closed the new resource recordcard, refresh the "New resource" dialog, 
    //   this will put the focus back onto txtBarcode 
		try {
		  if (DialogCount > 0 && document.getElementById("DialogWindow" + DialogCount).outerHTML.indexOf("recordcard/resourceitem_new.aspx") > 0) {
		    document.getElementById("DialogWindow" + DialogCount).contentWindow.__doPostBack("", "");
		  }
		} catch (e) {
//		  alert(e.message);
		}
	}
}

//
//  Browser sniffing
//
var agt=navigator.userAgent.toLowerCase();
var is_major   = parseInt(navigator.appVersion);
var is_minor   = parseFloat(navigator.appVersion);
var is_ie      = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3     = (is_ie && (is_major < 4));
var is_ie4     = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
var is_ie4up   = (is_ie && (is_major >= 4));
var is_ie5     = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5_5   = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
var is_ie5up   = (is_ie && !is_ie3 && !is_ie4);
var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
var is_ie6     = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
var is_ie7     = (is_ie && (is_major == 4) && (agt.indexOf("msie 7.")!=-1) );
var is_ie6up   = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);
var is_win     = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );

//
//  Global Objects
//
var OldSubmit = null;
var OldUnload = null;
var objMessage = null;

function getElementLeft(elem)
{
    xPos = elem.offsetLeft;
    tempEl = elem.offsetParent;
    while (tempEl != null)
    {
        xPos += tempEl.offsetLeft;
        tempEl = tempEl.offsetParent;
    }
    return xPos;
}

function getElementTop(elem)
{
    yPos = elem.offsetTop;
    tempEl = elem.offsetParent;
    while (tempEl != null)
    {
        yPos += tempEl.offsetTop;
        tempEl = tempEl.offsetParent;
    }
    return yPos;
}


function HideLocalElements()
{
	var HiddenElements = new Array();
	var HiddenCount=0;
	if (is_ie6)
	{
		for (var f = document.all.length - 1, form = null; (element = document.all[f]); f--)
		{
			src = element.src;
			if (element.id == "btnMessageOK" || element.id == "btnMessageYes" || element.id == "btnMessageNo" || element.id == "btnMessageCancel")
			{
			
			}
			else
			{
				if (element.tagName == "SELECT")
				{
					HiddenElements[HiddenCount] = [element,element.style.visibility];
					if (HiddenElements[HiddenCount][1] == "")
					{
						HiddenElements[HiddenCount][1] = "visible";
					}
					HiddenCount++;
					element.style.visibility = "hidden"
				}
			}
		}
	}
}

function HideElements()
{

	var HiddenElements = new Array();
	var HiddenCount=0;
	if (is_ie6 || is_ie7)
	{
		for (var f = document.all.length - 1, form = null; (element = document.all[f]); f--)
		{
			src = element.src;
			if (element.id == "btnMessageOK" || element.id == "btnMessageYes" || element.id == "btnMessageNo" || element.id == "btnMessageCancel")
			{
			}
			else
			{
				if (element.tagName == "SELECT"  || element.tagName == "OBJECT" )
				{
					HiddenElements[HiddenCount] = [element,element.style.visibility];
					if (HiddenElements[HiddenCount][1] == "")
					{
						HiddenElements[HiddenCount][1] = "visible";
					}
					HiddenCount++;
					element.style.visibility = "hidden"
				}
			}
		}	

		for (var frame = 0; frame < window.frames.length; frame++)
		{
			for (var f = window.frames[frame].document.all.length - 1, form = null; (element = window.frames[frame].document.all[f]); f--)
			{
				src = element.src;
				if (element.id == "btnMessageOK" || element.id == "btnMessageYes" || element.id == "btnMessageNo" || element.id == "btnMessageCancel")
				{
				
				}
				else
				{
					if (element.tagName == "SELECT" || element.tagName == "OBJECT" )
					{
						HiddenElements[HiddenCount] = [element,element.style.visibility];
						if (HiddenElements[HiddenCount][1] == "")
						{
							HiddenElements[HiddenCount][1] = "visible";
						}
						HiddenCount++;
						element.style.visibility = "hidden"
					}
				}
			}
		}

	}

	return HiddenElements;
}

function ShowElements(Elements)
{
	if (is_ie6 || is_ie7)
	{
		if (Elements)
		{
			var i = -1;
			while (i < Elements.length)
			{
				try
				{
          if (Elements[i][0].id == "FrontEnd")
          {
            Elements[i][0].style.visibility = 'visible';
          }else{
					  Elements[i][0].style.visibility = Elements[i][1];
					}
				}
				catch (e)
				{
				}
				i++;
			}
		}
	}
}

//
//  Initialize page, allows themes to set themselves up
//
function InitApp(RunLoadHandlers)
{
    RunLoadHandlers == undefined ? false : true;
    try{
    //alert('initAppLoaded with ' + RunLoadHandlers  );
    }catch(e){}
    //return;
    //
    //  Initialize global objects
    //
    objMessage = new MessageWindow();
    	
	//
    //  Check for server feedback
    //
    if (ConfirmCloseRequest == 1)
    {
		if (is_ie6)
		{
			setTimeout("ConfirmClose(Message);",2)
		}
		else
		{
			ConfirmClose(Message);
		}
    }
    else
	{
		if (Message.length)
		{
		    if (ConfirmSaveRequest == "1") {
		        ConfirmClose(Message);
		    }
		    else {
		        ShowMessage(Message);
		    }	
			//ShowMessage(Message)
		}
	}

	if (ErrorMessage.length)
	{
	    ShowError(ErrorMessage)
	}
	
    if (AutoRebindParent == 1)
    {
        try
        {
            window.parent.Rebind(RebindReason);
        }
        catch (ex)
        {
        
        }
    }

    if (Redirect.length > 0)
    {
		WindowRedirect(Redirect);
    }

    if (AutoReloadParent == 1) 
    {
		if (window.parent.DialogCount > 0)
		{
		 	var o = window.parent.document.getElementById("DialogWindow" + (window.parent.DialogCount - 1));
		 	if(o)
		 	{
				o.contentWindow.__doPostBack("","");
		 	}
		 	else
		 	{
		 		window.parent.__doPostBack("","");
		 	}
		}
		else
		{
			__doPostBack("","");
		}
    }

    try	// Attempt to set the title of the parent dialog header automaticaly this will error on the first page made
	{
        parent.window.DialogSetTitle(document.title);
    }
    catch (e) {
    }

    if (AutoClose == 1)
    {
        window.parent.DialogClose();
		if (Dialog_Open)
		{
			window.parent.DialogOpen(Dialog_Open_Name,Dialog_Open_Param);
		}
    }
    else
    {
		if (Dialog_Open)
		{
			window.parent.DialogOpen(Dialog_Open_Name,Dialog_Open_Param);
		}
    }

    if (strNewWindow != '')
    {
    	NewWindow(strNewWindow);
    }
    
	//
	//  Make sure we are rendering in the right mode
	//
	if(document.compatMode)
	{
		if(document.compatMode=='BackCompat')
		{
			alert('WARNING: This document is being rendered in Quirks mode.');
		}
	}
	
	try
	{
		InitApplication();
	}
	catch (e)
	{
	
	}

	try
	{
		InitPage();
	}
	catch (e)
	{
	}

	try
	{
		InitTheme();
	}
	catch (e)
	{
	}

	try{
	if(RunLoadHandlers == undefined || RunLoadHandlers == true){
	var ilcount = intLoadFunctionsCount;
	    var objldfunc = objLoadFunctions;
	//
	//  Call all the registered onload handlers
	//
	    for (i=0;i<ilcount; i++)
	{
        try
        {
	            objldfunc[i]
	    }
	    catch (e)
	    {
	        if (IsDebugging)
	        {
	            alert ("onload function failed '" + objLoadFunction[i].tostring + "'");
	        }
	    }
	}
	}
    }catch(e){}
	//  Update the postback handler	
	//oldDoPostBack = window.__doPostBack;
	//window.__doPostBack = function(eventTarget, eventArgument) 
	//{
		//ShowProcessing();
		//oldDoPostBack(eventTarget,eventArgument);
	//}

	// Set up for barcode scanning
	ReplaceInputHandlers();

}

function WindowRedirect(URL)
{
	if (window.parent != window)
	{
		window.parent.WindowRedirect(URL)
		return;
	}
	window.location = Path_App + URL;
}

function ConfirmClose(Message)
{
	Confirm(Message, ConfirmResult);
}

function ConfirmResult(msgResult)
{
	switch (msgResult)
	{
		case "YES":
			__doPostBack("CONFIRMCLOSE_SAVE");
			break;

        case "NO":
            window.parent.DialogClose();
            break;
        default: // Cancel
            //	Do nothing
            ConfirmSaveRequest = 0;
            ConfirmCloseRequest = 0;
	}
}

//
//  Translates a language string
//
function Translate(Mask,P1,P2,P3,P4,P5,P6)
{
    if (P1 != null) {strTemp=Mask.replace(/%1/,P1)};
    if (P2 != null) {strTemp=strTemp.replace(/%2/,P2)};
    if (P3 != null) {strTemp=strTemp.replace(/%3/,P3)};
    if (P4 != null) {strTemp=strTemp.replace(/%4/,P4)};
    if (P5 != null) {strTemp=strTemp.replace(/%5/,P5)};
    if (P6 != null) {strTemp=strTemp.replace(/%6/,P6)};
    return strTemp;
}

//
//  Plays a sound in a embed object
//
function PlaySound(strID)
{
	var sound = document.getElementById(strID);

	try // Reset file to beginning can fail with some browsers
	{
		sound.Stop();
		sound.Rewind();
	} 
	catch (e) 
	{
	}

	try 
	{
		sound.DoPlay();
	}
	catch (e) 
	{
		try
		{
			sound.Play();
		}
		catch (e)
		{
			//
			// No sound plugin or maybe no sound hardware we just give up at this point
			//
		}
	}
}
////
////  Opens a new window
////
//function NewWindow(URL)
//{
//	if (document.all) 
//	{
//		Width = screen.availWidth - 10;
//		Height = screen.availHeight - 59;
//	}
//	else if (document.layers || document.getElementById) 
//	{
//		if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth)
//		{
//			Width = top.screen.availWidth - 50; 
//			Height = top.screen.availHeight - 50; 
//		}
//		else
//		{
//			Width = top.window.outerWidth; 
//			Height = top.window.outerHeight; 
//		}
//	}

//	o = window.open(Path_App + URL + "?screenwidth=" + Width + "&screenheight=" + Height,"","menubar=no,location=no,toolbar=no,title=no,status=yes,resize=yes,left=0,top=0,width=" + Width + ",height=" + Height);
//	try
//	{
////		o.moveTo(-3, -3);
//	}
//	catch (e)
//	{
//	}
//}



//
//  Opens a new window
//
function NewWindow(URL, pageview_id)
{
	if (document.all) 
	{
		Width = screen.availWidth - 10;
		Height = screen.availHeight - 59;
	}
	else if (document.layers || document.getElementById) 
	{
		if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth)
		{
			Width = top.screen.availWidth - 50; 
			Height = top.screen.availHeight - 50; 
		}
		else
		{
			Width = top.window.outerWidth; 
			Height = top.window.outerHeight; 
		}
	}
    if ( pageview_id == undefined )
    {
    	o = window.open(Path_App + URL + "?screenwidth=" + Width + "&screenheight=" + Height,"","menubar=no,location=no,toolbar=no,title=no,status=yes,resize=yes,left=0,top=0,width=" + Width + ",height=" + Height);
    }
    else
    {
      o = window.open(Path_App + URL + "?screenwidth=" + Width + "&screenheight=" + Height + "&action=pageview&pageview_id=" + pageview_id,"","menubar=no,location=no,toolbar=no,title=no,status=yes,resize=yes,left=0,top=0,width=" + Width + ",height=" + Height);
    }
	try
	{
//		o.moveTo(-3, -3);
	}
	catch (e)
	{
	}


}

//
//  Navigates to a new page though code
//
function LoadPage(strURL,lngTimeDelay)
{
	if (lngTimeDelay>0)
	{
		setTimeout(LoadPage(strURL),lngTimeDelay);
	}
	else
	{
		window.location=strURL;
	}
}

//
//  Fixes problems with IE
//
function FixIE()
{
	
	if (is_ie4)	 // Add the getElementById function dosn't exist in IE 4
	{
		document.getElementById=function (sElement) {return document.all[sElement];}
	}

	if ((is_ie5_5 || is_ie6) && is_win)  // Fix PNG's IE 5.5 and 6 on windows only
	{
		//
		//  Fix elements in the document that have images
		//
		var src="";
		for (var f = document.all.length - 1, form = null; (element = document.all[f]); f--)
		{
			src = element.src;
			if (element.tagName == "INPUT" || element.tagName == "IMG")
			{
				if (element.src.match(/\.png$/i) != null)
				{
					element.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
					element.style.width = element.width + "px";
					element.style.height = element.height + "px";
					element.src = Path_App + "skin/images/blank.gif";
				}
			}
		}

		//
		//  Fix stylesheet images
		//
		var stylesheets=document.styleSheets;
		for(var i=0;i<stylesheets.length;i++)
		{
			var stylesheet=stylesheets[i];
		
		    if(stylesheet.href.indexOf("BookBinder.css")==-1) //don't want to effect the main book back ground
		    {
			    var rules=stylesheet.rules;
			    var basepath = stylesheet.href.substring(0,stylesheet.href.lastIndexOf("/")+1);
        			
			        for(var j=0;j<rules.length;j++)
			        {
				        var curRule=rules[j];
				        if(curRule.style.backgroundImage && (curRule.style.backgroundImage.indexOf('.png') > 0))
				        {
					        var imageName=curRule.style.backgroundImage;
					        imageName=imageName.substr(4,imageName.length-5);
					        curRule.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + basepath + imageName + "', sizingMethod='scale')";
					        curRule.style.backgroundImage="";
				        }
				    }
			}
		}
	}
}

// used to handle barcodes
var barcodeInput =false;
var barcodeScanned = ""

// Events hit the controls first then the parent.
function OnBodyKeyPress(e) 
{
		// Only handle this if the window doesn't have any dialogs open
		if (e.charCode)
		{
			var sourceKeyCode = e.charCode; // Modzilla ASCII keycode property
		}
		else
		{
			var sourceKeyCode = e.keyCode; // IE ASCII keycode property
		}
	
		switch(sourceKeyCode)
		{
		case 8:
			EventStop(e);
			return false;
		case 12: // Datalogic start character so barcode must have started scanning.
			barcodeInput=true;
			EventStop(e);
			return true;
		case 13:  // return key
			if (barcodeInput)
			{
				barcodeInput=false;
				MasterPage_OnBarcodeScanned(barcodeScanned);
				barcodeScanned="";
				EventStop(e);
			}
			else if(isJunior==false)
			{
			/*
				//
				//  Cancel the enter key as it will submit the form
				//
				EventStop(e);
				//
				//  Check to see if we have a submit button available, if so submit the form
				//
				objForm = document.getElementById("aspnetForm");
				intNextControl = 0;
				while (intNextControl < objForm.elements.length)
				{
					try
					{
						if (objForm.elements[intNextControl].type == "submit")
						{
							objForm.elements[intNextControl].click();
							break;
						}
					}
					catch(ex)
					{
					}
					intNextControl = intNextControl + 1;
				}
				return false;
				*/
			}
			break;
		case 126: // ~ Character so barcode must have started scanning
			barcodeInput=true;
			EventStop(e);
			break;
		case 172: //¬ Character so barcode must have started scanning
			barcodeInput=true;
			EventStop(e);
			break;
		default: // capture all other characters and add them to the barcode field
			if (barcodeInput)
			{
				barcodeScanned=barcodeScanned + String.fromCharCode(sourceKeyCode);
				EventStop(e);
			}
			break;
		}
	// fire our childs original keypress method if it has one
	FireChildKeyPress(e)
}

function ReplaceInputHandlers()
{
	var el
	var inputElements=document.getElementsByTagName("INPUT");
	for (i=0;i<inputElements.length;i++)
	{
		el=inputElements[i]
		if (!(el.onkeypress==""))
		{
			// assign our original keypress method to a new event name
			el.originalonkeypress = el.onkeypress;
			// Remove the existing handler
			el.onkeypress=null;
		}
	}
}

// this will fire the original keypress event on the child

function FireChildKeyPress(e)
{
	if (e.srcElement)
	{
		var childSource = e.srcElement;  // IE
	}
	else
	{
		var childSource = e.target;  // Mozilla
	}
	
	if (childSource.originalonkeypress)
	{
		childSource.originalonkeypress(e);			
	}
}

function EventStop(e)
{
	e.cancelBubble = true;
	
	if (e.stopPropagation)
	{
	    e.stopPropagation();
	}
    
    if (e.keyCode)
    {
        if (is_ie)
        {
			e.keyCode = 0;
		}
    }
}


function DialogReturnResult(Result)
{
	try
	{
		if (DialogCount == 1)
		{
			DialogResult(Result);
		}
		else
		{
			document.getElementById("DialogWindow" + (DialogCount - 1)).contentWindow.DialogResult(Result);	
		}
	}
	catch (e)
	{
		alert("An exception occured when returning a value to a dialog\n\nException: " + e + "\nResult: " + Result);
	}
}

function DialogResult(Result)
{
	alert("No 'DialogResult' function present on this window.  Please declare one as it is needed.\n\n\nReturn Value: " + Result)
}

function DialogSetTitle(Title)
{
	document.getElementById("DialogTitle" + DialogCount).innerHTML=Title;
}

function DialogAllowClose() {
	return true;
}

function FullScreenWidth()
{
	return screen.availWidth;
}

function FullScreenHeight()
{
	return screen.availHeight;
}

function ScreenWidth()
{
	if (document.compatMode)
	{
		if (document.compatMode=='BackCompat')
		{
    		result = screen.availWidth;
        }
    }
	if (document.documentElement)
	{
		result = document.documentElement.clientWidth;
	}
	else
	{
		if (window.innerWidth)
		{
			result = window.innerWidth;
		}
	}	
	return result
}

function ScreenHeight()
{
	if (document.compatMode)
	{
		if (document.compatMode=='BackCompat')
		{
    		return screen.availHeight;
        }
    }
	if (document.documentElement)
	{
		return document.documentElement.clientHeight;
	}
	else
	{
		return window.innerHeight;
	}
}

var BarcodeFiltering=0;
var BarocdeFiltered="";
var txtBarcode=null;

function MessageWindow()
{
	this.Elements=null;
    this.Icon = document.getElementById('Dialog_Message_Image');
    
    this.SetText = function(value)
    {
        document.getElementById('Dialog_Message_Text').innerHTML = value;
    }
    
    this.SetTitle = function(value)
    {
		document.getElementById('Dialog_Message_Title').innerHTML = value;
    }

    this.SetButtons = function(OK_Visible, Yes_Visible, No_Visible, Cancel_Visible)
    {
        if (OK_Visible == true)
        {
            document.getElementById('btnMessageOK').style.display = "inline";
        }
        else
        {
            document.getElementById('btnMessageOK').style.display = "none";
        }
        
        if (Yes_Visible == true)
        {
            document.getElementById('btnMessageYes').style.display = "inline";
        }
        else
        {
            document.getElementById('btnMessageYes').style.display = "none";
        }
        
        if (No_Visible == true)
        {
            document.getElementById('btnMessageNo').style.display = "inline";
        }
        else
        {
            document.getElementById('btnMessageNo').style.display = "none";
        }
        
        if(Cancel_Visible == true)
        {
            document.getElementById('btnMessageCancel').style.display = "inline";
        }
        else
        {
            document.getElementById('btnMessageCancel').style.display = "none";
        }
    }

    // Place holder for actual function
    this.Callback = function ()
    {
        return true;
    }

    this.SetCallback = function(Callback)
    {
        if (Callback == null)
        {
            this.Callback = function ()
            {
                return true;
            }
        }
        else
        {
            this.Callback = Callback;
        }
    }

    this.SetIcon = function (IconName)
    {
		this.Icon.src = Path_App + "skin/images/dialog/32/" + IconName + ".gif";
    }

    this.Show = function()
    {
        this.Elements = HideElements(0, 0, 0, 0);

        var dialog = eval(Dialog_BaseID + "MessageWindow.Show();");

        if (document.getElementById('btnMessageOK').style.display != "none")
        {
            document.getElementById('btnMessageOK').focus();
        }
    }

    this.Hide = function ()
    {
   
        eval(Dialog_BaseID + "MessageWindow.Close();");
		
        this.CallBack = function() {return true;}
        this.Text="";
        ShowElements(this.Elements);
    }
}

function Question(Message, Callback, Title)
{
	if (window.parent != window)
	{
		window.parent.Question(Message, Callback, Title);
		return;
	}
	if (Title == null)
	{
		Title = "";
	}
    objMessage.SetButtons(false, true, true, false);
    objMessage.SetTitle(Title);
    objMessage.SetText(Message);
    objMessage.SetCallback(Callback);
    objMessage.SetIcon("question");
    objMessage.Show();
}

function Confirm(Message, Callback, Title)
{
	if (window.parent != window)
	{
		window.parent.Confirm(Message, Callback, Title);
		return;
	}
	if (Title == null)
	{
		Title = "";
	}
    objMessage.SetButtons(false, true, true, true);
    objMessage.SetText(Message);
    objMessage.SetTitle(Title);
    objMessage.SetCallback(Callback);
    objMessage.SetIcon("question");
    objMessage.Show();
}

function ShowMessage(Message, Callback, Title)
{
	if (window.parent != window)
	{
		window.parent.ShowMessage(Message, Callback, Title);
		return;
	}
	
	if (Title == null)
	{
		Title = "";
	}
  if (objMessage != null) 
  {
    objMessage.SetButtons(true, false, false, false);
    objMessage.SetTitle(Title);
    objMessage.SetText(Message);
    objMessage.SetCallback(Callback);
    objMessage.SetIcon("information");
    objMessage.Show();
  }
}

function ShowError(Message, Callback)
{
	if (window.parent != window)
	{
		window.parent.ShowError(Message, Callback);
		return;
	}
    objMessage.SetButtons(true, false, false, false);
    objMessage.SetText(Message);
    objMessage.SetCallback(Callback);
    objMessage.SetIcon("error");
    objMessage.Show();
}

/*
    Popup Element Control
*/
var OldOnClick=document.onclick;
var Popup_CurrentDiv = null
var Popup_RelatedObject = null

document.onclick = function (e)
{
    if (Popup_CurrentDiv != null)
    {
        var target = (e && e.target) || (event && event.srcElement);
        var parent = Popup_CheckParent(target);

        if (parent) 
        {
            Popup_CurrentDiv.style.display='none';
            Popup_CurrentDiv=null;
        }

        if (target == Popup_CurrentDiv)
        {
            Popup_CurrentDiv.style.display='block';
        }
        return false;
    }
    return true;
}

function Popup_CheckParent(obj)
{
    while(obj.parentNode)
    {
        if (obj == Popup_RelatedObject)
        {
            return false
        }
        obj = obj.parentNode
    }
    return true
} 

function Popup_Show(objDiv,objRelatedObject)
{
    if (Popup_CurrentDiv != null && Popup_CurrentDiv != objDiv)
    {
        Popup_CurrentDiv.style.display = "none";
        Popup_CurrentDiv=null;
    }
    Popup_CurrentDiv = objDiv;
    Popup_CurrentDiv.style.display = "block";
    Popup_CurrentDiv.style.width = objRelatedObject.style.width;
    Popup_RelatedObject = objRelatedObject;
}

function Popup_Hide(objDiv)
{
    if (Popup_CurrentDiv == objDiv)
    {
        Popup_CurrentDiv.style.display = "none";
        Popup_CurrentDiv=null;
    }
}

function FocusNextControl(CurrentControl)
{
    for (i=0;i++;i<CurrentControl.form.length)
    {
        if (CurrentControl.form[i] == CurrentControl)
        {
            CurrentControl.form[i + 1].focus();
        }
    }
}

function Option_AddItem(obj, value, unique, text)
{

	if (unique == true)
	{
	  var strValueAsString;
		for (i = 0; i < obj.options.length; i++)
		{
		  strValueAsString = trimAll(value);

			if (obj.options[i].value.toUpperCase() == strValueAsString.toUpperCase())
			{
				return;
			}
		}
	}
	strValueAsString = trimAll(value);
	obj.options.add(new Option(strValueAsString, strValueAsString))
}

  function trimAll(sString)
  {
    while (sString.substring(0,1) == ' ')
    {
      sString = sString.substring(1, sString.length);
    }
    while (sString.substring(sString.length-1, sString.length) == ' ')
    {
      sString = sString.substring(0,sString.length-1);
    }
    return sString;
  }
  
function Option_MoveItem(source,destination)
{
	destination.options.add(new Option(source.options[source.selectedIndex].text,source.options[source.selectedIndex].value));
	source.options.remove(source.selectedIndex);
}

function Option_MoveSelectedUp(obj)
{
    var text = obj.options[obj.selectedIndex].text;
    var value = obj.options[obj.selectedIndex].value;
    
    if (obj.selectedIndex == 0)
    {
        return
    }
    obj.options[obj.selectedIndex].text = obj.options[obj.selectedIndex - 1].text;
    obj.options[obj.selectedIndex].value = obj.options[obj.selectedIndex - 1].value;
    
    obj.options[obj.selectedIndex - 1].text = text;
    obj.options[obj.selectedIndex - 1].value = value;
    
    obj.selectedIndex = obj.selectedIndex - 1;
}

function Option_MoveSelectedDown(obj)
{
    var text = obj.options[obj.selectedIndex].text;
    var value = obj.options[obj.selectedIndex].value;
    
    if (obj.selectedIndex == obj.options.length -1)
    {
        return
    }
    obj.options[obj.selectedIndex].text = obj.options[obj.selectedIndex + 1].text;
    obj.options[obj.selectedIndex].value = obj.options[obj.selectedIndex + 1].value;
    
    obj.options[obj.selectedIndex + 1].text = text;
    obj.options[obj.selectedIndex + 1].value = value;
    
    obj.selectedIndex = obj.selectedIndex + 1;
}

function Option_RemoveItem(obj, index)
{
	if (index > -1 && index < obj.options.length)
	{
		obj.options.remove(index)
	}
}

/**
 * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, useExpressInstall, quality, xiRedirectUrl, redirectUrl, detectKey){
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', useExpressInstall);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs.push(key +"="+ variables[key]);
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "PlugIn"); }
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "ActiveX"); }
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else{
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // throws if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	if (window.opera || !document.all) return;
	var objects = document.getElementsByTagName("OBJECT");
	for (var i=0; i < objects.length; i++) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
// fixes bug in fp9 see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
deconcept.SWFObjectUtil.prepUnload = function() {
	__flash_unloadHandler = function(){};
	__flash_savedUnloadHandler = function(){};
	if (typeof window.onunload == 'function') {
		var oldUnload = window.onunload;
		window.onunload = function() {
			deconcept.SWFObjectUtil.cleanupSWFs();
			oldUnload();
		}
	} else {
		window.onunload = deconcept.SWFObjectUtil.cleanupSWFs;
	}
}
if (typeof window.onbeforeunload == 'function') {
	var oldBeforeUnload = window.onbeforeunload;
	window.onbeforeunload = function() {
		deconcept.SWFObjectUtil.prepUnload();
		oldBeforeUnload();
	}
} else {
	window.onbeforeunload = deconcept.SWFObjectUtil.prepUnload;
}
/* add Array.push if needed (ie5) */
if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;

//
//  Dialog Configuration
//
function Page(Width, Height, Source)
{
	this.width = Width;
	this.height = Height;
	this.src = Source;
}

//
//  Slider Control Functions
//


var Pages=new Array;
Pages['LOGON']=new Page(260,100,"logon.aspx");
Pages['ABOUT']=new Page(400,440,"about.aspx");
Pages['ADVANCEDSEARCH']=new Page(500,235,"advancedsearch.aspx");
Pages['SORT']=new Page(430,210,"sort.aspx");
Pages['EXPORT']=new Page(265,192,"export.aspx");
Pages['IMPORT']=new Page(460,285,"management/utility/import.aspx");
Pages['IMPORT_CLASSLIST'] = new Page(380, 285, "management/tool/importclasslist.aspx");
Pages['GOTO'] = new Page(260, 70, "management/goto.aspx");
Pages['COPY'] = new Page(320, 384, "management/utility/copy.aspx");
Pages['FLAGGINGBYBCR'] = new Page(600, 384, "management/utility/flaggingbybcr.aspx");
Pages['RELEASENOTES'] = new Page(600, 384, "releasenotes.aspx");

Pages['ACCOUNTREMINDERS']=new Page(300,360, "management/tool/accountreminders.aspx");
Pages['CALENDAR']=new Page(670,495,"management/tool/calendar.aspx");
Pages['REMINDERS']=new Page(300,365, "management/tool/reminders.aspx");
Pages['TOOL_FLOORPLAN'] =new Page(650,524,"management/tool/floorplan.aspx");
Pages['TOOL_BOOKOFTHEWEEK'] =new Page(400,287,"management/tool/bookoftheweek.aspx");
Pages['TOOL_QUICKREPLACE'] = new Page(500, 470, "management/tool/quickreplace.aspx");
Pages['TOOL_ADDKEYWORDS'] = new Page(500, 205, "management/tool/addkeywords.aspx");

Pages['REPORT_MANAGE'] = new Page(465, 370, "management/report/manage.aspx");
Pages['REPORT_VIEW'] = new Page(834, 620, "management/report/view.aspx");
Pages['REPORT_PARAMETERS'] = new Page(430, 235, "management/report/parameters.aspx");
Pages['REPORT_SCHOOLINSPECTION'] = new Page(265, 235, "management/report/schoolinspection.aspx");
Pages['REPORT_IMPORT'] = new Page(683, 95, "management/report/import.aspx");
//Pages['REPORT_OFSTEAD_REPORT'] = new Page(680, 500, "management/reports/ofsteadreport.aspx");

Pages['LABELPRINT_MANAGE'] = new Page(465, 370, "modules/labelprint/manage.aspx");
Pages['LABELPRINT_GENERATEBARCODES'] = new Page(400, 225, "modules/labelprint/GenerateBarcodes.aspx");
Pages['LABELPRINT_CARDPRINT'] = new Page(300, 320, "modules/labelprint/cardprint.aspx");
Pages['LABELPRINT_OPTIONS'] = new Page(400, 320, "modules/labelprint/options.aspx");
Pages['LABELPRINT_VIEWER'] = new Page(834, 620, "management/report/view.aspx");
Pages['LABELPRINT_IMPORT'] = new Page(683, 100, "modules/labelprint/import.aspx");

Pages['CHANGEPASSWORD'] =new Page(282,117,"changepassword.aspx");
Pages['FIND_RESOURCE'] = new Page(800,550,"management/utility/findresource.aspx");

Pages['UTILITY_MERGEGROUP']=new Page(350,65,"management/utility/mergegroup.aspx");

Pages['MYACCOUNT']=new Page(500,400,"modules/myaccount/account.aspx");
Pages['MYACCOUNT_REVIEW'] = new Page(600,490,"modules/myaccount/review.aspx");

Pages['SCHEDULE_DISCOVERY']=new Page(500,515,"management/schedule/discovery.aspx");
Pages['SCHEDULE_NEWS']=new Page(300,175,"management/schedule/news.aspx");
Pages['SCHEDULE_DATATIDY']=new Page(350,195,"management/schedule/datatidy.aspx");
Pages['SCHEDULE_REMINDERS']=new Page(500,490,"management/schedule/reminders.aspx");
Pages['SCHEDULE_STATEMENTS']=new Page(650,505,"management/schedule/statements.aspx");
Pages['SCHEDULE_DIRECTORYSERVICES'] = new Page(350, 285, "management/schedule/directoryservices.aspx");
Pages['SCHEDULE_ACCELERATED_READER'] = new Page(515, 245, "management/schedule/acceleratedreader.aspx");
Pages['SCHEDULE_LINKSPLUSIMPORT'] = new Page(495, 245, "management/schedule/weblinks.aspx");
Pages['SCHEDULE_EXTERNAL_MEDIA'] = new Page(475, 284, "management/schedule/externalmedia.aspx");

Pages['PAGEVIEW_MANAGE'] = new Page(465, 370, "management/pageview/manage.aspx");
Pages['PAGEVIEW_NEW']=new Page(400,95,"management/pageview/new.aspx");
Pages['PAGEVIEW_NEW_RESOURCE']=new Page(400,120,"management/pageview/new_resource.aspx");
Pages['PAGEVIEW_COPY']=new Page(400,105,"management/pageview/copy.aspx");
Pages['PAGEVIEW_EDIT']=new Page(650,530,"management/pageview/edit.aspx");
Pages['PAGEVIEW_IMPORT']=new Page(400,95,"management/pageview/import.aspx");

Pages['RECORDCARD_FLOORPLAN']=new Page(650,550,"floorplan.aspx");
Pages['RECORDCARD_RESOURCEITEM']=new Page(650,575,"resourceitem.aspx");
Pages['RECORDCARD_BORROWER']=new Page(650,504,"borrower.aspx");
Pages['RECORDCARD_TUTORGROUP']=new Page(550,380,"tutorgroup.aspx");
Pages['RECORDCARD_NEWS']=new Page(775,550,"news.aspx");
Pages['RECORDCARD_REVIEW']=new Page(650,465,"review.aspx");
Pages['RECORDCARD_LOOKUPMARCTAG']=new Page(400,245,"generic.aspx");
Pages['RECORDCARD_DATACLEANSEREPLACEMENT']=new Page(320,130,"generic.aspx");
Pages['RECORDCARD_DATACLEANSEREMOVAL']=new Page(320,100,"generic.aspx");
Pages['RECORDCARD_LOOKUPCLASS']=new Page(320,130,"generic.aspx");
Pages['RECORDCARD_SOFTWARELICENSE']=new Page(320,325,"generic.aspx");
Pages['RECORDCARD_AUDIT']=new Page(320,255,"generic.aspx");
Pages['RECORDCARD_OUTPUT']=new Page(320,180,"generic.aspx");
Pages['RECORDCARD_CUSTOMCATALOGUE']=new Page(320,425,"generic.aspx");
Pages['RECORDCARD_SCHEDULE']=new Page(420,400,"generic.aspx");
Pages['RECORDCARD_INTAKE']=new Page(500,570,"intake.aspx");
Pages['RECORDCARD_INTAKE_TRANSFER']=new Page(300,230,"management/recordcard/intake_transfer.aspx");
Pages['RECORDCARD_SUPPLIER']=new Page(320,300,"generic.aspx");
Pages['RECORDCARD_PAPERSIZE']=new Page(320,150,"generic.aspx");
Pages['RECORDCARD_CLASSCOLOURCODE']=new Page(430,435,"classcolourcode.aspx");

Pages['RECORDCARD_RESOURCE_NEW']=new Page(400,348,"management/recordcard/resource_new.aspx");
Pages['RECORDCARD_RESOURCEITEM_NEW']=new Page(250,290,"management/recordcard/resourceitem_new.aspx");
Pages['RECORDCARD_BORROWER_NEW']=new Page(250,285,"management/recordcard/borrower_new.aspx");
Pages['RECORDCARD_BORROWER_PHOTO'] = new Page(400, 360, "management/recordcard/borrower_photograph.aspx");
Pages['RECORDCARD_RESOURCEITEM_CHANGE_BARCODE'] = new Page(300, 288, "management/recordcard/changebarcode.aspx");

Pages['OPTIONS_FIELDS']=new Page(370,300,"management/options/fields.aspx");
Pages['OPTIONS_FIELDS_ADD']=new Page(300,120,"management/options/fields_add.aspx");
Pages['OPTIONS_PAGEVIEW']=new Page(410,360,"management/options/pageview.aspx");
Pages['OPTIONS_NEWS']=new Page(430,360,"management/options/news.aspx");
Pages['OPTIONS_DATATIDY']=new Page(350,385,"management/options/datatidy.aspx");
Pages['OPTIONS_LANGUAGE']=new Page(330,355,"management/options/language.aspx");
Pages['OPTIONS_LANGUAGEMODIFY']=new Page(650,500,"management/options/languagemodify.aspx");
Pages['OPTIONS_RESTRICTIONS']=new Page(400,300,"management/options/restrictions.aspx");
Pages['OPTIONS_RESERVATIONS']=new Page(320,215,"management/options/reservations.aspx");
Pages['OPTIONS_RESTRICTIONS_BORROWER']=new Page(520,335,"management/options/restrictions/borrower.aspx");
Pages['OPTIONS_RESTRICTIONS_BORROWER_MODIFY']=new Page(300,165,"management/options/restrictions/borrower_modify.aspx");
Pages['OPTIONS_RESTRICTIONS_BORROWER_NEW']=new Page(320,75,"management/options/restrictions/borrower_new.aspx");
Pages['OPTIONS_RESTRICTIONS_RESOURCE_MODIFY']=new Page(320,425,"management/options/restrictions/resource_modify.aspx");
Pages['OPTIONS_BARCODES']=new Page(540,350,"management/options/barcodes.aspx");
Pages['OPTIONS_BARCODEMASK_MODIFY']=new Page(450,400,"management/options/barcodes_modify.aspx");
Pages['OPTIONS_JUNIOR']=new Page(400,250,"management/options/junior.aspx");
Pages['OPTIONS_PRINTING']=new Page(400,125,"management/options/printing.aspx");
Pages['OPTIONS_REMINDERS']=new Page(350,400,"management/options/reminders.aspx");
Pages['OPTIONS_GENERAL']=new Page(650,550,"management/options/general.aspx");
Pages['OPTIONS_DATATIDY']=new Page(350,385,"management/options/datatidy.aspx");
Pages['OPTIONS_MODULES_SIP2SERVER']=new Page(300,310,"management/options/modules/sip2server.aspx");

Pages['PRINT_SETUP']=new Page(300,330,"printsetup.aspx");
Pages['PRINT_PREVIEW']=new Page(750,550,"handler/output.ashx");
Pages['PDF_PREVIEW']=new Page(750,550,"handler/pdfHandler.ashx");

Pages['FORM_MANAGE']=new Page(350,350,"management/form/manage.aspx");
Pages['FORM_NEW']=new Page(320,70,"management/form/new.aspx");
Pages['FORM_EDIT']=new Page(650,505,"management/form/edit.aspx");

Pages['REVIEW_TEMPLATE_EDIT']=new Page(650,480,"management/options/reviewquestions.aspx");

Pages['SECURITY_PASSWORDMANAGER'] = new Page(430, 329, "management/security/passwordmanager.aspx");

Pages['SECURITY_USERMANAGER']=new Page(300,245,"management/security/usermanager.aspx");
Pages['SECURITY_USERMANAGER_MODIFY']=new Page(300,305,"management/security/usermanager_modify.aspx");
Pages['SECURITY_GROUPMANAGER']=new Page(300,245,"management/security/groupmanager.aspx");
/*Pages['SECURITY_GROUPMANAGER_MODIFY']=new Page(400,373,"management/security/groupmanager_modify.aspx");*/
Pages['SECURITY_GROUPMANAGER_MODIFY']=new Page(450,373,"management/security/groupmanager_modify.aspx");

Pages['EDIT_FILTER']=new Page(300,200,"controls/pageview_advancedsearch_edititem.aspx");
Pages['JUNIOR_RESERVE']=new Page(480,320,"modules/enquiry/reserve.aspx");

Pages['CALENDAR_FR'] = new Page(350, 450, "management/tool/CalendarForcedReturn.aspx");
Pages['OPAC_THESAURUS'] = new Page(450, 210, "modules/thesaurus/thesaurus.aspx");
