//http://javascriptcompressor.com/ /* window.js */ var Window=Class.create();Window.keepMultiModalWindow=false;Window.hasEffectLib=(typeof Effect!='undefined');Window.resizeEffectDuration=0.4;Window.prototype={initialize:function(){var b;var c=0;if(arguments.length>0){if(typeof arguments[0]=="string"){b=arguments[0];c=1}else b=arguments[0]?arguments[0].id:null}if(!b)b="window_"+new Date().getTime();if($(b))alert("Window "+b+" is already registered in the DOM! Make sure you use setDestroyOnClose() or destroyOnClose: true in the constructor");this.options=Object.extend({className:"dialog",blurClassName:null,minWidth:100,minHeight:20,resizable:true,closable:true,minimizable:true,maximizable:true,draggable:true,userData:null,showEffect:(Window.hasEffectLib?Effect.Appear:Element.show),hideEffect:(Window.hasEffectLib?Effect.Fade:Element.hide),showEffectOptions:{},hideEffectOptions:{},effectOptions:null,parent:document.body,title:" ",url:null,onload:Prototype.emptyFunction,width:200,height:300,opacity:1,recenterAuto:true,wiredDrag:false,closeCallback:null,destroyOnClose:false,gridX:1,gridY:1},arguments[c]||{});if(this.options.blurClassName)this.options.focusClassName=this.options.className;if(typeof this.options.top=="undefined"&&typeof this.options.bottom=="undefined")this.options.top=this._round(Math.random()*500,this.options.gridY);if(typeof this.options.left=="undefined"&&typeof this.options.right=="undefined")this.options.left=this._round(Math.random()*500,this.options.gridX);if(this.options.effectOptions){Object.extend(this.options.hideEffectOptions,this.options.effectOptions);Object.extend(this.options.showEffectOptions,this.options.effectOptions);if(this.options.showEffect==Element.Appear)this.options.showEffectOptions.to=this.options.opacity}if(Window.hasEffectLib){if(this.options.showEffect==Effect.Appear)this.options.showEffectOptions.to=this.options.opacity;if(this.options.hideEffect==Effect.Fade)this.options.hideEffectOptions.from=this.options.opacity}if(this.options.hideEffect==Element.hide)this.options.hideEffect=function(){Element.hide(this.element);if(this.options.destroyOnClose)this.destroy()}.bind(this);if(this.options.parent!=document.body)this.options.parent=$(this.options.parent);this.element=this._createWindow(b);this.element.win=this;this.eventMouseDown=this._initDrag.bindAsEventListener(this);this.eventMouseUp=this._endDrag.bindAsEventListener(this);this.eventMouseMove=this._updateDrag.bindAsEventListener(this);this.eventOnLoad=this._getWindowBorderSize.bindAsEventListener(this);this.eventMouseDownContent=this.toFront.bindAsEventListener(this);this.eventResize=this._recenter.bindAsEventListener(this);this.topbar=$(this.element.id+"_top");this.bottombar=$(this.element.id+"_bottom");this.content=$(this.element.id+"_content");Event.observe(this.topbar,"mousedown",this.eventMouseDown);Event.observe(this.bottombar,"mousedown",this.eventMouseDown);Event.observe(this.content,"mousedown",this.eventMouseDownContent);Event.observe(window,"load",this.eventOnLoad);Event.observe(window,"resize",this.eventResize);Event.observe(window,"scroll",this.eventResize);Event.observe(this.options.parent,"scroll",this.eventResize);if(this.options.draggable){var d=this;[this.topbar,this.topbar.up().previous(),this.topbar.up().next()].each(function(a){a.observe("mousedown",d.eventMouseDown);a.addClassName("top_draggable")});[this.bottombar.up(),this.bottombar.up().previous(),this.bottombar.up().next()].each(function(a){a.observe("mousedown",d.eventMouseDown);a.addClassName("bottom_draggable")})}if(this.options.resizable){this.sizer=$(this.element.id+"_sizer");Event.observe(this.sizer,"mousedown",this.eventMouseDown)}this.useLeft=null;this.useTop=null;if(typeof this.options.left!="undefined"){this.element.setStyle({left:parseFloat(this.options.left)+'px'});this.useLeft=true}else{this.element.setStyle({right:parseFloat(this.options.right)+'px'});this.useLeft=false}if(typeof this.options.top!="undefined"){this.element.setStyle({top:parseFloat(this.options.top)+'px'});this.useTop=true}else{this.element.setStyle({bottom:parseFloat(this.options.bottom)+'px'});this.useTop=false}this.storedLocation=null;this.setOpacity(this.options.opacity);if(this.options.zIndex)this.setZIndex(this.options.zIndex);if(this.options.destroyOnClose)this.setDestroyOnClose(true);this._getWindowBorderSize();this.width=this.options.width;this.height=this.options.height;this.visible=false;this.constraint=false;this.constraintPad={top:0,left:0,bottom:0,right:0};if(this.width&&this.height)this.setSize(this.options.width,this.options.height);this.setTitle(this.options.title);Windows.register(this)},destroy:function(){this._notify("onDestroy");Event.stopObserving(this.topbar,"mousedown",this.eventMouseDown);Event.stopObserving(this.bottombar,"mousedown",this.eventMouseDown);Event.stopObserving(this.content,"mousedown",this.eventMouseDownContent);Event.stopObserving(window,"load",this.eventOnLoad);Event.stopObserving(window,"resize",this.eventResize);Event.stopObserving(window,"scroll",this.eventResize);Event.stopObserving(this.content,"load",this.options.onload);if(this._oldParent){var a=this.getContent();var b=null;for(var i=0;i ";$(this.getId()+"_table_content").innerHTML=b;this.content=$(this.element.id+"_content")}this.getContent().innerHTML=a},setAjaxContent:function(a,b,c,d){this.showFunction=c?"showCenter":"show";this.showModal=d||false;b=b||{};this.setHTMLContent("");this.onComplete=b.onComplete;if(!this._onCompleteHandler)this._onCompleteHandler=this._setAjaxContent.bind(this);b.onComplete=this._onCompleteHandler;new Ajax.Request(a,b);b.onComplete=this.onComplete},_setAjaxContent:function(a){Element.update(this.getContent(),a.responseText);if(this.onComplete)this.onComplete(a);this.onComplete=null;this[this.showFunction](this.showModal)},setURL:function(a){if(this.options.url)this.content.src=null;this.options.url=a;var b="";$(this.getId()+"_table_content").innerHTML=b;this.content=$(this.element.id+"_content")},getURL:function(){return this.options.url?this.options.url:null},refresh:function(){if(this.options.url)$(this.element.getAttribute('id')+'_content').src=this.options.url},setCookie:function(a,b,c,d,e){a=a||this.element.id;this.cookie=[a,b,c,d,e];var f=WindowUtilities.getCookie(a);if(f){var g=f.split(',');var x=g[0].split(':');var y=g[1].split(':');var w=parseFloat(g[2]),h=parseFloat(g[3]);var i=g[4];var j=g[5];this.setSize(w,h);if(i=="true")this.doMinimize=true;else if(j=="true")this.doMaximize=true;this.useLeft=x[0]=="l";this.useTop=y[0]=="t";this.element.setStyle(this.useLeft?{left:x[1]}:{right:x[1]});this.element.setStyle(this.useTop?{top:y[1]}:{bottom:y[1]})}},getId:function(){return this.element.id},setDestroyOnClose:function(){this.options.destroyOnClose=true},setConstraint:function(a,b){this.constraint=a;this.constraintPad=Object.extend(this.constraintPad,b||{});if(this.useTop&&this.useLeft)this.setLocation(parseFloat(this.element.style.top),parseFloat(this.element.style.left))},_initDrag:function(a){if(Event.element(a)==this.sizer&&this.isMinimized())return;if(Event.element(a)!=this.sizer&&this.isMaximized())return;if(Prototype.Browser.IE&&this.heightN==0)this._getWindowBorderSize();this.pointer=[this._round(Event.pointerX(a),this.options.gridX),this._round(Event.pointerY(a),this.options.gridY)];if(this.options.wiredDrag)this.currentDrag=this._createWiredElement();else this.currentDrag=this.element;if(Event.element(a)==this.sizer){this.doResize=true;this.widthOrg=this.width;this.heightOrg=this.height;this.bottomOrg=parseFloat(this.element.getStyle('bottom'));this.rightOrg=parseFloat(this.element.getStyle('right'));this._notify("onStartResize")}else{this.doResize=false;var b=$(this.getId()+'_close');if(b&&Position.within(b,this.pointer[0],this.pointer[1])){this.currentDrag=null;return}this.toFront();if(!this.options.draggable)return;this._notify("onStartMove")}Event.observe(document,"mouseup",this.eventMouseUp,false);Event.observe(document,"mousemove",this.eventMouseMove,false);WindowUtilities.disableScreen('__invisible__','__invisible__',this.overlayOpacity);document.body.ondrag=function(){return false};document.body.onselectstart=function(){return false};this.currentDrag.show();Event.stop(a)},_round:function(a,b){return b==1?a:a=Math.floor(a/b)*b},_updateDrag:function(a){var b=[this._round(Event.pointerX(a),this.options.gridX),this._round(Event.pointerY(a),this.options.gridY)];var c=b[0]-this.pointer[0];var d=b[1]-this.pointer[1];if(this.doResize){var w=this.widthOrg+c;var h=this.heightOrg+d;c=this.width-this.widthOrg;d=this.height-this.heightOrg;if(this.useLeft)w=this._updateWidthConstraint(w);else this.currentDrag.setStyle({right:(this.rightOrg-c)+'px'});if(this.useTop)h=this._updateHeightConstraint(h);else this.currentDrag.setStyle({bottom:(this.bottomOrg-d)+'px'});this.setSize(w,h);this._notify("onResize")}else{this.pointer=b;if(this.useLeft){var e=parseFloat(this.currentDrag.getStyle('left'))+c;var f=this._updateLeftConstraint(e);this.pointer[0]+=f-e;this.currentDrag.setStyle({left:f+'px'})}else this.currentDrag.setStyle({right:parseFloat(this.currentDrag.getStyle('right'))-c+'px'});if(this.useTop){var g=parseFloat(this.currentDrag.getStyle('top'))+d;var i=this._updateTopConstraint(g);this.pointer[1]+=i-g;this.currentDrag.setStyle({top:i+'px'})}else this.currentDrag.setStyle({bottom:parseFloat(this.currentDrag.getStyle('bottom'))-d+'px'});this._notify("onMove")}if(this.iefix)this._fixIEOverlapping();this._removeStoreLocation();Event.stop(a)},_endDrag:function(a){WindowUtilities.enableScreen('__invisible__');if(this.doResize)this._notify("onEndResize");else this._notify("onEndMove");Event.stopObserving(document,"mouseup",this.eventMouseUp,false);Event.stopObserving(document,"mousemove",this.eventMouseMove,false);Event.stop(a);this._hideWiredElement();this._saveCookie();document.body.ondrag=null;document.body.onselectstart=null},_updateLeftConstraint:function(a){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;if(ab-this.constraintPad.right)a=b-this.constraintPad.right-this.width-this.widthE-this.widthW}return a},_updateTopConstraint:function(a){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var h=this.height+this.heightN+this.heightS;if(ab-this.constraintPad.bottom)a=b-this.constraintPad.bottom-h}return a},_updateWidthConstraint:function(w){if(this.constraint&&this.useLeft&&this.useTop){var a=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;var b=parseFloat(this.element.getStyle("left"));if(b+w+this.widthE+this.widthW>a-this.constraintPad.right)w=a-this.constraintPad.right-b-this.widthE-this.widthW}return w},_updateHeightConstraint:function(h){if(this.constraint&&this.useLeft&&this.useTop){var a=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var b=parseFloat(this.element.getStyle("top"));if(b+h+this.heightN+this.heightS>a-this.constraintPad.bottom)h=a-this.constraintPad.bottom-b-this.heightN-this.heightS}return h},_createWindow:function(a){var b=this.options.className;var c=document.createElement("div");c.setAttribute('id',a);c.className="dialog";var d;if(this.options.url)d="";else d="
";var e=this.options.closable?"
":"";var f=this.options.minimizable?"
":"";var g=this.options.maximizable?"
":"";var h=this.options.resizable?"class='"+b+"_sizer' id='"+a+"_sizer'":"class='"+b+"_se'";var i="../themes/default/blank.gif";c.innerHTML=e+f+g+"
"+this.options.title+"
"+d+"
";Element.hide(c);this.options.parent.insertBefore(c,this.options.parent.firstChild);Event.observe($(a+"_content"),"load",this.options.onload);return c},changeClassName:function(b){var c=this.options.className;var d=this.getId();$A(["_close","_minimize","_maximize","_sizer","_content"]).each(function(a){this._toggleClassName($(d+a),c+a,b+a)}.bind(this));this._toggleClassName($(d+"_top"),c+"_title",b+"_title");$$("#"+d+" td").each(function(a){a.className=a.className.sub(c,b)});this.options.className=b},_toggleClassName:function(a,b,c){if(a){a.removeClassName(b);a.addClassName(c)}},setLocation:function(a,b){a=this._updateTopConstraint(a);b=this._updateLeftConstraint(b);var e=this.currentDrag||this.element;e.setStyle({top:a+'px'});e.setStyle({left:b+'px'});this.useLeft=true;this.useTop=true},getLocation:function(){var a={};if(this.useTop)a=Object.extend(a,{top:this.element.getStyle("top")});else a=Object.extend(a,{bottom:this.element.getStyle("bottom")});if(this.useLeft)a=Object.extend(a,{left:this.element.getStyle("left")});else a=Object.extend(a,{right:this.element.getStyle("right")});return a},getSize:function(){return{width:this.width,height:this.height}},setSize:function(a,b,c){a=parseFloat(a);b=parseFloat(b);if(!this.minimized&&athis.options.maxHeight)b=this.options.maxHeight;if(this.options.maxWidth&&a>this.options.maxWidth)a=this.options.maxWidth;if(this.useTop&&this.useLeft&&Window.hasEffectLib&&Effect.ResizeWindow&&c){new Effect.ResizeWindow(this,null,null,a,b,{duration:Window.resizeEffectDuration})}else{this.width=a;this.height=b;var e=this.currentDrag?this.currentDrag:this.element;e.setStyle({width:a+this.widthW+this.widthE+"px"});e.setStyle({height:b+this.heightN+this.heightS+"px"});if(!this.currentDrag||this.currentDrag==this.element){var d=$(this.element.id+'_content');d.setStyle({height:b+'px'});d.setStyle({width:a+'px'})}}},updateHeight:function(){this.setSize(this.width,this.content.scrollHeight,true)},updateWidth:function(){this.setSize(this.content.scrollWidth,this.height,true)},toFront:function(){if(this.element.style.zIndex0)&&(navigator.userAgent.indexOf('Opera')<0)&&(this.element.getStyle('position')=='absolute')){new Insertion.After(this.element.id,'');this.iefix=$(this.element.id+'_iefix')}if(this.iefix)setTimeout(this._fixIEOverlapping.bind(this),50)},_fixIEOverlapping:function(){Position.clone(this.element,this.iefix);this.iefix.style.zIndex=this.element.style.zIndex-1;this.iefix.show()},_getWindowBorderSize:function(a){var b=this._createHiddenDiv(this.options.className+"_n");this.heightN=Element.getDimensions(b).height;b.parentNode.removeChild(b);var b=this._createHiddenDiv(this.options.className+"_s");this.heightS=Element.getDimensions(b).height;b.parentNode.removeChild(b);var b=this._createHiddenDiv(this.options.className+"_e");this.widthE=Element.getDimensions(b).width;b.parentNode.removeChild(b);var b=this._createHiddenDiv(this.options.className+"_w");this.widthW=Element.getDimensions(b).width;b.parentNode.removeChild(b);var b=document.createElement("div");b.className="overlay_"+this.options.className;document.body.appendChild(b);var c=this;setTimeout(function(){c.overlayOpacity=($(b).getStyle("opacity"));b.parentNode.removeChild(b)},10);if(Prototype.Browser.IE){this.heightS=$(this.getId()+"_row3").getDimensions().height;this.heightN=$(this.getId()+"_row1").getDimensions().height}if(Prototype.Browser.WebKit&&Prototype.Browser.WebKitVersion<420)this.setSize(this.width,this.height);if(this.doMaximize)this.maximize();if(this.doMinimize)this.minimize()},_createHiddenDiv:function(a){var b=document.body;var c=document.createElement("div");c.setAttribute('id',this.element.id+"_tmp");c.className=a;c.style.display='none';c.innerHTML='';b.insertBefore(c,b.firstChild);return c},_storeLocation:function(){if(this.storedLocation==null){this.storedLocation={useTop:this.useTop,useLeft:this.useLeft,top:this.element.getStyle('top'),bottom:this.element.getStyle('bottom'),left:this.element.getStyle('left'),right:this.element.getStyle('right'),width:this.width,height:this.height}}},_restoreLocation:function(){if(this.storedLocation!=null){this.useLeft=this.storedLocation.useLeft;this.useTop=this.storedLocation.useTop;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow)new Effect.ResizeWindow(this,this.storedLocation.top,this.storedLocation.left,this.storedLocation.width,this.storedLocation.height,{duration:Window.resizeEffectDuration});else{this.element.setStyle(this.useLeft?{left:this.storedLocation.left}:{right:this.storedLocation.right});this.element.setStyle(this.useTop?{top:this.storedLocation.top}:{bottom:this.storedLocation.bottom});this.setSize(this.storedLocation.width,this.storedLocation.height)}Windows.resetOverflow();this._removeStoreLocation()}},_removeStoreLocation:function(){this.storedLocation=null},_saveCookie:function(){if(this.cookie){var a="";if(this.useLeft)a+="l:"+(this.storedLocation?this.storedLocation.left:this.element.getStyle('left'));else a+="r:"+(this.storedLocation?this.storedLocation.right:this.element.getStyle('right'));if(this.useTop)a+=",t:"+(this.storedLocation?this.storedLocation.top:this.element.getStyle('top'));else a+=",b:"+(this.storedLocation?this.storedLocation.bottom:this.element.getStyle('bottom'));a+=","+(this.storedLocation?this.storedLocation.width:this.width);a+=","+(this.storedLocation?this.storedLocation.height:this.height);a+=","+this.isMinimized();a+=","+this.isMaximized();WindowUtilities.setCookie(a,this.cookie)}},_createWiredElement:function(){if(!this.wiredElement){if(Prototype.Browser.IE)this._getWindowBorderSize();var a=document.createElement("div");a.className="wired_frame "+this.options.className+"_wired_frame";a.style.position='absolute';this.options.parent.insertBefore(a,this.options.parent.firstChild);this.wiredElement=$(a)}if(this.useLeft)this.wiredElement.setStyle({left:this.element.getStyle('left')});else this.wiredElement.setStyle({right:this.element.getStyle('right')});if(this.useTop)this.wiredElement.setStyle({top:this.element.getStyle('top')});else this.wiredElement.setStyle({bottom:this.element.getStyle('bottom')});var b=this.element.getDimensions();this.wiredElement.setStyle({width:b.width+"px",height:b.height+"px"});this.wiredElement.setStyle({zIndex:Windows.maxZIndex+30});return this.wiredElement},_hideWiredElement:function(){if(!this.wiredElement||!this.currentDrag)return;if(this.currentDrag==this.element)this.currentDrag=null;else{if(this.useLeft)this.element.setStyle({left:this.currentDrag.getStyle('left')});else this.element.setStyle({right:this.currentDrag.getStyle('right')});if(this.useTop)this.element.setStyle({top:this.currentDrag.getStyle('top')});else this.element.setStyle({bottom:this.currentDrag.getStyle('bottom')});this.currentDrag.hide();this.currentDrag=null;if(this.doResize)this.setSize(this.width,this.height)}},_notify:function(a){if(this.options[a])this.options[a](this);else Windows.notify(a,this)}};var Windows={windows:[],modalWindows:[],observers:[],focusedWindow:null,maxZIndex:0,overlayShowEffectOptions:{duration:0.5},overlayHideEffectOptions:{duration:0.5},addObserver:function(a){this.removeObserver(a);this.observers.push(a)},removeObserver:function(a){this.observers=this.observers.reject(function(o){return o==a})},notify:function(a,b){this.observers.each(function(o){if(o[a])o[a](a,b)})},getWindow:function(a){return this.windows.detect(function(d){return d.getId()==a})},getFocusedWindow:function(){return this.focusedWindow},updateFocusedWindow:function(){this.focusedWindow=this.windows.length>=2?this.windows[this.windows.length-2]:null},register:function(a){this.windows.push(a)},addModalWindow:function(a){if(this.modalWindows.length==0){WindowUtilities.disableScreen(a.options.className,'overlay_modal',a.overlayOpacity,a.getId(),a.options.parent)}else{if(Window.keepMultiModalWindow){$('overlay_modal').style.zIndex=Windows.maxZIndex+1;Windows.maxZIndex+=1;WindowUtilities._hideSelect(this.modalWindows.last().getId())}else this.modalWindows.last().element.hide();WindowUtilities._showSelect(a.getId())}this.modalWindows.push(a)},removeModalWindow:function(a){this.modalWindows.pop();if(this.modalWindows.length==0)WindowUtilities.enableScreen();else{if(Window.keepMultiModalWindow){this.modalWindows.last().toFront();WindowUtilities._showSelect(this.modalWindows.last().getId())}else this.modalWindows.last().element.show()}},register:function(a){this.windows.push(a)},unregister:function(a){this.windows=this.windows.reject(function(d){return d==a})},closeAll:function(){this.windows.each(function(w){Windows.close(w.getId())})},closeAllModalWindows:function(){WindowUtilities.enableScreen();this.modalWindows.each(function(a){if(a)a.close()})},minimize:function(a,b){var c=this.getWindow(a);if(c&&c.visible)c.minimize();Event.stop(b)},maximize:function(a,b){var c=this.getWindow(a);if(c&&c.visible)c.maximize();Event.stop(b)},close:function(a,b){var c=this.getWindow(a);if(c)c.close();if(b)Event.stop(b)},blur:function(a){var b=this.getWindow(a);if(!b)return;if(b.options.blurClassName)b.changeClassName(b.options.blurClassName);if(this.focusedWindow==b)this.focusedWindow=null;b._notify("onBlur")},focus:function(a){var b=this.getWindow(a);if(!b)return;if(this.focusedWindow)this.blur(this.focusedWindow.getId());if(b.options.focusClassName)b.changeClassName(b.options.focusClassName);this.focusedWindow=b;b._notify("onFocus")},unsetOverflow:function(a){this.windows.each(function(d){d.oldOverflow=d.getContent().getStyle("overflow")||"auto";d.getContent().setStyle({overflow:"hidden"})});if(a&&a.oldOverflow)a.getContent().setStyle({overflow:a.oldOverflow})},resetOverflow:function(){this.windows.each(function(d){if(d.oldOverflow)d.getContent().setStyle({overflow:d.oldOverflow})})},updateZindex:function(a,b){if(a>this.maxZIndex){this.maxZIndex=a;if(this.focusedWindow)this.blur(this.focusedWindow.getId())}this.focusedWindow=b;if(this.focusedWindow)this.focus(this.focusedWindow.getId())}};var Dialog={dialogId:null,onCompleteFunc:null,callFunc:null,parameters:null,confirm:function(a,b){if(a&&typeof a!="string"){Dialog._runAjaxRequest(a,b,Dialog.confirm);return}a=a||"";b=b||{};var c=b.okLabel?b.okLabel:"Ok";var d=b.cancelLabel?b.cancelLabel:"Cancel";b=Object.extend(b,b.windowParameters||{});b.windowParameters=b.windowParameters||{};b.className=b.className||"alert";var e="class ='"+(b.buttonClass?b.buttonClass+" ":"")+" ok_button'";var f="class ='"+(b.buttonClass?b.buttonClass+" ":"")+" cancel_button'";var a="
"+a+"
";return this._openDialog(a,b)},alert:function(a,b){if(a&&typeof a!="string"){Dialog._runAjaxRequest(a,b,Dialog.alert);return}a=a||"";b=b||{};var c=b.okLabel?b.okLabel:"Ok";b=Object.extend(b,b.windowParameters||{});b.windowParameters=b.windowParameters||{};b.className=b.className||"alert";var d="class ='"+(b.buttonClass?b.buttonClass+" ":"")+" ok_button'";var a="
"+a+"
";return this._openDialog(a,b)},info:function(a,b){if(a&&typeof a!="string"){Dialog._runAjaxRequest(a,b,Dialog.info);return}a=a||"";b=b||{};b=Object.extend(b,b.windowParameters||{});b.windowParameters=b.windowParameters||{};b.className=b.className||"alert";var a="";if(b.showProgress)a+="";b.ok=null;b.cancel=null;return this._openDialog(a,b)},setInfoMessage:function(a){$('modal_dialog_message').update(a)},closeInfo:function(){Windows.close(this.dialogId)},_openDialog:function(a,b){var c=b.className;if(!b.height&&!b.width){b.width=WindowUtilities.getPageSize(b.options.parent||document.body).pageWidth/2}if(b.id)this.dialogId=b.id;else{var t=new Date();this.dialogId='modal_dialog_'+t.getTime();b.id=this.dialogId}if(!b.height||!b.width){var d=WindowUtilities._computeSize(a,this.dialogId,b.width,b.height,5,c);if(b.height)b.width=d+5;else b.height=d+5}b.effectOptions=b.effectOptions;b.resizable=b.resizable||false;b.minimizable=b.minimizable||false;b.maximizable=b.maximizable||false;b.draggable=b.draggable||false;b.closable=b.closable||false;var e=new Window(b);e.getContent().innerHTML=a;e.showCenter(true,b.top,b.left);e.setDestroyOnClose();e.cancelCallback=b.onCancel||b.cancel;e.okCallback=b.onOk||b.ok;return e},_getAjaxContent:function(a){Dialog.callFunc(a.responseText,Dialog.parameters)},_runAjaxRequest:function(a,b,c){if(a.options==null)a.options={};Dialog.onCompleteFunc=a.options.onComplete;Dialog.parameters=b;Dialog.callFunc=c;a.options.onComplete=Dialog._getAjaxContent;new Ajax.Request(a.url,a.options)},okCallback:function(){var b=Windows.focusedWindow;if(!b.okCallback||b.okCallback(b)){$$("#"+b.getId()+" input").each(function(a){a.onclick=null});b.close()}},cancelCallback:function(){var b=Windows.focusedWindow;$$("#"+b.getId()+" input").each(function(a){a.onclick=null});b.close();if(b.cancelCallback)b.cancelCallback(b)}} if(Prototype.Browser.WebKit){var array=navigator.userAgent.match(new RegExp(/AppleWebKit\/([\d\.\+]*)/));Prototype.Browser.WebKitVersion=parseFloat(array[1])}var WindowUtilities={getWindowScroll:function(a){var T;var L;var W;var H;a=a||document.body;if(a!=document.body){T=a.scrollTop;L=a.scrollLeft;W=a.scrollWidth;H=a.scrollHeight}else{var w=window;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft}else if(w.document.body){T=body.scrollTop;L=body.scrollLeft}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight}else if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight}else{W=body.offsetWidth;H=body.offsetHeight}}}return{top:T,left:L,width:W,height:H}},getPageSize:function(a){a=a||document.body;var b;var c;var d;var e;if(a!=document.body){b=a.getWidth();c=a.getHeight();e=a.scrollWidth;d=a.scrollHeight}else{var f,yScroll;if(window.innerHeight&&window.scrollMaxY){f=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY}else if(document.body.scrollHeight>document.body.offsetHeight){f=document.body.scrollWidth;yScroll=document.body.scrollHeight}else{f=document.body.offsetWidth;yScroll=document.body.offsetHeight}if(self.innerHeight){b=self.innerWidth;c=self.innerHeight}else if(document.documentElement&&document.documentElement.clientHeight){b=document.documentElement.clientWidth;c=document.documentElement.clientHeight}else if(document.body){b=document.body.clientWidth;c=document.body.clientHeight}if(yScroll600);if(scrolling)Effect.ScrollTo('divSearchResultsFiltering');var frm=document.frmSearch;frm.sortBy.value=intIndex;frm.page.value=1;frm.cfr.value=4;if(flags){if((flags&2)==2){if(scrolling)setTimeout('ajaxRefreshSearchByQuerystring(document.frmSearch)',1000);else ajaxRefreshSearchByQuerystring(frm)}else{if(scrolling)setTimeout('document.frmSearch.submit()',1000);else frm.submit()}}else{if(scrolling)setTimeout('document.frmSearch.submit()',1000);else frm.submit()}}function page_selection(val,flags){var frm=document.frmSearch;frm.page.value=val;frm.cfr.value='3';if(flags){if((flags&2)==2&&window.sysProgressImage){ajaxRefreshSearchByQuerystring(frm)}else{frm.submit()}}else{frm.submit()}}function resultsFilter_onChange(useAjax){if(queryStr('cmd')=='dosearchhtml')useAjax=false;var exclusions='cmdsearchresultsfilteringreset';var frm=document.forms['form_resultsFiltering'];var newQuerystring='';var elementIdFound=false;if(useAjax){for(var i=0;iSearching...';document.forms['form_resultsFiltering'].action='/index.asp';document.forms['form_resultsFiltering'].submit()}}function ajaxRefreshSearchByQuerystring(frm){var newQuerystring='';var elementIdFound=false;for(var i=0;i";C.outerHTML=strNewHTML}})}}function doTheSearch(){var showBorders=0;var url='';showBorders=queryStr('bordersOn');var suppressPaging=queryStr('suppressPaging');showProgress();if(varElementID=='')varElementID=10;if(queryStr('showAjax')=='1'){if(!$('sysShowAjax')){Element.insert('
')}}if(document.getElementById('divSearchResultsFiltering')){url='/sysSearchResultsFiltering.asp?'+varReqQuerystring+'&elementID='+varElementID;new Ajax.Updater('divSearchResultsFiltering',url,{evalScripts:true});if(document.getElementById('sysShowAjax')){document.getElementById('sysShowAjax').innerHTML='Click for results filtering
'}}url='/sysSearchResults.asp?'+varReqQuerystring+'&elementID='+varElementID+'&suppressPaging='+suppressPaging;new Ajax.Updater('searchResultsContainer',url,{evalScripts:true});var toInsert="
"+url+"
";if(document.getElementById('sysShowAjax')){document.getElementById('sysShowAjax').innerHTML+='Click for search results'}if(document.getElementById('sysShowAjax')){document.getElementById('sysShowAjax').innerHTML='For Debugging: Click to view the results HTML
'+document.getElementById('sysShowAjax').innerHTML}}function showProgress(){if(!window.sysProgressImage)return;if($('tdProgressIndicator')){if(document.images['sysImgProgressIndicator']){document.images['sysImgProgressIndicator'].src=sysProgressImage.src}else{document.getElementById('tdProgressIndicator').innerHTML='
'}}}function sysSetElementId(x){varElementID=x}function grayOutTheSearchResultsContainer(){var vDiv=$('searchResultsContainer');var vDivGray=$('searchResultsContainerGrayed');if(!vDivGray)return;vDivGray.style.width=vDiv.offsetWidth;vDivGray.style.height=vDiv.offsetHeight;vDivGray.style.top=vDiv.offsetTop;vDivGray.style.left=vDiv.offsetLeft;vDivGray.style.backgroundColor='#afafaf';vDivGray.style.opacity=.7;vDivGray.style.filter='alpha(opacity=70);'}function restoreTheSearchResultsContainer(){var vDiv=document.getElementById('searchResultsContainer');var vDivGray=document.getElementById('searchResultsContainerGrayed');vDivGray.style.width=vDiv.offsetWidth;vDivGray.style.height=vDiv.offsetHeight;vDivGray.style.left=-10000;vDivGray.style.top=(vDivGray.offsetHeight*-1)}function sysGrayOut(vis,options){var options=options||{};var zindex=options.zindex||50;var opacity=options.opacity||70;var opaque=(opacity/100);var bgcolor=options.bgcolor||'#000000';var dark=document.getElementById('darkenScreenObject');if(!dark){var tbody=document.getElementsByTagName("body")[0];var tnode=document.createElement('div');tnode.style.position='absolute';tnode.style.top='0px';tnode.style.left='0px';tnode.style.overflow='hidden';tnode.style.display='none';tnode.id='darkenScreenObject';tbody.appendChild(tnode);dark=document.getElementById('darkenScreenObject')}if(vis){if(document.body&&(document.body.scrollWidth||document.body.scrollHeight)){var pageWidth=document.body.scrollWidth+'px';var pageHeight=document.body.scrollHeight+'px'}else if(document.body.offsetWidth){var pageWidth=document.body.offsetWidth+'px';var pageHeight=document.body.offsetHeight+'px'}else{var pageWidth='100%';var pageHeight='100%'}dark.style.opacity=opaque;dark.style.MozOpacity=opaque;dark.style.filter='alpha(opacity='+opacity+')';dark.style.zIndex=zindex;dark.style.backgroundColor=bgcolor;dark.style.width=pageWidth;dark.style.height=pageHeight;dark.style.display='block'}else{dark.style.display='none'}}function Right(str,n){if(n<=0){return""}else if(n>String(str).length){return str}else{var iLen=String(str).length;return String(str).substring(iLen,iLen-n)}}var searchFunctions=function(){var jsFunctions=[];return{setVideoOverlays:function(){$$("[hasVideo]").each(function(C){var oParent=C.offsetParent;var vidImage=new Element('img');vidImage.src='/library/ideas/movieReel-xsm.png';vidImage.style.border="0";vidImage.style.zIndex="9999";vidImage.style.position="absolute";Element.insert(C,{after:vidImage});Element.clonePosition(vidImage,C,{setTop:true,setWidth:false,setHeight:false,offsetLeft:(C.offsetWidth-vidImage.offsetWidth)+10,offsetTop:(C.offsetHeight-vidImage.offsetHeight)+10})})},selfLabeledCtl_onFocus:function(C,V){if(C.value==V)C.value=''},name_onBlur:function(B){if(B.value=='test')$$('[dv]').each(function(C){C.value=C.getAttribute('dv')})},buildSelfLabeledForms:function(){return;ajax.buildSeritasControls()},buildSystemToolbar:function(){if($('seritasSysToolbar')){var t=$('seritasSysToolbar').childElements();t.each(function(C){alert(C.getAttribute('icon'))})}},setDefaultFormValues:function(C){if(C.value=='test'){$$('[dv]').each(function(D){D.value=D.getAttribute('dv')})}},hidePageChrome:function(){$$('.pageChrome').each(function(C){C.style.display='none'})},addFunction:function(s){jsFunctions[jsFunctions.length]=s},doFunctions:function(){for(var i=0;ione of our associates
very soon!

