jQuery.fn.hint = function (blurClass) { if (!blurClass) { blurClass = 'blur'; } return this.each(function () { // get jQuery version of 'this' var $input = jQuery(this), // capture the rest of the variable to allow for reuse title = $input.attr('title'), $form = jQuery(this.form), $win = jQuery(window); function remove() { if ($input.val() === title && $input.hasClass(blurClass)) { $input.val('').removeClass(blurClass); } } // only apply logic if the element has the attribute if (title) { // on blur, set value to title attr if text is blank $input.blur(function () { if (this.value === '') { $input.val(title).addClass(blurClass); } }).focus(remove).blur(); // now change all inputs to title // clear the pre-defined text when form is submitted $form.submit(remove); $win.unload(remove); // handles Firefox's autocomplete } }); }; // function SwitchImg() {var rem,keep=0,store,obj,switcher=new Array,history=document.Data;for(rem=0;rem<(SwitchImg.arguments.length-2);rem+=3){store=SwitchImg.arguments[(navigator.appName=='Netscape')?rem:rem+1];if((store.indexOf('document.layers[')==0&&document.layers==null)||(store.indexOf('document.all[')==0&&document.all==null)) store='document'+store.substring(store.lastIndexOf('.'),store.length);obj=eval(store);if(obj!=null){switcher[keep++]=obj;switcher[keep++]=(history==null||history[keep-1]!=obj)?obj.src:history[keep];obj.src=SwitchImg.arguments[rem+2];}} document.Data=switcher;} function RestoreImg() {if(document.Data!=null) for(var rem=0;rem<(document.Data.length-1);rem+=2) document.Data[rem].src=document.Data[rem+1];} function TreeExpandToogle(ID){var ExpandButton=document.getElementById("tree_expand"+ID);var ExpandArea=document.getElementById("tree"+ID);if(ExpandArea){if(ExpandArea.style.display==""){if(ExpandButton) ExpandButton.innerHTML="";ExpandArea.style.display="none";}else{if(ExpandButton) ExpandButton.innerHTML="";ExpandArea.style.display="";}}} function PopupNewWindow(url,width,height,params){if(params=="") params='toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no';var left=(screen.width-width)/2;var top=(screen.height-height)/2;params=params+',width='+width+',height='+height+',screenX='+left+',screenY='+top;window.open(url,'',params);}var AjaxIsRunning = false; var AjaxURL = ""; // ------------------------------------------ // freemap ajax helper functions // ------------------------------------------ // Options: // TargetId - elementid // Callback // CallbackFailed // PostParams = name=111&help=abc // PostForm // BeforeHTML // AfterHTML // FailedHTML // NoProgress - true function Ajax(URL, Options) { var request = null; AjaxIsRunning = true; if (!Options['BeforeHTML']) Options['BeforeHTML'] = ""; if (!Options['AfterHTML']) Options['AfterHTML'] = ""; if (!Options['FailedHTML']) Options['FailedHTML'] = ""; if (!Options['TargetId']) Options['TargetId'] = ""; if (!Options['NoProgress']) Options['NoProgress'] = false; // if (Options['TargetId'] != "") { if (typeof ThemeOpenArea == 'function') { Options['TargetId'] = ThemeOpenArea(Options['TargetId'], URL, Options); } } // if (Options['PostForm']) { var f = document.getElementById(Options['PostForm']); var Params = ""; for( var i = 0; i < f.elements.length; i++ ) { if (f.elements[i].type == "checkbox") { if (f.elements[i].checked) { Params += ((Params == "") ? "":"&") + f.elements[i].name + '=' + encodeURI(f.elements[i].value); } } else { Params += ((Params == "") ? "":"&") + f.elements[i].name + '=' + encodeURI(f.elements[i].value); } } if (!Options['PostParams']) { Options['PostParams'] = ""; } Options['PostParams'] = ((Options['PostParams'] == "") ? "":"&") + Params; } if (Options['PostParams']) Method = "POST"; else Method = "GET"; // try { request = new XMLHttpRequest(); } catch(e) { try { request = new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) { } } var Text = ""; if (request != null) { request.onreadystatechange = function() { if (request.readyState == 4) { if (request.status == 200) { Text = request.responseText; if (Options['Callback']) { Text = Options['Callback'](Text); } if (Options['TargetId'] != "") { document.getElementById(Options['TargetId']).innerHTML = Options['BeforeHTML'] + Text + Options['AfterHTML']; runScripts( document.getElementById(Options['TargetId'])); } if (Options['OnSuccess']) { Options['OnSuccess'](); } } else { if (Options['CallbackFailed']) { Text = Options['CallbackFailed']; } if (Options['TargetId'] != "") { document.getElementById(Options['TargetId']).innerHTML = Options['FailedHTML']; } else { alert("Problem retrieving XML data"); } } AjaxIsRunning = false; } } } if ((Options['TargetId'] != "") && (!Options['NoProgress'])) { document.getElementById(Options['TargetId']).innerHTML = ""; } AjaxURL = URL; request.open(Method, URL + '&Ajax=' + Options['TargetId'], true); if (Options['PostParams']) { request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); request.setRequestHeader("Content-length", Options['PostParams'].length); request.setRequestHeader("Connection", "close"); request.send(Options['PostParams']); } else { request.send(null); } } function Sjax(URL, Options) { if (!Options['TargetId']) Options['TargetId'] = ""; if (window.XMLHttpRequest) { AJAX = new XMLHttpRequest(); } else { AJAX = new ActiveXObject("Microsoft.XMLHTTP"); } if (AJAX) { AJAX.open("GET", URL, false); AJAX.send(null); Text = AJAX.responseText; if (Options['TargetId'] != "") { if (typeof ThemeOpenArea == "function") { Options['TargetId'] = ThemeOpenArea(Options['TargetId'], URL, Options); } } if (Options['TargetId'] != "") { document.getElementById(Options['TargetId']).innerHTML = Text; runScripts(document.getElementById(Options['TargetId'])); } return Text; } else { return false; } } function runScripts(e) { if (e.nodeType != 1) return; //if it's not an element node, return if (e.tagName.toLowerCase() == 'script') { eval(e.text); //run the script } else { var n = e.firstChild; while ( n ) { if ( n.nodeType == 1 ) { runScripts( n ); //if it's an element node, recurse } n = n.nextSibling; } } } // first line contains DIV name .. function RefreshContent(input) { lines = input.split("#"); element = document.getElementById(lines[1]); if (element) { lines.splice(0, 2); element.innerHTML = lines.join("#"); } return ""; } function GalleryShowWindow(){var Control=document.getElementById("gallery");if(Control){Control.style.display="block";Control.style.position="absolute";window.scrollTo(0,0);}} function GalleryHideWindow(){var Control=document.getElementById("gallery");if(Control){Control.style.display="none";}} function GalleryShowFromURL(ImageURL){GalleryShowWindow();Ajax('?Proc=gallery&ImageURL='+ImageURL+'',{TargetId:'gallery'});} function GalleryShowByGalleryID(GalleryID,AttachmentType){GalleryShowWindow();Ajax('?Proc=gallery&GalleryID='+GalleryID+'&AttachmentType='+AttachmentType,{TargetId:'gallery'});} function GalleryShowForAttachmentID(AttachmentID,AttachmentType){GalleryShowWindow();Ajax('?Proc=gallery&AttachmentID='+AttachmentID+'&AttachmentType='+AttachmentType,{TargetId:'gallery'});} function PreloadGalleryImage(URL){var GS=document.getElementById('gallery');var GSP=document.getElementById('gallery_picture_frame');var GSN=document.getElementById('gallery_navigator');var Pic=document.getElementById("gallery_picture");var GalleryImage=new Image();var ScreenWidth=0;var ScreenHeight=0;var theHeight=0;if(window.innerHeight){theHeight=window.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){theHeight=document.documentElement.clientHeight;}else if(document.body){theHeight=document.body.clientHeight;} ScreenHeight=theHeight;var theWidth=0;if(window.innerWidth){theWidth=window.innerWidth;}else if(document.documentElement&&document.documentElement.clientWidth){theWidth=document.documentElement.clientWidth;}else if(document.body){theWidth=document.body.clientWidth;} ScreenWidth=theWidth;function GalleryResize(NewWidth,NewHeight){if(NewWidth==0){NewWidth=400;} if(NewHeight==0){NewHeight=400;} var toolbar;if(GSN==null){toolbar=0;}else{toolbar=24;GSN.style.display="block";GSN.style.position="absolute";GSN.style.left="16px";GSN.style.top="16px";GSN.style.width=NewWidth+"px";GSN.style.height="24px";} GSP.style.display="block";GSP.style.position="absolute";GSP.style.left="16px";GSP.style.top=(16+toolbar)+"px";GSP.style.width=NewWidth+"px";GSP.style.height=NewHeight+"px";GS.style.left=((ScreenWidth-NewWidth-32)/2)+"px";GS.style.top=((ScreenHeight-NewHeight-32-toolbar)/2)+"px";GS.style.width=(NewWidth+32)+"px";GS.style.height=(NewHeight+32+toolbar)+"px";} function ImageLoaded(){var NewWidth=GalleryImage.width;var NewHeight=GalleryImage.height;var Prop=0;if(NewWidth==0) NewWidth=400;if(NewHeight==0) NewHeight=400;if((NewWidth>ScreenWidth-64)||(NewHeight>ScreenHeight-88)){if((NewWidth/(ScreenWidth-64))<=(NewHeight/(ScreenHeight-88))){Prop=(NewHeight/(ScreenHeight-88));if(Prop>0){NewWidth=NewWidth/Prop;NewHeight=NewHeight/Prop;}}else{Prop=(NewWidth/(ScreenWidth-64));if(Prop>0){NewWidth=NewWidth/Prop;NewHeight=NewHeight/Prop;}}} Pic.src=GalleryImage.src;GalleryResize(NewWidth,NewHeight);Pic.width=NewWidth;Pic.height=NewHeight;} GalleryImage.onload=ImageLoaded;GalleryImage.src=URL;} if(!this.JSON){this.JSON={};} (function(){function f(n){return n<10?'0'+n:n;} if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+ f(this.getUTCMonth()+1)+'-'+ f(this.getUTCDate())+'T'+ f(this.getUTCHours())+':'+ f(this.getUTCMinutes())+':'+ f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};} var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';} function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);} if(typeof rep==='function'){value=rep.call(holder,key,value);} switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';} gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i