﻿Type.registerNamespace("PhotoSite.Framework");PhotoSite.Framework.Event=function(B,A){this._name=B;this._properties=A||{};this._createEvent();};PhotoSite.Framework.Event.prototype={_name:null,_properties:null,_event:null,_createAndInitGeckoEvent:function(){var B=null;var A=this._properties;switch(this._name){case"focus":case"blur":case"activate":B=document.createEvent("UIEvents");B.initUIEvent(this._name,A.canBubble||false,A.cancelable||false,window,1);break;case"click":case"mousedown":case"mouseup":case"mouseover":case"mousemove":case"mouseout":B=document.createEvent("MouseEvents");B.initMouseEvent(this._name,A.canBubble||false,A.cancelable||false,window,1,A.screenX||0,A.screenY||0,A.clientX||0,A.clientY||0,A.ctrlKey||false,A.altKey||false,A.shiftKey||false,A.metaKey||false,A.button||0,A.relatedTarget||null);break;default:B=document.createEvent("HTMLEvents");B.initEvent(this._name,A.canBubble||true,A.cancelable||true);break;}return B;},_createEvent:function(){if(document.createEventObject){this._event=document.createEventObject();for(var A in this._properties){this._event[A]=this._properties[A];}}else{if(document.createEvent){this._event=this._createAndInitGeckoEvent();}}},fire:function(A){if(A.fireEvent){A.fireEvent("on"+this._name,this._event);}else{A.dispatchEvent(this._event);}},dispatch:function(A){this.fire(A);}};PhotoSite.Framework.Event.fireEvent=function(C,B,A){var D=new PhotoSite.Framework.Event(B,A);D.fire(C);};$fireEvent=PhotoSite.Framework.Event.fireEvent;PhotoSite.Framework.Event.getMousePositionFromEvent=function(A){return PhotoSite.Framework.Event.getMousePositionFromRawEvent(A.rawEvent);};PhotoSite.Framework.Event.getMousePositionFromRawEvent=function(C){var A=0;var B=0;if(C.pageX||C.pageY){A=C.pageX;B=C.pageY;}else{if(C.clientX||C.clientY){A=C.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;B=C.clientY+document.body.scrollTop+document.documentElement.scrollTop;}}return{x:A,y:B};};
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();