'}$('divSimpleContactForm').innerHTML=onSuccessText}})},btnSearchResults_onClick:function(sURL,iWidth){sURL+='&fromWindowJs=1';dialogWin=new Window({className:"dialog",title:"Make An Offer",width:iWidth,height:480,destroyOnClose:true,recenterAuto:true,minimizable:false,maximizable:false,url:sURL,showEffectOptions:{duration:1.0}});dialogWin.showCenter()},loadVehicleImages:function(){$$('[imgsrc]').each(function(C){C.src=C.getAttribute('imgsrc')})},loadFlowPlayerVideo:function(vid,splash,targetObj,autoPlayVideo,w,h){var c='{ controlsOverVideo: true,';c+='showMenu: false,';c+='showMuteVolumeButton: true,';c+='showVolumeSlider: true,';c+='showPlayButton: true,';c+='showStopButton: true,';c+='showFullScreenButton: false,';c+='autoBuffering: true,';c+='menuItems: [ false, false, false, false, false, false ], ';if(splash!=''){c+='playList: [{ url: \''+splash+'\', autoPlay: true },{ url: \''+vid+'\', autoPlay: '+autoPlayVideo+' }], '}else{c+='playList: [{ url: \''+vid+'\', autoPlay: '+autoPlayVideo+' }], '}c+='autoRewind: false}';var fo=new SWFObject('/FlowPlayerDark.swf','FlowPlayer',w,h,'9','#fff',true);fo.addVariable('config',c);fo.write(targetObj)}}}();Event.observe(document,'dom:loaded',function(){searchFunctions.buildSelfLabeledForms();if(queryStr("nochrome")=='1'){searchFunctions.hidePageChrome()}sysFixPNG()}); // compressed at http://refresh-sf.com/yui/ /* persistentCookie_generalCompressed.js */ function rand(A){return Math.ceil(Math.random()*A)}function getCookieVal(B){var A=document.cookie.indexOf(";",B);if(A==-1){A=document.cookie.length}return unescape(document.cookie.substring(B,A))}function GetCookie(D){var B=D+"=";var F=B.length;var A=document.cookie.length;var E=0;while(E2)?A[2]:null;var H=(G>3)?A[3]:null;var D=(G>4)?A[4]:null;var F=(G>5)?A[5]:false;document.cookie=C+"="+escape(E)+((B==null)?"":("; expires="+B.toUTCString()))+((H==null)?"":("; path="+H))+((D==null)?"":("; domain="+D))+((F==true)?"; secure":"")}function DeleteCookie(A){var C=new Date();C.setTime(C.getTime()-1);var B=GetCookie(A);document.cookie=A+"="+B+"; expires="+C.toGMTString()}; /* end persistentCookie_generalCompressed.js */ // compressed at http://refresh-sf.com/yui/ 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(L,B,M,D,H,J,F,E,C,K,I){if(!document.getElementById){return }this.DETECT_KEY=I?I:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(L){this.setAttribute("swf",L)}if(B){this.setAttribute("id",B)}if(M){this.setAttribute("width",M)}if(D){this.setAttribute("height",D)}if(H){this.setAttribute("version",new deconcept.PlayerVersion(H.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(J){this.addParam("bgcolor",J)}var A=E?E:"high";this.addParam("quality",A);this.setAttribute("useExpressInstall",F);this.setAttribute("doExpressInstall",false);var G=(C)?C:window.location;this.setAttribute("xiRedirectUrl",G);this.setAttribute("redirectUrl","");if(K){this.setAttribute("redirectUrl",K)}};deconcept.SWFObject.prototype={setAttribute:function(A,B){this.attributes[A]=B},getAttribute:function(A){return this.attributes[A]},addParam:function(B,A){this.params[B]=A},getParams:function(){return this.params},addVariable:function(B,A){this.variables[B]=A},getVariable:function(A){return this.variables[A]},getVariables:function(){return this.variables},getVariablePairs:function(){var C=new Array();var B;var A=this.getVariables();for(B in A){C.push(B+"="+A[B])}return C},getSWFHTML:function(){var B="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn")}B='0){B+='flashvars="'+D+'"'}B+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX")}B='';B+='';var C=this.getParams();for(var E in C){B+=''}var A=this.getVariablePairs().join("&");if(A.length>0){B+=''}B+=""}return B},write:function(B){if(this.getAttribute("useExpressInstall")){var A=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(A)&&!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 C=(typeof B=="string")?document.getElementById(B):B;C.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var D=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){D=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(C){try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");D=new deconcept.PlayerVersion([6,0,21]);B.AllowScriptAccess="always"}catch(C){if(D.major==6){return D}}try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(C){}}if(B!=null){D=new deconcept.PlayerVersion(B.GetVariable("$version").split(" ")[1].split(","))}}return D};deconcept.PlayerVersion=function(A){this.major=A[0]!=null?parseInt(A[0]):0;this.minor=A[1]!=null?parseInt(A[1]):0;this.rev=A[2]!=null?parseInt(A[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.majorA.major){return true}if(this.minorA.minor){return true}if(this.rev'+a+''})});$$(".hidden-checkbox").each(function(C){var X=C.up("form");var B=C.getAttribute("for");X.insert({top:""});C.observe("click",function(){$(B).value=(C.checked)?"1":"0"})})},stockNumber_preflightCheck:function(c){var d=c.sg.value;var e=c.stockNumber.value;var f='/templates/vehSearch_stockNumberLookup_ajax.asp?sg='+d+'&stk='+e;new Ajax.Request(f,{onSuccess:function(a){var b=a.responseText.split("*|*")[1];if(b==""){alert("That stock number cannot be found.")}else{c.submit()}}})},recolorRows:function(a){var b=false;var c=document.getElementById(a);var d=c.getElementsByTagName('tbody');if(d){var e=d[0].getElementsByTagName('tr');if(e){for(var i=0;i"+c+" is empty. Click the red "edit tab" to add content.";C.style.border="1px solid gray";C.style.margin="10px"}else{a=a+"\nClick to Edit. Right-click for more options."}C.innerHTML+=" ";var e='[';e+=b+'] '+c+'\n'+a+'-1){e='/admin/buttons.asp?cmdSaveAndClose=1&cmd=suppress';e+='&val=1&elementid='+c;e+='&pageid='+p+'&sg='+d}else{e='/admin/webcontentElements.asp?cmdSaveAndClose=1';e+='&cmd=updateElement&fldnContentTypeID=0';e+='&elementid='+c;e+='&p='+p+'&sg='+d}new Ajax.Request(e,{method:'get',onSuccess:function(a){document.location.reload()}})}},moveContent:function(a){var b=a[0];var p=a[1];var c=a[2];var d='/admin/contentMgr_site.asp?cmd=displayElementList';d+='&listFlags=4&sg='+c+'&p='+p+'';d+='&sourceElementID='+b;ajax.showPopInWindow([d,'Move Content',320,480])},doMoveContent:function(a){if(confirm("WARNING! This action will overwrite any existing content, and cannot be undone!\n\nOK to continue?")){alert(1)}},dummyFunction:function(){}}}();var toolbarTimer;function mobileCheckbox_onClick(d){d.disabled=true;var e="/admin/contentMgr_pageEdit_exec.asp?cmd=setMobileFlag&sg="+varSysSiteGuid+"&pageid="+varSysPageNumber;new Ajax.Request(e,{onSuccess:function(a){var b=a.responseText+"*|*failure";var c=b.split("*|*");if(c[1]=="success"){document.location=document.location}else{alert("There was an error and the update was not made.")}}})}function pageDropdown_onChange(a){clearTimeout(toolbarTimer);toolbarTimer=setTimeout(function(){pageDropdown_onChangeEx(a)},2000)}function pageDropdown_onChangeEx(d){var e=d.value;var f=[];var g=0;if(e.indexOf('filter:')==0){for(var i=0;i