var Prototype={Version:"1.6.0.2",Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div").__proto__&&document.createElement("div").__proto__!==document.createElement("form").__proto__},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Class={create:function(){var e=null,d=$A(arguments);if(Object.isFunction(d[0])){e=d.shift()}function a(){this.initialize.apply(this,arguments)}Object.extend(a,Class.Methods);a.superclass=e;a.subclasses=[];if(e){var b=function(){};b.prototype=e.prototype;a.prototype=new b;e.subclasses.push(a)}for(var c=0;c<d.length;c++){a.addMethods(d[c])}if(!a.prototype.initialize){a.prototype.initialize=Prototype.emptyFunction}a.prototype.constructor=a;return a}};Class.Methods={addMethods:function(g){var c=this.superclass&&this.superclass.prototype;var b=Object.keys(g);if(!Object.keys({toString:true}).length){b.push("toString","valueOf")}for(var a=0,d=b.length;a<d;a++){var f=b[a],e=g[f];if(c&&Object.isFunction(e)&&e.argumentNames().first()=="$super"){var h=e,e=Object.extend((function(i){return function(){return c[i].apply(this,arguments)}})(f).wrap(h),{valueOf:function(){return h},toString:function(){return h.toString()}})}this.prototype[f]=e}return this}};var Abstract={};Object.extend=function(a,c){for(var b in c){a[b]=c[b]}return a};Object.extend(Object,{inspect:function(a){try{if(Object.isUndefined(a)){return"undefined"}if(a===null){return"null"}return a.inspect?a.inspect():String(a)}catch(b){if(b instanceof RangeError){return"..."}throw b}},toJSON:function(a){var c=typeof a;switch(c){case"undefined":case"function":case"unknown":return;case"boolean":return a.toString()}if(a===null){return"null"}if(a.toJSON){return a.toJSON()}if(Object.isElement(a)){return}var b=[];for(var e in a){var d=Object.toJSON(a[e]);if(!Object.isUndefined(d)){b.push(e.toJSON()+": "+d)}}return"{"+b.join(", ")+"}"},toQueryString:function(a){return $H(a).toQueryString()},toHTML:function(a){return a&&a.toHTML?a.toHTML():String.interpret(a)},keys:function(a){var b=[];for(var c in a){b.push(c)}return b},values:function(b){var a=[];for(var c in b){a.push(b[c])}return a},clone:function(a){return Object.extend({},a)},isElement:function(a){return a&&a.nodeType==1},isArray:function(a){return a!=null&&typeof a=="object"&&"splice" in a&&"join" in a},isHash:function(a){return a instanceof Hash},isFunction:function(a){return typeof a=="function"},isString:function(a){return typeof a=="string"},isNumber:function(a){return typeof a=="number"},isUndefined:function(a){return typeof a=="undefined"}});Object.extend(Function.prototype,{argumentNames:function(){var a=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");return a.length==1&&!a[0]?[]:a},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var a=this,c=$A(arguments),b=c.shift();return function(){return a.apply(b,c.concat($A(arguments)))}},bindAsEventListener:function(){var a=this,c=$A(arguments),b=c.shift();return function(d){return a.apply(b,[d||window.event].concat(c))}},curry:function(){if(!arguments.length){return this}var a=this,b=$A(arguments);return function(){return a.apply(this,b.concat($A(arguments)))}},delay:function(){var a=this,b=$A(arguments),c=b.shift()*1000;return window.setTimeout(function(){return a.apply(a,b)},c)},wrap:function(b){var a=this;return function(){return b.apply(this,[a.bind(this)].concat($A(arguments)))}},methodize:function(){if(this._methodized){return this._methodized}var a=this;return this._methodized=function(){return a.apply(null,[this].concat($A(arguments)))}}});Function.prototype.defer=Function.prototype.delay.curry(0.01);Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"'};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(b,a){this.callback=b;this.frequency=a;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute()}finally{this.currentlyExecuting=false}}}});Object.extend(String,{interpret:function(a){return a==null?"":String(a)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,{gsub:function(e,c){var a="",d=this,b;c=arguments.callee.prepareReplacement(c);while(d.length>0){if(b=d.match(e)){a+=d.slice(0,b.index);a+=String.interpret(c(b));d=d.slice(b.index+b[0].length)}else{a+=d,d=""}}return a},sub:function(c,a,b){a=this.gsub.prepareReplacement(a);b=Object.isUndefined(b)?1:b;return this.gsub(c,function(d){if(--b<0){return d[0]}return a(d)})},scan:function(b,a){this.gsub(b,a);return String(this)},truncate:function(b,a){b=b||30;a=Object.isUndefined(a)?"...":a;return this.length>b?this.slice(0,b-a.length)+a:String(this)},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var b=new RegExp(Prototype.ScriptFragment,"img");var a=new RegExp(Prototype.ScriptFragment,"im");return(this.match(b)||[]).map(function(c){return(c.match(a)||["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)})},escapeHTML:function(){var a=arguments.callee;a.text.data=this;return a.div.innerHTML},unescapeHTML:function(){var a=new Element("div");a.innerHTML=this.stripTags();return a.childNodes[0]?(a.childNodes.length>1?$A(a.childNodes).inject("",function(b,c){return b+c.nodeValue}):a.childNodes[0].nodeValue):""},toQueryParams:function(b){var a=this.strip().match(/([^?#]*)(#.*)?$/);if(!a){return{}}return a[1].split(b||"&").inject({},function(e,f){if((f=f.split("="))[0]){var c=decodeURIComponent(f.shift());var d=f.length>1?f.join("="):f[0];if(d!=undefined){d=decodeURIComponent(d)}if(c in e){if(!Object.isArray(e[c])){e[c]=[e[c]]}e[c].push(d)}else{e[c]=d}}return e})},toArray:function(){return this.split("")},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(a){return a<1?"":new Array(a+1).join(this)},camelize:function(){var d=this.split("-"),a=d.length;if(a==1){return d[0]}var c=this.charAt(0)=="-"?d[0].charAt(0).toUpperCase()+d[0].substring(1):d[0];for(var b=1;b<a;b++){c+=d[b].charAt(0).toUpperCase()+d[b].substring(1)}return c},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase()},dasherize:function(){return this.gsub(/_/,"-")},inspect:function(b){var a=this.gsub(/[\x00-\x1f\\]/,function(c){var d=String.specialChar[c[0]];return d?d:"\\u00"+c[0].charCodeAt().toPaddedString(2,16)});if(b){return'"'+a.replace(/"/g,'\\"')+'"'}return"'"+a.replace(/'/g,"\\'")+"'"},toJSON:function(){return this.inspect(true)},unfilterJSON:function(a){return this.sub(a||Prototype.JSONFilter,"#{1}")},isJSON:function(){var a=this;if(a.blank()){return false}a=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(a)},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())},include:function(a){return this.indexOf(a)>-1},startsWith:function(a){return this.indexOf(a)===0},endsWith:function(a){var b=this.length-a.length;return b>=0&&this.lastIndexOf(a)===b},empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)},interpolate:function(a,b){return new Template(this,b).evaluate(a)}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},unescapeHTML:function(){return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")}})}String.prototype.gsub.prepareReplacement=function(b){if(Object.isFunction(b)){return b}var a=new Template(b);return function(c){return a.evaluate(c)}};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});with(String.prototype.escapeHTML){div.appendChild(text)}var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()}return this.template.gsub(this.pattern,function(d){if(a==null){return""}var f=d[1]||"";if(f=="\\"){return d[2]}var b=a,g=d[3];var e=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;d=e.exec(g);if(d==null){return f}while(d!=null){var c=d[1].startsWith("[")?d[2].gsub("\\\\]","]"):d[1];b=b[c];if(null==b||""==d[3]){break}g=g.substring("["==d[3]?d[1].length:d[0].length);d=e.exec(g)}return f+String.interpret(b)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(c,b){var a=0;c=c.bind(b);try{this._each(function(e){c(e,a++)})}catch(d){if(d!=$break){throw d}}return this},eachSlice:function(d,c,b){c=c?c.bind(b):Prototype.K;var a=-d,e=[],f=this.toArray();while((a+=d)<f.length){e.push(f.slice(a,a+d))}return e.collect(c,b)},all:function(c,b){c=c?c.bind(b):Prototype.K;var a=true;this.each(function(e,d){a=a&&!!c(e,d);if(!a){throw $break}});return a},any:function(c,b){c=c?c.bind(b):Prototype.K;var a=false;this.each(function(e,d){if(a=!!c(e,d)){throw $break}});return a},collect:function(c,b){c=c?c.bind(b):Prototype.K;var a=[];this.each(function(e,d){a.push(c(e,d))});return a},detect:function(c,b){c=c.bind(b);var a;this.each(function(e,d){if(c(e,d)){a=e;throw $break}});return a},findAll:function(c,b){c=c.bind(b);var a=[];this.each(function(e,d){if(c(e,d)){a.push(e)}});return a},grep:function(d,c,b){c=c?c.bind(b):Prototype.K;var a=[];if(Object.isString(d)){d=new RegExp(d)}this.each(function(f,e){if(d.match(f)){a.push(c(f,e))}});return a},include:function(a){if(Object.isFunction(this.indexOf)){if(this.indexOf(a)!=-1){return true}}var b=false;this.each(function(c){if(c==a){b=true;throw $break}});return b},inGroupsOf:function(b,a){a=Object.isUndefined(a)?null:a;return this.eachSlice(b,function(c){while(c.length<b){c.push(a)}return c})},inject:function(a,c,b){c=c.bind(b);this.each(function(e,d){a=c(a,e,d)});return a},invoke:function(b){var a=$A(arguments).slice(1);return this.map(function(c){return c[b].apply(c,a)})},max:function(c,b){c=c?c.bind(b):Prototype.K;var a;this.each(function(e,d){e=c(e,d);if(a==null||e>=a){a=e}});return a},min:function(c,b){c=c?c.bind(b):Prototype.K;var a;this.each(function(e,d){e=c(e,d);if(a==null||e<a){a=e}});return a},partition:function(d,b){d=d?d.bind(b):Prototype.K;var c=[],a=[];this.each(function(f,e){(d(f,e)?c:a).push(f)});return[c,a]},pluck:function(b){var a=[];this.each(function(c){a.push(c[b])});return a},reject:function(c,b){c=c.bind(b);var a=[];this.each(function(e,d){if(!c(e,d)){a.push(e)}});return a},sortBy:function(b,a){b=b.bind(a);return this.map(function(d,c){return{value:d,criteria:b(d,c)}}).sort(function(f,e){var d=f.criteria,c=e.criteria;return d<c?-1:d>c?1:0}).pluck("value")},toArray:function(){return this.map()},zip:function(){var b=Prototype.K,a=$A(arguments);if(Object.isFunction(a.last())){b=a.pop()}var c=[this].concat(a).map($A);return this.map(function(e,d){return b(c.pluck(d))})},size:function(){return this.toArray().length},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">"}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(c){if(!c){return[]}if(c.toArray){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}if(Prototype.Browser.WebKit){$A=function(c){if(!c){return[]}if(!(Object.isFunction(c)&&c=="[object NodeList]")&&c.toArray){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse}Object.extend(Array.prototype,{_each:function(b){for(var a=0,c=this.length;a<c;a++){b(this[a])}},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(a){return a!=null})},flatten:function(){return this.inject([],function(b,a){return b.concat(Object.isArray(a)?a.flatten():[a])})},without:function(){var a=$A(arguments);return this.select(function(b){return !a.include(b)})},reverse:function(a){return(a!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(a){return this.inject([],function(d,c,b){if(0==b||(a?d.last()!=c:!d.include(c))){d.push(c)}return d})},intersect:function(a){return this.uniq().findAll(function(b){return a.detect(function(c){return b===c})})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]"},toJSON:function(){var a=[];this.each(function(b){var c=Object.toJSON(b);if(!Object.isUndefined(c)){a.push(c)}});return"["+a.join(", ")+"]"}});if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c,a){a||(a=0);var b=this.length;if(a<0){a=b+a}for(;a<b;a++){if(this[a]===c){return a}}return -1}}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(b,a){a=isNaN(a)?this.length:(a<0?this.length+a:a)+1;var c=this.slice(0,a).reverse().indexOf(b);return(c<0)?c:a-c-1}}Array.prototype.toArray=Array.prototype.clone;function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var e=[];for(var b=0,c=this.length;b<c;b++){e.push(this[b])}for(var b=0,c=arguments.length;b<c;b++){if(Object.isArray(arguments[b])){for(var a=0,d=arguments[b].length;a<d;a++){e.push(arguments[b][a])}}else{e.push(arguments[b])}}return e}}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(a){$R(0,this,true).each(a);return this},toPaddedString:function(c,b){var a=this.toString(b||10);return"0".times(c-a.length)+a},toJSON:function(){return isFinite(this)?this.toString():"null"}});$w("abs round ceil floor").each(function(a){Number.prototype[a]=Math[a].methodize()});function $H(a){return new Hash(a)}var Hash=Class.create(Enumerable,(function(){function a(b,c){if(Object.isUndefined(c)){return b}return b+"="+encodeURIComponent(String.interpret(c))}return{initialize:function(b){this._object=Object.isHash(b)?b.toObject():Object.clone(b)},_each:function(c){for(var b in this._object){var d=this._object[b],e=[b,d];e.key=b;e.value=d;c(e)}},set:function(b,c){return this._object[b]=c},get:function(b){return this._object[b]},unset:function(b){var c=this._object[b];delete this._object[b];return c},toObject:function(){return Object.clone(this._object)},keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},index:function(c){var b=this.detect(function(d){return d.value===c});return b&&b.key},merge:function(b){return this.clone().update(b)},update:function(b){return new Hash(b).inject(this,function(c,d){c.set(d.key,d.value);return c})},toQueryString:function(){return this.map(function(d){var c=encodeURIComponent(d.key),b=d.value;if(b&&typeof b=="object"){if(Object.isArray(b)){return b.map(a.curry(c)).join("&")}}return a(c,b)}).join("&")},inspect:function(){return"#<Hash:{"+this.map(function(b){return b.map(Object.inspect).join(": ")}).join(", ")+"}>"},toJSON:function(){return Object.toJSON(this.toObject())},clone:function(){return new Hash(this)}}})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(c,a,b){this.start=c;this.end=a;this.exclusive=b},_each:function(a){var b=this.start;while(this.include(b)){a(b);b=b.succ()}},include:function(a){if(a<this.start){return false}if(this.exclusive){return a<this.end}return a<=this.end}});var $R=function(c,a,b){return new ObjectRange(c,a,b)};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){if(!this.include(a)){this.responders.push(a)}},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(d,b,c,a){this.each(function(f){if(Object.isFunction(f[d])){try{f[d].apply(f,[b,c,a])}catch(g){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,b,a){$super(a);this.transport=Ajax.getTransport();this.request(b)},request:function(b){this.url=b;this.method=this.options.method;var d=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){d._method=this.method;this.method="post"}this.parameters=d;if(d=Object.toQueryString(d)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+d}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){d+="&_="}}}try{var a=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}Ajax.Responders.dispatch("onCreate",this,a);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||d):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(c){this.dispatchException(c)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var e={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){e["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){e.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var c=this.options.requestHeaders;if(Object.isFunction(c.push)){for(var b=0,d=c.length;b<d;b+=2){e[c[b]]=c[b+1]}}else{$H(c).each(function(f){e[f.key]=f.value})}}for(var a in e){this.transport.setRequestHeader(a,e[a])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var c=Ajax.Request.Events[a],b=new Ajax.Response(this);if(c=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)}catch(d){this.dispatchException(d)}var f=b.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&f&&f.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+c]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+c,this,b,b.headerJSON)}catch(d){this.dispatchException(d)}if(c=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);return !a||(a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null}catch(b){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch("onException",this,a)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(c){this.request=c;var d=this.transport=c.transport,a=this.readyState=d.readyState;if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(d.responseText);this.headerJSON=this._getHeaderJSON()}if(a==4){var b=d.responseXML;this.responseXML=Object.isUndefined(b)?null:b;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(a){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var a=this.getHeader("X-JSON");if(!a){return null}a=decodeURIComponent(escape(a));try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}},_getResponseJSON:function(){var a=this.request.options;if(!a.evalJSON||(a.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,a,c,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};b=Object.clone(b);var d=b.onComplete;b.onComplete=(function(e,f){this.updateContent(e.responseText);if(Object.isFunction(d)){d(e,f)}}).bind(this);$super(c,b)},updateContent:function(d){var c=this.container[this.success()?"success":"failure"],a=this.options;if(!a.evalScripts){d=d.stripScripts()}if(c=$(c)){if(a.insertion){if(Object.isString(a.insertion)){var b={};b[a.insertion]=d;c.insert(b)}else{a.insertion(c,d)}}else{c.update(d)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,a,c,b){$super(b);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=c;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(b){if(arguments.length>1){for(var a=0,d=[],c=arguments.length;a<c;a++){d.push($(arguments[a]))}return d}if(Object.isString(b)){b=document.getElementById(b)}return Element.extend(b)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(f,a){var c=[];var e=document.evaluate(f,$(a)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var b=0,d=e.snapshotLength;b<d;b++){c.push(Element.extend(e.snapshotItem(b)))}return c}}if(!window.Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(){var a=this.Element;this.Element=function(d,c){c=c||{};d=d.toLowerCase();var b=Element.cache;if(Prototype.Browser.IE&&c.name){d="<"+d+' name="'+c.name+'">';delete c.name;return Element.writeAttribute(document.createElement(d),c)}if(!b[d]){b[d]=Element.extend(document.createElement(d))}return Element.writeAttribute(b[d].cloneNode(false),c)};Object.extend(this.Element,a||{})}).call(window);Element.cache={};Element.Methods={visible:function(a){return $(a).style.display!="none"},toggle:function(a){a=$(a);Element[Element.visible(a)?"hide":"show"](a);return a},hide:function(a){$(a).style.display="none";return a},show:function(a){$(a).style.display="";return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:function(a,b){a=$(a);if(b&&b.toElement){b=b.toElement()}if(Object.isElement(b)){return a.update().insert(b)}b=Object.toHTML(b);a.innerHTML=b.stripScripts();b.evalScripts.bind(b).defer();return a},replace:function(b,c){b=$(b);if(c&&c.toElement){c=c.toElement()}else{if(!Object.isElement(c)){c=Object.toHTML(c);var a=b.ownerDocument.createRange();a.selectNode(b);c.evalScripts.bind(c).defer();c=a.createContextualFragment(c.stripScripts())}}b.parentNode.replaceChild(c,b);return b},insert:function(c,e){c=$(c);if(Object.isString(e)||Object.isNumber(e)||Object.isElement(e)||(e&&(e.toElement||e.toHTML))){e={bottom:e}}var d,f,b,g;for(var a in e){d=e[a];a=a.toLowerCase();f=Element._insertionTranslations[a];if(d&&d.toElement){d=d.toElement()}if(Object.isElement(d)){f(c,d);continue}d=Object.toHTML(d);b=((a=="before"||a=="after")?c.parentNode:c).tagName.toUpperCase();g=Element._getContentFromAnonymousElement(b,d.stripScripts());if(a=="top"||a=="after"){g.reverse()}g.each(f.curry(c));d.evalScripts.bind(d).defer()}return c},wrap:function(b,c,a){b=$(b);if(Object.isElement(c)){$(c).writeAttribute(a||{})}else{if(Object.isString(c)){c=new Element(c,a)}else{c=new Element("div",c)}}if(b.parentNode){b.parentNode.replaceChild(c,b)}c.appendChild(b);return c},inspect:function(b){b=$(b);var a="<"+b.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(f){var e=f.first(),c=f.last();var d=(b[e]||"").toString();if(d){a+=" "+c+"="+d.inspect(true)}});return a+">"},recursivelyCollect:function(a,c){a=$(a);var b=[];while(a=a[c]){if(a.nodeType==1){b.push(Element.extend(a))}}return b},ancestors:function(a){return $(a).recursivelyCollect("parentNode")},descendants:function(a){return $(a).select("*")},firstDescendant:function(a){a=$(a).firstChild;while(a&&a.nodeType!=1){a=a.nextSibling}return $(a)},immediateDescendants:function(a){if(!(a=$(a).firstChild)){return[]}while(a&&a.nodeType!=1){a=a.nextSibling}if(a){return[a].concat($(a).nextSiblings())}return[]},previousSiblings:function(a){return $(a).recursivelyCollect("previousSibling")},nextSiblings:function(a){return $(a).recursivelyCollect("nextSibling")},siblings:function(a){a=$(a);return a.previousSiblings().reverse().concat(a.nextSiblings())},match:function(b,a){if(Object.isString(a)){a=new Selector(a)}return a.match($(b))},up:function(b,d,a){b=$(b);if(arguments.length==1){return $(b.parentNode)}var c=b.ancestors();return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a)},down:function(b,c,a){b=$(b);if(arguments.length==1){return b.firstDescendant()}return Object.isNumber(c)?b.descendants()[c]:b.select(c)[a||0]},previous:function(b,d,a){b=$(b);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(b))}var c=b.previousSiblings();return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a)},next:function(c,d,b){c=$(c);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(c))}var a=c.nextSiblings();return Object.isNumber(d)?a[d]:Selector.findElement(a,d,b)},select:function(){var a=$A(arguments),b=$(a.shift());return Selector.findChildElements(b,a)},adjacent:function(){var a=$A(arguments),b=$(a.shift());return Selector.findChildElements(b.parentNode,a).without(b)},identify:function(b){b=$(b);var c=b.readAttribute("id"),a=arguments.callee;if(c){return c}do{c="anonymous_element_"+a.counter++}while($(c));b.writeAttribute("id",c);return c},readAttribute:function(c,a){c=$(c);if(Prototype.Browser.IE){var b=Element._attributeTranslations.read;if(b.values[a]){return b.values[a](c,a)}if(b.names[a]){a=b.names[a]}if(a.include(":")){return(!c.attributes||!c.attributes[a])?null:c.attributes[a].value}}return c.getAttribute(a)},writeAttribute:function(e,c,f){e=$(e);var b={},d=Element._attributeTranslations.write;if(typeof c=="object"){b=c}else{b[c]=Object.isUndefined(f)?true:f}for(var a in b){c=d.names[a]||a;f=b[a];if(d.values[a]){c=d.values[a](e,f)}if(f===false||f===null){e.removeAttribute(c)}else{if(f===true){e.setAttribute(c,c)}else{e.setAttribute(c,f)}}}return e},getHeight:function(a){return $(a).getDimensions().height},getWidth:function(a){return $(a).getDimensions().width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(!(a=$(a))){return}var c=a.className;return(c.length>0&&(c==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(c)))},addClassName:function(a,b){if(!(a=$(a))){return}if(!a.hasClassName(b)){a.className+=(a.className?" ":"")+b}return a},removeClassName:function(a,b){if(!(a=$(a))){return}a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();return a},toggleClassName:function(a,b){if(!(a=$(a))){return}return a[a.hasClassName(b)?"removeClassName":"addClassName"](b)},cleanWhitespace:function(b){b=$(b);var c=b.firstChild;while(c){var a=c.nextSibling;if(c.nodeType==3&&!/\S/.test(c.nodeValue)){b.removeChild(c)}c=a}return b},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(f,d){f=$(f),d=$(d);var h=d;if(f.compareDocumentPosition){return(f.compareDocumentPosition(d)&8)===8}if(f.sourceIndex&&!Prototype.Browser.Opera){var g=f.sourceIndex,c=d.sourceIndex,b=d.nextSibling;if(!b){do{d=d.parentNode}while(!(b=d.nextSibling)&&d.parentNode)}if(b&&b.sourceIndex){return(g>c&&g<b.sourceIndex)}}while(f=f.parentNode){if(f==h){return true}}return false},scrollTo:function(a){a=$(a);var b=a.cumulativeOffset();window.scrollTo(b[0],b[1]);return a},getStyle:function(b,c){b=$(b);c=c=="float"?"cssFloat":c.camelize();var d=b.style[c];if(!d){var a=document.defaultView.getComputedStyle(b,null);d=a?a[c]:null}if(c=="opacity"){return d?parseFloat(d):1}return d=="auto"?null:d},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(b,c){b=$(b);var e=b.style,a;if(Object.isString(c)){b.style.cssText+=";"+c;return c.include("opacity")?b.setOpacity(c.match(/opacity:\s*(\d?\.?\d*)/)[1]):b}for(var d in c){if(d=="opacity"){b.setOpacity(c[d])}else{e[(d=="float"||d=="cssFloat")?(Object.isUndefined(e.styleFloat)?"cssFloat":"styleFloat"):d]=c[d]}}return b},setOpacity:function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;return a},getDimensions:function(c){c=$(c);var g=$(c).getStyle("display");if(g!="none"&&g!=null){return{width:c.offsetWidth,height:c.offsetHeight}}var b=c.style;var f=b.visibility;var d=b.position;var a=b.display;b.visibility="hidden";b.position="absolute";b.display="block";var h=c.clientWidth;var e=c.clientHeight;b.display=a;b.position=d;b.visibility=f;return{width:h,height:e}},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,"position");if(b=="static"||!b){a._madePositioned=true;a.style.position="relative";if(window.opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""}return a},makeClipping:function(a){a=$(a);if(a._overflow){return a}a._overflow=Element.getStyle(a,"overflow")||"auto";if(a._overflow!=="hidden"){a.style.overflow="hidden"}return a},undoClipping:function(a){a=$(a);if(!a._overflow){return a}a.style.overflow=a._overflow=="auto"?"":a._overflow;a._overflow=null;return a},cumulativeOffset:function(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;b=b.offsetParent}while(b);return Element._returnOffset(c,a)},positionedOffset:function(b){var a=0,d=0;do{a+=b.offsetTop||0;d+=b.offsetLeft||0;b=b.offsetParent;if(b){if(b.tagName=="BODY"){break}var c=Element.getStyle(b,"position");if(c!=="static"){break}}}while(b);return Element._returnOffset(d,a)},absolutize:function(b){b=$(b);if(b.getStyle("position")=="absolute"){return}var d=b.positionedOffset();var f=d[1];var e=d[0];var c=b.clientWidth;var a=b.clientHeight;b._originalLeft=e-parseFloat(b.style.left||0);b._originalTop=f-parseFloat(b.style.top||0);b._originalWidth=b.style.width;b._originalHeight=b.style.height;b.style.position="absolute";b.style.top=f+"px";b.style.left=e+"px";b.style.width=c+"px";b.style.height=a+"px";return b},relativize:function(a){a=$(a);if(a.getStyle("position")=="relative"){return}a.style.position="relative";var c=parseFloat(a.style.top||0)-(a._originalTop||0);var b=parseFloat(a.style.left||0)-(a._originalLeft||0);a.style.top=c+"px";a.style.left=b+"px";a.style.height=a._originalHeight;a.style.width=a._originalWidth;return a},cumulativeScrollOffset:function(b){var a=0,c=0;do{a+=b.scrollTop||0;c+=b.scrollLeft||0;b=b.parentNode}while(b);return Element._returnOffset(c,a)},getOffsetParent:function(a){if(a.offsetParent){return $(a.offsetParent)}if(a==document.body){return $(a)}while((a=a.parentNode)&&a!=document.body){if(Element.getStyle(a,"position")!="static"){return $(a)}}return $(document.body)},viewportOffset:function(d){var a=0,c=0;var b=d;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;if(b.offsetParent==document.body&&Element.getStyle(b,"position")=="absolute"){break}}while(b=b.offsetParent);b=d;do{if(!Prototype.Browser.Opera||b.tagName=="BODY"){a-=b.scrollTop||0;c-=b.scrollLeft||0}}while(b=b.parentNode);return Element._returnOffset(c,a)},clonePosition:function(b,d){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});d=$(d);var e=d.viewportOffset();b=$(b);var f=[0,0];var c=null;if(Element.getStyle(b,"position")=="absolute"){c=b.getOffsetParent();f=c.viewportOffset()}if(c==document.body){f[0]-=document.body.offsetLeft;f[1]-=document.body.offsetTop}if(a.setLeft){b.style.left=(e[0]-f[0]+a.offsetLeft)+"px"}if(a.setTop){b.style.top=(e[1]-f[1]+a.offsetTop)+"px"}if(a.setWidth){b.style.width=d.offsetWidth+"px"}if(a.setHeight){b.style.height=d.offsetHeight+"px"}return b}};Element.Methods.identify.counter=1;Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(d,b,c){switch(c){case"left":case"top":case"right":case"bottom":if(d(b,"position")==="static"){return null}case"height":case"width":if(!Element.visible(b)){return null}var e=parseInt(d(b,c),10);if(e!==b["offset"+c.capitalize()]){return e+"px"}var a;if(c==="height"){a=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{a=["border-left-width","padding-left","padding-right","border-right-width"]}return a.inject(e,function(f,g){var h=d(b,g);return h===null?f:f-parseInt(h,10)})+"px";default:return d(b,c)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(c,a,b){if(b==="title"){return a.title}return c(a,b)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(c,b){b=$(b);var a=b.getStyle("position");if(a!=="static"){return c(b)}b.setStyle({position:"relative"});var d=c(b);b.setStyle({position:a});return d});$w("positionedOffset viewportOffset").each(function(a){Element.Methods[a]=Element.Methods[a].wrap(function(e,c){c=$(c);var b=c.getStyle("position");if(b!=="static"){return e(c)}var d=c.getOffsetParent();if(d&&d.getStyle("position")==="fixed"){d.setStyle({zoom:1})}c.setStyle({position:"relative"});var f=e(c);c.setStyle({position:b});return f})});Element.Methods.getStyle=function(a,b){a=$(a);b=(b=="float"||b=="cssFloat")?"styleFloat":b.camelize();var c=a.style[b];if(!c&&a.currentStyle){c=a.currentStyle[b]}if(b=="opacity"){if(c=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(c[1]){return parseFloat(c[1])/100}}return 1}if(c=="auto"){if((b=="width"||b=="height")&&(a.getStyle("display")!="none")){return a["offset"+b.capitalize()]+"px"}return null}return c};Element.Methods.setOpacity=function(b,e){function f(g){return g.replace(/alpha\([^\)]*\)/gi,"")}b=$(b);var a=b.currentStyle;if((a&&!a.hasLayout)||(!a&&b.style.zoom=="normal")){b.style.zoom=1}var d=b.getStyle("filter"),c=b.style;if(e==1||e===""){(d=f(d))?c.filter=d:c.removeAttribute("filter");return b}else{if(e<0.00001){e=0}}c.filter=f(d)+"alpha(opacity="+(e*100)+")";return b};Element._attributeTranslations={read:{names:{"class":"className","for":"htmlFor"},values:{_getAttr:function(a,b){return a.getAttribute(b,2)},_getAttrNode:function(a,c){var b=a.getAttributeNode(c);return b?b.value:""},_getEv:function(a,b){b=a.getAttribute(b);return b?b.toString().slice(23,-2):null},_flag:function(a,b){return $(a).hasAttribute(b)?b:null},style:function(a){return a.style.cssText.toLowerCase()},title:function(a){return a.title}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b},style:function(a,b){a.style.cssText=b?b:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr,src:a._getAttr,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})})(Element._attributeTranslations.read.values)}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1)?0.999999:(b==="")?"":(b<0.00001)?0:b;return a}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;if(b==1){if(a.tagName=="IMG"&&a.width){a.width++;a.width--}else{try{var d=document.createTextNode(" ");a.appendChild(d);a.removeChild(d)}catch(c){}}}return a};Element.Methods.cumulativeOffset=function(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;if(b.offsetParent==document.body){if(Element.getStyle(b,"position")=="absolute"){break}}b=b.offsetParent}while(b);return Element._returnOffset(c,a)}}}}}if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(b,c){b=$(b);if(c&&c.toElement){c=c.toElement()}if(Object.isElement(c)){return b.update().insert(c)}c=Object.toHTML(c);var a=b.tagName.toUpperCase();if(a in Element._insertionTranslations.tags){$A(b.childNodes).each(function(d){b.removeChild(d)});Element._getContentFromAnonymousElement(a,c.stripScripts()).each(function(d){b.appendChild(d)})}else{b.innerHTML=c.stripScripts()}c.evalScripts.bind(c).defer();return b}}if("outerHTML" in document.createElement("div")){Element.Methods.replace=function(c,e){c=$(c);if(e&&e.toElement){e=e.toElement()}if(Object.isElement(e)){c.parentNode.replaceChild(e,c);return c}e=Object.toHTML(e);var d=c.parentNode,b=d.tagName.toUpperCase();if(Element._insertionTranslations.tags[b]){var f=c.next();var a=Element._getContentFromAnonymousElement(b,e.stripScripts());d.removeChild(c);if(f){a.each(function(g){d.insertBefore(g,f)})}else{a.each(function(g){d.appendChild(g)})}}else{c.outerHTML=e.stripScripts()}e.evalScripts.bind(e).defer();return c}}Element._returnOffset=function(b,c){var a=[b,c];a.left=b;a.top=c;return a};Element._getContentFromAnonymousElement=function(c,b){var d=new Element("div"),a=Element._insertionTranslations.tags[c];if(a){d.innerHTML=a[0]+b+a[1];a[2].times(function(){d=d.firstChild})}else{d.innerHTML=b}return $A(d.childNodes)};Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD})}).call(Element._insertionTranslations);Element.Methods.Simulated={hasAttribute:function(a,c){c=Element._attributeTranslations.has[c]||c;var b=$(a).getAttributeNode(c);return b&&b.specified}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div").__proto__){window.HTMLElement={};window.HTMLElement.prototype=document.createElement("div").__proto__;Prototype.BrowserFeatures.ElementExtensions=true}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K}var a={},b=Element.Methods.ByTag;var c=Object.extend(function(f){if(!f||f._extendedByPrototype||f.nodeType!=1||f==window){return f}var d=Object.clone(a),e=f.tagName,h,g;if(b[e]){Object.extend(d,b[e])}for(h in d){g=d[h];if(Object.isFunction(g)&&!(h in f)){f[h]=g.methodize()}}f._extendedByPrototype=Prototype.emptyFunction;return f},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);Object.extend(a,Element.Methods.Simulated)}}});c.refresh();return c})();Element.hasAttribute=function(a,b){if(a.hasAttribute){return a.hasAttribute(b)}return Element.Methods.Simulated.hasAttribute(a,b)};Element.addMethods=function(c){var h=Prototype.BrowserFeatures,d=Element.Methods.ByTag;if(!c){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var b=c;c=arguments[1]}if(!b){Object.extend(Element.Methods,c||{})}else{if(Object.isArray(b)){b.each(g)}else{g(b)}}function g(j){j=j.toUpperCase();if(!Element.Methods.ByTag[j]){Element.Methods.ByTag[j]={}}Object.extend(Element.Methods.ByTag[j],c)}function a(l,k,j){j=j||false;for(var n in l){var m=l[n];if(!Object.isFunction(m)){continue}if(!j||!(n in k)){k[n]=m.methodize()}}}function e(l){var j;var k={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(k[l]){j="HTML"+k[l]+"Element"}if(window[j]){return window[j]}j="HTML"+l+"Element";if(window[j]){return window[j]}j="HTML"+l.capitalize()+"Element";if(window[j]){return window[j]}window[j]={};window[j].prototype=document.createElement(l).__proto__;return window[j]}if(h.ElementExtensions){a(Element.Methods,HTMLElement.prototype);a(Element.Methods.Simulated,HTMLElement.prototype,true)}if(h.SpecificElementExtensions){for(var i in Element.Methods.ByTag){var f=e(i);if(Object.isUndefined(f)){continue}a(d[i],f.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){var a={};var b=Prototype.Browser;$w("width height").each(function(e){var c=e.capitalize();a[e]=(b.WebKit&&!document.evaluate)?self["inner"+c]:(b.Opera)?document.body["client"+c]:document.documentElement["client"+c]});return a},getWidth:function(){return this.getDimensions().width},getHeight:function(){return this.getDimensions().height},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};var Selector=Class.create({initialize:function(a){this.expression=a.strip();this.compileMatcher()},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath){return false}var a=this.expression;if(Prototype.Browser.WebKit&&(a.include("-of-type")||a.include(":empty"))){return false}if((/(\[[\w-]*?:|:checked)/).test(this.expression)){return false}return true},compileMatcher:function(){if(this.shouldUseXPath()){return this.compileXPathMatcher()}var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var f=this.expression,g=Selector.patterns,b=Selector.xpath,d,a;if(Selector._cache[f]){this.xpath=Selector._cache[f];return}this.matcher=[".//*"];while(f&&d!=f&&(/\S/).test(f)){d=f;for(var c in g){if(a=f.match(g[c])){this.matcher.push(Object.isFunction(b[c])?b[c](a):new Template(b[c]).evaluate(a));f=f.replace(a[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(a){a=a||document;if(this.xpath){return document._getElementsByXPath(this.xpath,a)}return this.matcher(a)},match:function(j){this.tokens=[];var o=this.expression,a=Selector.patterns,f=Selector.assertions;var b,d,g;while(o&&b!==o&&(/\S/).test(o)){b=o;for(var k in a){d=a[k];if(g=o.match(d)){if(f[k]){this.tokens.push([k,Object.clone(g)]);o=o.replace(g[0],"")}else{return this.findElements(document).include(j)}}}}var n=true,c,l;for(var k=0,h;h=this.tokens[k];k++){c=h[0],l=h[1];if(!Selector.assertions[c](j,l)){n=false;break}}return n},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(a){if(a[1]=="*"){return""}return"[local-name()='"+a[1].toLowerCase()+"' or local-name()='"+a[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(a){a[1]=a[1].toLowerCase();return new Template("[@#{1}]").evaluate(a)},attr:function(a){a[1]=a[1].toLowerCase();a[3]=a[5]||a[6];return new Template(Selector.xpath.operators[a[2]]).evaluate(a)},pseudo:function(a){var b=Selector.xpath.pseudos[a[1]];if(!b){return""}if(Object.isFunction(b)){return b(a)}return new Template(Selector.xpath.pseudos[a[1]]).evaluate(a)},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",checked:"[@checked]",disabled:"[@disabled]",enabled:"[not(@disabled)]",not:function(b){var j=b[6],h=Selector.patterns,a=Selector.xpath,f,c;var g=[];while(j&&f!=j&&(/\S/).test(j)){f=j;for(var d in h){if(b=j.match(h[d])){c=Object.isFunction(a[d])?a[d](b):new Template(a[d]).evaluate(b);g.push("("+c.substring(1,c.length-1)+")");j=j.replace(b[0],"");break}}}return"[not("+g.join(" and ")+")]"},"nth-child":function(a){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",a)},"nth-last-child":function(a){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",a)},"nth-of-type":function(a){return Selector.xpath.pseudos.nth("position() ",a)},"nth-last-of-type":function(a){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",a)},"first-of-type":function(a){a[6]="1";return Selector.xpath.pseudos["nth-of-type"](a)},"last-of-type":function(a){a[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](a)},"only-of-type":function(a){var b=Selector.xpath.pseudos;return b["first-of-type"](a)+b["last-of-type"](a)},nth:function(g,e){var h,i=e[6],d;if(i=="even"){i="2n+0"}if(i=="odd"){i="2n+1"}if(h=i.match(/^(\d+)$/)){return"["+g+"= "+h[1]+"]"}if(h=i.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(h[1]=="-"){h[1]=-1}var f=h[1]?Number(h[1]):1;var c=h[2]?Number(h[2]):0;d="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(d).evaluate({fragment:g,a:f,b:c})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(a){a[3]=(a[5]||a[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(a)},pseudo:function(a){if(a[6]){a[6]=a[6].replace(/"/g,'\\"')}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(a)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(a,b){return b[1].toUpperCase()==a.tagName.toUpperCase()},className:function(a,b){return Element.hasClassName(a,b[1])},id:function(a,b){return a.id===b[1]},attrPresence:function(a,b){return Element.hasAttribute(a,b[1])},attr:function(b,c){var a=Element.readAttribute(b,c[1]);return a&&Selector.operators[c[2]](a,c[5]||c[6])}},handlers:{concat:function(d,c){for(var e=0,f;f=c[e];e++){d.push(f)}return d},mark:function(a){var d=Prototype.emptyFunction;for(var b=0,c;c=a[b];b++){c._countedByPrototype=d}return a},unmark:function(a){for(var b=0,c;c=a[b];b++){c._countedByPrototype=undefined}return a},index:function(a,d,g){a._countedByPrototype=Prototype.emptyFunction;if(d){for(var b=a.childNodes,e=b.length-1,c=1;e>=0;e--){var f=b[e];if(f.nodeType==1&&(!g||f._countedByPrototype)){f.nodeIndex=c++}}}else{for(var e=0,c=1,b=a.childNodes;f=b[e];e++){if(f.nodeType==1&&(!g||f._countedByPrototype)){f.nodeIndex=c++}}}},unique:function(b){if(b.length==0){return b}var d=[],e;for(var c=0,a=b.length;c<a;c++){if(!(e=b[c])._countedByPrototype){e._countedByPrototype=Prototype.emptyFunction;d.push(Element.extend(e))}}return Selector.handlers.unmark(d)},descendant:function(a){var d=Selector.handlers;for(var c=0,b=[],e;e=a[c];c++){d.concat(b,e.getElementsByTagName("*"))}return b},child:function(a){var e=Selector.handlers;for(var d=0,c=[],f;f=a[d];d++){for(var b=0,g;g=f.childNodes[b];b++){if(g.nodeType==1&&g.tagName!="!"){c.push(g)}}}return c},adjacent:function(a){for(var c=0,b=[],e;e=a[c];c++){var d=this.nextElementSibling(e);if(d){b.push(d)}}return b},laterSibling:function(a){var d=Selector.handlers;for(var c=0,b=[],e;e=a[c];c++){d.concat(b,Element.nextSiblings(e))}return b},nextElementSibling:function(a){while(a=a.nextSibling){if(a.nodeType==1){return a}}return null},previousElementSibling:function(a){while(a=a.previousSibling){if(a.nodeType==1){return a}}return null},tagName:function(a,j,c,b){var k=c.toUpperCase();var e=[],g=Selector.handlers;if(a){if(b){if(b=="descendant"){for(var f=0,d;d=a[f];f++){g.concat(e,d.getElementsByTagName(c))}return e}else{a=this[b](a)}if(c=="*"){return a}}for(var f=0,d;d=a[f];f++){if(d.tagName.toUpperCase()===k){e.push(d)}}return e}else{return j.getElementsByTagName(c)}},id:function(b,a,j,f){var g=$(j),d=Selector.handlers;if(!g){return[]}if(!b&&a==document){return[g]}if(b){if(f){if(f=="child"){for(var c=0,e;e=b[c];c++){if(g.parentNode==e){return[g]}}}else{if(f=="descendant"){for(var c=0,e;e=b[c];c++){if(Element.descendantOf(g,e)){return[g]}}}else{if(f=="adjacent"){for(var c=0,e;e=b[c];c++){if(Selector.handlers.previousElementSibling(g)==e){return[g]}}}else{b=d[f](b)}}}}for(var c=0,e;e=b[c];c++){if(e==g){return[g]}}return[]}return(g&&Element.descendantOf(g,a))?[g]:[]},className:function(b,a,c,d){if(b&&d){b=this[d](b)}return Selector.handlers.byClassName(b,a,c)},byClassName:function(c,b,f){if(!c){c=Selector.handlers.descendant([b])}var h=" "+f+" ";for(var e=0,d=[],g,a;g=c[e];e++){a=g.className;if(a.length==0){continue}if(a==f||(" "+a+" ").include(h)){d.push(g)}}return d},attrPresence:function(c,b,a,g){if(!c){c=b.getElementsByTagName("*")}if(c&&g){c=this[g](c)}var e=[];for(var d=0,f;f=c[d];d++){if(Element.hasAttribute(f,a)){e.push(f)}}return e},attr:function(a,j,h,k,c,b){if(!a){a=j.getElementsByTagName("*")}if(a&&b){a=this[b](a)}var l=Selector.operators[c],f=[];for(var e=0,d;d=a[e];e++){var g=Element.readAttribute(d,h);if(g===null){continue}if(l(g,k)){f.push(d)}}return f},pseudo:function(b,c,e,a,d){if(b&&d){b=this[d](b)}if(!b){b=a.getElementsByTagName("*")}return Selector.pseudos[c](b,e,a)}},pseudos:{"first-child":function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(Selector.handlers.previousElementSibling(e)){continue}c.push(e)}return c},"last-child":function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(Selector.handlers.nextElementSibling(e)){continue}c.push(e)}return c},"only-child":function(b,g,a){var e=Selector.handlers;for(var d=0,c=[],f;f=b[d];d++){if(!e.previousElementSibling(f)&&!e.nextElementSibling(f)){c.push(f)}}return c},"nth-child":function(b,c,a){return Selector.pseudos.nth(b,c,a)},"nth-last-child":function(b,c,a){return Selector.pseudos.nth(b,c,a,true)},"nth-of-type":function(b,c,a){return Selector.pseudos.nth(b,c,a,false,true)},"nth-last-of-type":function(b,c,a){return Selector.pseudos.nth(b,c,a,true,true)},"first-of-type":function(b,c,a){return Selector.pseudos.nth(b,"1",a,false,true)},"last-of-type":function(b,c,a){return Selector.pseudos.nth(b,"1",a,true,true)},"only-of-type":function(b,d,a){var c=Selector.pseudos;return c["last-of-type"](c["first-of-type"](b,d,a),d,a)},getIndices:function(d,c,e){if(d==0){return c>0?[c]:[]}return $R(1,e).inject([],function(a,b){if(0==(b-c)%d&&(b-c)/d>=0){a.push(b)}return a})},nth:function(c,s,u,r,e){if(c.length==0){return[]}if(s=="even"){s="2n+0"}if(s=="odd"){s="2n+1"}var q=Selector.handlers,p=[],d=[],g;q.mark(c);for(var o=0,f;f=c[o];o++){if(!f.parentNode._countedByPrototype){q.index(f.parentNode,r,e);d.push(f.parentNode)}}if(s.match(/^\d+$/)){s=Number(s);for(var o=0,f;f=c[o];o++){if(f.nodeIndex==s){p.push(f)}}}else{if(g=s.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(g[1]=="-"){g[1]=-1}var v=g[1]?Number(g[1]):1;var t=g[2]?Number(g[2]):0;var w=Selector.pseudos.getIndices(v,t,c.length);for(var o=0,f,k=w.length;f=c[o];o++){for(var n=0;n<k;n++){if(f.nodeIndex==w[n]){p.push(f)}}}}}q.unmark(c);q.unmark(d);return p},empty:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(e.tagName=="!"||(e.firstChild&&!e.innerHTML.match(/^\s*$/))){continue}c.push(e)}return c},not:function(a,d,k){var g=Selector.handlers,l,c;var j=new Selector(d).findElements(k);g.mark(j);for(var f=0,e=[],b;b=a[f];f++){if(!b._countedByPrototype){e.push(b)}}g.unmark(j);return e},enabled:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(!e.disabled){c.push(e)}}return c},disabled:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(e.disabled){c.push(e)}}return c},checked:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(e.checked){c.push(e)}}return c}},operators:{"=":function(b,a){return b==a},"!=":function(b,a){return b!=a},"^=":function(b,a){return b.startsWith(a)},"$=":function(b,a){return b.endsWith(a)},"*=":function(b,a){return b.include(a)},"~=":function(b,a){return(" "+b+" ").include(" "+a+" ")},"|=":function(b,a){return("-"+b.toUpperCase()+"-").include("-"+a.toUpperCase()+"-")}},split:function(b){var a=[];b.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(c){a.push(c[1].strip())});return a},matchElements:function(f,g){var e=$$(g),d=Selector.handlers;d.mark(e);for(var c=0,b=[],a;a=f[c];c++){if(a._countedByPrototype){b.push(a)}}d.unmark(e);return b},findElement:function(b,c,a){if(Object.isNumber(c)){a=c;c=false}return Selector.matchElements(b,c||"*")[a||0]},findChildElements:function(e,g){g=Selector.split(g.join(","));var d=[],f=Selector.handlers;for(var c=0,b=g.length,a;c<b;c++){a=new Selector(g[c].strip());f.concat(d,a.findElements(e))}return(b>1)?f.unique(d):d}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(d,c){for(var e=0,f;f=c[e];e++){if(f.tagName!=="!"){d.push(f)}}return d},unmark:function(a){for(var b=0,c;c=a[b];b++){c.removeAttribute("_countedByPrototype")}return a}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(a){$(a).reset();return a},serializeElements:function(g,b){if(typeof b!="object"){b={hash:!!b}}else{if(Object.isUndefined(b.hash)){b.hash=true}}var c,f,a=false,e=b.submit;var d=g.inject({},function(h,i){if(!i.disabled&&i.name){c=i.name;f=$(i).getValue();if(f!=null&&(i.type!="submit"||(!a&&e!==false&&(!e||c==e)&&(a=true)))){if(c in h){if(!Object.isArray(h[c])){h[c]=[h[c]]}h[c].push(f)}else{h[c]=f}}}return h});return b.hash?d:Object.toQueryString(d)}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(a){return $A($(a).getElementsByTagName("*")).inject([],function(b,c){if(Form.Element.Serializers[c.tagName.toLowerCase()]){b.push(Element.extend(c))}return b})},getInputs:function(g,c,d){g=$(g);var a=g.getElementsByTagName("input");if(!c&&!d){return $A(a).map(Element.extend)}for(var e=0,h=[],f=a.length;e<f;e++){var b=a[e];if((c&&b.type!=c)||(d&&b.name!=d)){continue}h.push(Element.extend(b))}return h},disable:function(a){a=$(a);Form.getElements(a).invoke("disable");return a},enable:function(a){a=$(a);Form.getElements(a).invoke("enable");return a},findFirstElement:function(b){var c=$(b).getElements().findAll(function(d){return"hidden"!=d.type&&!d.disabled});var a=c.findAll(function(d){return d.hasAttribute("tabIndex")&&d.tabIndex>=0}).sortBy(function(d){return d.tabIndex}).first();return a?a:c.find(function(d){return["input","select","textarea"].include(d.tagName.toLowerCase())})},focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a},request:function(b,a){b=$(b),a=Object.clone(a||{});var d=a.parameters,c=b.readAttribute("action")||"";if(c.blank()){c=window.location.href}a.parameters=b.serialize(true);if(d){if(Object.isString(d)){d=d.toQueryParams()}Object.extend(a.parameters,d)}if(b.hasAttribute("method")&&!a.method){a.method=b.method}return new Ajax.Request(c,a)}};Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Object.toQueryString(c)}}return""},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=$(a);var c=a.tagName.toLowerCase();Form.Element.Serializers[c](a,b);return a},clear:function(a){$(a).value="";return a},present:function(a){return $(a).value!=""},activate:function(a){a=$(a);try{a.focus();if(a.select&&(a.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(a.type))){a.select()}}catch(b){}return a},disable:function(a){a=$(a);a.blur();a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(a,b){switch(a.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(a,b);default:return Form.Element.Serializers.textarea(a,b)}},inputSelector:function(a,b){if(Object.isUndefined(b)){return a.checked?a.value:null}else{a.checked=!!b}},textarea:function(a,b){if(Object.isUndefined(b)){return a.value}else{a.value=b}},select:function(d,a){if(Object.isUndefined(a)){return this[d.type=="select-one"?"selectOne":"selectMany"](d)}else{var c,f,g=!Object.isArray(a);for(var b=0,e=d.length;b<e;b++){c=d.options[b];f=this.optionValue(c);if(g){if(f==a){c.selected=true;return}}else{c.selected=a.include(f)}}}},selectOne:function(b){var a=b.selectedIndex;return a>=0?this.optionValue(b.options[a]):null},selectMany:function(d){var a,e=d.length;if(!e){return null}for(var c=0,a=[];c<e;c++){var b=d.options[c];if(b.selected){a.push(this.optionValue(b))}}return a},optionValue:function(a){return Element.extend(a).hasAttribute("value")?a.value:a.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,a,b,c){$super(c,b);this.element=$(a);this.lastValue=this.getValue()},execute:function(){var a=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);this.lastValue=a}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case"checkbox":case"radio":Event.observe(a,"click",this.onElementEvent.bind(this));break;default:Event.observe(a,"change",this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});if(!window.Event){var Event={}}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(b){var a;switch(b.type){case"mouseover":a=b.fromElement;break;case"mouseout":a=b.toElement;break;default:return null}return Element.extend(a)}});Event.Methods=(function(){var a;if(Prototype.Browser.IE){var b={0:1,1:4,2:2};a=function(d,c){return d.button==b[c]}}else{if(Prototype.Browser.WebKit){a=function(d,c){switch(c){case 0:return d.which==1&&!d.metaKey;case 1:return d.which==1&&d.metaKey;default:return false}}}else{a=function(d,c){return d.which?(d.which===c+1):(d.button===c)}}}return{isLeftClick:function(c){return a(c,0)},isMiddleClick:function(c){return a(c,1)},isRightClick:function(c){return a(c,2)},element:function(d){var c=Event.extend(d).target;return Element.extend(c.nodeType==Node.TEXT_NODE?c.parentNode:c)},findElement:function(d,f){var c=Event.element(d);if(!f){return c}var e=[c].concat(c.ancestors());return Selector.findElement(e,f,0)},pointer:function(c){return{x:c.pageX||(c.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),y:c.pageY||(c.clientY+(document.documentElement.scrollTop||document.body.scrollTop))}},pointerX:function(c){return Event.pointer(c).x},pointerY:function(c){return Event.pointer(c).y},stop:function(c){Event.extend(c);c.preventDefault();c.stopPropagation();c.stopped=true}}})();Event.extend=(function(){var a=Object.keys(Event.Methods).inject({},function(b,c){b[c]=Event.Methods[c].methodize();return b});if(Prototype.Browser.IE){Object.extend(a,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});return function(b){if(!b){return false}if(b._extendedByPrototype){return b}b._extendedByPrototype=Prototype.emptyFunction;var c=Event.pointer(b);Object.extend(b,{target:b.srcElement,relatedTarget:Event.relatedTarget(b),pageX:c.x,pageY:c.y});return Object.extend(b,a)}}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(Event.prototype,a);return Prototype.K}})();Object.extend(Event,(function(){var b=Event.cache;function c(j){if(j._prototypeEventID){return j._prototypeEventID[0]}arguments.callee.id=arguments.callee.id||1;return j._prototypeEventID=[++arguments.callee.id]}function g(j){if(j&&j.include(":")){return"dataavailable"}return j}function a(j){return b[j]=b[j]||{}}function f(l,j){var k=a(l);return k[j]=k[j]||[]}function h(k,j,l){var o=c(k);var n=f(o,j);if(n.pluck("handler").include(l)){return false}var m=function(p){if(!Event||!Event.extend||(p.eventName&&p.eventName!=j)){return false}Event.extend(p);try{l.call(k,p)}catch(q){}};m.handler=l;n.push(m);return m}function i(m,j,k){var l=f(m,j);return l.find(function(n){return n.handler==k})}function d(m,j,k){var l=a(m);if(!l[j]){return false}l[j]=l[j].without(i(m,j,k))}function e(){for(var k in b){for(var j in b[k]){b[k][j]=null}}}if(window.attachEvent){window.attachEvent("onunload",e)}return{observe:function(l,j,m){l=$(l);var k=g(j);var n=h(l,j,m);if(!n){return l}if(l.addEventListener){l.addEventListener(k,n,false)}else{l.attachEvent("on"+k,n)}return l},stopObserving:function(l,j,m){l=$(l);var o=c(l),k=g(j);if(!m&&j){f(o,j).each(function(p){l.stopObserving(j,p.handler)});return l}else{if(!j){Object.keys(a(o)).each(function(p){l.stopObserving(p)});return l}}var n=i(o,j,m);if(!n){return l}if(l.removeEventListener){l.removeEventListener(k,n,false)}else{l.detachEvent("on"+k,n)}d(o,j,m);return l},fire:function(l,k,j){l=$(l);if(l==document&&document.createEvent&&!l.dispatchEvent){l=document.documentElement}var m;if(document.createEvent){m=document.createEvent("HTMLEvents");m.initEvent("dataavailable",true,true)}else{m=document.createEventObject();m.eventType="ondataavailable"}m.eventName=k;m.memo=j||{};if(document.createEvent){l.dispatchEvent(m)}else{l.fireEvent(m.eventType,m)}return Event.extend(m)}}})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});(function(){var b;function a(){if(document.loaded){return}if(b){window.clearInterval(b)}document.fire("dom:loaded");document.loaded=true}if(document.addEventListener){if(Prototype.Browser.WebKit){b=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){a()}},0);Event.observe(window,"load",a)}else{document.addEventListener("DOMContentLoaded",a,false)}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;a()}}}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(a,b){return Element.insert(a,{before:b})},Top:function(a,b){return Element.insert(a,{top:b})},Bottom:function(a,b){return Element.insert(a,{bottom:b})},After:function(a,b){return Element.insert(a,{after:b})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(b,a,c){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,c)}this.xcomp=a;this.ycomp=c;this.offset=Element.cumulativeOffset(b);return(c>=this.offset[1]&&c<this.offset[1]+b.offsetHeight&&a>=this.offset[0]&&a<this.offset[0]+b.offsetWidth)},withinIncludingScrolloffsets:function(b,a,d){var c=Element.cumulativeScrollOffset(b);this.xcomp=a+c[0]-this.deltaX;this.ycomp=d+c[1]-this.deltaY;this.offset=Element.cumulativeOffset(b);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+b.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+b.offsetWidth)},overlap:function(b,a){if(!b){return 0}if(b=="vertical"){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight}if(b=="horizontal"){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();return Element.absolutize(a)},relativize:function(a){Position.prepare();return Element.relativize(a)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(b,c,a){a=a||{};return Element.clonePosition(c,b,a)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(b){function a(c){return c.blank()?null:"[contains(concat(' ', @class, ' '), ' "+c+" ')]"}b.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(c,e){e=e.toString().strip();var d=/\s/.test(e)?$w(e).map(a).join(""):a(e);return d?document._getElementsByXPath(".//*"+d,c):[]}:function(e,f){f=f.toString().strip();var g=[],h=(/\s/.test(f)?$w(f):null);if(!h&&!f){return g}var c=$(e).getElementsByTagName("*");f=" "+f+" ";for(var d=0,k,j;k=c[d];d++){if(k.className&&(j=" "+k.className+" ")&&(j.include(f)||(h&&h.all(function(i){return !i.toString().blank()&&j.include(" "+i+" ")})))){g.push(Element.extend(k))}}return g};return function(d,c){return $(c||document.body).getElementsByClassName(d)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length>0})._each(a)},set:function(a){this.element.className=a},add:function(a){if(this.include(a)){return}this.set($A(this).concat(a).join(" "))},remove:function(a){if(!this.include(a)){return}this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods();var is_iframe_created=true;var is_history_allow_add=true;var expectedHash="";var is_lock_on_frame=false;var is_bookmark_history_item=true;var is_single_widget_address_bar=false;var ajax_back_iframe_name="ajaxnav";var is_window_load=false;var iframesfix=false;var start_page_history="";var is_history_started=false;var old_vertical_position=-1;var always_refresh=false;var another_callback=null;var is_null=false;var is_null_value="";var select_filters_only=false;var scroll_done=false;function ajax_state(){this.widget_type="";this.name="";this.page_no=1;this.filter_name="";this.tab_group=-1}function widget_info(){this.page_no=1;this.filter_name=1;this.widget_name=""}var widget_list=new Array();function MyTimer(a){this.obj=(arguments.length)?arguments[0]:document.window;return this}MyTimer.prototype.setInterval=function(c,d){var b=MyTimer.getNew();var a=MyTimer.buildCall(this.obj,b,arguments);MyTimer.set[b].timer=window.setInterval(a,d);return b};MyTimer.prototype.setTimeout=function(b,c){var a=MyTimer.getNew();MyTimer.buildCall(this.obj,a,arguments);MyTimer.set[a].timer=window.setTimeout("MyTimer.callOnce("+a+");",c);return a};MyTimer.prototype.clearInterval=function(a){if(!MyTimer.set[a]){return}window.clearInterval(MyTimer.set[a].timer);MyTimer.set[a]=null};MyTimer.prototype.clearTimeout=function(a){if(!MyTimer.set[a]){return}window.clearTimeout(MyTimer.set[a].timer);MyTimer.set[a]=null};MyTimer.set=new Array();MyTimer.buildCall=function(e,d,b){var c="";MyTimer.set[d]=new Array();if(e!=window){MyTimer.set[d].obj=e;c="MyTimer.set["+d+"].obj."}c+=b[0]+"(";if(b.length>2){MyTimer.set[d][0]=b[2];c+="MyTimer.set["+d+"][0]";for(var a=1;(a+2)<b.length;a++){MyTimer.set[d][a]=b[a+2];c+=", MyTimer.set["+d+"]["+a+"]"}}c+=");";MyTimer.set[d].call=c;return c};MyTimer.callOnce=function(i){if(!MyTimer.set[i]){return}eval(MyTimer.set[i].call);MyTimer.set[i]=null};MyTimer.getNew=function(){var a=0;while(MyTimer.set[a]){a++}return a};function add_selected_tab_history(c){if(typeof(c)!="undefined"){start_page_history=c;c=""}if(c!=""){var d=window.location.hash;if(d!="#"&&d!=""){always_refresh=true;deserialize_window_hash(c);synchronize_main_widget_list(d,"");restore_history();set_window_hash(serialize_widget_list());always_refresh=false}else{deserialize_window_hash(c);set_window_hash(serialize_widget_list())}}else{if(select_filters_only){try{var a=new Array();a=deserialize_window_hash(start_page_history,"");restore_history(a)}catch(b){log_exceptions(" Method: - add_selected_tab_history "+b.message)}}}}function add_tab_history(b,a){if(b!=""){add_browser_history("tab="+b+"&group_id="+a)}}function add_widget_history(b,c,a){add_browser_history("widget="+b+"&page="+c+"&filter="+a)}function add_browser_history(a){if(is_history_allow_add==false){return}is_lock_on_frame=true;try{add_history(a)}catch(b){log_exceptions(" Method: - add_browser_history "+b.message)}is_lock_on_frame=false}function synchronize_widget_list(a){var e=new Array();var d,c;var b=0;for(b=0;b<widget_list.length;b++){d=(widget_list[b].name==a.name&&widget_list[b].widget_type=="widget");c=(widget_list[b].tab_group==a.tab_group&&widget_list[b].widget_type==a.widget_type&&a.widget_type=="tab");if(!(d||c)){e.push(widget_list[b])}}e.push(a);return e}function synchronize_main_widget_list(d,b){var a=deserialize_window_hash(d,"");var e=null;if(typeof(b)!="undefined"){for(history_index=0;history_index<a.length;history_index++){e=synchronize_widget_list(a[history_index])}}else{var c=read_widget_info(d);e=synchronize_widget_list(c)}widget_list.length=0;widget_list=e}function add_history(a){if(!is_single_widget_address_bar){if(start_page_history!=""){var b=window.location.hash;if(!(b!="#"&&b!="")){deserialize_window_hash(start_page_history)}set_window_hash(serialize_widget_list());synchronize_main_widget_list(a,"");start_page_history=""}else{synchronize_main_widget_list(a)}a=serialize_widget_list()}set_window_hash(a)}function get_iframe_document(a){var b=document.getElementById(a);var c=null;if(b!=null){c=b.contentWindow.document}return c}function set_window_hash(a){is_history_started=true;window.location.hash=a;expectedHash="#"+a;if(iframesfix){_historyFrame=document.getElementById(ajax_back_iframe_name);var b=_historyFrame.contentWindow.document;var b=get_iframe_document(ajax_back_iframe_name);if(b!=null){b.open("javascript:'<html></html>'");b.write("<html><head><script type=\"text/javascript\"><\/script></head><body><input id='hash_value' name='hash_value' value='"+a+"'></input></body></html>");b.close()}}}function AjaxIframesFixer(b){try{this.iframeid=b;if(document.getElementById(ajax_back_iframe_name)){this.timer=new MyTimer(this);this.timer.setTimeout("checkWhetherChanged",50,"")}}catch(a){log_exceptions(" Method: - AjaxIframesFixer "+a.message)}}AjaxIframesFixer.prototype.checkWhetherChanged=function(a){try{if(is_lock_on_frame==false&&is_window_load==true){history_item_value="";my_iframe_doc=get_iframe_document(ajax_back_iframe_name);my_hash_box=my_iframe_doc.getElementById("hash_value");window_hash=window.location.hash;if(window_hash.indexOf("#")>-1){window_hash=window_hash.substr(1,window_hash.length)}if(my_hash_box!=null){history_item_value=my_hash_box.value;if(is_null==true&&is_null_value!=""&&is_null_value==history_item_value){history.forward();is_null=false;is_null_value=""}}else{is_null=true;is_null_value=window_hash;go_back_once_more()}if(history_item_value!=window_hash&&history_item_value!=""&&is_bookmark_history_item==false){widget_list.length=0;window.location.hash=history_item_value;deserialize_window_hash(window.location.hash);restore_history();is_history_started=true}else{if(history_item_value==""&&window_hash!=""&&is_bookmark_history_item==true){always_refresh=true;deserialize_window_hash(window.location.hash);restore_history();always_refresh=false}else{if(history_item_value==window_hash&&history_item_value!=""&&window_hash!=""&&is_bookmark_history_item==true){always_refresh=true;deserialize_window_hash(window.location.hash);restore_history();always_refresh=false}}}is_bookmark_history_item=false}}catch(b){}this.timer.setTimeout("checkWhetherChanged",500,"")};function go_back_once_more(){if(is_history_started){history.go(-1);is_history_started=false}}function FixBackAndBookmarking(){try{if(!document.getElementById||!document.getElementsByTagName){return}if(iframesfix){fix=new AjaxIframesFixer(ajax_back_iframe_name)}}catch(a){log_exceptions(" Method:- FixBackAndBookmarking "+a.message)}}function initialize_history_manager(){try{var a=navigator.userAgent.toLowerCase();var d=new MyTimer(this);if(a.indexOf("msie")>-1){iframesfix=true;d.setTimeout("FixBackAndBookmarking",500,"")}else{var b=new AjaxBookmarkFix()}}catch(c){log_exceptions(" Method:- initialize_history_manager "+c.message)}}function select_tab_navigate(c){try{var b=$("a_"+c);if(b!=null){b.onclick()}page_no=get_widget_selected_page(c);log_exceptions("select tab navigate page ::: "+page_no,true);if((page_no>=2&&page_no<=10)&&check_widget_entry(c)==false){opened_page_no=$("pagination-"+c).getElementsByClassName("current");page_to_open_li=opened_page_no[0].previous(page_no-2);anchor_to_click=page_to_open_li.getElementsBySelector("a");anchor_to_click[0].onclick()}}catch(a){log_exceptions(" Method :- select_tab_navigate :: "+a.message)}}function get_widget_selected_page(b){try{if($("pagination-"+b)!=null){opened_page_no=$("pagination-"+b).getElementsByClassName("current");if(opened_page_no!=null&&opened_page_no[0]!=null){page_no=opened_page_no[0].innerHTML.strip();page_no=parseInt(page_no);return page_no}}}catch(a){log_exceptions("Method :- get_widget_selected_page "+a.message)}return 1}function get_filter_element_reference(b,c){var a=$(b+"_"+c);if(a==null){a=$(b+"_filter")}return a}function get_widget_selected_filter(d,e){var c="popular";var a=get_filter_element_reference(d,e);var b="";if(a!=null){b=a.tagName;if(b=="A"){my_parent_element=$(d+"_"+e).up(1);filter_anchores=my_parent_element.getElementsByClassName("filter");for(filter_index=0;filter_index<filter_anchores.length;filter_index++){if(filter_anchores[filter_index].visible()==false){c=filter_anchores[filter_index].id;break}}}else{if(b=="SELECT"){c=a.options[a.selectedIndex].value}}if(c!=""&&b!="SELECT"){return get_splited_item(c,"_",1)}}return c}function get_widget_state(c,b){var a=new widget_info();a.page_no=get_widget_selected_page(c);a.filter_name=get_widget_selected_filter(c,b);a.widget_name=c;return a}function change_dropdown_filter(c,b){var a=0;for(a=0;a<c.options.length;a++){if(c.options[a].value==b){c.selectedIndex=a;break}}}function select_widget_filter(c,b){try{if(c=="recent"){change_filter(oRequestHandlers[0],b,"all","all",2)}else{if(c=="popular"){change_filter(oRequestHandlers[0],b,"all","all",1)}else{if(b=="stories"){if(c.indexOf("_")>-1){c=get_splited_item(c,"_",0)}new_change_filter(["all","city","country","region","world"],c,"stories")}}}}catch(a){log_exceptions("Method :- select_widget_filter "+a.message)}}function restore_single_history_item(l,m){if(typeof(m)=="undefined"){m=true}else{m=false}if(l.widget_type=="tab"&&m==true){log_exceptions("restoring tab history :::: "+l.name,true);select_tab_navigate(l.name)}else{if(l.widget_type=="widget"){log_exceptions("restoring widget history :::: "+l.name,true);var g=get_widget_state(l.name,l.filter_name);var d=l.name;var h=l.page_no;var c=l.filter_name;if(g.page_no==h&&g.filter_name==c&&always_refresh==false){return}if($("a_"+d)!=null&&m==true){$("a_"+d).onclick()}var n=get_filter_element_reference(d,c);var e="";if(n!=null){e=n.tagName}if(h==1){if(n!=null){if(e=="A"&&m==true){n.onclick();return}else{if(e=="SELECT"){change_dropdown_filter(n,c)}}}}else{if(g.filter_name!=c){if(e=="A"&&m==true){select_widget_filter(c,d)}else{if(e=="SELECT"){change_dropdown_filter(n,c)}}}}if(m==false){return false}var b=c;var k="all";var f="";var a=readCookie("type_category_filter").split(",");if(a.length==4){f=a[0];k=a[1]}oRequestHandlers[0].setParameters(h,f,k,c);oRequestHandlers[0].update(d,"bottom")}}}function check_widget_entry(a){var c=false;var b=0;for(b=0;b<widget_list.length;b++){if(widget_list[b].widget_type=="widget"&&widget_list[b].name==a){c=true;break}}return c}function restore_history(e){var d;var a=false;if(typeof(e)=="undefined"){d=widget_list}else{d=e;a=true}is_history_allow_add=false;var c=0;for(c=0;c<d.length;c++){try{if(a){restore_single_history_item(d[c],a)}else{restore_single_history_item(d[c])}}catch(b){log_exceptions(" Method: - restore_history "+b.message)}}is_history_allow_add=true;return}function AjaxBookmarkFix(){this.timer=new MyTimer(this);if(window.location.hash!=""){always_refresh=true}this.timer.setTimeout("handleHistory",100)}AjaxBookmarkFix.prototype.handleHistory=function(){try{if(window.location.hash!=expectedHash&&is_lock_on_frame==false&&is_window_load==true){expectedHash=window.location.hash;widget_list.length=0;deserialize_window_hash(window.location.hash);restore_history();always_refresh=false;is_history_started=true}if(window.location.hash==""){go_back_once_more()}}catch(a){log_exceptions(" Method: - AjaxBookmarkFix.prototype.handleHistory "+a.message)}this.timer.setTimeout("handleHistory",700)};function start_history_manager(a){try{initialize_history_manager();if(typeof(window.onload)!="undefined"){another_callback=window.onload}if(typeof(a)!="undefined"&&a!=""){window.onload=function(){if(another_callback!=null&&typeof(loading_map)!="undefined"&&$("map")!=null){check_flash_movie_loaded(a)}else{if(another_callback!=null&&(typeof(loading_map)=="undefined"||$("map")==null)){add_selected_tab_history(a);another_callback();is_window_load=true}else{add_selected_tab_history(a);is_window_load=true}}is_page_completely_loaded=true}}else{window.onload=function(){if(another_callback!=null&&typeof(loading_map)!="undefined"&&$("map")!=null){check_flash_movie_loaded()}else{if(another_callback!=null&&(typeof(loading_map)=="undefined"||$("map")==null)){another_callback();is_window_load=true}else{is_window_load=true}}is_page_completely_loaded=true}}}catch(b){log_exceptions(" Method: - start_history_manager "+b.message)}}function redirection_start_history_manager(){if(typeof(is_start_history)!="undefined"){if(typeof(my_page_history)=="undefined"){start_history_manager()}else{start_history_manager(my_page_history)}}}function check_flash_movie_loaded(a){if(getFlashMovie("masala_swf")!=null&&typeof(getFlashMovie("masala_swf").reloadFlash)!="undefined"){if(typeof(a)!="undefined"&&a!=""){add_selected_tab_history(a)}is_window_load=true;another_callback()}else{if(scroll_done==false){scroll_done=true;scrollTo(0,1)}if(typeof(a)!="undefined"&&a!=""){setTimeout("check_flash_movie_loaded('"+a+"')",140)}else{setTimeout("check_flash_movie_loaded()",140)}}}function deserialize_window_hash(e,a){var b=false;var d=null;if(typeof(a)!="undefined"){b=true;d=new Array()}if(e.length<=1){return}ajax_state_list=e.split(",");for(j=0;j<ajax_state_list.length;j++){var c=read_widget_info(ajax_state_list[j]);if(b){d.push(c)}else{widget_list.push(c)}}if(b){return d}}function serialize_widget_list(){var a="";for(i=0;i<widget_list.length;i++){var b=widget_list[i];if(a!=""){a+=","}if(b.widget_type=="widget"){a+="widget="+b.name+"&page="+b.page_no+"&filter="+b.filter_name}else{a+="tab="+b.name+"&group="+b.tab_group}}return a}function read_widget_info(d){var e=new ajax_state();if(d.indexOf("widget")>-1){var b=d.split("&");for(i=0;i<b.length;i++){var a=b[i].split("=");if(i==0){e.widget_type="widget";e.name=a[1]}else{if(i==1){e.page_no=parseInt(a[1])}else{if(i==2){e.filter_name=a[1]}}}}}else{if(d.indexOf("tab")>-1){var c=d.split("&");for(i=0;i<c.length;i++){var a=c[i].split("=");if(i==0){e.widget_type="tab";e.name=a[1];e.name=a[1]}else{if(i==1){e.tab_group=a[1]}}}}}return e};var Callbacks={};Callbacks.fire=function(a){var b=Callbacks[a];if(b){b();Callbacks[a]=null}};var domain=location.protocol+"//"+location.host;var is_profile_edit_auto_complete_registered=null;var is_img_auto_complete_registered=false;var is_spell_check_done=false;var is_redirection_done=false;var firstLoad=true;var is_vid_auto_complete_registered=false;var is_blog_auto_complete_registered=false;var is_verify_geolocation=true;var is_disable_img_button=false;function periodicalUpdater(){new Ajax.Request("/twitter/cb_tweets",{parameters:"",asynchronous:false,onComplete:function(a){$("listOfTweets").insert({top:a.responseText});setTimeout(periodicalUpdater,7000)}})}function periodicalUpdaterIncoming(){new Ajax.Request("/twitter/cb_incoming_tweets",{parameters:"",asynchronous:false,onComplete:function(a){$("listOfTweets").insert({top:a.responseText});setTimeout(periodicalUpdaterIncoming,7000)}})}function showBox(b){try{if($("popupRegisterBox")){$("popupRegisterBox").hide()}if($("popupActivationBox")){$("popupActivationBox").hide()}if($("popupLoginBox")){$("popupLoginBox").hide()}if($("popupResendActivationEmailBox")){$("popupResendActivationEmailBox").hide()}if($("popupForgotPasswordBox")){$("popupForgotPasswordBox").hide()}if($("popupListContactsBox")){$("popupListContactsBox").hide()}if($("popupThanksForInvitingContactsBox")){$("popupThanksForInvitingContactsBox").hide()}if($("popupCalculatorContainer")){$("popupCalculatorContainer").hide()}if($("popupRedeemPoints")){$("popupRedeemPoints").hide()}if(b!=null&&b){b.show()}}catch(a){log_exceptions(" Method: - showBox "+a.message)}}function setFocusAndClearErrorMessage(b,a){b.focus();a.innerHTML=""}function loadBox(){var a=readCookie("show_box");if(a!=null&&a=="registration_box"){showRegisterBox($("joinAllvoices"))}else{if(a!=null&&a=="login_box"){showLoginBox($("loginAllvoices"))}else{if(typeof(a)!="undefined"&&a!=null&&a!=""){new Ajax.Request("/user/show_post_login_popup",{parameters:"popup_name="+a,asynchronous:false})}}}setCookie("show_box","")}function moveTwitterPopupBox(){movePopupBox($("popupTwitterCompleteBox"),$("addTwitterCredentials"))}var clickedPopupButton="";function movePopupBox(e,d){try{if(d){clickedPopupButton=d}else{if(clickedPopupButton!=""){d=clickedPopupButton}}classNames=e.className.split(" ");e.className="";for(i=0;i<classNames.length;i++){if(classNames[i].substr(0,10)!="popupArrow"){e.className+=" "+classNames[i]}}if(d){var h="";var c="";var a="";var g="";var f=SpareTools.getOffsetFromWrapper(d);if(d.innerHTML=="Login"){h=35;c=1008-f.x-291;e.className+=" popupArrowLoginTop"}else{if(d.innerHTML=="Join Allvoices"){h=35;c=1008-f.x-256;e.className+=" popupArrowRegisterTop"}else{if(d.id=="report_your_news_top"){h=42;c=5;e.className+=" popupArrowNewsTop"}else{if(d.id=="report_your_news_right"){h=f.y+40;c=5;e.className+=" popupArrowNewsRight"}else{if(d.id=="report_your_news_left"){h=f.y+40;c=615;e.className+=" popupArrowNewsLeft"}else{if(d.id=="postcomment"){h=f.y+40;c=600-f.x;e.className+=" popupArrowComments"}else{if(d.id=="twitterFormLink"){h=f.y+25;g=f.x-5}else{if(d.className=="addPlus"){h=f.y+25;c=1008-f.x-(d.offsetWidth/2)-65;e.className+=" popupArrowAddPlus"}else{if(d.id=="showCalculator"){h=40;c=5;e.className+=" popupArrowNewsTop"}else{if(d.id=="showRedeemPoints"){h=40;c=105;e.className+=" popupArrowNewsTop"}else{if(d.id=="inviteMoreContacts"){h=35;c=110}else{if(d.parentNode.className=="links"){h=f.y+25;if(d.parentNode.parentNode.parentNode.parentNode.parentNode.className=="left"){c=1008-f.x-(d.offsetWidth/2)-310;e.className+=" popupArrowAddPlusLeft"}else{c=1008-f.x-(d.offsetWidth/2)-70;e.className+=" popupArrowAddPlus"}}else{h=f.y+40;g=f.x-30}}}}}}}}}}}}SpareTools.moveObject(e,h,g,a,c)}else{e.style.left="";e.style.top=""}}catch(b){log_exceptions(" Method: - movePopupBox "+b.message)}}function saveComments(b){if($("save_comment")!=null&&typeof($("save_comment"))!="undefined"&&$("save_comment").value=="true"){$("save_comment").value="false";var d="";var a=document.getElementById("comment_for_event_person");for(var c=0;c<a.length;c++){if(a.elements[c].name=="event_person_id"){d=a.elements[c].value}}if(d==null||d==""){d=$("event_person_id").value}submit_comment_form(d);if(b){movePopupBox($("popupActivationBox"),$("postcomment"))}}}function showResendActivationEmailBox(a){box_id="popupResendActivationEmailBox";evalStr="setFocusAndClearErrorMessage($('popup_resend_username'), $('resendActivationEmailErrorMessage'))";get_box("resend",box_id,evalStr);showBox($(box_id));movePopupBox($(box_id),a)}function showForgotPasswordBox(a){box_id="popupForgotPasswordBox";evalStr="setFocusAndClearErrorMessage($('popup_forgot_username'), $('forgotPasswordErrorMessage'))";get_box("forgot",box_id,evalStr);showBox($(box_id));movePopupBox($(box_id),a)}function showLoginBox(a,b){if(is_logged_in()){saveComments(false);if($("redirectUrl")!=null&&typeof($("redirectUrl"))!="undefined"&&$("redirectUrl").value!=""){window.location.href=$("redirectUrl").value;return true}}box_id="popupLoginBox";evalStr="setFocusAndClearErrorMessage($('popup_login_username'), $('loginErrorMessage'))";get_box("login",box_id,evalStr);showBox($(box_id));movePopupBox($(box_id),a);if(b){Callbacks.postLogin=b}}function showRegisterBox(b){try{box_id="popupRegisterBox";remove_all_decendants("change_captcha_register");evalStr="setFocusAndClearErrorMessage($('popup_user_email'), $('registerErrorMessage'));create_recaptcha('change_captcha_register');";get_box("register",box_id,evalStr);showBox($(box_id));movePopupBox($(box_id),b)}catch(a){log_exceptions(" Method: - showRegisterBox "+a.message)}}function showTwitterBox(a){box_id="popupTwitterBox";evalStr="setFocusAndClearErrorMessage($('popup_user_email'), $('twitterErrorMessage'))";get_box("twitter",box_id,evalStr);showBox($(box_id));movePopupBox($(box_id),a)}function setTwitterName(a){$("twitter_name").innerHTML='Your Twitter credentials are set to <a href="http://www.twitter.com/'+a+'" target="_blank">'+a+"</a>.";$("twitter_credentials").innerHTML="We have already have your Twitter credentials."}function showTwitterCompleteBox(a,b){box_id="popupTwitterCompleteBox";get_box("twitter_complete",box_id,b);showBox($(box_id));movePopupBox($(box_id),a)}function showActivationBox(a){box_id="popupActivationBox";showBox($(box_id));movePopupBox($(box_id),a)}function resetRedirectUrl(){if($("redirectUrl")!=null&&typeof($("redirectUrl"))!="undefined"){$("redirectUrl").value=""}}function redirectUrl(a){if(a==""){if($("redirectUrl")!=null&&typeof($("redirectUrl"))!="undefined"&&$("redirectUrl").value!=""){a=$("redirectUrl").value}}if(a!=""){window.location.href=a}return}function postAuthenticationProcess(b,a){if($("redirectUrl")!=null&&typeof($("redirectUrl"))!="undefined"&&$("redirectUrl").value!=""){window.location=$("redirectUrl").value;is_redirection_done=true}if($("loggedIn")!=null&&typeof($("loggedIn"))!="undefined"){$("loggedIn").value=a}Callbacks.fire("postLogin");saveComments(b)}function reloadPage(){if(!is_redirection_done){doReloadPage.defer()}is_redirection_done=false}function doReloadPage(){window.location.reload()}function inviteContacts(a){if(a=="true"){box_id="popupListContactsBox";showBox($(box_id))}return false}function validate_state(state_name,country,element_to_show,progress_element){url=domain+"/main/cb_check_state";if($(element_to_show)!=null){Element.hide(element_to_show)}if($(progress_element)!=null){Element.hide(progress_element)}if(state_name==""||country==""){return}getVars="state="+state_name+"&country="+country;on_complete_method=function(transport){response_data=eval(transport.responseText);if(typeof progress_element!="undefined"){Element.hide(progress_element)}if(response_data.status=="cancel"){Element.show(element_to_show)}else{Element.hide(element_to_show)}};new Ajax.Request(this.url,{parameters:getVars,asynchronous:false,onLoading:function(){if(typeof progress_element!="undefined"){Element.Show(progress_element)}},onComplete:on_complete_method})}function validate_city(city_name,country,element_to_show,progress_element,state_value){url=domain+"/main/cb_check_city";Element.hide(element_to_show);if($(progress_element)!=null){Element.hide(progress_element)}Element.hide(progress_element);if(city_name==""||country==""){return}getVars="city="+city_name+"&country="+country;if(typeof(state_value)!="undefined"&&state_value!=""){getVars+="&state="+state_value}on_complete_method=function(transport){response_data=eval(transport.responseText);if(typeof progress_element!="undefined"){Element.hide(progress_element)}if(response_data.status=="cancel"){Element.show(element_to_show)}else{Element.hide(element_to_show)}};new Ajax.Request(this.url,{parameters:getVars,asynchronous:false,onLoading:function(){if(typeof progress_element!="undefined"){Element.Show(progress_element)}},onComplete:on_complete_method})}function validate_country(country_name,element_to_show,progress_element){url=domain+"/main/cb_check_country";if(country_name==""){return}getVars="country="+country_name;new Ajax.Request(this.url,{parameters:getVars,asynchronous:false,onLoading:function(){if(typeof progress_element!="undefined"){Element.show(progress_element)}},onComplete:function(transport){response_data=eval(transport.responseText);if(typeof progress_element!="undefined"){Element.hide(progress_element)}if(response_data.status=="cancel"){Element.show(element_to_show)}else{Element.hide(element_to_show);temp_element=$("user_cellphones_country_code");if(typeof temp_element!="undefined"){temp_element.value=response_data.country_code}}}})}function onChangeCountry(objSelect){var countryname;countryname=objSelect.options[objSelect.selectedIndex].value;cityselect=$("geolocation_id");cityselect.disabled=true;showhidediv("hidediv","showdiv");new Ajax.Request("/main/cb_getcities",{parameters:{country:countryname},asynchronous:true,onLoading:function(){},onComplete:function(transport){try{json_data=eval(transport.responseText);cityselect.clear();cityselect.length=0;for(i=0;i<json_data.length;i++){var y=document.createElement("option");y.text=json_data[i].attributes.location_name;y.value=json_data[i].attributes.id;try{cityselect.add(y,null)}catch(ex){cityselect.add(y)}}}catch(ex){log_exceptions(" callback: - onComplete of cb_getcities "+ex.message)}cityselect.disabled=false;showhidediv("showdiv","hidediv")}})}function register_geo_location_with_id_new(f,d,g,c){d=(d||"");c=(c||"");var a=function(){$(d+"geo_no_city_"+f).hide();$(d+"geo_city_wait_"+f).hide()};var h=function(){var j="";if($(d+"geo_country_"+f).selectedIndex){$(d+"geo_no_city_"+f).hide();$(d+"geo_city_wait_"+f).show();var m="&country_hint="+$(d+"geo_country_"+f).options[$(d+"geo_country_"+f).selectedIndex].innerHTML;if($(d+"state_field_geo_"+f).style.display!="none"){var k="&state="+$(d+"geo_state_"+f).value}else{var k=""}var l="&city_hint="+$(d+"geo_city_"+f).value.replace(/^\s+|\s+$/g,"");var j=l+m+k}return{action:"/main/cb_city_auto_complete",parameters:j}};var b=function(){$(d+"geo_city_wait_"+f).hide()};var e=function(){$(d+"geo_city_wait_"+f).hide();$(d+"geo_no_city_"+f).show()};new AutoComplete(d+"geo_city_"+f,{inputLocation:c,clearFunc:a,loadFunc:h,doneFunc:b,noneFunc:e,offsetLeft:g,delay:0.25,resultFormat:AutoComplete.Options.RESULT_FORMAT_HTML})}function register_geo_location_with_id(c,e,d){var b="";if(typeof(e)!="undefined"){b=e}var a=new Ajax.Autocompleter(b+"geo_city_"+c,b+"geo_city_list_auto_complete_"+c,"/main/cb_city_auto_complete",{callback:function(g,h){try{Element.hide(b+"geo_no_city_"+c);return"?country_hint="+$(b+"geo_country_"+c).options[$(b+"geo_country_"+c).selectedIndex].text+"&state="+$(b+"geo_state_"+c).options[$(b+"geo_state_"+c).selectedIndex].text+"&city_hint="+$(b+"geo_city_"+c).value}catch(f){log_exceptions(" callback: - Ajax.Autocompleter callback "+f.message);return false}},minChars:1,indicator:b+"geo_city_wait_"+c,updateElement:function(f){var g=$(b+"geo_city_"+c);g.value=f.innerHTML;if(d){prefill_form_fields(g.form,b+"geo_city_",g)}}})}function do_fields_empty(a){for(i=0;i<a.length;i++){$(a[i]).value=""}}function tab_selection(j,a,g,b,f){try{log_exceptions("other tab ::: "+typeof(g));for(var d=0;d<g.length;d++){try{hideDiv(g[d])}catch(h){log_exceptions("Method: - tab_selection catch block 1 "+h.message)}}showDiv(j);if(typeof b=="object"){for(var d=0;d<b.length;d++){try{if($(b[d]).hasClassName(f)){$(b[d]).removeClassName(f)}}catch(h){log_exceptions("Method: - tab_selection catch block 2 "+h.message)}}}else{if($(b).hasClassName(f)){$(b).removeClassName(f)}}if(!$(a).hasClassName(f)){$(a).addClassName(f);$(a).blur()}}catch(c){log_exceptions("Method: - tab_selection catch block 3 "+c.message)}}function change_tab_selection(e,a,d,b,c){tab_selection(e,a,d,b,c)}function showDiv(a){Element.show(a)}function hideDiv(a){Element.hide(a)}function checkusername(b,e,a){try{var d=$(b).value.strip().replace(/[^a-zA-Z0-9\-\.\_]+/,"");d=d.replace(/[;.]+/g,"");$(b).value=d;if(typeof a!="undefined"){if(a==d){$(e).update("");return false}}if(d==""){return false}if(d.length<5){$(e).update("<font color=RED><b>"+error_list.username_min_length+"</b></font>");return false}else{if(d.length>255){$(e).update("<font color=RED><b>"+error_list.username_max_length+"</b></font>");return false}}$(b).disabled=true;new Ajax.Request("/user/check_existing_user",{parameters:{username:d},asynchronous:true,onLoading:function(){},onComplete:function(g){var f=parseInt(g.responseText);$(b).disabled=false;if(f==1){$(e).innerHTML="<font color=GREEN><b>"+error_list.signup_username_free+"</b></font>"}else{if(f==0){$(e).innerHTML="<font color=RED><b>"+error_list.signup_username_unavailable+"</b></font>"}}}})}catch(c){log_exceptions("Method:- checkusername "+c.message)}}function hide_element_shown(a){if($(a).visible()){Element.hide(a)}}function clear_txt_fields(a){for(i=0;i<a.length;i++){$(a[i]).value=""}}function change_status_elements(b,a){for(i=0;i<b.length;i++){$(b[i]).disabled=a}}function remove_previous_error_div(a){if(typeof(a)=="undefined"){a=""}if($("errorExplanation"+a)){Element.remove("errorExplanation"+a)}else{if($("errorList"+a)){Element.remove("errorList"+a)}}}function change_category(a){document.title="Business";if(typeof(json_data)=="undefined"){return}}function showhidediv(b,a){if($("loadingmsg").hasClassName(b)){$("loadingmsg").removeClassName(b);$("loadingmsg").addClassName(a)}}function make_visible_elmnt_hide(a){if(typeof a!="undefined"){if(Element.visible(a)){new Effect.Fade(a,{duration:1})}}}function status_message_div(){if($("status_message")==null){return}if($("status_message").visible()){Element.remove("status_message")}}function validate_comment_temp(){try{var a=validate_empty_field("content_comment_comment","div_comment_form","Comment","370px");setCookie("editornew",$("abc").value);if($("abc").value=="edit"){RedBox.close()}}catch(b){log_exceptions("Method :- validate_comment_temp "+b.message)}return a}var abc=0;function validate_empty_field(b,a,g,e,d){var f="";remove_previous_error_div();if(typeof(d)!="undefined"){var c=get_tiny_mce_value(b);if(typeof(c)!="object"){return false}if(c.text_value==""||c.is_empty==true){f+="You must write something.#"}}else{if($(b).value.strip()==""){f+="You must write something.#"}}if(f==""){return true}else{style="";if(typeof e!="undefined"&&e!=""){style=e}new Insertion.Top(a,get_error_list_html(f.split("#"),"error(s) prohibited this "+g.toLowerCase()+" from being saved"));return false}}function validate_empty_textarea(b,a,e,c){var d="";remove_previous_error_div();if(trim($(b).value).length==0){d+="You must write something.#"}if(d==""){return true}else{style="";if(typeof c!="undefined"&&c!=""){style=c}new Insertion.Top(a,get_error_list_html(d.split("#"),"error(s) prohibited this "+e.toLowerCase()+" from being saved"));return false}}function add_postfix(a){parent_elmnt=$(a);child_element=parent_elmnt.descendants();parent_elmnt.id+="_old";log_exceptions("add postfix :: "+parent_elmnt.id);for(i=0;i<child_element.length;i++){if(typeof(child_element[i].id)!="undefined"){if(child_element[i].id!=null&&child_element[i].id!=""){log_exceptions("Element name :: "+child_element[i].name);child_element[i].id+="_old";log_exceptions(child_element[i].id)}}}log_exceptions("==================================")}function remove_postfix(a){parent_elmnt=$(a);child_element=parent_elmnt.descendants();parent_elmnt.id=parent_elmnt.id.sub("_old","");log_exceptions(parent_elmnt.id);for(i=0;i<child_element.length;i++){if(typeof(child_element[i].id)!="undefined"){if(child_element[i].id!=null&&child_element[i].id!=""){child_element[i].id=child_element[i].id.sub("_old","");log_exceptions(child_element[i].id)}}}}function validate_multiple_empty_field(c,b,g,e){disable_form(b,true);var f="";remove_previous_error_div();for(var a=0;a<c.length;a++){if($(c[a]).value==""){f+=g[a]+" can't be empty.#"}else{if($(c[a]).value.length>0&&$(c[a]).value[0]==" "){f+="Text should not start with space#"}}if(c[a]=="shared_image_1"){temp=$F(c[a]);if((temp!="")&&(!checkExtension_img(temp))){f+=error_list.unknown_img_format+"#"}}if(c[a]=="shared_video_1"){temp=$F(c[a]);if((temp!="")&&(!checkExtension_vid(temp))){f+=error_list.unsupported_format+"#"}}}if(f==""){return true}else{var d="";if(typeof e!="undefined"){d=e}new Insertion.Top(b,get_error_div(f.split("#"),"error(s) prohibited this form from being saved",d,"errorExplanation_ans"));disable_form(b,false);return false}}function validate_forgot_form(){disable_form("login_content",true);var a="";remove_previous_error_div();if($("user_email").value==""){a+=error_list.forgot_blank_email+"#"}else{if(!validateemail($("user_email").value)){a+=error_list.wrong_email+"#"}}if(a==""){return true}else{new Insertion.Top("login_content",get_error_list_html(a.split("#"),error_list.forgot_password_error_heading,""));disable_form("login_content",false);return false}}function validate_blog_form(){disable_form("display_error",true);var a="";remove_previous_error_div();if($("blog_title").value==""){a+=error_list.blank_title+"#"}if(tinyMCE.get("blog_full_content").getContent()==""){a+=error_list.blank_body+"#"}if($F("shared_blog_country_1")!=""){validate_country($F("shared_blog_country_1"),"blog_no_country","blog_country_wait");if(Element.visible("blog_no_country")){a+=error_list.country_not_found+"#"}}if($F("shared_blog_city_1")!=""){validate_city($F("shared_blog_city_1"),$F("shared_blog_country_1"),"blog_no_city","blog_city_wait");if(Element.visible("blog_no_city")){a+=error_list.city_not_found+"#"}}if(a==""){return true}else{new Insertion.Top("display_error",get_error_div(a.split("#"),error_list.blogs_error_heading,""));disable_form("display_error",false);return false}}my_tiny_mce_object=function(){this.is_empty=false;this.text_value=""};function get_tinymce_textbox_value(){textContent=tinyMCE.activeEditor.gettextContent();if(typeof(textContent)=="undefined"){textContent=""}no_of_matches=0;for(i=0;i<textContent.length;i++){current_code=textContent.charCodeAt(i);if(current_code==160||(current_code>=0&&current_code<=32)){no_of_matches+=1}else{break}}if(no_of_matches==textContent.length){return true}else{return false}}function get_tiny_mce_value(a,c){try{my_values=new my_tiny_mce_object();if(typeof(c)=="undefined"){$(a).value=tinyMCE.activeEditor.getContent()}else{$(a).value=tinyMCE.get(a).getContent()}my_values.text_value=$(a).value.strip();if(my_values.text_value!=""){my_values.is_empty=get_tinymce_textbox_value()}return my_values}catch(b){log_exceptions("Method :- get_tiny_mce_value "+b.message);return false}}function validate_blog_form_in_lb(){var a=get_tiny_mce_value("blog_full_content");if(typeof(a)!="object"){return false}disable_form("edit_blog_form",true);var b="";remove_previous_error_div();if($("blog_title").value==""){b+=error_list.blank_blog_title+"#"}if(a.text_value==""||a.is_empty==true){b+=error_list.blank_body+"#"}if(b==""){return true}else{disable_form("div_blog_edit_form",false);new Insertion.Top("div_blog_edit_form",get_error_div(b.split("#"),error_list.blogs_error_heading,""));return false}}function validate_geo_location(d,l,k,b,h,e){if(!is_verify_geolocation){return""}if(typeof(k)=="undefined"){k=1}var f="";var g=true;remove_previous_error_div();if(typeof(b)=="undefined"){b=""}if(typeof(h)=="undefined"){h=""}if(typeof(e)=="undefined"){e=""}if(typeof(d)!="undefined"){f=d}if(typeof(l)!="undefined"){if(l=="optional"){g=false}}var n=$(f+"geo_country_"+k).options[$(f+"geo_country_"+k).selectedIndex].value;var a=($(f+"geo_country_"+k).selectedIndex!=-1&&$(f+"geo_country_"+k).selectedIndex!=0);var j=false;var c="";var m=$(f+"geo_city_"+k).value;if(a&&n=="United States of America"){j=($(f+"geo_state_"+k).selectedIndex!=-1&&$(f+"geo_state_"+k).selectedIndex!=0);if(j){c=$(f+"geo_state_"+k).options[$(f+"geo_state_"+k).selectedIndex].text}}is_city=($(f+"geo_city_"+k).value!="");if(!(a||j||is_city||g)){return""}if(b==n&&h==m&&e==c){return""}validate_city(m,n,f+"geo_no_city_"+k,f+"geo_city_wait_"+k,c);errorhtml="";if(!a){errorhtml+=error_list.blank_country+"#"}if(n.strip()=="United States of America"){if(c==""){errorhtml+=error_list.blank_state+"#"}}if($(f+"geo_city_"+k).value==""){errorhtml+=error_list.blank_city+"#"}else{if(Element.visible(f+"geo_no_city_"+k)){errorhtml+=error_list.city_not_found+"#"}}return errorhtml}function isLeapYear(a){return((a%4==0)&&(a%100!=0||a%400==0))}function readDaysInMonth(b,a){if(b==1&&isLeapYear(a)==true){return 29}else{return[31,28,31,30,31,30,31,31,30,31,30,31][b]}}function checkDateForNumberOfDaysInMonth(c,b,a){days=readDaysInMonth((b-1),a);if(days<$("date_day").value){c+="The month specified only has "+days+" days.#"}return c}function validate_profile_form(){disable_form("save_profile_form",true);remove_previous_error_div();var c="";if($("user_user_name").value==""){c+=error_list.blank_username+"#"}if($("user_user_name").value.length<5){c+=error_list.username_min_length+"#"}if($("date_month").value==""){c+="Please select month you were born.#"}if($("date_day").value==""){c+="Please select day you were born.#"}else{c=checkDateForNumberOfDaysInMonth(c,$("date_month").value,$("date_year").value)}var a=$("date_year").value;var b=(new Date()).getFullYear()-13;if(a>b){c+="Age should be 13 or more#"}if($("profile_image").value!=""){if(!checkExtension_img($("profile_image").value)){c+=error_list.unknown_img_format+"#"}}if($("password_password").value!=""||$("password_confirmpassword").value!=""){before_length=c.length;if(($("password_password").value!=$("password_confirmpassword").value)){c+=error_list.confirm_password+"#"}if(($("password_password").value.length<6)){c+=error_list.minimum_password_length+"#"}if(before_length<c.length){$("password_password").value="";$("password_confirmpassword").value=""}}c+=validate_geo_location();if($("levelofeducation").selectedIndex==-1){c+=error_list.blank_education+"#"}if(c==""){return true}else{if($("success_status_bar")){Element.remove("success_status_bar")}new Insertion.Top("save_profile_form",get_error_list_html(c.split("#"),error_list.update_profile_error_heading,""));disable_form("save_profile_form",false);return false}}function validate_share_url_form(){disable_form("div_urls_rss_form",true);var a="";remove_previous_error_div();var b=0;if($F("url")==""){a+=error_list.blank_url+"#";b+=1}else{if(!validateurl($F("url"))){a+=error_list.wrong_url+"#";b+=1}}if(a==""){return true}else{new Insertion.Top("div_urls_rss_form",get_error_div(a.split("#"),error_list.url_feed_error_heading,""));disable_form("div_urls_rss_form",false);return false}}function validate_partial_complete(){if(typeof(swfu)!="undefined"&&swfu.getStats().in_progress==1){alert(error_list.image_upload_progress);return false}disable_form("signup_form",true,undefined,"div_processing_spinner_partial");var c="";remove_previous_error_div();if($("date_month").value==""){c+="Please select month you were born.#"}if($("date_day").value==""){c+="Please select day you were born.#"}else{c=checkDateForNumberOfDaysInMonth(c,$("date_month").value,$("date_year").value)}var b=(new Date()).getFullYear()-13;var a=$("date_year").value;if(a==""||a>b){c+="Age should be 13 or more#"}c+=validate_geo_location();if($("levelofeducation").selectedIndex==-1){c+=error_list.blank_education+"#"}if($("user_terms_of_service")!=null&&$("user_terms_of_service").checked!=1){c+=error_list.blank_terms_of_service+"#"}if($("user_privacy_policy")!=null&&$("user_privacy_policy").checked!=1){c+=error_list.blank_privacy_policy+"#"}if($("profile_uploaded_image")!=null&&$("profile_uploaded_image").visible()==false){c+=error_list.blank_image+"#"}if(c==""){return true}else{new Insertion.Top("registeration_content",get_error_list_html(c.split("#"),error_list.signup_error_heading,""));disable_form("signup_form",false,undefined,"div_processing_spinner_partial");return false}}function validate_login_form(){disable_form("login_content",true);var a="";remove_previous_error_div();if($("user_name").value==""){a+=error_list.blank_email+"#"}else{if(!validateemail($("user_name").value)){a+=error_list.wrong_email+"#"}}if(($("password").value.length<1)){a+=error_list.blank_password+"#"}if(a==""){return true}else{new Insertion.Top("login_content",get_error_list_html(a.split("#"),error_list.login_error_heading,""));disable_form("login_content",false);return false}}function validate_partial_signup_form(){disable_form("signup_form",true,undefined,"div_processing_spinner_partial");var a="";remove_previous_error_div();if($("user_email").value==""){a+=error_list.blank_email+"#"}else{if(!validateemail($("user_email").value)){a+=error_list.wrong_email+"#"}}if($("user_user_name").value==""){a+=error_list.blank_username+"#"}else{if($("user_user_name").value.length<5){a+=error_list.username_min_length+"#"}}before_length=a.length;if(($("user_password").value!=$("confirmpassword").value)){a+=error_list.confirm_password+"#";new Ajax.Request("/main/change_captcha",{parameters:{},asynchronous:true,onLoading:function(){},onComplete:function(b){$("change_captcha").update(b.responseText)},onError:function(){alert("Sorry, Captcha image could not be replaced this time.")}})}if(($("user_password").value.length<6)){a+=error_list.minimum_password_length+"#"}if(before_length<a.length){$("confirmpassword").value="";$("user_password").value=""}if($("user_terms_of_service")!=null&&$("user_terms_of_service").checked!=1){a+=error_list.blank_terms_of_service+"#"}if(a==""){return true}else{new Insertion.Top("registeration_content",get_error_list_html(a.split("#"),error_list.signup_error_heading,""));disable_form("signup_form",false,undefined,"div_processing_spinner_partial");return false}}function validateEmailFields(b,a,d){var c="";if($(b).value==""){c+=error_list.blank_email+"#"}else{if(!validateemail($(b).value)){c+=error_list.wrong_email+"#"}}if(c==""){return true}else{$(a).innerHTML=get_error_list_html(c.split("#"),"Ooops, something didn't go right there...","","yes");$(a).show();$(d).hide();return false}}function validate_signup_form(){disable_form("signup_form",true);var c="";remove_previous_error_div();if($("user_email").value==""){c+=error_list.blank_email+"#"}else{if(!validateemail($("user_email").value)){c+=error_list.wrong_email+"#"}}if($("user_user_name").value==""){c+=error_list.blank_username+"#"}else{if($("user_user_name").value.length<5){c+=error_list.username_min_length+"#"}}before_length=c.length;if(($("user_password").value!=$("confirmpassword").value)){c+=error_list.confirm_password+"#";new Ajax.Request("/main/change_captcha",{parameters:{},asynchronous:true,onLoading:function(){},onComplete:function(d){$("change_captcha").update(d.responseText)},onError:function(){alert("Sorry, Captcha image could not be replaced this time.")}})}if(($("user_password").value.length<6)){c+=error_list.minimum_password_length+"#"}if(before_length<c.length){$("confirmpassword").value="";$("user_password").value=""}var a=$("date_year").value;var b=(new Date()).getFullYear()-13;if(a>b){c+="Age should be 13 or more#"}c+=validate_geo_location();if($("levelofeducation").selectedIndex==-1){c+=error_list.blank_education+"#"}country_code=$("user_cellphones_country_code").value;cellphone=$("user_cellphones_cellphone").value;if((country_code!=""&&isNaN(country_code))||(cellphone!=""&&isNaN(cellphone))){c+=error_list.wrong_cellphone+"#"}pincode=$("user_cellphones_pincode").value;if(pincode!=""&&(isNaN(pincode)||pincode.length<5)){c+=error_list.wrong_pincode+"#"}if($("captcha").value==""){c+="Enter text for Captcha image.#"}if($("user_terms_of_service")!=null&&$("user_terms_of_service").checked!=1){c+=error_list.blank_terms_of_service+"#"}if(c==""){return true}else{new Insertion.Top("registeration_content",get_error_list_html(c.split("#"),error_list.signup_error_heading,""));disable_form("signup_form",false);return false}}function validate_search_form(){if($("search_box").value.strip()==""||$("search_box").value.strip()==error_list.searchbox){return false}var a=new RegExp("[^a-z-0-9A-Z]+");$("search_box").value=$("search_box").value.strip().replace(a,"-");return true}function validate_geosearch_form(){if($("location_search").value.strip()==""||$("location_search").value.strip()==error_list.locationbox){return false}return true}function inline_spinner_ajax(c,a,d,f,b){Element.hide(a);var e=$(d);Element.show(e);new Ajax.Request(c,{asynchronous:true,onComplete:function(g){if(g.responseText.indexOf("success")>-1){if(typeof f=="function"){f();e.style.display="none"}else{e.innerHTML=f}}else{if(typeof b=="function"){b();e.style.display="none"}else{e.innerHTML=b}}}})}function become_fan(f,a,e,c){var b=domain+"/users/"+f+"/become_fan";function d(){$(e+"_fanLink").style.display="";$(e+"_notFanLink").style.display="none";if(c!=""&&$(c+"_notFanLink")){$(c+"_fanLink").style.display="";$(c+"_notFanLink").style.display="none"}}inline_spinner_ajax(b,a,e+"_ajaxWait",d,"Weird error. Refresh & try again?")}function remove_fan(e,a,d){var b=domain+"/users/"+e+"/remove_fan";function c(){$(d+"_fanLink").style.display="none";$(d+"_notFanLink").style.display=""}inline_spinner_ajax(b,a,d+"_ajaxWait",c,"Weird error. Refresh & try again?")}function send_friend_request(c,b){var d=(b.getElementsByClassName("ajaxWait"))[0];Element.show(d);var a=domain+"/users/"+c+"/request_friendship";new Ajax.Request(a,{asynchronous:true,onComplete:function(e){if(e.responseText.indexOf("success")>-1){d.innerHTML=error_list.friend_request_success}else{d.innerHTML=error_list.friend_request_error}}})}function confirm_friend_request(d,c,a){c.innerHTML='<p class="ajaxWait"><img src="/images/ajax/ajax-wait-arrows.gif" style="width:16px; height:16px;" /> Saving...</p>';var b=domain+"/users/"+d+"/confirm_friendship?status="+a;new Ajax.Request(b,{asynchronous:true,onComplete:function(e){if(e.responseText.indexOf("success")>-1){c.innerHTML=error_list.friend_confirm_success}else{c.innerHTML=error_list.friend_request_error}}})}function send_verification_code(){progress_element="send_verification_message";url=domain+"/main/send_verification_code";params="cellphone="+$("user_cellphone_country_code").value+"-"+$("cell_phone").value;div_to_add="profile_page";var a="";remove_previous_error_div();if($("cell_phone").value==""){a+=error_list.blank_cellphone}else{if(!validate_digits($("cell_phone").value)){a+="Cellphone - "+error_list.digits_only}}if($("user_cellphone_country_code").value==""||$("user_cellphone_country_code_confirmed").value==""){a+=error_list.blank_country_code}else{if($("user_cellphone_country_code").value!=$("user_cellphone_country_code_confirmed").value){a+=error_list.confirm_country_code}else{if(!validate_digits($("user_cellphone_country_code").value)){a+="Country Code-"+error_list.digits_only}else{if(!validate_digits($("user_cellphone_country_code_confirmed").value)){a+="Confirm Country Code-"+error_list.digits_only}}}}if($("cell_phone_confirmed").value!=$("cell_phone").value){a+=error_list.update_profile_confirm_phone}else{if(!validate_digits($("cell_phone_confirmed").value)){a+=" Confirmed cellphone - "+error_list.digits_only}}if(a!=""){new Insertion.Top($(div_to_add),get_error_div(a.split("#"),error_list.update_profile_cellphone_error_heading,""));return false}else{new Ajax.Request(url,{parameters:params,asynchronous:true,onLoading:function(){if(typeof progress_element!="undefined"){Element.show(progress_element)}},onComplete:function(b){if(dialogbox_response_eval("profile_page",error_list.update_profile_cellphone_error_heading,b.responseText,"")){$("success_msg").update(error_list.update_profile_success_sendverification);divAddClassName($("success_msg"),"siteFlashMsg");$(progress_element).hide();change_status_elements(["btn_send_verify_code","cell_phone_confirmed","cell_phone","user_cellphone_country_code","user_cellphone_country_code_confirmed"],"true");Element.show("div_pincode")}}});return false}}function divAddClassName(a,b){a.addClassName(b)}function send_verification_code_email(){progress_element="send_verification_message_email";url=domain+"/main/send_verification_code_via_email";params="email="+$("email").value;div_to_add="profile_page_email";var a="";remove_previous_error_div();if($("email").value==""){a+=error_list.blank_email}else{if(!validateemail($("email").value)){a+=error_list.wrong_email}}if($("email_confirmed").value!=$("email").value){a+=error_list.update_profile_confirm_email}if(a!=""){new Insertion.Top($(div_to_add),get_error_div(a.split("#"),error_list.update_profile_email_error_heading,""));return false}else{new Ajax.Request(url,{parameters:params,asynchronous:true,onLoading:function(){if(typeof progress_element!="undefined"){Element.show(progress_element)}},onComplete:function(b){if(dialogbox_response_eval("profile_page_email",error_list.update_profile_email_error_heading,b.responseText,"")){$("success_msg_email").update("Email is successfully sent.");divAddClassName($("success_msg_email"),"siteFlashMsg");$(progress_element).hide();change_status_elements(["btn_send_verify_code_email","email_confirmed","email"],"true");Element.show("div_pincode_email")}}});return false}}function veritfy_pincode(){div_to_add="profile_page";progress_element="verification_pincode_message";url=domain+"/main/verify_cellphone";params="cellphone="+$("user_cellphone_country_code").value+"-"+$("cell_phone").value+"&pincode="+$("pin_code").value;var a="";if($("pin_code").value==""){a+=error_list.update_profile_blank_pincode}if(!validate_digits($("pin_code").value)){a+=error_list.digits_only}if(a!=""){new Insertion.Top($(div_to_add),get_error_div(a.split("#"),error_list.update_profile_pincode_error_heading,""));return false}else{new Ajax.Request(url,{parameters:params,asynchronous:true,onLoading:function(){if(typeof progress_element!="undefined"){Element.show(progress_element)}},onComplete:function(b){if(dialogbox_response_eval("profile_page",error_list.update_profile_pincode_error_heading,b.responseText,"")){$("success_msg").update(error_list.update_profile_success_pincode_msg);divAddClassName($("success_msg"),"siteFlashMsg");$(progress_element).hide();change_status_elements(["btn_send_verify_code","cell_phone_confirmed","cell_phone","pin_code","btn_verify_pincode","user_cellphone_country_code","user_cellphone_country_code_confirmed"],"true")}else{hide_element_shown(progress_element)}}});return false}}function verify_email_pincode(){div_to_add="profile_page_email";progress_element="verification_pincode_message_email";url=domain+"/main/verify_email";params="email="+$("email").value+"&pincode="+$("email_pin_code").value;var a="";if($("email_pin_code").value==""){a+=error_list.update_profile_blank_pincode}if(!validate_digits($("email_pin_code").value)){a+=error_list.digits_only}if(a!=""){new Insertion.Top($(div_to_add),get_error_div(a.split("#"),error_list.update_profile_pincode_error_heading,""));return false}else{new Ajax.Request(url,{parameters:params,asynchronous:true,onLoading:function(){if(typeof progress_element!="undefined"){Element.show(progress_element)}},onComplete:function(b){if(dialogbox_response_eval("profile_page",error_list.update_profile_pincode_error_heading,b.responseText,"")){$("success_msg_email").update("Now, your email is verified successfully.");divAddClassName($("success_msg_email"),"siteFlashMsg");$(progress_element).hide();change_status_elements(["btn_send_verify_code_email","email_confirmed","email","email_pin_code","btn_verify_pincode_email"],"true")}else{hide_element_shown(progress_element)}}});return false}}function validate_share_content(d,b,e,a,c){validate_email=validate_multiemails(d);if(b.value.length==0){validate_email+="Your name cannot be empty#"}if(b.value.length>0&&b.value[0]==" "){validate_email+="Your name should not start with space#"}if(e.value.length==0){validate_email+="Your email cannot be empty#"}if(validate_email==""){return true}else{error_div=$(a);if(!error_div.visible()){error_div.show()}new Insertion.Top($(a),get_error_div(validate_email.split("#"),error_list.wrong_email_heading,c));return false}}function validate_share_content_with_captcha(e,c,f,a,b,d){validate_email=validate_multiemails(e);if(c.value.length==0){validate_email+="Your name cannot be empty#"}if(c.value.length>0&&c.value[0]==" "){validate_email+="Your name should not start with space#"}if(f.value.length==0){validate_email+="Your email cannot be empty#"}if(typeof(Recaptcha)!="undefined"){if(Recaptcha.get_response().strip().length<0){validate_email+="Please enter the 6 letters in the picture#"}}else{if(a.value.length!=6){validate_email+="Please enter the 6 letters in the picture#"}}if(validate_email==""){return true}else{error_div=$(b);if(!error_div.visible()){error_div.show()}error_div.update("");new Insertion.Top($(b),get_error_list_html(validate_email.split("#"),error_list.wrong_email_heading,d));return false}}function get_all_email_address(){var j="";var k=encodeURIComponent($("page_url").value);var h="Event";var d=encodeURIComponent($("invite_message").value);var a="";var l="Share";var b="";if(validate_multiemails($("invite_email_address").value,true)==""){a=$("invite_email_address").value}var c=($("contactsTable")?$("contactsTable"):$("contactsTable_inline"));if(c){var f=c.getElementsByTagName("INPUT");var g=0;for(var e=0;e<f.length;e++){if(f[e].type=="checkbox"&&f[e].checked){j+=$("email_"+e).innerHTML.strip()+",";g+=1}}}j+=a;b="page_url="+k+"&content_type="+h+"&inivite_message="+d+"&invite_email_address="+encodeURIComponent(j)+"&share=Share";return b}function validate_invite_friend(c,a,b){validate_email=validate_multiemails(c,true);if(validate_email==""||validate_import_contacts()){return true}else{error_div=$(a);if(!error_div.visible()){error_div.show()}new Insertion.Top($(a),get_error_div(validate_email.split("#"),error_list.wrong_email_heading,b));return false}}function validate_import_contacts(){var c=($("contactsTable")?$("contactsTable"):$("contactsTable_inline"));if(c){var b=c.getElementsByTagName("INPUT");var d=0;for(var a=0;a<b.length;a++){if(b[a].type=="checkbox"&&b[a].checked){d+=1}}return(d>0?true:false)}else{return true}}function validate_multiemails(c,b){var a=c.replace(/\s+/g,"").split(",");var d="";if(c==""||c.strip()==error_list.enter_email_address){if(typeof(b)!="undefined"){d+=error_list.blank_multi_email+"#"}else{d+=error_list.blank_email+"#"}return d}for(i=0;i<a.length;i++){if(a[i]==""||validateemail(a[i])==false){d+=error_list.wrong_email_address+"#";break}}return d}function validateemail(b){var a=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return a.test(b)}function validateurl(a){var b=/^(((http|https|ftp):\/\/)?)(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i;return b.test(a)}function validate_digits(b){var a=/[^\d]/;if(a.test(b)){return false}return true}function validate_image_file(c){var a=new Array(".jpg",".gif",".jpeg",".png",".bmp",".JPG",".GIF",".JPEG",".PNG",".BMP");var b=0;for(i=0;i<a.length;i++){if(c.indexOf(a[i])!=-1){b=1}}if(b==1){return true}else{return false}}function checkExtension_img(c){c=c.toString();var a=c.split(".");if(a.length==1){return false}var b=a[a.length-1];b=b.toLowerCase();if(b=="jpg"||b=="gif"||b=="png"||b=="jpeg"||b=="bmp"){return true}return false}function checkExtension_vid(b){b=b.toString();var a=b.split(".");if(a.length==1){return false}ext=a[a.length-1];ext=ext.toLowerCase();if(ext=="mpeg"||ext=="mp4"||ext=="mov"||ext=="mpg"||ext=="avi"||ext=="wmv"||ext=="3gp"){return true}return false}function cancel_images_videos_upload(){new Ajax.Request("/main/cancel_images_videos_upload",{asynchronous:true,evalScripts:true,onComplete:function(a){}})}function delete_record(a){if(confirm_submit("Are you sure you want to delete this blog?")){$("status_msg_"+a).value="please wait";Element.visible("status_msg_"+a);remove_previous_error_div();Element.hide("status_message");new Ajax.Request("/blog/delete_blog/"+a,{asynchronous:true,evalScripts:true,onComplete:function(b){if(dialogbox_response_eval("display_error","error prohibited this Blog from being deleted",b.responseText,"width:555px")){oRequestHandlers[0].update("manage_blog");$("message_content").update("Blog is deleted successfully");Element.show("status_message")}}})}}function delete_video(a){if(confirm_submit("Are you sure you want to delete this video?")){$("status_msg_"+a).value="please wait";Element.visible("status_msg_"+a);remove_previous_error_div();Element.hide("status_message");new Ajax.Request("/video/delete_video/"+a,{asynchronous:true,evalScripts:true,onComplete:function(b){oRequestHandlers[0].update("manage_video");$("message_content").update("Video is deleted successfully");Element.show("status_message")}})}}function delete_image(a){if(confirm_submit("Are you sure you want to delete this image?")){$("status_msg_"+a).value="please wait";Element.visible("status_msg_"+a);remove_previous_error_div();Element.hide("status_message");new Ajax.Request("/image/delete_image/"+a,{asynchronous:true,evalScripts:true,onComplete:function(b){oRequestHandlers[0].update("manage_image");$("message_content").update("Image is deleted successfully");Element.show("status_message")}})}}function confirm_submit(b){var a=confirm(b);if(a){return true}else{return false}}function publish_record(b){if(confirm_submit("Are you sure to publish this blog?")){try{Element.hide("status_message");$("status_msg_"+b).value="please wait";Element.visible("status_msg_"+b);remove_previous_error_div();status_message_div();new Ajax.Request("/blog/publish_blog/"+b,{asynchronous:true,evalScripts:true,onComplete:function(c){if(dialogbox_response_eval("display_error","error prohibited this Blog from being published",c.responseText,"width:555px")){oRequestHandlers[0].update("manage_blog");$("message_content").update("Blog is published successfully");Element.show("status_message")}}})}catch(a){log_exceptions("Method :- publish_record "+a.message)}}}function publish_video(b){if(confirm_submit("Are you sure to publish this video?")){try{Element.hide("status_message");$("status_msg_"+b).value="please wait";Element.visible("status_msg_"+b);remove_previous_error_div();status_message_div();new Ajax.Request("/video/publish_video/"+b,{asynchronous:true,evalScripts:true,onComplete:function(c){oRequestHandlers[0].update("manage_video");$("message_content").update("Video is published successfully");Element.show("status_message")}})}catch(a){log_exceptions("Method :- publish_video "+a.message)}}}function publish_image(b){if(confirm_submit("Are you sure to publish this image?")){try{Element.hide("status_message");$("status_msg_"+b).value="please wait";Element.visible("status_msg_"+b);remove_previous_error_div();status_message_div();new Ajax.Request("/image/publish_image/"+b,{asynchronous:true,evalScripts:true,onComplete:function(c){oRequestHandlers[0].update("manage_image");$("message_content").update("Image is published successfully");Element.show("status_message")}})}catch(a){log_exceptions("Method :- publish_image "+a.message)}}}function validate_invitation_form(){disable_form("div_invitation",true);var a="";if($F("invitation_to")==""){a+="No recepient is mentioned#"}else{if(validate_multiemails($F("invitation_to"))){a+="Enter valid email-address#"}}if($F("invitation_sub")==""){a+="Subject is empty#"}if($F("invitation_body")==""){a+="Body is empty#"}if(a==""){return true}else{new Insertion.Top("div_invitation",get_error_div(a.split("#"),error_list.update_profile_invitation_error_heading,""));disable_form("div_invitation",false);return false}}function get_error_div(a,d,c,b,e){error_count=0;errorhtml="";if(typeof(b)=="undefined"){b="errorExplanation"}if(typeof(e)=="undefined"){e=""}if(typeof(a.length)!="undefined"){for(i=0;i<a.length;i++){if(a[i]!=""){errorhtml+="<li>"+a[i]+"</li>";error_count++}}}else{errorhtml="<li>"+a+"</li>"}if($("errorExplanation"+e)){Element.remove("errorExplanation"+e)}if(c.length>0){preerrorhtml="<div id='errorExplanation"+e+"' class='"+b+"' style='"+c+"'>"}else{preerrorhtml="<div id='errorExplanation"+e+"' class='errorExplanation'>"}preerrorhtml+="<h2>"+error_count+" "+d+"</h2>";preerrorhtml+="<p>There were problems with the following fields:</p><br/><div class='heightclear'></div>";preerrorhtml+="<ul>"+errorhtml+"</ul>";preerrorhtml+="<div class='clear'></div></div>";return preerrorhtml}function get_error_list_html(b,f,h,a){var d=0;var g="";if(typeof(h)=="undefined"){h=""}if(typeof(a)=="undefined"){a=""}if(typeof(b.length)!="undefined"){for(var c=0;c<b.length;c++){if(b[c]!=""){if(a==""){g+="<li>"+b[c]+"</li>"}else{g+=b[c]+"<br/>"}d++}}}else{g="<li>"+b+"</li>"}if($("errorList"+h)){Element.remove("errorList"+h)}if(a==""){var e='<div id="errorList'+h+'" class="errorList">';e+='<div class="errorListInner">';e+="<h5>"+d+" "+f+"</h5>";e+="<ul>"+g+"</ul>";e+="</div></div>"}else{e=g}return e}function dialogbox_response_eval(div_to_add,error_heading,json_text,style){try{dialog_response=eval(json_text);remove_previous_error_div();if(typeof(dialog_response.status)=="undefined"){return true}if(dialog_response.status=="ok"){return true}else{if(dialog_response.status=="cancel"){if($(div_to_add)==null){return false}if($("errorList")){Element.remove("errorList")}if(!$(div_to_add).visible()){Element.show(div_to_add)}if((error_list.session_time_out+"#")==dialog_response.error){alert(error_list.session_time_out);window.location.reload();return}else{new Insertion.Top($(div_to_add),get_error_list_html(dialog_response.error.split("#"),error_heading))}}}}catch(ex){log_exceptions("Method :- dialogbox_response_eval "+ex.message)}}function rand(a){return(Math.random())}function reset_ne_se_cookies(){setCookie("northeast","77.07878389624943,-178.2421875");setCookie("southwest","-56.75272287205734,-166.9921875");setCookie("map_center_and_zoom","10.163030512096046,7.382812500000013,2")}function parseCookie(a,b){var c=readCookie(b);val_arr=c.split(",");if(a<val_arr.length){return val_arr[a]}return""}function validate_create_event_form(a,b,d){if(typeof(d)=="undefined"){d=""}var c="";if($("title"+d).value.strip()==""){c+="Title cannot be empty.#"}my_values=get_tiny_mce_value("summary"+d);if(typeof(my_values)!="object"){return false}disable_form(a,true);remove_previous_error_div();if(my_values.text_value==""||my_values.is_empty==true){c+=error_list.blank_body+"#"}c+=validate_geo_location("event_");if(c==""){return true}else{style="";if(typeof b!="undefined"){style=b}new Insertion.Top(a,get_error_list_html(c.split("#")," error(s) prohibited this form from being saved",style,""));disable_form(a,false);return false}}function validate_create_person_form(a,b){disable_form(a,true);var c="";if($("title").value==""){c+="Title cannot be empty.#"}if(tinyMCE.get("summary").getContent()==""){c+="You must enter biography of this Person.#"}c+=validate_geo_location("person_");if(c==""){return true}else{style="";if(typeof b!="undefined"){style=b}new Insertion.Top(a,get_error_div(c.split("#")," error(s) prohibited this form from being saved",style,"errorExplanation_ans"));disable_form(a,false);return false}}function validate_share_content_for_person(){validate_email=validate_multiemails($("email_address").value);if(validate_email==""){return true}else{new Insertion.Top("share_error",get_error_div(validate_email.split("#"),"error prohibited this person from being shared",300,"errorExplanation_ans"));return false}}function validate_share_content_for_event(){validate_email=validate_multiemails($("email_address").value);if(validate_email==""){return true}else{new Insertion.Top("share_error",get_error_div(validate_email.split("#"),"error prohibited this person from being shared",300,"errorExplanation_ans"));return false}}function validate_feedback_email_form(){disable_form("div_feedback_email",true);var a="";if($("feedback_name").value==""){a+="You must enter your name.#"}if($("feedback_email").value==""){a+="You must specify your email.#"}if($("feedback_subject").value==""){a+="You must enter a subject.#"}if($("feedback_body").value==""){a+="Your message cannot be empty.#"}if(!validateemail($("feedback_email").value)){a+="Please enter the email in a correct format.#"}if(a==""){return true}else{new Insertion.Top("div_feedback_email",get_error_div(a.split("#"),"caused your registration to fail",""));disable_form("div_feedback_email",false);return false}}function validate_image_upload_form(b,a){var c=get_tiny_mce_value("shared_image_desc_1");if(typeof(c)!="object"){return false}disable_form(a,true);if(typeof(b)=="undefined"){b=""}if(typeof(a)=="undefined"){a="div_image_upload_form"}var d="";remove_previous_error_div();if($("shared_image_title_1").value.gsub(" ","")==""){d+="Title cannot be empty.#"}if(b!="manage"){if($("shared_image_1").value.gsub(" ","")==""){d+="No image selected. Please select an image.#"}else{if(!checkExtension_img($("shared_image_1").value.gsub(" ",""))){d+=error_list.unknown_img_format+"#"}}shared_image_description=c.text_value;is_description_empty=c.is_empty;if(shared_image_description==""||is_description_empty==true){d+="Description cannot be empty.#"}}if(d==""){return true}else{new Insertion.Top($(a),get_error_list_html(d.split("#"),error_list.image_error_heading,""));disable_form(a,false);return false}}function validate_video_upload_form(a){var b=get_tiny_mce_value("shared_video_desc_1");if(typeof(b)!="object"){return false}disable_form("div_video_upload_form",true);var c="";remove_previous_error_div();if($("shared_video_title_1").value.gsub(" ","")==""){c+="Title cannot be empty.#"}validate_geo_location("","optional");if(a!="manage"){if($("shared_video_1").value.gsub(" ","")==""&&$("youtube_link").value.gsub(" ","")==""){c+="No Video selected. Please select a Video.#"}else{if($("shared_video_1").value.gsub(" ","")!=""&&!checkExtension_vid($("shared_video_1").value.gsub(" ",""))){c+=error_list.unsupported_format+"#"}}shared_video_description=b.text_value;is_description_empty=b.is_empty;if(shared_video_description==""||is_description_empty==true){c+="Description cannot be empty.#"}}if(c==""){return true}else{new Insertion.Top("div_video_upload_form",get_error_list_html(c.split("#"),error_list.video_error_heading,""));disable_form("div_video_upload_form",false);return false}}function updateEvent(b,a){if(typeof(a)=="undefined"){a=""}if(!validate_create_event_form("update_event_form"+a,"510px",a)){return false}new Ajax.Request("/event/update_event/"+b,{asynchronous:true,evalScripts:true,onComplete:function(c){if(dialogbox_response_eval("div_update_event_form"+a,"error prohibited this event from being saved",c.responseText,"")){if(a!=""){oRequestHandlers[0].clearCache();oRequestHandlers[0].update("userevents");oRequestHandlers[0].clearCache();oRequestHandlers[0].update("user_updates");RedBox.close()}else{Element.show("div_update_event_spinner"+a);Element.hide("update_event_form"+a);Element.show("div_update_event_form"+a);window.location.reload();RedBox.close()}}else{Element.hide("div_update_event_spinner"+a);Element.show("div_update_event_form"+a);disable_form("div_update_event_form"+a,false);errorhtml="Summary has not been updated#";new Insertion.Top("update_event_form"+a,get_error_div(errorhtml.split("#")," error(s) prohibited this form from being saved",style,"errorExplanation_ans"))}},onLoading:function(c){Element.hide("div_update_event_form"+a);Element.show("div_update_event_spinner"+a)},parameters:$("update_event"+a).serialize()})}function updatePerson(a){tinyMCE.triggerSave();Element.hide("div_update_person_form");Element.show("div_update_person_spinner");if(!validate_create_person_form("div_create_person","510px")){Element.hide("div_update_person_spinner");Element.show("div_update_person_form");return false}new Ajax.Request("/person/update_person/"+a,{asynchronous:true,evalScripts:true,onComplete:function(c){if(dialogbox_response_eval("div_create_person","error prohibited this person from being updated",c.responseText,"")){try{Element.hide("div_update_person_spinner");Element.hide("update_person_form");Element.show("div_update_person_form");$("person_title_"+a).update($("title").value);$("person_summary_"+a).update("");$("person_category").update($("category").options[$("category").selectedIndex].text);$("person_summary_"+a).innerHTML=tinyMCE.get("summary").getContent();$("location_span_country").update($("person_geo_city_1").value);$("location_span_name").update($("person_geo_country_1").value);category_id=$("category").options[$("category").selectedIndex].value}catch(b){b=b;log_exceptions(" Method :- callback of update_person "+b.message)}RedBox.close();window.location.reload()}else{Element.hide("div_update_person_spinner");Element.show("div_update_person_form")}},onLoading:function(b){},parameters:$("update_person").serialize()})}function updateContent(b,a){my_url="/save_blog/"+a;posted_variables=Form.serialize("edit_blog_form_profile_"+b);new Ajax.Request(my_url,{parameters:posted_variables,asynchronous:true,onLoading:function(c){RedBox.close();Element.show("blog_edited_progress_"+b)},onComplete:function(c){Element.hide("blog_edited_success_"+b);Element.hide("blog_edited_failed_"+b);Element.show("blog_edited_progressbar_"+b);oRequestHandlers[0].clearCache();oRequestHandlers[0].update("blogs");oRequestHandlers[0].update("user_updates")}})}function validate_comment_length(a){}function validate_create_links_list(a){disable_form(a,true);var b="";if($("links_list_name").value.strip()==""){b+=error_list.blank_links_list_name+"#"}if(b==""){return true}else{new Insertion.Top(a,get_error_list_html(b.split("#"),error_list.links_list_error_heading,""));disable_form(a,false);return false}}function validate_edit_external_list_title(a,c){disable_form(a,true);var b="";if($("links_list_name_"+c).value.strip()==""){b+=error_list.blank_links_list_name+"#"}if(b==""){return true}else{new Insertion.Top(a,get_error_list_html(b.split("#"),error_list.links_list_error_heading,""));disable_form(a,false);return false}}function validate_external_link(a,c){if(typeof(c)=="undefine"){c=""}else{c="_"+c}disable_form(a+c,true);var b="";if($("list_item_title"+c).value.strip()==""){b+=error_list.blank_list_item_title+"#"}if(!validateurl($("list_item_url"+c).value)){b+=error_list.invalid_list_item_url+"#"}if(b==""){return true}else{new Insertion.Top(a+c,get_error_list_html(b.split("#"),error_list.links_list_error_heading,""));disable_form(a+c,false);return false}}function validate_external_blog(a){disable_form(a,true);var b="";if($("ext_blog_title").value.strip()==""){b+=error_list.external_blog_blank_title+"#"}if(!validateurl($("ext_blog_url").value)){b+=error_list.wrong_url+"#"}if(b==""){return true}else{new Insertion.Top(a,get_error_div(b.split("#"),error_list.external_blog_error_heading,"width:250px;"));disable_form(a,false);return false}}function validate_favourite(a){disable_form(a,true);var b="";if($("favourite_title").value.strip()==""){b+=error_list.blank_favourite_title+"#"}if(!validateurl($("favourite_url").value)){b+=error_list.wrong_url+"#"}if(b==""){return true}else{new Insertion.Top(a,get_error_div(b.split("#"),error_list.favourite_error_heading,"width:250px;"));disable_form(a,false);return false}}function validate_add_news_story_form(c){try{c=tinyMCE.get(c).getContent()}catch(a){log_exceptions("Method :- validate_add_news_story_form "+a.message);return false}try{disable_form("div_urls_rss_form",true);var e="";tinyMCE.triggerSave();remove_previous_error_div();var d=$("action_type").value;var b=$("summary_row").style.display=="none";if($("story_title").value.strip()==""&&!b){if(d=="story"){e+=error_list.blank_story_title+"#"}else{e+=error_list.blank_blog_link_title+"#"}}if(!validateurl($F("story_url"))){e+=error_list.wrong_url+"#"}if(e==""&&$("get_summary_or_submit").value=="get_summary"){remove_previous_error_div();oRequestHandlers[0].retrieve_url(tinyMCE,"content","retrieve_url","story_full_content",$("story_url").value,$("page_type").value,$("page_id").value,d);disable_form("div_urls_rss_form",false);if(typeof($("getsummary").disable)!="undefined"){$("getsummary").disable()}else{$("getsummary").disabled=true}return false}else{if(!b&&c.length<=0){e+=error_list.blank_body+"#"}}if(e==""){return true}else{if(d=="story"){new Insertion.Top("div_urls_rss_form",get_error_list_html(e.split("#"),error_list.url_feed_error_heading,""))}else{new Insertion.Top("div_urls_rss_form",get_error_list_html(e.split("#"),error_list.blog_link_error_heading,""))}disable_form("div_urls_rss_form",false);return false}}catch(a){log_exceptions("Method :- validate_add_news_story_form exception block 2 "+a.message)}}function launch_url(a){try{new Ajax.Request(a,{parameters:"",asynchronous:true,onLoading:function(){}.bind(this),onComplete:function(c){}.bind(this)})}catch(b){log_exceptions("Method :- launch_url "+b.message)}return true}function event_from_image_content(a){if(validate_image_upload_form()){Element.hide("image_upload_div");copy_content_new_event("shared_image_title_"+a,"shared_image_desc_"+a,"geo_country_1","geo_state_1","geo_city_1","tag_list_"+a,"Image")}}function event_from_video_content(a){if(validate_video_upload_form(a)){Element.hide("video_upload_form");copy_content_new_event("shared_video_title_1","shared_video_desc_1","geo_country_1","geo_state_1","geo_city_1","tag_list_1","Video")}}function event_from_blog_content(){disable_form("blog_structure",true,"");if(validate_blog_form_in_lb()){disable_form("edit_blog_form",false);Element.hide("blog_structure");copy_content_new_event_new("blog_title","blog_full_content","geo_country_1","geo_state_1","geo_city_1","content_tag_list","Blog")}else{disable_form("blog_structure",false,"")}}function strip_video_img_tags(a){ScriptFragment="<object[^>]*>([\\S\\s]*?)</object>";ScriptImageFragment="<img[^>]*/>";a=a.gsub(ScriptImageFragment,"");a=a.gsub(ScriptFragment,"");return a.gsub("<a [^>]*><img[^>]*/>([\\S\\s]*?)</a>","")}function copy_content_new_event(l,c,a,k,d,m,f){Element.show("event_blog");title_val=$(l).value;$("title").value=title_val;summary_text=$(c).value=strip_video_img_tags($(c).value).strip();$("ref_blog_title").innerHTML=title_val;$("ref_blog_summary").innerHTML=summary_text;$("summary").value=summary_text;try{$("tag_list").value=$(m).value;is_country_already_selected=false;if($(a).selectedIndex!=-1&&$(a).selectedIndex!=0){if($("event_geo_country_1").selectedIndex==$(a).selectedIndex){is_country_already_selected=true}else{$("event_geo_country_1").selectedIndex=$(a).selectedIndex}}if($(d).value.strip()!=""){$("event_geo_city_1").value=$(d).value}if($(k).selectedIndex!=-1&&$(k).selectedIndex!=0){update_state_field=$("event_geo_state_1");current_state_field=$(k);if(!is_country_already_selected){update_state_field.options.length=0;for(i=0;i<current_state_field.options.length;i++){var b=current_state_field.options[i];var h=document.createElement("OPTION");update_state_field.options.add(h);try{h.text=b.text}catch(g){log_exceptions("Method :- copy_content_new_event block 1 "+g.message)}}}update_state_field.selectedIndex=current_state_field.selectedIndex}my_index=$(a).selectedIndex;country_value=$(a).options[my_index].text;if(country_value=="USA"||country_value=="United States of America"){Element.show("event_state_field_geo_1");$("event_geo_state_1").disabled=false}$("submit").value="Publish";register_geo_location_with_id(1,"event_");create_event_loadEditor("summary");$("blog_reference").toggle()}catch(j){log_exceptions("Method :- copy_content_new_event block 2 "+j.message)}}function copy_content_new_event_new(h,f,c,g,a,b,e){Element.show("event_blog");title_val=$(h).value;$("title").value=title_val;summary_text=$(f).value=strip_video_img_tags($(f).value).strip();$("ref_blog_title").innerHTML=title_val;$("ref_blog_summary").innerHTML=summary_text;$("summary").value=summary_text;try{$("tag_list").value=$(b).value;if($(c).value.strip()!=""){$("event_geo_country_1").value=$(c).value}if($(a).value.strip()!=""){$("event_geo_city_1").value=$(a).value}if($(g).value.strip()!=""){$("event_geo_state_1").value=$(g).value}$("submit").value="Publish";create_event_loadEditor("summary");$("blog_reference").toggle()}catch(d){log_exceptions("Method :- copy_content_new_event_new "+d.message)}}function get_captcha(b){var a=location.protocol+"//"+location.host+":"+location.port;return(new Ajax.Request(a+"/main/change_captcha",{method:"get",asynchronous:false})).transport.responseText}function show_share_content_email_form(q,r,b,c,g,h,n,f){try{var p="";if(h=="new"){p='<div class="siteEditForm" id="email-form-#{id}"><div class="ajaxSpinner" id="answer_email_success_#{id}" style="display:none;">'+error_list.share_content_mail+'</div><div id="answer_email_form_error_#{id}" style="display:none;">'+error_list.captcha_error+'</div><div class="ajaxSpinner" style="display:none;" name="ans_form_spinner_display_#{id}" id="share_form_spinner_display_#{id}"><p><img alt="wait..." src="/images/ajax/ajax-loader.gif"/></p><p>'+error_list.share_spinner_display+"</p></div><div class=\"clearFix\">&nbsp;</div><div name=\"email_form_part_#{id}\" id=\"email_form_part_#{id}\"><h3>Share With Your Friends</h3><p>Enter your friends email addresses separated by commas in the share with field below.</p><form onsubmit=\"new Ajax.Request('/content/share_content/#{id}', {asynchronous:true, evalScripts:true, onComplete:function(request){/*if (dialogbox_response_eval('answer_email_form_error_#{id}','error prohibited this content from being shared',request.responseText,''))*/if(request.responseText=='{cancel:true}'){hideDiv('share_form_spinner_display_#{id}');Element.show('email-form-#{id}');remove_previous_error_div();if(typeof(Recaptcha)!='undefined'){remove_all_decendants('change_captcha_event_#{id}');create_recaptcha('change_captcha_event_#{id}');}$('answer_email_form_error_#{id}').update('');new Insertion.Top($('answer_email_form_error_#{id}'),get_error_list_html(['"+error_list.captcha_error+"'],'"+error_list.wrong_email_heading+'\'));;Element.show(\'answer_email_form_error_#{id}\');showDiv(\'email_form_part_#{id}\');return false;}else{hideDiv(\'share_form_spinner_display_#{id}\');hideDiv(\'email_form_part_#{id}\');hideDiv(\'answer_email_form_error_#{id}\');Effect.Appear(\'answer_email_success_#{id}\', {duration:2.0});Effect.Fade(\'answer_email_success_#{id}\', {duration: 3.0});$(\'form_#{id}\').reset();}}, onLoading:function(request){hideDiv(\'answer_email_form_error_#{id}\');showDiv(\'share_form_spinner_display_#{id}\');hideDiv(\'email_form_part_#{id}\');}, parameters:Form.serialize(this)}); return false;" method="post" action="/content/share_content/#{id}" name="form_#{id}" id="form_#{id}"><input type="hidden" value="#{content_type}" name="content_type" id="content_type" /><input type="hidden" value="#{page_url}" name="page_url" id="page_url" /><p><label>Share With:</label><input type="text" class="textInput" name="email_address_#{id}" id="email_address_#{id}" onclick="if(this.value==error_list.enter_email_address){this.value=\'\';}"></p><p><label>Your Name:</label><input type="text" class="textInput" name="your_name_#{id}" id="your_name_#{id}" value="'+n+'"></p><p><label>Your Email:</label><input type="text" class="textInput" name="your_email_#{id}" id="your_email_#{id}" value="'+f+'"></p><p><label>Your Comment:</label><td><textarea class="textArea" name="comment_#{id}" id="comment_#{id}"></textarea></p><div class="fieldSet reCaptcha"><label>Enter the text in the image:</label><div id="change_captcha_event_#{id}">#{captcha}</div></div><p class="siteEditFormButtons"><input type="image" src="/images/buttons/share.png" onclick="$(\'answer_email_success_#{id}\').hide();$(\'answer_email_form_error_#{id}\').hide();return validate_share_content_with_captcha($(\'email_address_#{id}\').value,$(\'your_name_#{id}\'),$(\'your_email_#{id}\'),this.form[\'captcha\'],\'answer_email_form_error_#{id}\',\'width:285px;\');" value="Share" name="share" id="share"/><input type="image" src="/images/buttons/cancel.gif" onclick="Element.hide(\'email-form-#{id}\');return false;" value="Cancel"/></p></form></div></div>'}else{p='<div class="eventFormBox" id="email-form-#{id}"><div id="answer_email_success_#{id}" style="display:none;">'+error_list.share_content_mail+'</div><div id="answer_email_form_error_#{id}"></div><div style="padding: 10px;display:none;" name="ans_form_spinner_display_#{id}" id="share_form_spinner_display_#{id}"><center>'+error_list.share_spinner_display+'<img alt="wait..." src="/images/ajax/ajax-loader.gif"/><br/></center></div><span name="email_form_part_#{id}" id="email_form_part_#{id}"><br/><strong>'+error_list.share_content_multi_email+'</strong><br/><br/><form onsubmit="new Ajax.Request(\'/content/share_content/#{id}\', {asynchronous:true, evalScripts:true, onComplete:function(request){/*if (dialogbox_response_eval(\'answer_email_form_error_#{id}\',\'error prohibited this content from being shared\',request.responseText,\'\'))*/{hideDiv(\'share_form_spinner_display_#{id}\');hideDiv(\'email_form_part_#{id}\');$(\'answer_email_success_#{id}\').show();$(\'form_#{id}\').reset();}}, onLoading:function(request){hideDiv(\'answer_email_form_error_#{id}\');showDiv(\'share_form_spinner_display_#{id}\');hideDiv(\'email_form_part_#{id}\');}, parameters:Form.serialize(this)}); return false;" method="post" action="/content/share_content/#{id}" name="form_#{id}" id="form_#{id}"><table><tbody><tr><td>Share To</td><td><textarea class="interactive_ta" style="width: 530px;" name="email_address_#{id}" id="email_address_#{id}"></textarea><input type="hidden" value="#{content_type}" name="content_type" id="content_type" /><input type="hidden" value="#{page_url}" name="page_url" id="page_url" /></td></tr><tr><td>Your Name</td><td><input type="text" class="interactive_input" name="your_name_#{id}" id="your_name_#{id}" /></td></tr><tr><td>Your Email</td><td><input type="text" class="interactive_input" name="your_email_#{id}" id="your_email_#{id}"/></td></tr><tr><td>&nbsp;</td><td><input type="submit" onclick="$(\'answer_email_success_#{id}\').hide();return validate_share_content($(\'email_address_#{id}\').value,$(\'your_name_#{id}\'),$(\'your_email_#{id}\'),\'answer_email_form_error_#{id}\',\'width:285px;\');" value="Share" name="share" id="share"/><input type="button" onclick="Element.hide(\'email-form-#{id}\');return false;" value="Cancel"/></td></tr></tbody></table></form></span></div>'}var d=$("email-form-"+q);if(typeof(g)!="undefined"){if(d!=null){d.hide()}return}var o=null;if(d!=null){if(!d.visible()){o=d}else{d.hide();return}}else{var a=$(c);if(a!=null){o=a}}var l=$(r.toLowerCase()+"_share_button");if(l!=null){l.show()}if(typeof(Recaptcha)=="undefined"){new Ajax.Request("/main/change_captcha",{asynchronous:true,evalScripts:false,onComplete:function(v){var u=$(r.toLowerCase()+"_share_button");if(u!=null){u.hide()}var s=new Template(p);var t=s.evaluate({captcha:v.responseText,id:q,content_type:r,page_url:b});o.update(t);o.show();$("email_address_"+q).value=error_list.enter_email_address;Element.show("email_form_part_"+q)}.bind(this)})}else{var e=$(r.toLowerCase()+"_share_button");if(e!=null){e.hide()}var k=new Template(p);var m=k.evaluate({id:q,content_type:r,page_url:b});remove_all_decendants(o);o.update(m);o.show();$("email_address_"+q).value=error_list.enter_email_address;Element.show("email_form_part_"+q);create_recaptcha("change_captcha_event_"+q)}}catch(j){log_exceptions("Method :-  show_share_content_email_form "+j.message)}}function delete_user_list_item(a,b,c){new Ajax.Request("/user/delete_links_list_item/",{asynchronous:true,evalScripts:true,onComplete:function(d){Element.hide("edit_list_title_"+c);oRequestHandlers[0].update("links_list","top")},onLoading:function(d){Element.show("external_link_operation_status_"+c);$("external_link_operation_status_"+c).update("<p><img alt='deleting...' src='/images/ajax/ajax-loader.gif'/></p><p>Deleting the external link</p>")},parameters:"?profile_user_id="+a+"&item_id="+b});return false}function delete_user_list(a,b){new Ajax.Request("/user/delete_links_list/",{asynchronous:true,evalScripts:true,onComplete:function(c){Element.hide("edit_list_title_"+b);oRequestHandlers[0].update("links_list","top")},onLoading:function(c){Element.show("external_link_operation_status_"+b);$("external_link_operation_status_"+b).update("<p><img alt='deleting...' src='/images/ajax/ajax-loader.gif'/></p><p>Deleting the list</p>")},parameters:"?profile_user_id="+a+"&list_id="+b});return false}function delete_blog_entry(a,b){new Ajax.Request("/user/delete_external_blog/",{asynchronous:true,evalScripts:true,onComplete:function(c){Element.hide("my_blogs_spinner");Element.show("external_blog_operation_status");oRequestHandlers[0].update("external_blogs","top");$("external_blog_operation_status").update("<p>Record is deleted successfully</p>")},onLoading:function(c){Element.show("external_blog_operation_status");$("external_blog_operation_status").update("<p><img alt='deleting...' src='/images/ajax/ajax-loader.gif'/></p><p>Deleting the blog</p>")},parameters:"?ext_blog_id="+b+"&profile_user_id="+a});return false}function delete_favourite(a,b){new Ajax.Request("/user/delete_favourite/",{asynchronous:true,evalScripts:true,onComplete:function(c){Element.show("favourites_operation_status");oRequestHandlers[0].update("my_favourites","top");$("favourites_operation_status").update("<p>Record is deleted successfully</p>")},onLoading:function(c){Element.show("favourites_operation_status");$("favourites_operation_status").update("<p><img alt='deleting...' src='/images/ajax/ajax-loader.gif'/></p><p>Deleting the favourite</p>")},parameters:"?favourite_id="+b+"&profile_user_id="+a});return false}function update_select_list(d,e){selectlist=document.getElementById(e);d=d.split(",");var a=0;count=selectlist.options.length;while(a<count){selectlist.remove(a);a++}selectlist.options.length=0;var b=0;var c=new Option();selectlist.options.add(c);c.text="";c.selected=true;while(b<d.length){var c=new Option();selectlist.options.add(c);c.text=d[b];b++}}function populate_state(e,a,c,b,d){e=$(e);if(!d){$(a+"geo_city_"+c).value=""}if(e.options[e.selectedIndex].text=="USA"){Element.show(a+"state_field_geo_"+c);$(a+"geo_city_"+c).disabled=true;$(a+"geo_state_"+c).disabled=false}else{$(a+"geo_state_"+c).selectedIndex=0;Element.hide(a+"state_field_geo_"+c);$(a+"geo_city_"+c).disabled=false}}function populate_all_states(d,b){for(var c=0;c<d.elements.length;c++){if(d.elements[c]["id"].indexOf(b+"geo_country")==0){var a=/(\d+)$/.exec(d.elements[c]["id"]);if(a&&a.length==2){populate_state(d.elements[c],b,a[1],"",true)}}}}function addEvent(d,c,a){if(d.addEventListener){d.addEventListener(c,a,true);return true}else{if(d.attachEvent){var b=d.attachEvent("on"+c,a);return b}else{return false}}}function loadjscssfile(a,b){if(b=="js"){var c=document.createElement("script");c.setAttribute("type","text/javascript");c.setAttribute("src",a)}else{if(b=="css"){var c=document.createElement("link");c.setAttribute("rel","stylesheet");c.setAttribute("type","text/css");c.setAttribute("href",a)}}if(typeof c!="undefined"){document.getElementsByTagName("head")[0].appendChild(c)}}function get_splited_item(c,b,a){splitted_items_list=c.split(b);if(typeof(a)=="undefined"){return splitted_items_list}else{return splitted_items_list[a]}}function SetAllCheckBoxes(b,c,a){if(!document.forms[b]){return}index=document.forms[b].elements.select1.selectedIndex;readCheckBoxes=document.forms[b].elements.read;unreadCheckBoxes=document.forms[b].elements.unread;if(index==1){readCheckValue=false;unreadCheckValue=false}else{if(index==2){readCheckValue=true;unreadCheckValue=false}else{if(index==3){readCheckValue=false;unreadCheckValue=true}else{if(index==4){readCheckValue=true;unreadCheckValue=true}}}}if(readCheckBoxes){readCountCheckBoxes=readCheckBoxes.length;if(!readCountCheckBoxes){readCheckBoxes.checked=readCheckValue}else{for(i=0;i<readCountCheckBoxes;i++){readCheckBoxes[i].checked=readCheckValue}}}if(unreadCheckBoxes){unreadCountCheckBoxes=unreadCheckBoxes.length;if(!unreadCountCheckBoxes){unreadCheckBoxes.checked=unreadCheckValue}else{for(i=0;i<unreadCountCheckBoxes;i++){unreadCheckBoxes[i].checked=unreadCheckValue}}}}function get_message_ids(){message_ids="";FormName="message_form";if(!document.forms[FormName]){return message_ids}readCheckBoxes=document.forms[FormName].elements.read;unreadCheckBoxes=document.forms[FormName].elements.unread;if(readCheckBoxes){readCountCheckBoxes=readCheckBoxes.length;if(!readCountCheckBoxes){if(readCheckBoxes.checked){message_ids+=readCheckBoxes.value+","}}else{for(i=0;i<readCountCheckBoxes;i++){if(readCheckBoxes[i].checked){message_ids+=readCheckBoxes[i].value+","}}}}if(unreadCheckBoxes){unreadCountCheckBoxes=unreadCheckBoxes.length;if(!unreadCountCheckBoxes){if(unreadCheckBoxes.checked){message_ids+=unreadCheckBoxes.value+","}}else{for(i=0;i<unreadCountCheckBoxes;i++){if(unreadCheckBoxes[i].checked){message_ids+=unreadCheckBoxes[i].value+","}}}}return message_ids}function DeleteMessage(a){new Ajax.Request("/message/delete_message_threads/",{asynchronous:true,evalScripts:true,onComplete:function(b){Element.hide("message_thread_"+a)},onLoading:function(b){},parameters:"?message_ids="+a});return true}function DeleteMessages(){user_id=$("user_id").value;message_ids=get_message_ids();if(message_ids==""){alert("no item to delete");return false}else{new Ajax.Request("/message/delete_message_threads/",{asynchronous:true,evalScripts:true,onComplete:function(a){messages=message_ids.split(",");for(i=0;i<messages.length;i++){Element.hide("message_thread_"+messages[i])}},onLoading:function(a){},parameters:"?message_ids="+message_ids+"&user_id="+user_id});return true}return false}function MarkAsUnread(){message_ids=get_message_ids();if(message_ids==""){alert("No message selected");return false}else{new Ajax.Request("/message/mark_as_unread/",{asynchronous:true,evalScripts:true,onComplete:function(a){messages=message_ids.split(",");for(i=0;i<messages.length;i++){$("message_thread_"+messages[i]).addClassName("unread")}},onLoading:function(a){},parameters:"?message_ids="+message_ids});return true}return false}function MarkAsRead(){message_ids=get_message_ids();if(message_ids==""){alert("No message selected");return false}else{new Ajax.Request("/message/mark_as_read/",{asynchronous:true,evalScripts:true,onComplete:function(a){messages=message_ids.split(",");for(i=0;i<messages.length;i++){$("message_thread_"+messages[i]).removeClassName("unread")}},onLoading:function(a){},parameters:"?message_ids="+message_ids});return true}return false}function validate_compose_message_form(){disable_form("compose_message",true);var a="";if($("message_user_name").value==""){a+="You must specify recipient for this message.#"}if($("message_subject").value.strip()==""){a+="Subject cannot be empty.#"}my_values=get_tiny_mce_value("message_body");if(my_values.text_value==""||my_values.is_empty==true){a+=error_list.blank_body+"#"}if(a==""){return true}else{style="";new Insertion.Top("compose_message",get_error_div(a.split("#")," error(s) prohibited this form from being saved",style,"errorExplanation_ans"));disable_form("compose_message",false);return false}}function validate_reply_message_form(){disable_form("compose_message",true);var a="";my_values=get_tiny_mce_value("message_body");if(my_values.text_value==""||my_values.is_empty==true){a+=error_list.blank_body+"#"}if(a==""){return true}else{style="";new Insertion.Top("compose_message",get_error_div(a.split("#")," error(s) prohibited this form from being saved",style,"errorExplanation_ans"));disable_form("compose_message",false);return false}}function validate_abuse_form(b){disable_form(b,true);var a="";if($("abuse_reason_type").value==""){a+="Please select abuse type.#"}if($("captcha").value==""){a+="Enter text for Captcha image.#"}if(a==""){return true}else{new Insertion.Top(b,get_error_list_html(a.split("#"),"error(s) prohibited this abuse report from sending",""));disable_form(b,false);return false}}function val_abuse_form(a,b){disable_form(b,true);var c=[];if(b.elements.abuse_reason_type.value==""){c.push("Please select abuse type.")}if(b.elements.abuse_reason_detail.value==""){c.push("Please provide abuse detail.")}if(typeof(Recaptcha)!="undefined"){if(Recaptcha.get_response().strip()==""){c.push("Enter text for Captcha image.")}}else{if(b.elements.captcha.value==""){c.push("Enter text for Captcha image.")}}if(c.length==0){b.elements.page_url.value=window.location.href;return true}else{new Insertion.Top(a,get_error_list_html(c,"error(s) prohibited this abuse report from sending",""));disable_form(b,false);return false}}function checkboxer(f,d){var a=new RegExp("-"+d+"$");switch(d){case"":return false;break;case"all":var c=function(e){return true};break;case"none":var c=function(e){return false};break;default:var c=function(e){return a.match(e)}}for(var b=0;b<f.elements.length;b++){var g=f.elements[b];if(g.type=="checkbox"){g.checked=c(g.value)}}return true}function checkbox_values(d,b){var a=[];for(var c=0;c<d.elements.length;c++){var f=d.elements[c];if(f.type=="checkbox"&&f.checked){a.push([f,f.value.split("-")[0]])}}return a}function mark_messages(d,c){var b=checkbox_values(d);if(b.length<1){return false}if(c=="delete"){$("message_mark_success").hide();$("message_mark_progressbar").show()}var a=null;switch(c){case"read":a=function(h,f,g){h.removeClassName("unread");f.value=g+"-read"};break;case"unread":a=function(h,f,g){h.addClassName("unread");f.value=g+"-unread"};break;case"delete":a=function(h,f,g){Element.hide(h)};break}var e=function(g){for(var f=0;f<b.length;f++){a($("message_thread_"+b[f][1]),b[f][0],b[f][1])}};new Ajax.Request("/msg_thread/mark",{asynchronous:false,evalScripts:true,onComplete:e,parameters:"?ids="+b.join(",")+"&mark="+c});if(c=="delete"){$("message_mark_progressbar").hide();$("message_mark_success").show()}return true}function validate_msg_compose(b){var a=[];if(b.elements.recipient["value"]==""){a.push("Please choose a recipient.")}if(b.elements.subject&&b.elements.subject["value"].length<1){a.push("You need a subject.")}if(b.elements.body&&b.elements.body["value"].length<1){}if(a.length>0){new Insertion.Top("compose_message",get_error_list_html(a,"Whoops"));return false}return true}function toggle_processing_div(c,b){try{if(typeof(b)=="undefined"){b="div_processing_spinner"}if(!$(b)){return}if(c){Element.show(b)}else{Element.hide(b)}}catch(a){log_exceptions("Method :- toggle_processing_div "+a.message)}}function disable_form(e,d,a,c){try{if(typeof(a)=="undefined"){toggle_processing_div(d,c)}if(is_disable_img_button){return}img_buttons=$(e).getElementsBySelector("button");try{for(i=0;i<img_buttons.length;i++){if(d){if(typeof(img_buttons[i].disable)!="undefined"){img_buttons[i].disable()}else{img_buttons[i].disabled=true}}else{if(typeof(img_buttons[i].enable)!="undefined"){img_buttons[i].enable()}else{img_buttons[i].disabled=false}}}}catch(b){}img_buttons=$(e).getElementsByClassName("imgButton");try{for(i=0;i<img_buttons.length;i++){if(d){if(typeof(img_buttons[i].disable)!="undefined"){img_buttons[i].disable()}else{img_buttons[i].disabled=true}}else{if(typeof(img_buttons[i].enable)!="undefined"){img_buttons[i].enable()}else{img_buttons[i].disabled=false}}}}catch(b){}}catch(b){log_exceptions("Method :- disable_form "+b.message)}}function disable_buttons(b){if(is_disable_img_button){return}try{img_buttons=$(b).getElementsByClassName("imgButton");for(i=0;i<img_buttons.length;i++){img_buttons[i].disable()}}catch(a){log_exceptions("Method :- disable_buttons "+a.message)}}function move(c){var b=$("sortable_items").getElementsByTagName("li");var a=$A(b);a.each(function(d){d.className="sortable_li"});Sortable.create("sortable_items",{onUpdate:function(){new Ajax.Request("/user/update_list_orders",{asynchronous:true,evalScripts:true,parameters:Sortable.serialize("sortable_items")})},only:"sortable_li"})}function move_sortable_items(a){Sortable.create("sortable_items",{onUpdate:function(){new Ajax.Request("/user/update_list_orders",{asynchronous:true,evalScripts:true,parameters:Sortable.serialize("sortable_items")})},tag:"div",only:"sortable_item"})}function trim(a){if(a==null||a.length==0){return""}return a.replace(/^\s+|\s+$/g,"")}function isInteger(b){var a;for(a=0;a<b.length;a++){var d=b.charAt(a);if(((d<"0")||(d>"9"))){return false}}return true}function stripCharsInBag(d){var b;var e="()- ";var a="";for(b=0;b<d.length;b++){var f=d.charAt(b);if(e.indexOf(f)==-1){a+=f}}return a}function validPhoneNumber(a){return isInteger(stripCharsInBag(trim(a)))}function validate_tag_info(b){var g=b.split(",");var a=0;var f="";var c=0;var e=0;var d=get_tiny_mce_value("desc_"+g[0],"");if(typeof(d)!="object"){return false}disable_form("multiple_images",true);for(a=0;a<g.length;a++){remove_previous_error_div(a+1);if(g[a]==""){c+=1;continue}if($("title_"+g[a]).value==""){f+=error_list.blank_title+"#"}e=get_tiny_mce_value("desc_"+g[a],"");if(e.text_value==""||e.is_empty==true){f+=error_list.blank_description+"#"}ind=g[a];if($("syndication_"+ind)!=null&&$("syndication_"+ind).checked==1){if($("syndication_location_"+ind).value==""){f+="You must specify the detailed location.#"}if($("syndication_phone_number_"+ind).value==""){f+="You must specify a contact telephone number of the format +1-555-555-5555.#"}if($("syndication_phone_number_"+ind).value!=""&&(!validPhoneNumber($("syndication_phone_number_"+ind).value)||$("syndication_phone_number_"+ind).value.length>25)){f+="You have specified an invalid phone number.#"}if(!$("license_"+ind+"_exclusive").checked&&!$("license_"+ind+"_non_exclusive").checked){f+="You must select a license under which you would like to syndicate your image or video.#"}}if(f==""){c+=1}else{new Insertion.Top("div_image_"+g[a],get_error_list_html(f.split("#"),error_list.multi_upload_image_heading,(a+1)));f=""}}if(c==g.length){return true}else{disable_form("multiple_images",false);return false}}function validate_video_tags(b){var g=b.split(",");var a=0;var f="";var c=0;var e=0;b.indexOf(",");var d=get_tiny_mce_value("desc_"+g[0],"");if(typeof(d)!="object"){return false}disable_form("multiple_video",true);for(a=0;a<g.length;a++){remove_previous_error_div(a+1);if(g[a]==""){c+=1;continue}if($("title_"+g[a]).value==""){f+=error_list.blank_title+"#"}e=get_tiny_mce_value("desc_"+g[a],"");if(e.text_value==""||e.is_empty==true){f+=error_list.blank_description+"#"}ind=g[a];if($("syndication_"+ind)!=null&&$("syndication_"+ind).checked==1){if($("syndication_location_"+ind).value==""){f+="You must specify the detailed location.#"}if($("syndication_phone_number_"+ind).value==""){f+="You must specify a contact telephone number of the format +1-555-555-5555.#"}if($("syndication_phone_number_"+ind).value!=""&&(!validPhoneNumber($("syndication_phone_number_"+ind).value)||$("syndication_phone_number_"+ind).value.length>25)){f+="You have specified an invalid phone number.#"}if(!$("license_"+ind+"_exclusive").checked&&!$("license_"+ind+"_non_exclusive").checked){f+="You must select a license under which you would like to syndicate your image or video.#"}}if(f==""){c+=1}else{new Insertion.Top("div_video_"+g[a],get_error_list_html(f.split("#"),error_list.multi_upload_video_heading,"","",(a+1)));f=""}}if(c==g.length){return true}else{disable_form("multiple_video",false);return false}}function validate_youtube_vid_link(a){disable_form(a,true);var b="";remove_previous_error_div();if($("youtube_link").value.gsub(" ","")==""){b+="No Video selected. Please select a Video.#"}if(b==""){return true}else{new Insertion.Top(a,get_error_list_html(b.split("#"),error_list.video_error_heading,""));disable_form(a,false);return false}}function update_partial_event(b,e,d){try{var a=validate_geo_location("event_","required",1,b,e,d);remove_previous_error_div();if(a==""||a==(error_list.blank_country+"#"+error_list.blank_city+"#")){get_tiny_mce_value("summary");new Ajax.Request("/event/update_event_partially/",{asynchronous:false,evalScripts:true,onComplete:function(f){return},onLoading:function(f){},parameters:$("event_create_form").serialize()});return true}else{if(a==(error_list.city_not_found+"#")||a==(error_list.blank_city+"#")){new Insertion.Top("div_create_event",get_error_div(errorhtml.split("#")," error(s) prohibited this form from being saved","510px","errorExplanation_ans"));return false}}}catch(c){log_exceptions("Method :- update_partial_event "+c.message)}return false}function event_duplication_check(b){var a=location.protocol+"//"+location.host;url=a+"/event/check_duplicate";getVars="event_id="+b;new Ajax.Request(this.url,{parameters:getVars,asynchronous:false,onLoading:function(){},onComplete:function(c){if(typeof(c.responseText)=="undefined"||c.responseText==null||c.responseText==""){new Ajax.Request(a+"/event/process_new_event",{parameters:getVars+"&render_template=yes",asynchronous:false});c.responseText="new_event"}if(c.responseText=="new_event"){url=a+"/contributed-news/"+b;Element.hide("new_event_created");Element.show("new_event_created_2");setTimeout("document.new_event_created_2.submit();",400)}else{$("duplicate_screen").hide();$("similar_events").update(c.responseText);url=a+"/event/show_similar_events"}}})}function event_tag_suggestion(b){var a=location.protocol+"//"+location.host;url=a+"/event/check_suggested_tags";getVars="event_id="+b;new Ajax.Request(this.url,{parameters:getVars,asynchronous:false,onLoading:function(){},onComplete:function(d){var c=d.responseText;if(c=="new_event"||typeof(c)=="undefined"||c.length==0){url=a+"/event/post_create_event";Element.hide("ts_new_event_created");Element.show("ts_new_event_created_2");setTimeout("document.ts_new_event_created_2.submit();",400)}else{$("duplicate_screen").hide();$("duplicate_screen").update("");$("tag_suggestions").update(d.responseText);url=a+"/event/copyright_violation"}}})}function event_copyright_check(b){var a=location.protocol+"//"+location.host;url=a+"/event/check_copyright";getVars="event_id="+b;new Ajax.Request(this.url,{parameters:getVars,asynchronous:false,onLoading:function(){},onComplete:function(c){if(c.responseText=="new_event"){url=a+"/event/post_create_event";Element.hide("cr_new_event_created");Element.show("cr_new_event_created_2");setTimeout("document.cr_new_event_created_2.submit();",400)}else{$("duplicate_screen").hide();$("duplicate_screen").update("");$("similar_events").update(c.responseText);url=a+"/event/copyright_violation"}}})}function save_new_event(event_id){var domain=location.protocol+"//"+location.host;url=domain+"/event/save_new_event";getVars="event_id="+event_id;new Ajax.Request(this.url,{parameters:getVars,asynchronous:false,onLoading:function(){},onComplete:function(transport){response_data=eval("("+transport.responseText+")");url=domain+"/contributed-news/"+response_data.event_id+"?clear_cache=true";setTimeout("window.location = url",3000)}})}function attach_contributions(event_id){var domain=location.protocol+"//"+location.host;url=domain+"/event/attach_contributions";getVars="event_id="+event_id;new Ajax.Request(this.url,{parameters:getVars,asynchronous:false,onLoading:function(){},onComplete:function(transport){response_data=eval("("+transport.responseText+")");url=domain+"/contributed-news/"+response_data.event_id;document.attach_form.submit()}})}function buildErrors(c){var e=new Element("div",{id:"errorList",className:"errorList "});var b=new Element("div",{className:"errorListInner"});var a=new Element("h5").update(c.title);var d=new Element("ul");c.errors.each(function(f){d.insert(new Element("li").update(f))});b.insert(a).insert(d);e.insert(b);return e}var commentPosting=false;function submitComment(c){if(commentPosting){return false}$("commentError").hide();var g;if(Object.isElement(c)){g=c}else{Event.stop(c);g=Event.element(c)}var a=g.serialize(true);var d=$F("comment_id");var e=$F("comment_comment");if(e==null||e.replace(/\s/g,"")==""){$("commentError").show();var b={title:"The following error(s) prohibited this Comment from being saved",errors:["Comment cannot be blank"]};$("commentError"+d).update(buildErrors(b));return false}else{if(e.split(" ").length<4){$("commentError").show();var b={title:"The following error(s) prohibited this Comment from being saved",errors:["Your comment is too short. Express yourself!"]};$("commentError"+d).update(buildErrors(b));return false}}var h=d.blank()?"/comments":"/comments/"+d;if(a.recaptcha_challenge_field){h="/comments/"+a["comment[id]"]+"/ham"}new Ajax.Request(h,{method:d.blank()?"post":"put",parameters:a,onCreate:function(){commentPosting=true;$("form_spinner_display").update($F("save_comment_msg"));$("form_spinner_display").show();$$(".errorList").invoke("remove")},onFailure:function(f){$("form_spinner_display").hide();showLoginBox($("postcomment"),submitComment.curry(g))},onComplete:function(f){commentPosting=false;$("form_spinner_display").hide()}});return false}function submit_comment_form(id,content_type,update_all_list){try{if(typeof(id)=="undefined"){id=$("commentable_id").value}new Ajax.Request("/main/save_comment/"+id,{asynchronous:true,evalScripts:true,onComplete:function(request){try{if($("popupLoginBox")){$("popupLoginBox").hide()}dialog_response=eval(request.responseText);is_defined_response=true;if(typeof(dialog_response)=="undefined"||dialog_response==null){is_defined_response=false}if(is_defined_response&&dialogbox_response_eval("div_comment_form","error prohibited this Comment from being saved ",request.responseText,"")){RedBox.close();oRequestHandlers[0].clearCache();if(typeof(update_all_list)=="undefined"){update_all_list=true}if(typeof(content_type)=="undefined"){content_type="content"}oRequestHandlers[0].addVars="content_id="+id+"&content_type="+content_type;oRequestHandlers[0].update("comments");if(update_all_list==true){oRequestHandlers[0].clearCache();oRequestHandlers[0].update("contributions")}}else{$("form_table").style.display="";$("form_spinner_display").style.display="none"}if(is_defined_response&&dialog_response.status=="ok"){var base_url=""+window.location;if(base_url.indexOf("#")!=-1){base_url=base_url.substring(0,base_url.indexOf("#"))}$("form_table").style.display="";var comment_count=parseInt($("comment_count").innerHTML);if(true){if($("editornew").value!="edit"){comment_count=comment_count+1;$("comment_count").innerHTML=comment_count;$("comments_span").innerHTML="Comments: "+comment_count;if($("expand_comment")!=null){$("expand_comment").innerHTML="Comments: "+comment_count}var refDiv=null;parent_id=$("comment_parent_id").value;if(typeof(parent_id)!="undefined"&&parent_id!=""){refDiv=$("li_"+parent_id)}else{refDiv=$("dummy_div")}var newDiv=document.createElement("div");newDiv.innerHTML="&nbsp;";newDiv.setAttribute("id","new_comment_"+dialog_response.parent_obj_id);refDiv.appendChild(newDiv)}$("q_a_c_id").value=dialog_response.parent_obj_id;render_comment();commentPost()}}}catch(ex){log_exceptions("Method :- save_comment"+ex.message)}},onLoading:function(request){Element.hide("form_table");Element.show("form_spinner_display");if($("save_comment_msg")!=null&&typeof($("save_comment_msg"))!="undefined"){$("comment_msg").innerHTML=$("save_comment_msg").value}},parameters:"comment[type]="+encodeURIComponent($("comment_type").value.escapeHTML())+"&comment[comment]="+encodeURIComponent($("comment_comment").value)+"&comment[content_id]="+encodeURIComponent($("comment_content_id").value)+"&q_a_c_id="+$("q_a_c_id").value+"&editornew="+$("editornew").value+"&parent[root]="+$("parent_root").value.escapeHTML()+"&comment[parent_id]="+$("comment_parent_id").value.escapeHTML()})}catch(e){log_exceptions("Method :- submit_comment_form "+e.message)}return false}function save_comment_form_params(){try{new Ajax.Request("/main/save_comment_form_params",{asynchronous:true,onComplete:function(b){},parameters:"comment[type]="+encodeURIComponent($("comment_type").value.escapeHTML())+"&comment[comment]="+encodeURIComponent($("comment_comment").value)+"&comment[content_id]="+encodeURIComponent($("comment_content_id").value)+"&q_a_c_id="+$("q_a_c_id").value+"&editornew="+$("editornew").value+"&parent[root]="+$("parent_root").value.escapeHTML()+"&comment[parent_id]="+$("comment_parent_id").value.escapeHTML()})}catch(a){log_exceptions("Method :-  save_comment_form_params "+a.message)}return false}function delete_comment(d,b,a){try{new Ajax.Request("/main/delete_comment/"+d,{asynchronous:true,evalScripts:true,onComplete:function(e){if(typeof(b)=="undefined"){b="content"}if(typeof(a)=="undefined"){a=true}oRequestHandlers[0].clearCache();oRequestHandlers[0].addVars="content_id="+d+"&content_type="+b;oRequestHandlers[0].update("comments");if(a){oRequestHandlers[0].clearCache();oRequestHandlers[0].update("contributions")}window.location.reload()},onLoading:function(e){Element.show("form_spinner_display");if($("delete_comment_msg")!=null&&typeof($("delete_comment_msg"))!="undefined"){$("comment_msg").innerHTML=$("delete_comment_msg").value}},parameters:"q_a_c_id="+$("q_a_c_id").value+"&comment[type]="+encodeURIComponent($("comment_type").value.escapeHTML())})}catch(c){log_exceptions("Method :- delete_comment "+c.message)}return false}function rateit(d,e,a,b){var c=a==1?"up":"down";if(rateWait(d,e,c)){new Ajax.Request("/save_rate/"+e,{asynchronous:true,evalScripts:true,onComplete:function(f){if(b=="Event"||b=="Person"){rates=f.responseText.split("-");$("rateUp"+e).innerHTML=rates[0];$("rateDown"+e).innerHTML=rates[1]}rateCallback(f,c,e)},parameters:"?rateable_type="+b+"&value="+a})}return false}function save_rateit_session(c,d,a,b){new Ajax.Request("/save_rate_session/"+b+"/"+d+"/"+a,{asynchronous:true,evalScripts:true});return false}function clkstrm(b,a){new Ajax.Request("/main/save_external_clickstream/"+a+"?u="+escape(b.href),{asynchronous:true})}function tog_abuse_form(d,g,c){try{var b=$("abused-form-"+d+"_abuse_report_error");var a="report-form-"+c+"-"+d;if(c===""){a="report-form-"+g+"-"+d}if(b){b.remove()}if($("abused-form-"+d)==null||$("abused-form-"+d).visible()){Element.toggle(a);var j=$(a);if(!j.visible()){j.update("");try{$("flagEventLink").className="reportAbuse"}catch(h){log_exceptions("Method :- tog_abuse_form "+h.message)}return}}new Ajax.Request("/event/abused/"+d+"?atype="+g+"&subtype="+c,{asynchronous:true,evalScripts:true,onComplete:function(l){try{remove_all_decendants(a);$(a).show();new Insertion.Bottom(a,l.responseText);var k="change_captcha_"+d;create_recaptcha(k);$("flagEventLink").className="reportAbuse"}catch(e){log_exceptions("Callback of /event/abused/ call"+e.message)}}})}catch(f){log_exceptions("Method :- tog_abuse_form "+f.message)}}function radio_checked(b){if(!b.length){return b.checked}for(var a=0;a<b.length;a++){if(b[a].checked){return true}}return false}function validateSEForm(){try{var b=document.getElementById("submitType").value;if(b=="ExistingEvent"&&!radio_checked(document.getElementById("similarEventForm")["existing_id"])){alert("Please select an existing event");return false}else{return true}}catch(a){log_exceptions("Method :- validateSEForm "+a.message)}}function check_url_redirect(a){var b=location.href;if(b.indexOf(a)==0){return true}else{window.location=location.protocol+"//"+location.host+"/post_event";return false}}function submit_form(){document.similarEventForm.submit();return false}function delete_content_item(a,b,c){if(confirm_submit("Are you sure you want to delete this content?")){new Ajax.Request("/content/delete_content_item/"+a+"?content_type="+b,{asynchronous:true,evalScripts:true,onComplete:function(d){oRequestHandlers[0].clearCache();oRequestHandlers[0].update(c)}})}}function change_content_item_status(b,c,e,a,d){if(confirm_submit("Are you sure you want to "+a+" this content?")){new Ajax.Request("/content/delete_content_item/"+b+"?content_type="+c+"&status="+a+"&event_person_id="+d,{asynchronous:true,evalScripts:true,onComplete:function(f){oRequestHandlers[0].clearCache();window.location.reload()}})}}function change_related_event_status(c,b,a,d){if(confirm_submit("Are you sure you want to hide this related event?")){new Ajax.Request("/content/delete_related_event?event_person_id="+c+"&related_event_id="+b+"&status="+a+"&related_event_type="+d,{asynchronous:true,evalScripts:true,onComplete:function(e){oRequestHandlers[0].clearCache();window.location.reload()}})}}function change_person_image(a,b){change_event_image(a,b,"Person")}function change_event_image(c,b,a){if(typeof(a)=="undefined"){a="Event"}if(confirm_submit("Are you sure you want to change the "+a+" image?")){new Ajax.Request("/set_thumbnail_id_via_list_view/"+a.toLowerCase()+"/"+c+"/"+b,{asynchronous:true,evalScripts:true,onComplete:function(d){oRequestHandlers[0].clearCache();oRequestHandlers[0].clearCache();window.location.reload()}})}}function bury_event_person(a,f,e,c,d,b){new Effect.Fade("form_spinner_display_fade_"+f,{duration:0,from:1,to:0.9});new Ajax.Request("/main/bury_event_people/",{asynchronous:true,evalScripts:true,onComplete:function(g){Element.hide("form_spinner_display_"+f);window.location.reload()},onLoading:function(g){Element.show("form_spinner_display_"+f)},parameters:"id="+f+"&type="+a})}function is_tiny_mce_loaded(c){var b=false;try{get_tiny_mce_value(c);b=true}catch(a){log_exceptions("Method :- is_tiny_mce_loaded "+a.message)}return b}function validate_bulk_email_form(a,b,d){remove_previous_error_div();if(typeof(d)=="undefined"){d=""}var c="";if($("subject"+d).value.strip()==""){c+="Subject cannot be empty.#"}my_values=get_tiny_mce_value("message"+d);if(my_values.text_value==""||my_values.is_empty==true){c+=error_list.blank_body+"#"}if(c==""){return true}else{style="";if(typeof b!="undefined"){style=b}new Insertion.Top(a,get_error_list_html(c.split("#")," error(s) prohibited this form from being saved",style,"errorExplanation_ans"));return false}}function set_redirect_cookie(){setCookie("event_landing_page","true")}function get_abuse_report_ids(){checkbox_ids="";FormName="abuse_form";if(!document.forms[FormName]){return checkbox_ids}abuse_report_boxes=document.forms[FormName].elements.abuse_report;if(abuse_report_boxes){abuseCountCheckBoxes=abuse_report_boxes.length;if(!abuseCountCheckBoxes){if(abuse_report_boxes.checked){checkbox_ids+=abuse_report_boxes.value+",";abuse_report_boxes.checked=false}}else{for(i=0;i<abuseCountCheckBoxes;i++){if(abuse_report_boxes[i].checked){checkbox_ids+=abuse_report_boxes[i].value+",";abuse_report_boxes[i].checked=false}}}}return checkbox_ids}function change_abuse_report_status(a,b){if(b==""){b=get_abuse_report_ids()}if(b==""){alert("No abuse report selected");return false}else{new Ajax.Request("/admin/change_abuse_report_status?status="+a+"&abuse_report_ids="+b,{asynchronous:true,evalScripts:true,onComplete:function(c){window.location.reload()},onLoading:function(c){}});return true}return false}function submit_resolution_comment_form(){try{new Ajax.Request("/admin/save_resolution_comment",{asynchronous:true,evalScripts:true,onComplete:function(b){if(dialogbox_response_eval("div_comment_form","error prohibited this Comment from being saved ",b.responseText,"")){RedBox.close();oRequestHandlers[0].clearCache();window.location.reload()}else{$("form_table").style.display="";$("form_spinner_display").style.display="none"}},onLoading:function(b){Element.hide("form_table");Element.show("form_spinner_display")},parameters:"resolution_comment="+$("resolution_comment").value+"&report_id="+$("report_id").value})}catch(a){log_exceptions("Method :- submit_resolution_comment_form "+a.message)}return false}function prefill_form_fields(d,c,b){for(var a=0;a<d.elements.length;a++){if(d.elements[a].id.indexOf(c)==0&&d.elements[a].id!=b.id){if(b.selectedIndex||b.selectedIndex==0){if(!d.elements[a].selectedIndex){d.elements[a].selectedIndex=b.selectedIndex}}else{if(b.value&&b.value!=""){if(!d.elements[a].value){d.elements[a].value=b.value}}}}}}function update_element_fade(b,a){tag_element=$(b);tag_element.update(a);tag_element.show();Effect.Fade(b,{duration:5})}function load_backend_suggested_tags(d){try{var c=summary=country=city=category_id="";var b="";c=$("title"+d).value.strip();if(c==""){b+="Title cannot be empty.<br/>"}my_values=get_tiny_mce_value("summary"+d);if(typeof(my_values)!="object"){return false}summary=my_values.text_value;if(summary==""||my_values.is_empty==true){b+=error_list.blank_body}if(b!=""){update_element_fade("tag_list_error",b);return}category_id=$("category").value;if($("event_geo_country_1").selectedIndex!=0){country=$("event_geo_country_1").value;if($("event_geo_city_1").value!=""){city=$("event_geo_city_1").value}}new Ajax.Request("/event/get_suggested_tags/",{asynchronous:true,evalScripts:true,onComplete:function(e){$("load_tags_progress_bar").hide();if(e.responseText.strip()==""){update_element_fade("tag_list_error",error_list.no_tag_found);return}else{$("tag_list").value=e.responseText}return},onLoading:function(e){$("load_tags_progress_bar").show()},parameters:"title="+encodeURIComponent(c)+"&summary="+encodeURIComponent(summary)+"&country="+encodeURIComponent(country)+"&city="+encodeURIComponent(city)+"&category_id="+category_id+"&tag_list="+$("tag_list").value});return true}catch(a){log_exceptions("Method :- load_backend_suggested_tags "+a.message)}}function add_bookmark(a,b){Element.show("bookmark_spinner");new Ajax.Request("/user/add_bookmark",{asynchronous:true,evalScripts:true,onComplete:function(c){Element.hide("bookmark_spinner");responseText=c.responseText;if(responseText=="limit_exceed"){update_element_fade("bookmark_status",error_list.limit_exceed);return}else{if(responseText=="failed"){update_element_fade("bookmark_status",error_list.bookmark_add_error);return}}Element.hide("add_bookmark");Element.show("remove_bookmark")},parameters:"?bookmarkable_type="+b+"&bookmarkable_id="+a})}function remove_bookmark(a,b){Element.show("bookmark_spinner");new Ajax.Request("/user/remove_bookmark",{asynchronous:true,evalScripts:true,onComplete:function(c){Element.hide("bookmark_spinner");responseText=c.responseText;if(responseText=="failed"){update_element_fade("bookmark_status",error_list.bookmark_remove_error);return}Element.hide("remove_bookmark");Element.show("add_bookmark")},parameters:"?bookmarkable_type="+b+"&bookmarkable_id="+a})}function clear_history_items(a){if(confirm_submit(error_list.clear_history_confirmation)){Element.show("clear_history_items_spinner");new Ajax.Request("/user/cb_clear_history",{asynchronous:true,evalScripts:true,onComplete:function(b){Element.hide("clear_history_items_spinner");$("user_history_count").update("0");oRequestHandlers[0].update("browser_history","bottom")},parameters:"?user_id="+a})}}function toggle_history(a){if(confirm_submit(error_list.toggle_history_confirmation)){Element.show("toggle_history_spinner");new Ajax.Request("/user/cb_toggle_history",{asynchronous:true,evalScripts:true,onComplete:function(b){Element.hide("toggle_history_spinner");window.location.reload()},parameters:"?user_id="+a})}}function msg_mark_spam(a){if(confirm_submit("Are you sure you want to mark this message as spam?")){new Ajax.Request("/msg_thread/msg_mark_spam",{asynchronous:true,evalScripts:true,onComplete:function(b){window.location=location.protocol+"//"+location.host+"/msg_thread/inbox"},parameters:"?thread_id="+a})}}function commentDelete(a){if(typeof(is_page_completely_loaded)!="undefined"){$("q_a_c_id").value=a;if(confirm_submit("Are you sure you want to delete this comment?")){delete_comment(a)}}}function commentEdit(a){moveDivCommentForm("edit_reply_"+a);$("postcomment").up().hide();$("commentFormMsg").hide();$("cancelcomment").up().show();$("editcomment").up().show();$("comment_id").value=a;$("comment_comment").value=$("comm_text_"+a).innerHTML.strip().gsub(/\<br\s?\/?\>/i,"\n").stripTags();$("comment_comment").focus();return false}function commentReply(a){if(typeof(is_page_completely_loaded)!="undefined"){moveDivCommentForm("edit_reply_"+a);$("postcomment").up().show();$("cancelcomment").up().show();$("editcomment").up().hide();$("commentFormMsg").show();$("parent_root").value="parent";$("comment_parent_id").value=a;$("comment_comment").focus()}}function commentPost(){$("postcomment").up().show();$("editcomment").up().hide();$("comment_comment").value="";$("comment_parent_id").value="";$("parent_root").value="root";$("editornew").value="new";showInlineContribBox("div_comment_form","comment_comment",0,8);moveDivCommentForm("parent_comment_div")}function commentReset(){remove_previous_error_div();moveDivCommentForm("parent_comment_div");$("cancelcomment").up().hide();$("postcomment").up().show();$("editcomment").up().hide();$("comment_id").value="";$("comment_comment").value="";if($("temp_comment_captcha")){$("temp_comment_captcha").remove()}$("comment_parent_id").value="";$("parent_root").value="";var a="Comments: "+$$(".comment").size();if($("comments_span")){$("comments_span").update(a)}if($("commentListCount")){$("commentListCount").update(a)}}function hideCommentForms(){if(typeof(is_page_completely_loaded)!="undefined"){var a=document.getElementById($("active_comment_div").value);a.style.display="none"}}function moveDivCommentForm(c){$("active_comment_div").value=c;$(c).style.display="";var b=document.getElementById("div_comment_form");var a=document.getElementById(c);a.appendChild(b)}function comment_mark_spam(a){if(confirm_submit("Are you sure you want to mark this comment as spam?")){link_obj=$("flagLink-"+a);link_obj.className=(link_obj.className=="reportAbuse")?"reportAbuseWait":"reportAbuse";new Ajax.Request("/main/comment_mark_spam",{asynchronous:true,evalScripts:true,onComplete:function(b){$("mark-spam-"+a).toggle();$("marked-spam-"+a).toggle()},parameters:"?comment_id="+a})}}function resolve_spam_comment(a,b){if((a=="delete"&&confirm_submit("Are you sure you want to delete this comment?"))||(!a&&confirm_submit("Are you sure you want to mark this comment not as spam?"))||(a&&confirm_submit("Are you sure you want to delete this comment permanently?"))){new Ajax.Request("/admin/resolve_spam_comment?is_spam="+a+"&comment_id="+b,{asynchronous:true,evalScripts:true,onComplete:function(c){window.location.reload()},onLoading:function(c){Element.show("div_processing_spinner")}});return false}}function changeEventMediaTabs(f,d,b,g){if($(f).className!="selected"){$(d).className="";$(f).className="selected";var a=$(d+"_scroll");a.style.zIndex=1;var c=$(f+"_scroll");c.style.zIndex=2;$("mediaTabsLbl").innerHTML='<a href="'+g+'">'+b+"</a>";var e=c.getElementsBySelector("li");if(e!=null){var h=e[0].getElementsBySelector("div");if(h!=null){h[0].onclick()}}}}function toggleHiddenList(a,b){Element.toggle(b);if(a.className=="left"||a.className=="leftTemp"){a.onmouseout=function(){this.className=(this.className=="bottomTemp"||this.className=="bottom")?"bottom":"left"};a.className="bottomTemp"}else{a.onmouseout=function(){this.className=(this.className=="leftTemp"||this.className=="left")?"left":"bottom"};a.className="leftTemp"}a.blur()}function commentOpens(f,e,b,d,c,a){if(typeof(is_page_completely_loaded)!="undefined"){f.parentNode.className=(f.parentNode.className=="commentsOpenShow")?"commentsOpenHide":"commentsOpenShow";$("event_comments").toggle();if(f.parentNode.className=="commentsOpenHide"&&firstLoad){firstLoad=false;Element.toggle("comments_lists_event_landing");oRequestHandlers[0].setParameters(e,b,d,c);requesthandler.type=a;oRequestHandlers[0].update("new_comments_landing","bottom")}}}function validate_profile_image_upload_form(b,a,e,c){var d="";remove_previous_error_div();file_name=$(b).value.strip();if(file_name==""){d+="You must select a file.#"}else{if(!validate_image_file(file_name)){d+="You must select an image file.#"}}if(d==""){return true}else{style="";if(typeof c!="undefined"&&c!=""){style=c}new Insertion.Top(a,get_error_list_html(d.split("#"),"error(s) prohibited this "+e.toLowerCase()+" from being saved"));return false}}function upload_profile_image(){var a=location.protocol+"//"+location.host;url=a+"/user/upload_profile_image";getVars="";new Ajax.Request(this.url,{parameters:getVars,asynchronous:true,onLoading:function(){showDiv("upload_profile_image_spinner");hideDiv("upload_profile_image_inner")},onComplete:function(b){if(b.responseText=="success"){RedBox.close();window.location.reload()}else{showDiv("upload_profile_image_inner");hideDiv("upload_profile_image_spinner")}},onFailure:function(){showDiv("upload_profile_image_inner");hideDiv("upload_profile_image_spinner")}})}function render_comment(){try{if($("q_a_c_id").value==null||typeof($("q_a_c_id").value)=="undefined"){return false}var a=$("q_a_c_id").value;new Ajax.Request("/main/render_comment/"+a,{asynchronous:true,evalScripts:true,onComplete:function(c){$("new_comment_"+a).update(c.responseText);$("form_spinner_display").style.display="none"},parameters:"display_content_detail="+$("display_content_detail").value})}catch(b){log_exceptions("Method :- render_comment "+b.message)}return false}function get_carrier(){try{var b=$("country")[$("country").selectedIndex].value;if($("country").selectedIndex){$("ajaxWait").show();new Ajax.Request("/static/get_carrier/"+escape(b),{asynchronous:true,evalScripts:true,onComplete:function(c){$("carriers").update(c.responseText);$("carriers").show();$("ajaxWait").hide();$("carrier").disabled=false},parameters:""})}$("carrier_number").value="";$("carrier").selectedIndex=0;$("carrier").disabled=true;$("cellphone").disabled=true;if($("cellphone").value==""){$("cellphone").value="Your Cellphone"}}catch(a){log_exceptions(" Method :- get_carrier "+a.message)}return false}function set_carrier_number(){var a=$("carrier")[$("carrier").selectedIndex].value;if($("carrier").selectedIndex){$("carrier_number").value=a;$("cellphone").disabled=false}else{$("carrier_number").value="";$("cellphone").disabled=true;if($("cellphone").value==""){$("cellphone").value="Your Cellphone"}}}function send_number_via_sms(){try{var d=$("carrier_number").value;var c=$("cellphone").value;var a="Something went wrong. Did you fill in all fields?";var b="You should receive the number on your cellphone in a few seconds!";if(d=="undefined"){$("message").update(a)}else{if(c=="undefined"||c=="Your Cellphone"){$("message").update(a)}else{$("ajaxWait").show();$("carrier").disabled=true;$("cellphone").disabled=true;$("country").disabled=true;$("submitBtn").disabled=true;new Ajax.Request("/send_number_to_sms/"+c+"/"+d,{asynchronous:true,evalScripts:true,onComplete:function(e){if(e.responseText=="failed"){$("message").update(a);$("carrier").disabled=false;$("cellphone").disabled=false;$("country").disabled=false;$("submitBtn").disabled=false}else{$("message").update(b)}$("ajaxWait").hide()},parameters:""})}}}catch(f){log_exceptions(" Method :- send_number_via_sms "+f.message)}return false}function get_box(whichbox,whichid,finishstr){str=($(whichid)?$(whichid).innerHTML:"");try{new Ajax.Request("/static/get_box",{asynchronous:true,evalScripts:true,onComplete:function(transport){$(whichid).innerHTML=transport.responseText;if(typeof(finishstr)!="undefined"&&finishstr!=null){eval(finishstr)}if(whichid=="popupLoginBox"){if(FACEBOOK_CONNECT){show_facebook_connect()}}},parameters:"whichbox="+whichbox})}catch(e){log_exceptions(" Method :- get_box "+e.message)}}function set_no_index_flag(a){try{new Ajax.Request("/main/set_no_index_flag/"+a,{asynchronous:true,evalScripts:true,onComplete:function(c){if(c.responseText=="yes"){$("hide_crawlers").className="normal";if($("hide_crawlers").innerHTML=="Hide From Crawlers"){$("hide_crawlers").innerHTML="Unhide From Crawlers"}else{$("hide_crawlers").innerHTML="Hide From Crawlers"}}},parameters:""})}catch(b){log_exceptions(" Method  :- set_no_index_flag "+b.message)}return false}function save_blog_url(a){try{if($("userBlogUrl").value){}else{if($("userBlogUrl").value){}else{new Ajax.Request("/main/save_blog_engine/"+a,{asynchronous:true,evalScripts:true,onComplete:function(c){$("blog_engine_url").hide()},parameters:"url="+escape($("userBlogUrl").value)})}}}catch(b){log_exceptions(" Method :- save_blog_url "+b.message)}return false}function deleteCredentials(a,c){try{new Ajax.Request("/delete_credentials/"+a,{asynchronous:true,evalScripts:true,onComplete:function(d){if(a=="twitter"){$("twitterStatus").innerHTML=d.responseText;$("popupTwitterCompleteBox").hide()}$(a+"CompleteMessage").innerHTML="Your credentials are now deleted. You can add them back at any time via your profile page.";$(a+"CompleteMessage").show()},parameters:""})}catch(b){log_exceptions(" Method :- deleteCredentials "+b.message)}}function tweet(b,a,d){if(b.className=="twitterLink"){try{b.className="twitterLinkWait";new Ajax.Request("/tweet/"+a+"/"+d,{asynchronous:true,evalScripts:true,onComplete:function(e){if(true){b.className="twitterLinkLocked";b.innerHTML="Tweeted";b.title="Submitted to Twitter";b.onClick=function(){this.blur();return false}}},parameters:""})}catch(c){log_exceptions(" Mehtod :- tweet "+c.message)}}b.blur();return false}function is_logged_in(){if($("loggedIn")!=null&&typeof($("loggedIn"))!="undefined"&&$("loggedIn").value>0){return true}else{return false}}function toggleAllContacts(c){var b=null;if($("contactsTable")){b=$("contactsTable").getElementsByTagName("INPUT")}else{b=c.parentNode.parentNode.parentNode.getElementsByTagName("INPUT")}for(var a=0;a<b.length;a++){if(b[a].type=="checkbox"){b[a].checked=c.checked}}}function hasSelectedContact(e,d){var c=null;if($("contactsTable")){c=$("contactsTable").getElementsByTagName("INPUT")}else{c=d.parentNode.parentNode.parentNode.getElementsByTagName("INPUT")}var a=false;for(var b=0;b<c.length;b++){if(c[b].type=="checkbox"){if(c[b].checked){a=true;c[b].value=""+c[b].id.split("contact_id"+e+"_")[1]}}}return a}function showNoContactSelected(a){$("contactsSpinner3"+a).hide();$("sendInvitationErrorMessage"+a).innerHTML="Please select a contact to invite.";$("sendInvitationErrorMessage"+a).show()}function send_profile_invitation(){try{if(!validate_import_contacts()){$("contactsSpinner3_inline").hide();new Insertion.Top($("listContacts_inline"),get_error_list_html(["Please select contacts from the given list"],"error(s) prohibited you from being sending invitations to your friends"));return false}new Ajax.Request("/user/profile_invite_contacts/",{asynchronous:true,evalScripts:true,onComplete:function(transport){try{var json_data=eval(transport.responseText);$("contactsSpinner3_inline").hide();if(json_data.status="ok"){json_data.error=json_data.error.gsub("#","");$("div_success_message").update("An invitation to join Allvoices has been sent to the following contacts: "+json_data.error.gsub(","," "))}else{new Insertion.Top($("listContacts_inline"),get_error_list_html([json_data.error],"error(s) prohibited you from being sending invitations to your friends"))}window.location.reload();return}catch(ex){log_exceptions(" Method :- profile_invite_contacts "+ex.message)}},onLoading:function(request){},parameters:$("inviteContact_inline").serialize()})}catch(e){log_exceptions(" Method :-  send_profile_invitation "+e.message)}}function importContactsForUser(userId,formOptions){new Ajax.Request("/contacts/import",{asynchronous:true,parameters:$H(formOptions).merge({userId:userId}),onSuccess:function(payload){var itemTemplate=new Template('<li><input type="checkbox" name="contacts[#{id}]" value="1"/><strong>#{name}</strong> (#{email})</li>');var listHtml=$A(eval(decode64(payload.responseText))).map(function(contact){return itemTemplate.evaluate(contact)}).join("\n");$("contacts_list").update(listHtml);$("contact_results").show()},onFailure:function(payload){var responseJSON=eval(decode64(payload.responseText));$("error_div").update(responseJSON[0].errorMsg).show()},onCreate:function(){$("error_div").hide();$("status_div").update("Please wait while we import your contacts...").show();$("contact_results").hide()},onComplete:function(){$("status_div").hide()}})}function resetContactsForm(b){$("importContactsForm"+b).reset();$("inviteContact"+b).reset();$("contactsSpinner2"+b).style.display="none";$("skipInvite").value="";var a=$("contactsTable"+b);while(a.rows.length>0){a.deleteRow(0)}}function importContacts(userId,id,refresh_page){if(typeof(refresh_page)=="undefined"){refresh_page=false}var importedEmailsList=$("importedEmails"+id).value;try{new Ajax.Request("/contacts/import/",{asynchronous:true,evalScripts:true,onComplete:function(transport){try{if(refresh_page){window.location.reload();return}var json_data=eval(decode64(transport.responseText));var tblObj=$("contactsTable"+id);var tblBody=tblObj.getElementsByTagName("tbody")[0];$("listContactErrorMessage"+id).innerHTML="";$("listContactErrorMessage"+id).hide();$("contactsSpinner"+id).hide();if(json_data[0].errorMsg!=null&&json_data[0].errorMsg!="undefined"){$("listContactErrorMessage"+id).innerHTML=json_data[0].errorMsg;$("listContactErrorMessage"+id).style.display=""}else{$("popupInviteContactsBox").show();$("popupInviteContactsBox").style.right=$("popupListContactsBox").style.right;$("popupInviteContactsBox").style.top=$("popupListContactsBox").style.top;$("popupListContactsBox").hide();$("importedEmails"+id).value+=","+$("inviter_email"+id).value+$("inviter_email_provider"+id).value;if(json_data.length>6){$("contactsScroll").className="contactsWrapper contactsWrapperScroll";setTimeout("var vertScroll = new VertScroll('contactsScroll', 0,0,0, false);",1000)}else{$("contactsScroll").className="contactsWrapper"}$("inviteContact"+id).show();$("contactsTableHeading"+id).style.display="";var allChecked=true;for(var i=0;i<json_data.length;i++){var tr=document.createElement("tr");tr.className="row"+((i%2)?0:1);var checkBoxTd=document.createElement("td");var chk=document.createElement("input");chk.setAttribute("id","contact_id"+id+"_"+json_data[i].id);chk.setAttribute("name","contact_id["+id+"]");chk.setAttribute("value",json_data[i].id);chk.setAttribute("type","checkbox");checkBoxTd.appendChild(chk);checkBoxTd.className="contactsTableCheck";tr.appendChild(checkBoxTd);var nameTd=document.createElement("td");var nameTextNode=document.createTextNode(json_data[i].name);if(json_data[i].name!=json_data[i].email){nameTd.appendChild(nameTextNode);nameTd.className="contactsTableName";tr.appendChild(nameTd)}var emailTd=document.createElement("td");if(json_data[i].name==json_data[i].email){emailTd.colSpan="2";emailTd.className="contactsTableName"}else{emailTd.className="contactsTableEmail"}var emailTextNode=document.createTextNode(json_data[i].email);emailTd.appendChild(emailTextNode);tr.appendChild(emailTd);tblBody.appendChild(tr);if(json_data[i].has_been_invited=="false"){chk.checked=true}else{allChecked=false}}$("contactsCheckAll"+id).checked=allChecked}}catch(ex){log_exceptions(" callback of  :-  /contacts/import/ "+ex.message)}},onLoading:function(request){},parameters:"userId="+userId+"&email="+encode64($("inviter_email"+id).value+$("inviter_email_provider"+id).value)+"&password="+encode64($("inviter_password"+id).value)})}catch(e){log_exceptions("Method :- importContacts "+e.message)}return false}function resetContacts(b){Element.hide("listContactErrorMessage"+b);Element.hide("contactsTableHeading"+b);var a=$("contactsTable"+b);while(a.rows.length>0){a.deleteRow(0)}}function postProcessRegistration(a,d,c){try{if(c!="skip=yes"){c="userId="+a+"&inviterEmail="+$("hidden_inviter_email"+d).value}new Ajax.Request("/post_registration_process",{asynchronous:true,evalScripts:true,onComplete:function(e){},onLoading:function(e){},parameters:c})}catch(b){log_exceptions(" Method :- postProcessRegistration "+b.message)}return false}function concatenate_contacts(d){var c=$("concatenatedContacts").value;var b=$("inviteContact"+d);for(var a=0;a<b.contact_id.length;a++){if(b.contact_id[a].checked){c=c+b.contact_id[a].value+","}}return c}function validEmail(c){if(c==null||c==""){return false}if(c.indexOf(" ")!=-1){return false}var a="@";var b=".";var d=c.indexOf(a);var e=c.indexOf(b);if(d<=0||d==c.length){return false}if(e<=0||e==c.length){return false}if(c.indexOf(a,(d+1))!=-1){return false}if(c.substring(d-1,d)==b||c.substring(d+1,d+2)==b){return false}if(c.indexOf(b,(d+2))==-1){return false}return true}var user_id=null;var post_params="";function verify_empty_fields(c){var b=false;c=$(c);var a=c.getElementsBySelector('[type="text"]');var d=c.getElementsBySelector("textarea");if(a){for(i=0;i<a.length;i++){if(a[i].value.strip().length>0){b=true;break}}}if(d&&!b){for(i=0;i<d.length;i++){if(d[i].value.strip().length>0){b=true;break}}}return b}function reset_textbox_area(a){if(a){for(i=0;i<a.length;i++){a[i].value=""}}}function reset_radio_buttons(a){if(a){for(i=0;i<a.length;i++){a[i].checked=false}}}function reset_surevey(c,a){var b=null;var f=null;var e=null;var d=$(a);if(c=="text"&&d){b=d.getElementsBySelector('[type="text"]');f=d.getElementsBySelector("textarea");reset_textbox_area(b);reset_textbox_area(f)}else{if(c=="radio"&&d){e=d.getElementsBySelector('[type="radio"]');reset_radio_buttons(e)}}}function save_post_param(){var a="";disable_form("form_user_survey",true);post_params=$("form_user_survey").serialize();remove_previous_error_div();if(!(verifyRadioButton($("form_user_survey").q1)||verify_empty_fields("ul_1"))){a+=error_list.blank_question_answer+"Question 1.#"}if(!(verifyRadioButton($("form_user_survey").q2)||verify_empty_fields("ul_2"))){a+=error_list.blank_question_answer+"Question 2.#"}if(a==""){return true}else{style="";if(typeof optional_width!="undefined"&&optional_width!=""){style=optional_width}new Insertion.Top("user_survey_error",get_error_list_html(a.split("#"),"error(s) prohibited this survey from being saved"));disable_form("form_user_survey",false);return false}}function verifyRadioButton(c){var a=false;var b=0;for(b=0;b<c.length;b++){if(c[b].checked){a=true}}return a}function delete_user_account(a){disable_buttons("save_profile_form");window.location="/delete/"+a;return false}function show_survey_box(b,a){user_id=b;RedBox.showInlineTop(a)}function post_survey_results(a){var b=a;disable_buttons("form_post_survey");$("div_spinner_survey").show();new Ajax.Request("/survey/post_user_delete_survey/"+b,{asynchronous:true,evalScripts:true,onComplete:function(c){RedBox.close();delete_user_account(a);$("div_spinner_survey").hide()},parameters:post_params})}function verify_profile_password(c){var b="";var a=($("user_password")?$("user_password").value.strip():"");var d=($("user_password_confirmation")?$("user_password_confirmation").value.strip():"");if(a==""||d==""){b+=error_list.blank_password+"#"}if(a.length<6||d.length<6){b+=error_list.min_password_length+"#"}if(a!=d){b+=error_list.confirm_password+"#"}if(b==""){return true}else{new Insertion.Top($(c),get_error_list_html(b.split("#"),"error(s) prohibited from password being saved"));return false}}function destroy_recaptcha(){if(typeof("Recaptcha")!="undefined"){Recaptcha.destroy()}}function reload_recaptcha(){if(typeof("Recaptcha")!="undefined"){Recaptcha.reload()}}function load_recaptcha(a){Recaptcha.create(recaptcha_pub_key,a,{theme:"red"})}function remove_all_decendants(c){try{var a=$(c).descendants();for(i=0;i<a.length;i++){a[i].remove()}}catch(b){log_exceptions(" Method :- remove_all_decendants "+b.message)}}function create_recaptcha(a){if(typeof(Recaptcha)!="undefined"){if($(a).innerHTML.strip()==""){Recaptcha.create(recaptcha_pub_key,a,{theme:"white"})}}}function loadEditor_abuse_admin(b,c,a){$("form_div").show();$("message_progressbar_div").hide();RedBox.showInline("compose_message");if(b){$("compose_heading").innerHTML="Send PM to Reporter"}else{$("compose_heading").innerHTML="Send PM to Abuser"}$("recipient_name").innerHTML=c;$("recipient").value=a;setTimeout("applyEditor(4,'message_body')",200)}function send_abuser_reporter_pm(){try{if(!confirm_submit("Are you sure you want to send this PM?")){return}get_tiny_mce_value("message_body");var my_params=$("abuser_reporter").serialize();$("form_div").hide();$("message_progressbar_div").show();new Ajax.Request("/msg_thread/save/",{asynchronous:false,evalScripts:true,onComplete:function(request){var my_object=eval(request.responseText);$("message_progressbar_div").hide();$("form_div").show();if(my_object&&my_object.status=="ok"){alert("message sent successfully");RedBox.close()}else{alert("message sent failed")}},onLoading:function(request){},parameters:my_params});return true}catch(ex){log_exceptions("Method :- send_abuser_reporter_pm "+ex.message)}}function toggleCommentsList(a){$("event_comments").toggle();a.up().toggleClassName("commentsOpenHide").toggleClassName("commentsClosedShow");return false}function get_syndication_field(a,b){return"syndication_"+b+"_"+a}function updateFields(b,d,c){var a=c.split(",");parent_field=$(get_syndication_field(b,d));for(i=0;i<a.length-1;i++){c_id=a[i];c_object=$(get_syndication_field(c_id,d));if(c_id!=b&&(typeof c_object.value=="undefined"||c_object.value=="")){c_object.value=parent_field.value}}}function unlinkPersonForEvent(b,c){var a="event_id="+b;a+="&people_id="+c;new Ajax.Request("/unlinkPersonForEvent",{parameters:a,asynchronous:false,onLoading:function(){},onComplete:function(d){$("person_link_"+c).hide();$("person_name_"+c).show()}})};String.prototype.parseColor=function(){var a="#";if(this.slice(0,4)=="rgb("){var c=this.slice(4,this.length-1).split(",");var b=0;do{a+=parseInt(c[b]).toColorPart()}while(++b<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var b=1;b<4;b++){a+=(this.charAt(b)+this.charAt(b)).toLowerCase()}}if(this.length==7){a=this.toLowerCase()}}}return(a.length==7?a:(arguments[0]||this))};Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return(b.nodeType==3?b.nodeValue:(b.hasChildNodes()?Element.collectTextNodes(b):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(c){return(c.nodeType==3?c.nodeValue:((c.hasChildNodes()&&!Element.hasClassName(c,b))?Element.collectTextNodesIgnoreClass(c,b):""))}).flatten().join("")};Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:(b/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||""};Element.forceRerendering=function(a){try{a=$(a);var c=document.createTextNode(" ");a.appendChild(c);a.removeChild(c)}catch(b){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5},reverse:function(a){return 1-a},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;return a>1?1:a},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5},pulse:function(b,a){a=a||5;return(((b%(1/a))*a).round()==0?((b*a*2)-(b*a*2).floor()):1-((b*a*2)-(b*a*2).floor()))},spring:function(a){return 1-(Math.cos(a*4.5*Math.PI)*Math.exp(-a*6))},none:function(a){return 0},full:function(a){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var b="position:relative";if(Prototype.Browser.IE){b+=";zoom:1"}a=$(a);$A(a.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(d){a.insertBefore(new Element("span",{style:b}).update(d==" "?String.fromCharCode(160):d),c)});Element.remove(c)}})},multiple:function(b,c){var e;if(((typeof b=="object")||Object.isFunction(b))&&(b.length)){e=b}else{e=$(b).childNodes}var a=Object.extend({speed:0.1,delay:0},arguments[2]||{});var d=a.delay;$A(e).each(function(g,f){new c(g,Object.extend(a,{delay:f*a.speed+d}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(b,c){b=$(b);c=(c||"appear").toLowerCase();var a=Object.extend({queue:{position:"end",scope:(b.id||"global"),limit:1}},arguments[2]||{});Effect[b.visible()?Effect.PAIRS[c][1]:Effect.PAIRS[c][0]](b,a)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(b){var c=new Date().getTime();var a=Object.isString(b.options.queue)?b.options.queue:b.options.queue.position;switch(a){case"front":this.effects.findAll(function(d){return d.state=="idle"}).each(function(d){d.startOn+=b.finishOn;d.finishOn+=b.finishOn});break;case"with-last":c=this.effects.pluck("startOn").max()||c;break;case"end":c=this.effects.pluck("finishOn").max()||c;break}b.startOn+=c;b.finishOn+=c;if(!b.options.queue.limit||(this.effects.length<b.options.queue.limit)){this.effects.push(b)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(a){this.effects=this.effects.reject(function(b){return b==a});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var c=new Date().getTime();for(var b=0,a=this.effects.length;b<a;b++){this.effects[b]&&this.effects[b].loop(c)}}});Effect.Queues={instances:$H(),get:function(a){if(!Object.isString(a)){return a}return this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get("global");Effect.Base=Class.create({position:null,start:function(options){function codeForEvent(options,eventName){return((options[eventName+"Internal"]?"this.options."+eventName+"Internal(this);":"")+(options[eventName]?"this.options."+eventName+"(this);":""))}if(options&&options.transition===false){options.transition=Effect.Transitions.linear}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),options||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;eval('this.render = function(pos){ if (this.state=="idle"){this.state="running";'+codeForEvent(this.options,"beforeSetup")+(this.setup?"this.setup();":"")+codeForEvent(this.options,"afterSetup")+'};if (this.state=="running"){pos=this.options.transition(pos)*'+this.fromToDelta+"+"+this.options.from+";this.position=pos;"+codeForEvent(this.options,"beforeUpdate")+(this.update?"this.update(pos);":"")+codeForEvent(this.options,"afterUpdate")+"}}");this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)}},loop:function(c){if(c>=this.startOn){if(c>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var b=(c-this.startOn)/this.totalTime,a=(b*this.totalFrames).round();if(a>this.currentFrame){this.render(b);this.currentFrame=a}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this)}if(this.options[a]){this.options[a](this)}},inspect:function(){var a=$H();for(property in this){if(!Object.isFunction(this[property])){a.set(property,this[property])}}return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(a){this.effects=a||[];this.start(arguments[1])},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1);b.cancel();b.event("beforeFinish");if(b.finish){b.finish(a)}b.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(c,f,e){c=Object.isString(c)?$(c):c;var b=$A(arguments),d=b.last(),a=b.length==5?b[3]:null;this.method=Object.isFunction(d)?d.bind(c):Object.isFunction(c[d])?c[d].bind(c):function(g){c[d]=g};this.start(Object.extend({from:f,to:e},a||{}))},update:function(a){this.method(a)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var a=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(a)},update:function(a){this.element.setOpacity(a)}});Effect.Move=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(a)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.setStyle({left:(this.options.x*a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})}});Effect.MoveBy=function(b,a,c){return new Effect.Move(b,Object.extend({x:c,y:a},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(b,c){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:c},arguments[2]||{});this.start(a)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(a){var b=(this.options.scaleFrom/100)+(this.factor*a);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType})}this.setDimensions(this.dims[0]*b,this.dims[1]*b)},finish:function(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(a,e){var f={};if(this.options.scaleX){f.width=e.round()+"px"}if(this.options.scaleY){f.height=a.round()+"px"}if(this.options.scaleFromCenter){var c=(a-this.dims[0])/2;var b=(e-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){f.top=this.originalTop-c+"px"}if(this.options.scaleX){f.left=this.originalLeft-b+"px"}}else{if(this.options.scaleY){f.top=-c+"px"}if(this.options.scaleX){f.left=-b+"px"}}}this.element.setStyle(f)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(a)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,d){return b+((this._base[d]+(this._delta[d]*a)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(d){var c=arguments[1]||{},b=document.viewport.getScrollOffsets(),e=$(d).cumulativeOffset(),a=(window.height||document.body.scrollHeight)-document.viewport.getHeight();if(c.offset){e[1]+=c.offset}return new Effect.Tween(null,b.top,e[1]>a?a:e[1],c,function(f){scrollTo(b.left,f.round())})};Effect.Fade=function(c){c=$(c);var a=c.getInlineOpacity();var b=Object.extend({from:c.getOpacity()||1,to:0,afterFinishInternal:function(d){if(d.options.to!=0){return}d.element.hide().setStyle({opacity:a})}},arguments[1]||{});return new Effect.Opacity(c,b)};Effect.Appear=function(b){b=$(b);var a=Object.extend({from:(b.getStyle("display")=="none"?0:b.getOpacity()||0),to:1,afterFinishInternal:function(c){c.element.forceRerendering()},beforeSetup:function(c){c.element.setOpacity(c.options.from).show()}},arguments[1]||{});return new Effect.Opacity(b,a)};Effect.SlideDown=function(c){c=$(c).cleanWhitespace();var a=c.down().getStyle("bottom");var b=c.getDimensions();return new Effect.Scale(c,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})},afterFinishInternal:function(d){d.element.undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.SlideUp=function(c){c=$(c).cleanWhitespace();var a=c.down().getStyle("bottom");var b=c.getDimensions();return new Effect.Scale(c,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().show()},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var b,a=$H();if(Prototype.Browser.WebKit){b=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';b=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(c){if(b[c]){a.set(c,b[c])}});if(Prototype.Browser.IE&&this.include("opacity")){a.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return a};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(b){var a=document.defaultView.getComputedStyle($(b),null);return Element.CSS_PROPERTIES.inject({},function(c,d){c[d]=a[d];return c})}}else{Element.getStyles=function(b){b=$(b);var a=b.currentStyle,c;c=Element.CSS_PROPERTIES.inject({},function(d,e){d[e]=a[e];return d});if(!c.opacity){c.opacity=b.getOpacity()}return c}}Effect.Methods={morph:function(a,b){a=$(a);new Effect.Morph(a,Object.extend({style:b},arguments[2]||{}));return a},visualEffect:function(c,e,b){c=$(c);var d=e.dasherize().camelize(),a=d.charAt(0).toUpperCase()+d.substring(1);new Effect[a](c,b);return c},highlight:function(b,a){b=$(b);new Effect.Highlight(b,a);return b}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(c,b){c=$(c);Effect[a.charAt(0).toUpperCase()+a.substring(1)](c,b);return c}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a]});Element.addMethods(Effect.Methods);if(typeof Effect=="undefined"){throw ("controls.js requires including script.aculo.us' effects.js library")}var Autocompleter={};Autocompleter.Base=Class.create({baseInitialize:function(b,c,a){b=$(b);this.element=b;this.update=$(c);this.hasFocus=false;this.changed=false;this.active=false;this.index=0;this.entryCount=0;this.oldElementValue=this.element.value;if(this.setOptions){this.setOptions(a)}else{this.options=a||{}}this.options.paramName=this.options.paramName||this.element.name;this.options.tokens=this.options.tokens||[];this.options.frequency=this.options.frequency||0.4;this.options.minChars=this.options.minChars||1;this.options.onShow=this.options.onShow||function(d,e){if(!e.style.position||e.style.position=="absolute"){e.style.position="absolute";Position.clone(d,e,{setHeight:false,offsetTop:d.offsetHeight})}Effect.Appear(e,{duration:0.15})};this.options.onHide=this.options.onHide||function(d,e){new Effect.Fade(e,{duration:0.15})};if(typeof(this.options.tokens)=="string"){this.options.tokens=new Array(this.options.tokens)}if(!this.options.tokens.include("\n")){this.options.tokens.push("\n")}this.observer=null;this.element.setAttribute("autocomplete","off");Element.hide(this.update);Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));Event.observe(this.element,"keydown",this.onKeyPress.bindAsEventListener(this))},show:function(){if(Element.getStyle(this.update,"display")=="none"){this.options.onShow(this.element,this.update)}if(!this.iefix&&(Prototype.Browser.IE)&&(Element.getStyle(this.update,"position")=="absolute")){new Insertion.After(this.update,'<iframe id="'+this.update.id+'_iefix" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.update.id+"_iefix")}if(this.iefix){setTimeout(this.fixIEOverlapping.bind(this),50)}},fixIEOverlapping:function(){Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)});this.iefix.style.zIndex=1;this.update.style.zIndex=2;Element.show(this.iefix)},hide:function(){this.stopIndicator();if(Element.getStyle(this.update,"display")!="none"){this.options.onHide(this.element,this.update)}if(this.iefix){Element.hide(this.iefix)}},startIndicator:function(){if(this.options.indicator){Element.show(this.options.indicator)}},stopIndicator:function(){if(this.options.indicator){Element.hide(this.options.indicator)}},onKeyPress:function(a){if(this.active){switch(a.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(a);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(a);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:this.markPrevious();this.render();Event.stop(a);return;case Event.KEY_DOWN:this.markNext();this.render();Event.stop(a);return}}else{if(a.keyCode==Event.KEY_TAB||a.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&a.keyCode==0)){return}}this.changed=true;this.hasFocus=true;if(this.observer){clearTimeout(this.observer)}this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000)},activate:function(){this.changed=false;this.hasFocus=true;this.getUpdatedChoices()},onHover:function(b){var a=Event.findElement(b,"LI");if(this.index!=a.autocompleteIndex){this.index=a.autocompleteIndex;this.render()}Event.stop(b)},onClick:function(b){var a=Event.findElement(b,"LI");this.index=a.autocompleteIndex;this.selectEntry();this.hide()},onBlur:function(a){setTimeout(this.hide.bind(this),250);this.hasFocus=false;this.active=false},render:function(){if(this.entryCount>0){for(var a=0;a<this.entryCount;a++){this.index==a?Element.addClassName(this.getEntry(a),"selected"):Element.removeClassName(this.getEntry(a),"selected")}if(this.hasFocus){this.show();this.active=true}}else{this.active=false;this.hide()}},markPrevious:function(){if(this.index>0){this.index--}else{this.index=this.entryCount-1}this.getEntry(this.index).scrollIntoView(true)},markNext:function(){if(this.index<this.entryCount-1){this.index++}else{this.index=0}this.getEntry(this.index).scrollIntoView(false)},getEntry:function(a){return this.update.firstChild.childNodes[a]},getCurrentEntry:function(){return this.getEntry(this.index)},selectEntry:function(){this.active=false;this.updateElement(this.getCurrentEntry())},updateElement:function(f){if(this.options.updateElement){this.options.updateElement(f);return}var d="";if(this.options.select){var a=$(f).select("."+this.options.select)||[];if(a.length>0){d=Element.collectTextNodes(a[0],this.options.select)}}else{d=Element.collectTextNodesIgnoreClass(f,"informal")}var c=this.getTokenBounds();if(c[0]!=-1){var e=this.element.value.substr(0,c[0]);var b=this.element.value.substr(c[0]).match(/^\s+/);if(b){e+=b[0]}this.element.value=e+d+this.element.value.substr(c[1])}else{this.element.value=d}this.oldElementValue=this.element.value;this.element.focus();if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,f)}},updateChoices:function(c){if(!this.changed&&this.hasFocus){this.update.innerHTML=c;Element.cleanWhitespace(this.update);Element.cleanWhitespace(this.update.down());if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;for(var a=0;a<this.entryCount;a++){var b=this.getEntry(a);b.autocompleteIndex=a;this.addObservers(b)}}else{this.entryCount=0}this.stopIndicator();this.index=0;if(this.entryCount==1&&this.options.autoSelect){this.selectEntry();this.hide()}else{this.render()}}},addObservers:function(a){Event.observe(a,"mouseover",this.onHover.bindAsEventListener(this));Event.observe(a,"click",this.onClick.bindAsEventListener(this))},onObserverEvent:function(){this.changed=false;this.tokenBounds=null;if(this.getToken().length>=this.options.minChars){this.getUpdatedChoices()}else{this.active=false;this.hide()}this.oldElementValue=this.element.value},getToken:function(){var a=this.getTokenBounds();return this.element.value.substring(a[0],a[1]).strip()},getTokenBounds:function(){if(null!=this.tokenBounds){return this.tokenBounds}var e=this.element.value;if(e.strip().empty()){return[-1,0]}var f=arguments.callee.getFirstDifferencePos(e,this.oldElementValue);var h=(f==this.oldElementValue.length?1:0);var d=-1,c=e.length;var g;for(var b=0,a=this.options.tokens.length;b<a;++b){g=e.lastIndexOf(this.options.tokens[b],f+h-1);if(g>d){d=g}g=e.indexOf(this.options.tokens[b],f+h);if(-1!=g&&g<c){c=g}}return(this.tokenBounds=[d+1,c])}});Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos=function(c,a){var d=Math.min(c.length,a.length);for(var b=0;b<d;++b){if(c[b]!=a[b]){return b}}return d};Ajax.Autocompleter=Class.create(Autocompleter.Base,{initialize:function(c,d,b,a){this.baseInitialize(c,d,a);this.options.asynchronous=true;this.options.onComplete=this.onComplete.bind(this);this.options.defaultParams=this.options.parameters||null;this.url=b},getUpdatedChoices:function(){this.startIndicator();var a=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());this.options.parameters=this.options.callback?this.options.callback(this.element,a):a;if(this.options.defaultParams){this.options.parameters+="&"+this.options.defaultParams}new Ajax.Request(this.url,this.options)},onComplete:function(a){this.updateChoices(a.responseText)}});Autocompleter.Local=Class.create(Autocompleter.Base,{initialize:function(b,d,c,a){this.baseInitialize(b,d,a);this.options.array=c},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this))},setOptions:function(a){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(b){var d=[];var c=[];var h=b.getToken();var g=0;for(var e=0;e<b.options.array.length&&d.length<b.options.choices;e++){var f=b.options.array[e];var j=b.options.ignoreCase?f.toLowerCase().indexOf(h.toLowerCase()):f.indexOf(h);while(j!=-1){if(j==0&&f.length!=h.length){d.push("<li><strong>"+f.substr(0,h.length)+"</strong>"+f.substr(h.length)+"</li>");break}else{if(h.length>=b.options.partialChars&&b.options.partialSearch&&j!=-1){if(b.options.fullSearch||/\s/.test(f.substr(j-1,1))){c.push("<li>"+f.substr(0,j)+"<strong>"+f.substr(j,h.length)+"</strong>"+f.substr(j+h.length)+"</li>");break}}}j=b.options.ignoreCase?f.toLowerCase().indexOf(h.toLowerCase(),j+1):f.indexOf(h,j+1)}}if(c.length){d=d.concat(c.slice(0,b.options.choices-d.length))}return"<ul>"+d.join("")+"</ul>"}},a||{})}});Form.Element.DelayedObserver=Class.create({initialize:function(b,a,c){this.delay=a||0.5;this.element=$(b);this.callback=c;this.timer=null;this.lastValue=$F(this.element);Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this))},delayedListener:function(a){if(this.lastValue==$F(this.element)){return}if(this.timer){clearTimeout(this.timer)}this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);this.lastValue=$F(this.element)},onTimerEvent:function(){this.timer=null;this.callback(this.element,$F(this.element))}});if(Object.isUndefined(Effect)){throw ("dragdrop.js requires including script.aculo.us' effects.js library")}var Droppables={drops:[],remove:function(a){this.drops=this.drops.reject(function(b){return b.element==$(a)})},add:function(b){b=$(b);var a=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});if(a.containment){a._containers=[];var c=a.containment;if(Object.isArray(c)){c.each(function(d){a._containers.push($(d))})}else{a._containers.push($(c))}}if(a.accept){a.accept=[a.accept].flatten()}Element.makePositioned(b);a.element=b;this.drops.push(a)},findDeepestChild:function(a){deepest=a[0];for(i=1;i<a.length;++i){if(Element.isParent(a[i].element,deepest.element)){deepest=a[i]}}return deepest},isContained:function(b,a){var c;if(a.tree){c=b.treeNode}else{c=b.parentNode}return a._containers.detect(function(d){return c==d})},isAffected:function(a,c,b){return((b.element!=c)&&((!b._containers)||this.isContained(c,b))&&((!b.accept)||(Element.classNames(c).detect(function(d){return b.accept.include(d)})))&&Position.within(b.element,a[0],a[1]))},deactivate:function(a){if(a.hoverclass){Element.removeClassName(a.element,a.hoverclass)}this.last_active=null},activate:function(a){if(a.hoverclass){Element.addClassName(a.element,a.hoverclass)}this.last_active=a},show:function(a,c){if(!this.drops.length){return}var b,d=[];this.drops.each(function(e){if(Droppables.isAffected(a,c,e)){d.push(e)}});if(d.length>0){b=Droppables.findDeepestChild(d)}if(this.last_active&&this.last_active!=b){this.deactivate(this.last_active)}if(b){Position.within(b.element,a[0],a[1]);if(b.onHover){b.onHover(c,b.element,Position.overlap(b.overlap,b.element))}if(b!=this.last_active){Droppables.activate(b)}}},fire:function(b,a){if(!this.last_active){return}Position.prepare();if(this.isAffected([Event.pointerX(b),Event.pointerY(b)],a,this.last_active)){if(this.last_active.onDrop){this.last_active.onDrop(a,this.last_active.element,b);return true}}},reset:function(){if(this.last_active){this.deactivate(this.last_active)}}};var Draggables={drags:[],observers:[],register:function(a){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress)}this.drags.push(a)},unregister:function(a){this.drags=this.drags.reject(function(b){return b==a});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress)}},activate:function(a){if(a.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=a}.bind(this),a.options.delay)}else{window.focus();this.activeDraggable=a}},deactivate:function(){this.activeDraggable=null},updateDrag:function(a){if(!this.activeDraggable){return}var b=[Event.pointerX(a),Event.pointerY(a)];if(this._lastPointer&&(this._lastPointer.inspect()==b.inspect())){return}this._lastPointer=b;this.activeDraggable.updateDrag(a,b)},endDrag:function(a){if(this._timeout){clearTimeout(this._timeout);this._timeout=null}if(!this.activeDraggable){return}this._lastPointer=null;this.activeDraggable.endDrag(a);this.activeDraggable=null},keyPress:function(a){if(this.activeDraggable){this.activeDraggable.keyPress(a)}},addObserver:function(a){this.observers.push(a);this._cacheObserverCallbacks()},removeObserver:function(a){this.observers=this.observers.reject(function(b){return b.element==a});this._cacheObserverCallbacks()},notify:function(b,a,c){if(this[b+"Count"]>0){this.observers.each(function(d){if(d[b]){d[b](b,a,c)}})}if(a.options[b]){a.options[b](a,c)}},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(a){Draggables[a+"Count"]=Draggables.observers.select(function(b){return b[a]}).length})}};var Draggable=Class.create({initialize:function(b){var c={handle:false,reverteffect:function(f,e,d){var g=Math.sqrt(Math.abs(e^2)+Math.abs(d^2))*0.02;new Effect.Move(f,{x:-d,y:-e,duration:g,queue:{scope:"_draggable",position:"end"}})},endeffect:function(e){var d=Object.isNumber(e._opacity)?e._opacity:1;new Effect.Opacity(e,{duration:0.2,from:0.7,to:d,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[e]=false}})},zindex:1000,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!arguments[1]||Object.isUndefined(arguments[1].endeffect)){Object.extend(c,{starteffect:function(d){d._opacity=Element.getOpacity(d);Draggable._dragging[d]=true;new Effect.Opacity(d,{duration:0.2,from:d._opacity,to:0.7})}})}var a=Object.extend(c,arguments[1]||{});this.element=$(b);if(a.handle&&Object.isString(a.handle)){this.handle=this.element.down("."+a.handle,0)}if(!this.handle){this.handle=$(a.handle)}if(!this.handle){this.handle=this.element}if(a.scroll&&!a.scroll.scrollTo&&!a.scroll.outerHTML){a.scroll=$(a.scroll);this._isScrollChild=Element.childOf(this.element,a.scroll)}Element.makePositioned(this.element);this.options=a;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this)},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);Draggables.unregister(this)},currentDelta:function(){return([parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")])},initDrag:function(a){if(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element]){return}if(Event.isLeftClick(a)){var c=Event.element(a);if((tag_name=c.tagName.toUpperCase())&&(tag_name=="INPUT"||tag_name=="SELECT"||tag_name=="OPTION"||tag_name=="BUTTON"||tag_name=="TEXTAREA")){return}var b=[Event.pointerX(a),Event.pointerY(a)];var d=Position.cumulativeOffset(this.element);this.offset=[0,1].map(function(e){return(b[e]-d[e])});Draggables.activate(this);Event.stop(a)}},startDrag:function(b){this.dragging=true;if(!this.delta){this.delta=this.currentDelta()}if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0);this.element.style.zIndex=this.options.zindex}if(this.options.ghosting){this._clone=this.element.cloneNode(true);this.element._originallyAbsolute=(this.element.getStyle("position")=="absolute");if(!this.element._originallyAbsolute){Position.absolutize(this.element)}this.element.parentNode.insertBefore(this._clone,this.element)}if(this.options.scroll){if(this.options.scroll==window){var a=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=a.left;this.originalScrollTop=a.top}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop}}Draggables.notify("onStart",this,b);if(this.options.starteffect){this.options.starteffect(this.element)}},updateDrag:function(event,pointer){if(!this.dragging){this.startDrag(event)}if(!this.options.quiet){Position.prepare();Droppables.show(pointer,this.element)}Draggables.notify("onDrag",this,event);this.draw(pointer);if(this.options.change){this.options.change(this)}if(this.options.scroll){this.stopScrolling();var p;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){p=[left,top,left+width,top+height]}}else{p=Position.page(this.options.scroll);p[0]+=this.options.scroll.scrollLeft+Position.deltaX;p[1]+=this.options.scroll.scrollTop+Position.deltaY;p.push(p[0]+this.options.scroll.offsetWidth);p.push(p[1]+this.options.scroll.offsetHeight)}var speed=[0,0];if(pointer[0]<(p[0]+this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[0]+this.options.scrollSensitivity)}if(pointer[1]<(p[1]+this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[1]+this.options.scrollSensitivity)}if(pointer[0]>(p[2]-this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[2]-this.options.scrollSensitivity)}if(pointer[1]>(p[3]-this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[3]-this.options.scrollSensitivity)}this.startScrolling(speed)}if(Prototype.Browser.WebKit){window.scrollBy(0,0)}Event.stop(event)},finishDrag:function(b,f){this.dragging=false;if(this.options.quiet){Position.prepare();var e=[Event.pointerX(b),Event.pointerY(b)];Droppables.show(e,this.element)}if(this.options.ghosting){if(!this.element._originallyAbsolute){Position.relativize(this.element)}delete this.element._originallyAbsolute;Element.remove(this._clone);this._clone=null}var g=false;if(f){g=Droppables.fire(b,this.element);if(!g){g=false}}if(g&&this.options.onDropped){this.options.onDropped(this.element)}Draggables.notify("onEnd",this,b);var a=this.options.revert;if(a&&Object.isFunction(a)){a=a(this.element)}var c=this.currentDelta();if(a&&this.options.reverteffect){if(g==0||a!="failure"){this.options.reverteffect(this.element,c[1]-this.delta[1],c[0]-this.delta[0])}}else{this.delta=c}if(this.options.zindex){this.element.style.zIndex=this.originalZ}if(this.options.endeffect){this.options.endeffect(this.element)}Draggables.deactivate(this);Droppables.reset()},keyPress:function(a){if(a.keyCode!=Event.KEY_ESC){return}this.finishDrag(a,false);Event.stop(a)},endDrag:function(a){if(!this.dragging){return}this.stopScrolling();this.finishDrag(a,true);Event.stop(a)},draw:function(a){var g=Position.cumulativeOffset(this.element);if(this.options.ghosting){var c=Position.realOffset(this.element);g[0]+=c[0]-Position.deltaX;g[1]+=c[1]-Position.deltaY}var f=this.currentDelta();g[0]-=f[0];g[1]-=f[1];if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){g[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;g[1]-=this.options.scroll.scrollTop-this.originalScrollTop}var e=[0,1].map(function(d){return(a[d]-g[d]-this.offset[d])}.bind(this));if(this.options.snap){if(Object.isFunction(this.options.snap)){e=this.options.snap(e[0],e[1],this)}else{if(Object.isArray(this.options.snap)){e=e.map(function(d,h){return(d/this.options.snap[h]).round()*this.options.snap[h]}.bind(this))}else{e=e.map(function(d){return(d/this.options.snap).round()*this.options.snap}.bind(this))}}}var b=this.element.style;if((!this.options.constraint)||(this.options.constraint=="horizontal")){b.left=e[0]+"px"}if((!this.options.constraint)||(this.options.constraint=="vertical")){b.top=e[1]+"px"}if(b.visibility=="hidden"){b.visibility=""}},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null}},startScrolling:function(a){if(!(a[0]||a[1])){return}this.scrollSpeed=[a[0]*this.options.scrollSpeed,a[1]*this.options.scrollSpeed];this.lastScrolled=new Date();this.scrollInterval=setInterval(this.scroll.bind(this),10)},scroll:function(){var current=new Date();var delta=current-this.lastScrolled;this.lastScrolled=current;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=delta/1000;this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1])}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*delta/1000;this.options.scroll.scrollTop+=this.scrollSpeed[1]*delta/1000}Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify("onDrag",this);if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*delta/1000;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*delta/1000;if(Draggables._lastScrollPointer[0]<0){Draggables._lastScrollPointer[0]=0}if(Draggables._lastScrollPointer[1]<0){Draggables._lastScrollPointer[1]=0}this.draw(Draggables._lastScrollPointer)}if(this.options.change){this.options.change(this)}},_getWindowScroll:function(w){var T,L,W,H;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}}});Draggable._dragging={};var SortableObserver=Class.create({initialize:function(b,a){this.element=$(b);this.observer=a;this.lastValue=Sortable.serialize(this.element)},onStart:function(){this.lastValue=Sortable.serialize(this.element)},onEnd:function(){Sortable.unmark();if(this.lastValue!=Sortable.serialize(this.element)){this.observer(this.element)}}});var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(a){while(a.tagName.toUpperCase()!="BODY"){if(a.id&&Sortable.sortables[a.id]){return a}a=a.parentNode}},options:function(a){a=Sortable._findRootElement($(a));if(!a){return}return Sortable.sortables[a.id]},destroy:function(a){var b=Sortable.options(a);if(b){Draggables.removeObserver(b.element);b.droppables.each(function(c){Droppables.remove(c)});b.draggables.invoke("destroy");delete Sortable.sortables[b.element.id]}},create:function(c){c=$(c);var b=Object.extend({element:c,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:c,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});this.destroy(c);var a={revert:true,quiet:b.quiet,scroll:b.scroll,scrollSpeed:b.scrollSpeed,scrollSensitivity:b.scrollSensitivity,delay:b.delay,ghosting:b.ghosting,constraint:b.constraint,handle:b.handle};if(b.starteffect){a.starteffect=b.starteffect}if(b.reverteffect){a.reverteffect=b.reverteffect}else{if(b.ghosting){a.reverteffect=function(f){f.style.top=0;f.style.left=0}}}if(b.endeffect){a.endeffect=b.endeffect}if(b.zindex){a.zindex=b.zindex}var d={overlap:b.overlap,containment:b.containment,tree:b.tree,hoverclass:b.hoverclass,onHover:Sortable.onHover};var e={onHover:Sortable.onEmptyHover,overlap:b.overlap,containment:b.containment,hoverclass:b.hoverclass};Element.cleanWhitespace(c);b.draggables=[];b.droppables=[];if(b.dropOnEmpty||b.tree){Droppables.add(c,e);b.droppables.push(c)}(b.elements||this.findElements(c,b)||[]).each(function(h,f){var g=b.handles?$(b.handles[f]):(b.handle?$(h).select("."+b.handle)[0]:h);b.draggables.push(new Draggable(h,Object.extend(a,{handle:g})));Droppables.add(h,d);if(b.tree){h.treeNode=c}b.droppables.push(h)});if(b.tree){(Sortable.findTreeElements(c,b)||[]).each(function(f){Droppables.add(f,e);f.treeNode=c;b.droppables.push(f)})}this.sortables[c.id]=b;Draggables.addObserver(new SortableObserver(c,b.onUpdate))},findElements:function(b,a){return Element.findChildren(b,a.only,a.tree?true:false,a.tag)},findTreeElements:function(b,a){return Element.findChildren(b,a.only,a.tree?true:false,a.treeTag)},onHover:function(e,d,a){if(Element.isParent(d,e)){return}if(a>0.33&&a<0.66&&Sortable.options(d).tree){return}else{if(a>0.5){Sortable.mark(d,"before");if(d.previousSibling!=e){var b=e.parentNode;e.style.visibility="hidden";d.parentNode.insertBefore(e,d);if(d.parentNode!=b){Sortable.options(b).onChange(e)}Sortable.options(d.parentNode).onChange(e)}}else{Sortable.mark(d,"after");var c=d.nextSibling||null;if(c!=e){var b=e.parentNode;e.style.visibility="hidden";d.parentNode.insertBefore(e,c);if(d.parentNode!=b){Sortable.options(b).onChange(e)}Sortable.options(d.parentNode).onChange(e)}}}},onEmptyHover:function(e,g,h){var j=e.parentNode;var a=Sortable.options(g);if(!Element.isParent(g,e)){var f;var c=Sortable.findElements(g,{tag:a.tag,only:a.only});var b=null;if(c){var d=Element.offsetSize(g,a.overlap)*(1-h);for(f=0;f<c.length;f+=1){if(d-Element.offsetSize(c[f],a.overlap)>=0){d-=Element.offsetSize(c[f],a.overlap)}else{if(d-(Element.offsetSize(c[f],a.overlap)/2)>=0){b=f+1<c.length?c[f+1]:null;break}else{b=c[f];break}}}}g.insertBefore(e,b);Sortable.options(j).onChange(e);a.onChange(e)}},unmark:function(){if(Sortable._marker){Sortable._marker.hide()}},mark:function(b,a){var d=Sortable.options(b.parentNode);if(d&&!d.ghosting){return}if(!Sortable._marker){Sortable._marker=($("dropmarker")||Element.extend(document.createElement("DIV"))).hide().addClassName("dropmarker").setStyle({position:"absolute"});document.getElementsByTagName("body").item(0).appendChild(Sortable._marker)}var c=Position.cumulativeOffset(b);Sortable._marker.setStyle({left:c[0]+"px",top:c[1]+"px"});if(a=="after"){if(d.overlap=="horizontal"){Sortable._marker.setStyle({left:(c[0]+b.clientWidth)+"px"})}else{Sortable._marker.setStyle({top:(c[1]+b.clientHeight)+"px"})}}Sortable._marker.show()},_tree:function(e,b,f){var d=Sortable.findElements(e,b)||[];for(var c=0;c<d.length;++c){var a=d[c].id.match(b.format);if(!a){continue}var g={id:encodeURIComponent(a?a[1]:null),element:e,parent:f,children:[],position:f.children.length,container:$(d[c]).down(b.treeTag)};if(g.container){this._tree(g.container,b,g)}f.children.push(g)}return f},tree:function(d){d=$(d);var c=this.options(d);var b=Object.extend({tag:c.tag,treeTag:c.treeTag,only:c.only,name:d.id,format:c.format},arguments[1]||{});var a={id:null,parent:null,children:[],container:d,position:0};return Sortable._tree(d,b,a)},_constructIndex:function(b){var a="";do{if(b.id){a="["+b.position+"]"+a}}while((b=b.parent)!=null);return a},sequence:function(b){b=$(b);var a=Object.extend(this.options(b),arguments[1]||{});return $(this.findElements(b,a)||[]).map(function(c){return c.id.match(a.format)?c.id.match(a.format)[1]:""})},setSequence:function(b,c){b=$(b);var a=Object.extend(this.options(b),arguments[2]||{});var d={};this.findElements(b,a).each(function(e){if(e.id.match(a.format)){d[e.id.match(a.format)[1]]=[e,e.parentNode]}e.parentNode.removeChild(e)});c.each(function(e){var f=d[e];if(f){f[1].appendChild(f[0]);delete d[e]}})},serialize:function(c){c=$(c);var b=Object.extend(Sortable.options(c),arguments[1]||{});var a=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:c.id);if(b.tree){return Sortable.tree(c,arguments[1]).children.map(function(d){return[a+Sortable._constructIndex(d)+"[id]="+encodeURIComponent(d.id)].concat(d.children.map(arguments.callee))}).flatten().join("&")}else{return Sortable.sequence(c,arguments[1]).map(function(d){return a+"[]="+encodeURIComponent(d)}).join("&")}}};Element.isParent=function(b,a){if(!b.parentNode||b==a){return false}if(b.parentNode==a){return true}return Element.isParent(b.parentNode,a)};Element.findChildren=function(d,b,a,c){if(!d.hasChildNodes()){return null}c=c.toUpperCase();if(b){b=[b].flatten()}var e=[];$A(d.childNodes).each(function(g){if(g.tagName&&g.tagName.toUpperCase()==c&&(!b||(Element.classNames(g).detect(function(h){return b.include(h)})))){e.push(g)}if(a){var f=Element.findChildren(g,b,a,c);if(f){e.push(f)}}});return(e.length>0?e.flatten():[])};Element.offsetSize=function(a,b){return a["offset"+((b=="vertical"||b=="height")?"Height":"Width")]};var _av_stats=new Array();var _av_start=new Date()/1000;var fn=0;function urchinTracker(a){_av_stats.urchin=a}function performSearch(c){var b=document.getElementById("searchbar");if(c!=""){$("search_box").value=c}var a=$("search_url").value;if(a!=""){b.action=a}b.submit()}function deleteCookie(a){document.cookie=a+"=null; expires=Thu, 01-Jan-1970 00:00:01 GMT"}function setCookie(b,a){document.cookie=b+"="+a+";path=/"}function setCookieExpiration(b,a){document.cookie=b+"; expires="+a}function readCookie(b){var a=document.cookie.match("(^|;) ?"+b+"=([^;]*)(;|$)");if(a){str_temp=unescape(a[2]);if(str_temp==";"){return""}else{return str_temp}}else{return""}}function reset_app_data(){reset_map_cookies();reset_type_category_filter_cookie()}function reset_type_category_filter_cookie(){setCookie("type_category_filter",",all,popular")}function reset_map_cookies(){document.cookie="northeast=77.07878389624943,180.2421875;path=/";document.cookie="southwest=-56.75272287205734,-166.9921875;path=/"}function register_location_searcher(){var a=new Ajax.Autocompleter("search_box","location_search_auto_complete","/locationsearch",{callback:function(b,c){Element.hide("no_location");return"?search_query="+$F("search_box")},afterUpdateElement:function(b,c){},updateElement:function(d){if(typeof(d.firstChild.innerHTML)=="undefined"){$("search_url").value="/search/"+$("search_box").value}else{$("search_box").value=d.firstChild.innerHTML;var c=d.id;if($("geourl_"+c)!=null&&typeof($("geourl_"+c).value)!="undefined"){$("search_url").value=$("geourl_"+c).value;var b="geo_url="+$("geourl_"+c).value;new Ajax.Request("/main/set_searched_geoloc/"+$("geoattrib_"+c).value,{parameters:b,asynchronous:true,evalScripts:true,onComplete:function(e){}})}else{$("search_url").value="/search/"+$("search_box").value}}window.location=$("search_url").value},minChars:4,frequency:0.5,indicator:"location_search_wait"})}if(window.onload){fn=window.onload}window.onload=function(){is_page_completely_loaded=true;if(window.location.href.indexOf("#")==-1){}_av_stats.blink=parseInt(((new Date()/1000)-_av_start)*1000);var b=[];b=["blink="+_av_stats.blink];var a=new Image();a.src="/images/stats.gif?"+b.join("&");if(fn){fn()}};function ArrayList(){this.aList=[]}ArrayList.prototype.count=function(){return this.aList.length};ArrayList.prototype.getAt=function(a){if(a>-1&&a<this.aList.length){return this.aList[a]}else{throw"Out of Bounds"}};ArrayList.prototype.add=function(a){this.aList.push(a)};ArrayList.prototype.clear=function(){this.aList=[]};ArrayList.prototype.removeAt=function(c){var a=this.aList.length;if(a>0&&c>-1&&c<this.aList.length){switch(c){case 0:this.aList.shift();break;case a-1:this.aList.pop();break;default:var d=this.aList.slice(0,c);var b=this.aList.slice(c+1);this.aList=d.concat(b);break}}};ArrayList.prototype.insert=function(d,c){var a=this.aList.length;var f=-1;if(c>-1&&c<a){switch(c){case 0:this.aList.unshift(d);f=0;break;case a:this.aList.push(d);f=a;break;default:var e=this.aList.slice(0,c-1);var b=this.aList.slice(c);this.aList=this.aList.concat(b.unshift(d));f=c;break}}return f};ArrayList.prototype.indexOf=function(b,e){var a=this.aList.length;var d=-1;if(e>-1&&e<a){var c=e;while(c<a){if(this.aList[c]==b){d=c;break}c++}}return d};ArrayList.prototype.lastIndexOf=function(b,e){var a=this.aList.length;var d=-1;if(e>-1&&e<a){var c=a-1;while(c>=e){if(this.aList[c]==b){d=c;break}c--}}return d};function Observer(){}Observer.prototype.update=function(){return};function Subject(){}Subject.prototype.notify=function(c){try{var d=this.observers.count();for(var b=0;b<d;b++){this.observers.getAt(b).update(c)}}catch(a){log_exceptions(" Method:- Subject.prototype.notify "+a.message)}};Subject.prototype.addObserver=function(a){if(!a.update){throw"Wrong parameter"}else{this.observers.add(a)}};Subject.prototype.removeObserver=function(a){if(!a.update){throw"Wrong parameter"}else{this.observers.removeAt(this.observers.indexOf(a,0))}};function ListObserver(b,a){this.widget_name=b;this.reload_map=true;this.my_list_type=null;this.addition_params="";if(typeof(a)!="undefined"){this.addition_params=a}};function AjaxWait(b,a){this.id=b;this.error=false;if(a){this.msg_pos=a}else{this.msg_pos="top"}if($("ajaxWait_"+b)){this.target=$(b+"_top");this.wrapper=$("ajaxWait_"+b);this.blinder=$("ajaxBlinder_"+b);this.temp=$("ajaxTemp_"+b);this.msg=$("ajaxMsg_"+b);this.msg.className="ajaxMsg "+this.msg_pos}else{this.error=true}this.start=function(){if(this.blinder.style.display=="none"){new Effect.Appear(this.blinder.id,{duration:0.3,from:0,to:0.9});this.resizeObject(this.blinder,this.wrapper.offsetWidth-2,this.wrapper.offsetHeight-3);new Effect.Appear(this.msg.id,{duration:0.3,from:0,to:1});this.resizeObject(this.msg,this.wrapper.offsetWidth-10,this.wrapper.offsetHeight-11)}else{}};this.finish=function(d){this.temp.innerHTML=d;new Effect.Fade(this.blinder.id,{duration:0.3,from:0.9,to:1});new Effect.Fade(this.msg.id,{duration:0.3,from:1,to:0});var c=this;setTimeout(function(){c.update()},300)};this.update=function(){try{this.target.innerHTML=this.temp.innerHTML;this.temp.innerHTML="";new Effect.Fade(this.blinder.id,{duration:0.5,from:1,to:0})}catch(c){log_exceptions(" Method: - update  of requesthandler.js "+c.message)}};this.resizeObject=function(e,d,c){if(d!=""||d==0){if(navigator.appName=="Microsoft Internet Explorer"){e.style.width=d}else{e.style.width=d+"px"}}if(c!=""||c==0){if(navigator.appName=="Microsoft Internet Explorer"){e.style.height=c}else{e.style.height=c+"px"}}}}function RequestHandler(){this.type="";this.requestedPageNo=1;this.observers=new ArrayList();this.list_type="all";this.sorting="popular";this.contributor_filter="popular";this.category="all";this.clear_cache=false;this.clear_location=false;this.sub_list_id="";this.addVars="";this.latestRequestTimeId=Array()}RequestHandler.prototype.update=function(i,c,j){try{if(typeof("addition_params")!="undefined"){}domain=location.protocol+"//"+location.host;if(i=="events"||i=="people"){setCookie("current_"+i+"_page",this.requestedPageNo)}anObserver=this.getObserver(i);url=domain+"/"+this.type+"/cb_"+i;var g="requested_page="+this.requestedPageNo;g+="&page="+this.requestedPageNo;if(anObserver.my_list_type!=null){g+="&type="+anObserver.my_list_type;this.list_type=anObserver.my_list_type}else{g+="&type="+this.list_type}g+="&category="+this.category;g+="&filter="+this.sorting;g+="&contributor_filter="+this.contributor_filter;g+="&ne="+readCookie("northeast");g+="&sw="+readCookie("southwest");g+="&clear_cache="+this.clear_cache;g+="&clear_location="+this.clear_location;g+="&"+this.addVars;if(this.sub_list_id!=""){g+="&"+j;var b=false}else{g+="&"+anObserver.addition_params;var b=true}setCookie("type_category_filter",(this.list_type+","+this.category+","+this.sorting+","+this.contributor_filter));this.list_type="all";if(this.sub_list_id!=""){i=i+"_"+this.sub_list_id}var f=new Date();var h=f.getTime()/1000;this.latestRequestTimeId[i]=h;try{var a=new AjaxWait(i,c);if(!a.error){a.start()}}catch(e){log_exceptions(" Method: - RequestHandler.prototype.update  block 1 "+e.message)}new Ajax.Request(url,{parameters:g,asynchronous:true,onLoading:function(){}.bind(this),onComplete:function(l){try{if($(i+"_top")!==null){if(h==this.latestRequestTimeId[i]){if(!a.error){a.finish(l.responseText);if($("embedded_javascript")!=null&&$(i+"_top").id!="undefined"&&$(i+"_top").id=="Videos_top"){var d=document.createElement("script");d.type="text/javascript";d.text="initFunc();";document.getElementById("embedded_javascript").appendChild(d)}}else{$(i+"_top").update("");new Insertion.Top($(i+"_top"),l.responseText)}}else{}}if(this.clear_location){reset_region_link()}}catch(k){log_exceptions(" Method: - RequestHandler.prototype.update  block 2"+k.message)}try{if(i=="new_comments_landing"){Element.toggle("comments_lists_event_landing")}}catch(k){log_exceptions(" Method: - RequestHandler.prototype.update  block 3"+k.message)}}.bind(this)});if(this.clear_cache){this.clear_cache=false}this.sub_list_id="";if(b){if(anObserver.reload_map){reloadFlash()}}}catch(e){log_exceptions(" Method: - RequestHandler.prototype.update  block 4"+e.message)}};RequestHandler.prototype.setParameters=function(c,b,e,d,a){if(typeof(a)!="undefined"){this.type=a}this.requestedPageNo=c;this.list_type=b;if(typeof(d)=="string"){this.sorting=d;this.contributor_filter=d}else{this.sorting=d[0];this.contributor_filter=d[1]}this.category=e};RequestHandler.prototype.addObserver=function(d,c,a,b){if(typeof(a)!="undefined"){observer=new ListObserver(d,a)}else{observer=new ListObserver(d)}if(typeof(b)!="undefined"){observer.my_list_type=b}observer.reload_map=c;this.observers.add(observer)};RequestHandler.prototype.getObserver=function(b){for(var a=0;a<this.observers.count();a++){anObserver=this.observers.getAt(a);if(anObserver.widget_name==b){return anObserver}}return null};RequestHandler.prototype.clearCache=function(){this.clear_cache=true};RequestHandler.prototype.retrieve_url=function(tinyMCEInstance,controller_name,cb_name,elem_name,story_url,page_type,page_id,action_type){if(page_type=="contributed-news"){page_type="Event"}var getVars="page_type="+page_type;getVars+="&page_id="+page_id;getVars+="&story_url="+escape(story_url);url=domain+"/"+controller_name+"/"+cb_name;var response1_text="";try{new Ajax.Request(url,{parameters:getVars,asynchronous:true,onLoading:function(){Element.show("div_urls_rss_spinner")}.bind(this),onComplete:function(transport){var json_data=eval("("+transport.responseText+")");var summary_result="<br /><div id='satisfiedWithSummary'><strong>";Element.hide("div_urls_rss_spinner");if(json_data.status=="cancel"){summary_html="";if(page_type=="Event"){$("error_text").innerHTML=json_data.message;$("error_text").show()}if(action_type=="story"){new Insertion.Top("div_urls_rss_form",get_error_list_html(json_data.message.split("#"),error_list.url_get_content,""))}else{new Insertion.Top("div_urls_rss_form",get_error_list_html(json_data.message.split("#"),error_list.url_get_content,""))}$("getsummary").enable()}else{if(json_data.status=="ok"){Element.show("summary_row");Element.show("title_row");Element.show("tag_row");summary_result+=error_list.satisfied_with_summary;summary_html=json_data.summary;title_text=json_data.title;document.getElementById("story_url").readOnly=true;Element.show("publish_button");Element.hide("getsummary_button");summary_result+="</strong></div>";if($("satisfiedWithSummary")){Element.remove("satisfiedWithSummary")}new Insertion.Top("summary_top",summary_result);Element.hide("div_urls_rss_spinner");tinyMCEInstance.get(elem_name).setContent(summary_html);$("story_title").value=title_text}}}.bind(this)})}catch(ex){log_exceptions(" Method: - RequestHandler.prototype.retrieve_url "+ex.message)}return true};var oRequestHandlers=new $A();var app_debug=false;var log_clientside_exceptions=true;var show_custom_messages=false;var domain=location.protocol+"//"+location.host;requesthandler=new RequestHandler();requesthandler.type="mapservice";oRequestHandlers[0]=requesthandler;function contentTabsSwitch(e,f){var a=e.parentNode;if(a.className!="selected"){var c=a.parentNode.getElementsByTagName("LI");for(var d=0;d<c.length;d++){c[d].className=""}var b=a.parentNode.parentNode.getElementsByTagName("DIV");for(d=0;d<b.length;d++){if(b[d].className=="siteContentTab"){b[d].style.display="none"}}a.className="selected";$(f).show()}e.blur()}function update_counts(){if($("user_latest_count").innerHTML<0){$("user_latest_count").update("0")}if($("user_video_count").innerHTML<0){$("user_video_count").update("0")}if($("user_image_count").innerHTML<0){$("user_image_count").update("0")}if($("user_blog_count").innerHTML<0){$("user_blog_count").update("0")}if($("user_event_count").innerHTML<0){$("user_event_count").update("0")}if($("user_comment_count").innerHTML<0){$("user_comment_count").update("0")}if($("user_history_count").innerHTML<0){$("user_history_count").update("0")}if($("user_bookmark_count").innerHTML<0){$("user_bookmark_count").update("0")}}function new_change_filter(a,b,c){for(i=0;i<a.length;i++){if(b==a[i]){$(c+"_plan_"+a[i]).show();$(c+"_"+a[i]).hide()}else{$(c+"_plan_"+a[i]).hide();$(c+"_"+a[i]).show()}}}function change_filter(b,g,c,d,a){var f="";var e="";switch(a){case 1:f="popular";e="recent";break;case 2:f="recent";e="popular";break}$(g+"_plan_"+f).show();$(g+"_"+f).hide();$(g+"_plan_"+e).hide();$(g+"_"+e).show();b.setParameters("1",c,d,f);return false}function toggleLinks(c,d){if(c.className!="selected"){var a=document.getElementById(d).getElementsByTagName("A");for(var b=0;b<a.length;b++){a[b].className=""}c.className="selected";c.blur();return true}c.blur();return false}function loadEditEventMaster(c){var b=document.getElementById("update_event_"+c);var a=document.getElementById("update_event_master");a.event_id.value=c;a.title.value=b.title.value;a.summary.value=$("edit_summary_"+c).innerHTML;a.tag_list.value=b.tag_list.value;if(document.getElementById("event_geo_country_1").options.length<=1){loadGeolocations("event_geo_country_1","event_geo_state_1")}changeSelectBox("category_master",b.category.value);changeSelectBox("event_geo_country_1",b.country.value);document.getElementById("event_geo_city_1").value=b.city.value;if(b.country.value=="United States of America"){document.getElementById("event_state_field_geo_1").style.display="";changeSelectBox("event_geo_state_1",b.state.value)}else{document.getElementById("event_state_field_geo_1").style.display="none"}}function loadEditBlogMaster(a){}function loadGeolocations(e,f){if(document.getElementById("geolocation_countries")&&document.getElementById(e)){var b=document.getElementById(e);var a=document.getElementById("geolocation_countries");b.options.length=0;for(i=0;i<a.options.length;i++){b.options[b.options.length]=new Option(a.options[i].innerHTML,a.options[i].value)}}if(document.getElementById("geolocation_states")&&document.getElementById(f)){var c=document.getElementById(f);var d=document.getElementById("geolocation_states");c.options.length=0;for(i=0;i<d.options.length;i++){c.options[c.options.length]=new Option(d.options[i].innerHTML,d.options[i].value)}}}function changeSelectBox(d,b){var a=document.getElementById(d);for(var c=0;c<a.options.length;c++){a.options[c].selected=(a.options[c].value==b?true:false)}}function showHoverContext(o,d,p,h,f,j,r,a,m){if(hoverContextLocked){return}if(p=="RedBox"){hcId=p}else{hcId=""}if(m!=""){m="hoverContextBox "+m}else{m="hoverContextBox"}if($("hoverContextBox"+hcId)){pauseHoverContextHide();var g=$("hoverContextBox"+hcId);g.className=m;if(hoverContextBackupObj!=""){hoverContextBackupObj.innerHTML=g.innerHTML;hoverContextBackupObj=""}if(!h){h=0}if(!f){f=0}var l=d.getElementsByTagName("IMG")[0];var k=d.getElementsByTagName("A")[0];if(l){l.title="";l.alt=""}if(k){k.title=""}var e=0;var c=0;if(o=="bottomLeft"){c=d.offsetHeight+2;if(d.parentNode.offsetLeft+d.offsetWidth+200>d.parentNode.parentNode.offsetWidth&&!j){e=-266+d.offsetWidth}}else{if(o=="bottomRight"){c=d.offsetHeight+2;if(d.parentNode.offsetLeft>200&&!j){e=-266+d.offsetWidth}}else{if(o=="topRight"){if(d.parentNode.offsetTop+d.parentNode.parentNode.parentNode.offsetTop+d.offsetHeight>d.parentNode.parentNode.parentNode.parentNode.offsetHeight){g.style.display="none";return}e=d.offsetWidth+2}}}var q="";if(p=="RedBox"){q=SpareTools.getOffsetFromRedbox(d.parentNode)}else{q=SpareTools.getOffsetFromWrapper(d.parentNode)}g.innerHTML="";if(r){g.innerHTML='<span class="staticHoverMsg">'+$(r).innerHTML+"</span>"}else{if(a){g.innerHTML=$(a).innerHTML}else{var n=d.parentNode.getElementsByTagName("DIV");for(var b=0;b<n.length;b++){if(n[b].className=="hoverContent"){g.innerHTML=n[b].innerHTML;hoverContextBackupObj=n[b];hoverContextBackupObj.innerHTML="";break}}}}SpareTools.moveObject(g,q.y+c+f,q.x+e+h);g.style.display="block";g.style.zIndex=500}}function lockHoverContext(a){hoverContextLocked=true}function unlockHoverContext(a){hoverContextLocked=false;if(a==undefined){a=""}hideHoverContext(a)}var hoverContextBackupObj="";var hoverContextLocked=false;var hideHoverTimeout=false;function hideHoverContext(a){if(hoverContextLocked){return}if(a==undefined){a=""}if($("hoverContextBox"+a)){hideHoverTimeout=true;setTimeout("if(hideHoverTimeout) { $('hoverContextBox"+a+"').hide(); hoverContextBackupObj.innerHTML = $('hoverContextBox"+a+"').innerHTML; hoverContextBackupObj = ''; }",100)}}function pauseHoverContextHide(){hideHoverTimeout=false}function flashPutHref(a){location.href=a}function flashPutTitle(a){document.title=a}function writeAllMediaPlayer(g,e,c,a,h,f,j,d){var b=new SWFObject(g,"slideshowpro",a,h,9,"#ffffff");b.useExpressInstall(domain+"/expressinstall.swf");b.addParam("allowFullScreen","true");b.addVariable("initialURL",escape(document.location));b.addVariable("xmlFile",e);b.addParam("wmode","transparent");if(f!=null&&typeof(f)=="undefined"){f="event_images"}$(f).innerHTML="";b.write(f);if(j!=null&&typeof(j)!="undefined"){$("mediaDesc").innerHTML=j}if(d!=null&&typeof(d)!="undefined"){video_index_found=d;show_video_next_prev()}urchinTracker(c);return false}function writeYouTubePlayer(g,e,a,d,b,c,f){embed_code='<object width="'+e+'" height="'+a+'"><param name="movie" value="'+g+'"></param><param name="allowFullScreen" value="true"></param> <param name="wmode" value="transparent"/> <embed src="'+g+'" type="application/x-shockwave-flash" wmode="transparent" allowfullscreen="true" width="'+e+'" height="'+a+'"></embed></object>';if(typeof(f)=="undefined"){f="event_images"}if(b!=null&&typeof(b)!="undefined"){$("mediaDesc").innerHTML=b}if(c!=null&&typeof(c)!="undefined"){video_index_found=c;show_video_next_prev()}urchinTracker(d);$(f).innerHTML=embed_code;return false}var slideshow_list=null;var main_image_list="mediaTab2_scroll";var arr_format="img";var video_slideshow_list=null;var main_video_list="slideShow_scroll";var video_index_found=0;function set_img_list(a,b){slideshow_list=a;arr_format=b}function slideshow_event_people_landing(a){if(typeof(a)!="undefined"){main_image_list=a}var b=$(main_image_list);if(b!=null){set_img_list(b.select("Img"),"img")}}function initialize_element_list(){if(slideshow_list==null){slideshow_event_people_landing()}}function video_slideshow_event_people_landing(a){if(typeof(a)!="undefined"){main_video_list=a}var b=$(main_video_list);if(b!=null){video_slideshow_list=b.getElementsByClassName("thumbBG")}}function writeImage(f,e,a,c,b){e=escape(e);urchinTracker(c);if(typeof(a)!="undefined"){initialize_element_list();var d="$('event_bigger_image').src='"+a+"';$('event_bigger_image').title='"+e+"';RedBox.showInline('div_big_image');show_next_prev();";e=unescape(e);$("event_images").innerHTML='<img id="event_bigger_image" src="'+f+'" title="'+e+'" onclick="'+d+'" />'}else{$("event_images").innerHTML='<img id="event_bigger_image" src="'+f+'" title="'+e+'" />'}if(typeof(b)!="undefined"){$("mediaDesc").innerHTML=b}return false}var image_details=function(){var c="";var b="";var a=""};function get_image_by_index(b){var a=new image_details();if(arr_format=="img"){a.url=slideshow_list[b].src;a.title=slideshow_list[b].title;a.summary=""}else{if(arr_format=="array"){var c=slideshow_list[b].image;if(typeof(c)=="undefined"){c=slideshow_list[b]}a.url=c.src;a.title=c.title;a.summary=c.summary}}return a}var index_found=0;function find_image_index(a){var b=0;if(slideshow_list!=null){for(b=0;b<slideshow_list.length;b++){if(get_image_by_index(b).url.include(a)){index_found=b;break}}}return index_found}function show_next_prev(){var c=$("event_bigger_image").src.split("/");var a=find_image_index(c[c.length-1]);initialize_element_list();if($("slideShow_scroll")){for(var b=0;b<slideshow_list.length;b++){if(b==a){$("thumb_img_"+b).setStyle({padding:"2px",left:"0",top:"0",background:"#336699"});current_thumb_pos=parseInt($("slideShow_scroll_thumbs").getStyle("top"));proposed_thumb_pos=(a-4)*-105;proposed_thumb_pos2=(a)*-105;if(current_thumb_pos>proposed_thumb_pos){button_pos=b-5;thumb_pos=b-4;$("slideShow_scroll_thumbs").setStyle({top:""+(thumb_pos*-105)+"px"});$("slideShow_scroll_button").setStyle({top:""+((button_pos*20)-1)+"px"})}else{if((slideshow_list.length-a>5)&&(current_thumb_pos<proposed_thumb_pos2)){$("slideShow_scroll_thumbs").setStyle({top:""+(b*-105)+"px"});$("slideShow_scroll_button").setStyle({top:""+((b*20)-1)+"px"})}}}else{$("thumb_img_"+b).setStyle({padding:"1px",left:"1px",top:"1px",background:"#999999"})}}}if(slideshow_list.length==1){$("next_button_slideshow").hide();$("prev_button_slideshow").hide()}else{$("imgCount").update("Photo "+(a+1)+" of "+slideshow_list.length)}}function show_video_next_prev(){if($("slideShow_scroll")){for(var a=0;a<video_slideshow_list.length;a++){if(a==video_index_found){$("thumb_img_"+a).setStyle({padding:"2px",left:"0",top:"0",background:"#336699"})}else{$("thumb_img_"+a).setStyle({padding:"1px",left:"1px",top:"1px",background:"#999999"})}}}if(video_slideshow_list.length==1){$("next_button_slideshow").hide();$("prev_button_slideshow").hide()}else{$("videoCount").update("Video "+(video_index_found+1)+" of "+video_slideshow_list.length)}}function next_image(a){index_found=index_found+1;if(index_found==slideshow_list.length){index_found=0}var b=change_big_image(index_found);urchinTracker(a+b+"/next")}function prev_image(a){index_found=index_found-1;if(index_found==-1){index_found=slideshow_list.length-1}var b=change_big_image(index_found);urchinTracker(a+b+"/prev")}function next_video(a){video_index_found=video_index_found+1;if(video_index_found==video_slideshow_list.length){video_index_found=0}video_slideshow_list[video_index_found].onclick();show_video_next_prev()}function prev_video(a){video_index_found=video_index_found-1;if(video_index_found==-1){video_index_found=video_slideshow_list.length-1}video_slideshow_list[video_index_found].onclick();show_video_next_prev()}function change_big_image(l){if(slideshow_list!=null){var k=$("event_bigger_image").src.split("/");var j=get_image_by_index(l);var e=j.url.split("/");var f="";var h="";var b=0;var d=j.title;if(k!=null&&e!=null){k[k.length-1]=e[e.length-1];h=e[e.length-1].split(".")[0].split("-")[0]}var a=k.length;for(b=0;b<a;b++){if(b==a-1){f+=k[b]}else{f+=k[b]+"/"}}$("event_bigger_image").src="";$("event_bigger_image").src=f;$("event_bigger_image").title="";$("event_bigger_image").title=d;var c=$("mediaDesc");if(c!=null){if(arr_format!="array"){var g=$("image_summary_"+l).value;c.update(g)}else{var g=j.summary;c.update(g)}}show_next_prev();return h}}var SpareTools={getPosition:function(c){c=c||window.event;var d={x:0,y:0};if(c.pageX||c.pageY){d.x=c.pageX;d.y=c.pageY}else{var f=document.documentElement;var a=document.body;d.x=c.clientX+(f.scrollLeft||a.scrollLeft)-(f.clientLeft||0);d.y=c.clientY+(f.scrollTop||a.scrollTop)-(f.clientTop||0)}return d},moveObject:function(f,e,d,b,c){var a=(navigator.appName=="Microsoft Internet Explorer")?"":"px";if(e==0||(e!=undefined&&e!="")){f.style.top=e+a}if(c==0||(c!=undefined&&c!="")){f.style.right=c+a}if(b==0||(b!=undefined&&b!="")){f.style.bottom=b+a}if(d==0||(d!=undefined&&d!="")){f.style.left=d+a}},resizeObject:function(d,c,a){var b=(navigator.appName=="Microsoft Internet Explorer")?"":"px";if(c!=undefined&&c!=""){d.style.width=c+b}if(a!=undefined&&a!=""&&!isNaN(a)){d.style.height=a+b}},getStartY:function(a){if(a.parentNode){return a.offsetTop+this.getStartY(a.parentNode)}else{return 0}},getStartX:function(a){if(a.parentNode){return a.offsetLeft+this.getStartX(a.parentNode)}else{return 0}},getOffsetFromWrapper:function(c){var b={x:0,y:0};if(c.parentNode&&c.id!="wrapper"){var a=this.getOffsetFromWrapper(c.parentNode);b.x=c.offsetLeft+a.x;b.y=c.offsetTop+a.y}return b},getOffsetFromRedbox:function(c){var b={x:0,y:0};if(c.parentNode&&c.id!="RB_window"){var a=this.getOffsetFromRedbox(c.parentNode);b.x=c.offsetLeft+a.x;b.y=c.offsetTop+a.y}return b}};var VertScrollFunctions={mouseDown:"",buttonOffset:0,moveScroll:function(d,f){var a=d.parentNode.offsetHeight-d.offsetHeight-1;if(f<-1){f=-1}else{if(f>a){f=a}}var b=document.getElementById(d.parentNode.parentNode.id+"_thumbs");var e=Math.round(f*100/a);var c=0;if(e>0){c=-Math.round((b.offsetHeight-b.parentNode.offsetHeight)*e/100)}SpareTools.moveObject(d,f,"");SpareTools.moveObject(b,c,"")}};function VertScroll(a,c,n,e,m){this.id=a;var g="";var h="";var l="";var b="";var k="";var j=document.getElementById(a).getElementsByTagName("DIV");for(var f=0;f<j.length;f++){if(j[f].className=="scroll"){l=j[f];l.id=a+"_scrollbox"}if(j[f].className=="scrollButton"){g=j[f];g.id=a+"_button"}if(j[f].className=="thumbs"){h=j[f];h.id=a+"_thumbs"}if(j[f].className=="scrollUp"){b=j[f];b.id=a+"_up"}if(j[f].className=="scrollDown"){k=j[f];k.id=a+"_down"}}l.style.display="";if(h.offsetHeight<l.offsetHeight){l.style.display="none"}else{b.parentNode.style.display="";var d=h.offsetHeight/l.offsetHeight;SpareTools.resizeObject(g,"",Math.floor(l.offsetHeight/d));if(m==undefined||m){SpareTools.moveObject(h.parentNode,"",9)}}g.onmousedown=function(p){VertScrollFunctions.mouseDown=this.parentNode.parentNode.id;var o=SpareTools.getPosition(p);VertScrollFunctions.buttonOffset=o.y-SpareTools.getStartY(this.parentNode)-this.offsetTop+this.parentNode.offsetTop};b.onmousedown=function(s){var q=this.parentNode.parentNode.getElementsByTagName("DIV");var p="";for(var o=0;o<q.length;o++){if(q[o].className=="scrollButton"){p=q[o];break}}var r=p.offsetTop-20;VertScrollFunctions.moveScroll(p,r)};k.onmousedown=function(s){var q=this.parentNode.parentNode.getElementsByTagName("DIV");var p="";for(var o=0;o<q.length;o++){if(q[o].className=="scrollButton"){p=q[o];break}}var r=p.offsetTop+20;VertScrollFunctions.moveScroll(p,r)};l.onclick=function(r){var o=SpareTools.getPosition(r);var p=this.getElementsByTagName("DIV")[0];if(o.y<SpareTools.getStartY(p)||o.y>SpareTools.getStartY(p)+p.offsetHeight){var q=o.y-SpareTools.getStartY(this)-p.offsetHeight/2;VertScrollFunctions.moveScroll(p,q)}};document.onmouseup=function(){if(VertScrollFunctions.mouseDown){var o=document.getElementById("wrapper");o.onselectstart=function(){};o.onmousedown=function(){};VertScrollFunctions.mouseDown=""}};document.onmousemove=function(o){if(VertScrollFunctions.mouseDown){var p=document.getElementById("wrapper");p.onselectstart=function(){return false};p.onmousedown=function(){return false};var s=SpareTools.getPosition(o);var u=document.getElementById(VertScrollFunctions.mouseDown+"_thumbs");var r=document.getElementById(VertScrollFunctions.mouseDown+"_button");var q=s.y-SpareTools.getStartY(r.parentNode.parentNode)-VertScrollFunctions.buttonOffset;var w=r.parentNode.offsetHeight-r.offsetHeight-1;if(q<-1){q=-1}else{if(q>w){q=w}}var t=Math.round(q*100/w);var v=0;if(t>0){v=-Math.round((u.offsetHeight-u.parentNode.offsetHeight)*t/100)}SpareTools.moveObject(r,q,"");SpareTools.moveObject(u,v,"")}}}function Carousel(c,a,b){this.id=c;this.totalItems=b;this.itemsPerPage=a;this.page=document.getElementById(this.id+"Page");this.push=document.getElementById(this.id+"Push");this.itemIndex=0;page=c+"Page";push=c+"Push";this.loadItems=function(h,g){if(g){g.childNodes[0].innerHTML="";var d=this.itemsPerPage;if(h==-1){this.itemIndex+=this.totalItems-(this.itemsPerPage*2)}else{if(h==0){d=this.totalItems}}pageInner=(g.getElementsByClassName("carouselPageInner"))[0];for(var e=0;e<d;e++){var f=this.id+"Item"+(this.itemIndex%this.totalItems);if(document.getElementById(f)){pageInner.innerHTML+=document.getElementById(f).innerHTML}this.itemIndex=(this.itemIndex+1)%this.totalItems}}};this.slide=function(e){this.loadItems(e,$(push));new Effect.Move(this.push,{x:e*this.push.offsetWidth,y:0,duration:0,mode:"absolute"});new Effect.Move(this.page,{x:-1*e*this.page.offsetWidth,y:0,duration:0.5,mode:"absolute"});new Effect.Move(this.push,{x:0,y:0,duration:0.5,mode:"absolute"});new Effect.Appear(this.push.id,{duration:0.5,from:0,to:1});new Effect.Appear(this.page.id,{duration:0.5,from:1,to:0});var d=this.page.id;this.page.id=this.push.id;this.push.id=d;this.page=document.getElementById(this.id+"Page");this.push=document.getElementById(this.id+"Push")};if(this.totalItems<=this.itemsPerPage){document.getElementById(this.id+"Inner").style.width="100%";this.loadItems(0,$(page))}else{this.loadItems(1,$(page));document.getElementById(this.id+"Left").style.display="";document.getElementById(this.id+"Right").style.display=""}new Effect.Move(this.page,{x:0,y:0,duration:0,mode:"absolute"});new Effect.Move(this.push,{x:this.push.offsetWidth,y:0,duration:0,mode:"absolute"})}function rateWait(a,c,b){if(a.className!="rateWait"&&a.className!="rateUpHold"&&a.className!="rateDownHold"){if(b=="up"){document.getElementById("rateDown"+c).className="rateDownHold"}else{document.getElementById("rateUp"+c).className="rateUpHold"}a.className="rateWait";a.blur();return true}a.blur();return false}function rateCallback(a,b,c){if(b=="up"){document.getElementById("rateDown"+c).className="rateDown";document.getElementById("rateUp"+c).className="rateUpHold"}else{document.getElementById("rateDown"+c).className="rateDownHold";document.getElementById("rateUp"+c).className="rateUp"}}function load_slideshow(g,f,e,d){RedBox.showInline(g);var b="";url="/slideshow/"+f+"/"+e+"/"+d;var a="";try{new Ajax.Request(url,{parameters:b,asynchronous:true,onLoading:function(){Element.show("div_spinner_slideshow")}.bind(this),onComplete:function(j){new Insertion.Top(g,j.responseText);Element.hide("div_spinner_slideshow");var h=new VertScroll("slideShow_scroll",5,0,0);if(d=="image"){slideshow_event_people_landing("slideShow_scroll");show_next_prev()}else{video_slideshow_event_people_landing("slideShow_scroll");show_video_next_prev();video_index_found=0}}.bind(this)})}catch(c){log_exceptions("Method: - load slideshow "+c.message)}return true}function save_share(e,b,d){try{var a="shareable_type="+e;a+="&shareable_id="+b;a+="&share_type="+d;new Ajax.Request("/main/save_share",{parameters:a,asynchronous:true})}catch(c){log_exceptions("Method: - save_share "+c.message)}}function toggle_user_score(b){try{var a="user_id="+b;new Ajax.Request("/main/toggle_user_score",{parameters:a,asynchronous:true,onComplete:function(f){try{if(f.responseText=="locked"){$("toggle_user_score").innerHTML="Unlock User Score"}else{if(f.responseText=="unlocked"){$("toggle_user_score").innerHTML="Lock User Score"}}}catch(d){log_exceptions("Method: - toggle_user_score "+d.message)}}.bind(this)})}catch(c){log_exceptions("Method: - toggle_user_score "+c.message)}}function toggle_bury_user(b){try{var a="user_id="+b;new Ajax.Request("/user/toggle_user_bury",{parameters:a,asynchronous:true,onComplete:function(f){try{if(f.responseText=="bury"){$("toggle_bury_user").innerHTML="<font color='BLACK'>Bury User</font>"}else{if(f.responseText=="unbury"){$("toggle_bury_user").innerHTML="<font color='RED'>Un-Bury User</font>"}}}catch(d){log_exceptions("Method: - toggle_user_score "+d.message)}}.bind(this)})}catch(c){log_exceptions("Method: - toggle_user_score "+c.message)}}function toggle_event_display(d,c){try{var a="id="+d+"&type="+c;new Ajax.Request("/event/update_display_setting",{parameters:a,asynchronous:false});location.reload(true)}catch(b){log_exceptions("Method: - toggle_event_display "+b.message)}}function report_as_spam(d,c){try{var a="event_id="+d+"&type="+c;new Ajax.Request("/event/handle_spam",{parameters:a,asynchronous:true,onComplete:function(g){try{if(c=="fp"){$("spam_detection").innerHTML="(REPORTED AS NOT SPAM)"}else{if(c=="fn"){$("spam_detection").innerHTML="(REPORTED AS SPAM)"}}}catch(f){log_exceptions("Method: - toggle_user_score "+f.message)}}.bind(this)})}catch(b){log_exceptions("Method: - toggle_user_score "+b.message)}}function delete_copyright_violation(c){try{var a="event_id="+c;new Ajax.Request("/event/delete_copyright_violation",{parameters:a,asynchronous:true,onComplete:function(f){try{$("copyright_violation").innerHTML=""}catch(d){log_exceptions("Method: - delete copyright violation "+d.message)}}.bind(this)})}catch(b){log_exceptions("Method: - delete copyright violation "+b.message)}}var ProfileManager=Class.create({initialize:function(a){this.managingElement=a;this.dirty=false;this._overrideExistingLinks();this._addSectionToForm()},changeSection:function(c){Event.stop(c);var a=Event.element(c);var b=a.getAttribute("href");new Ajax.Updater(this.managingElement.down(".main"),b,{method:"get",evalScripts:true,onComplete:this._doChangeSection.bindAsEventListener(this,a)})},_overrideExistingLinks:function(){this.managingElement.select(".side li a").invoke("observe","click",this.changeSection.bindAsEventListener(this))},_doChangeSection:function(b,a){this.managingElement.select(".side li").invoke("removeClassName","selected");a.up("li").addClassName("selected");this._addSectionToForm()},_addSectionToForm:function(){if(form=this.managingElement.down("form")){var b=this.managingElement.down(".side li.selected").readAttribute("id").gsub("sidelink_for_","");var a=new Element("input",{type:"hidden",name:"section",value:b});form.insert(a,"bottom")}}});function uploadImage(a){$$(".graphicBtnSmall").first().replace(new Element("img",{src:"/images/ajax/dot-spinner-red.gif"}))}jQuery(document).ready(function(){jQuery("span.time").timeago()});var exception_text_first="";var exception_text_second="";var exception_count_first=0;var exception_count_second=0;var exception_log_lock_condition=false;var my_ajax_object=null;var is_request_started=false;var start_request_time=null;var first_request_failed_time=5;var time_to_invoke_ajax_call=3000;var my_exception_text="";var my_exception_count=0;function log_exceptions(c,a){return true;var b=false;if(typeof(a)=="undefined"){a=false}b=(a==false||(a&&show_custom_messages));if(app_debug){if(typeof(GLog)!="undefined"){GLog.write(c)}else{if(typeof(JSLog)!="undefined"){JSLog.write(c)}else{if(typeof(console)!="undefined"){if(b){console.log(c)}}else{if(b){alert(c)}}}}}if(log_clientside_exceptions&&b&&c.length>0){if(exception_log_lock_condition){exception_text_second+=c+"\r\n";exception_count_second+=1}else{exception_text_first+=c+"\r\n";exception_count_first+=1}}}function my_method_logger(b){try{if(app_debug&&typeof(console)!="undefined"){console.log(b)}}catch(a){a=a}}function send_data(){var b=new Date();try{if(start_request_time&&((b.getTime()-start_request_time)/1000)>first_request_failed_time){my_method_logger("timeout happened ::: "+my_exception_text+" :: "+my_exception_count);try{if(my_ajax_object){my_ajax_object.transport.abort()}}catch(a){a=a}is_request_started=false;initialize_exception_variables()}if(!is_request_started){is_request_started=true;if(exception_log_lock_condition){exception_log_lock_condition=false;my_exception_text=my_exception_text+"\r\n"+encodeURIComponent(exception_text_second);my_exception_count=my_exception_count+exception_count_second}else{exception_log_lock_condition=true;my_exception_text=my_exception_text+"\r\n"+encodeURIComponent(exception_text_first);my_exception_count=my_exception_count+exception_count_first}params="exception_text="+my_exception_text+"&exception_count="+my_exception_count;my_method_logger("in condition :: "+params);if(my_exception_count==0){my_exception_text="";setTimeout("send_data();",time_to_invoke_ajax_call);is_request_started=false;return null}start_request_time=b.getTime();my_ajax_object=new Ajax.Request("/main/save_exception_logger",{parameters:params,asynchronous:true,onLoading:function(){},onComplete:function(c){my_method_logger("request completed called ::: "+c.status);if(c.status==200){initialize_exception_variables();my_exception_text="";my_exception_count=0;is_request_started=false;start_request_time=null}},onError:function(){}})}}catch(a){my_method_logger("Method :- send_data  "+a.message);my_method_logger(a.message)}setTimeout("send_data();",2*time_to_invoke_ajax_call)}function initialize_exception_variables(){if(exception_log_lock_condition){exception_text_first="";exception_count_first=0}else{exception_text_second="";exception_count_second=0}}setTimeout("send_data();",4*time_to_invoke_ajax_call);var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion(){var a;var b;var c;try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");a=b.GetVariable("$version")}catch(c){}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a="WIN 6,0,21,0";b.AllowScriptAccess="always";a=b.GetVariable("$version")}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a=b.GetVariable("$version")}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a="WIN 3,0,18,0"}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");a="WIN 2,0,0,11"}catch(c){a=-1}}return a}function GetSwfVer(){var g=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var f=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var a=navigator.plugins["Shockwave Flash"+f].description;var e=a.split(" ");var c=e[2].split(".");var h=c[0];var b=c[1];var d=e[3];if(d==""){d=e[4]}if(d[0]=="d"){d=d.substring(1)}else{if(d[0]=="r"){d=d.substring(1);if(d.indexOf("d")>0){d=d.substring(0,d.indexOf("d"))}}}var g=h+"."+b+"."+d}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){g=4}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){g=3}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){g=2}else{if(isIE&&isWin&&!isOpera){g=ControlVersion()}}}}}return g}function DetectFlashVer(f,d,c){versionStr=GetSwfVer();if(versionStr==-1){return false}else{if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",")}else{versionArray=versionStr.split(".")}var e=versionArray[0];var a=versionArray[1];var b=versionArray[2];if(e>parseFloat(f)){return true}else{if(e==parseFloat(f)){if(a>parseFloat(d)){return true}else{if(a==parseFloat(d)){if(b>=parseFloat(c)){return true}}}}}return false}}}function AC_AddExtension(b,a){if(b.indexOf("?")!=-1){if(b.substr(0,b.indexOf("?")).indexOf(a)==-1){return b.replace(/\?/,a+"?")}else{return b}}else{return b+a}}function AC_Generateobj(e,d,a){var c="";if(isIE&&isWin&&!isOpera){c+="<object ";for(var b in e){c+=b+'="'+e[b]+'" '}c+=">";for(var b in d){c+='<param name="'+b+'" value="'+d[b]+'" /> '}c+="</object>"}else{c+="<embed ";for(var b in a){c+=b+'="'+a[b]+'" '}c+="> </embed>"}document.write(c)}function AC_FL_RunContent(){var a=AC_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(a.objAttrs,a.params,a.embedAttrs)}function AC_SW_RunContent(){var a=AC_GetArgs(arguments,".dcr","src","clsid:166B1BCA-3F9C-11CF-8075-444553540000",null);AC_Generateobj(a.objAttrs,a.params,a.embedAttrs)}function AC_GetArgs(b,e,g,d,h){var a=new Object();a.embedAttrs=new Object();a.params=new Object();a.objAttrs=new Object();for(var c=0;c<b.length;c=c+2){var f=b[c].toLowerCase();switch(f){case"classid":break;case"pluginspage":a.embedAttrs[b[c]]=b[c+1];break;case"src":case"movie":b[c+1]=AC_AddExtension(b[c+1],e);a.embedAttrs.src=b[c+1];a.params[g]=b[c+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblclick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":case"id":a.objAttrs[b[c]]=b[c+1];break;case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":a.embedAttrs[b[c]]=a.objAttrs[b[c]]=b[c+1];break;default:a.embedAttrs[b[c]]=a.params[b[c]]=b[c+1]}}a.objAttrs.classid=d;if(h){a.embedAttrs.type=h}return a};var error_list={unknown_email:"Please login or register.",blank_content_title:"Please enter a title",blank_blog_title:"Please enter blog's title",blank_favourite_url:"Please enter your favourite url",invalid_favourite_url:"you did not enter a valid blog url",blank_favourite_title:"Please enter favourite's title ",blank_story_title:"Please enter story's title",blank_blog_link_title:"Please enter blog's title",confirm_email:"Email and Confirm email do not match",Username:"your choose name has already been taken. Please choose another.",email:"This email is already in use by someone else.",valid_country_city:"Please enter correct country and city",min_password_length:"Password should be minimum of 6 characters in length",username_min_length:"User name must be at least 5 characters long.",username_max_length:"User name size should be less than 256 characters",invalid_image:"Please enter valid image",image_description:"Description cannot be empty.",age_range:"Age cannot be less than 13.",blank_terms_of_service:"You have to accept both the Terms of Service and Privacy Policy to become a contributor.",blank_privacy_policy:"Please accept the Privacy Policy to become a contributor.",confirm_password:"Password and Confirm password do not match",education:"The level of education can only be high-school, college, graduate school and professional",blank_username:"User name can not be empty",event_summary:" should not be empty",education:"You forgot to select your level of education.",email:"You must enter an email address.",geolocation_id:"You did not enter the country or city in which you live.",age_range:"Date of Birth cannot be empty.",event_title:" should not be empty",blank_list_item_url:"Please enter a URL",blank_list_item_title:"Please enter title",blank_links_list_name:"Please enter list name",invalid_list_item_url:"you did not enter a valid url",external_blog_blank_title:"Please enter blog title",invalid_external_blog_url:"you did not enter a valid blog url",blank_blog_url:"Please enter a Blog URL",save_completed:"Your profile was saved successfully",country_not_found:"Please enter a valid country.",general_error:"Oops, something went wrong with registration. If the error is persistant, please contact help@allvoices.com.",activate_your_account:"Registration Step 2: Validate your email<br />Go Check your email<br />We have sent you an email containing a URL. You'll need to click the URL to verify your account. You should receive the email within the next few minutes. please also check your spam folder for the email from us.",validation_failed:"Your account could not be validated. Please check the URL sent via email. If the error is persistent contact help@allvoices.com.",already_activated:"Your account has already been confirmed. Just login to start contributing.",activation_completed:"Your account is now confirmed and registration is complete. Please sign in below and start reporting and contributing to the site.",spam:"The comment seems to be spam, it will be available on our site after admin review. Dont post this comment again.",minimum_password_length:"Password should be minimum of 6 characters in length",forgot_blank_email:"Please enter your email address to retrieve your password.",email_sent:"Your new temporary password has now been sent to your email address. Please check for the email and use the password to login.",email_not_found:"We couldn't find the email address you entered. Please check the email address and try again!",captcha_error:"Enter correct text as they are shown in the image.",general_abuse_error:"Oops, something went wrong while processing the abuse report.",country_not_found:"Please enter a valid country.",empty_username:"No user is registered with that email and password combination. Please check the email address and/or password.",user_not_activated:"You need to confirm your registration to login to allvoices.com. Do you need us to <a href='/resend-activation' title='resend the activation email'>resend the activation email</a>?.",user_not_activated_widget:"You need to confirm your registration to login to allvoices.com. Do you need us to <a href='javascript:;' onclick='loadTemplate(mytemplates.activation_email_temp);' title='resend the activation email'>resend the activation email</a>?.",city_not_found:"We don't have the city you entered in our system. Please check the spelling. If the city is still not recognized please select the largest city near you. We are constantly adding new locations, so keep an eye out for your city, or email us at support@allvoices.com.",multi_upload_image_heading:" error(s) prohibited this image from being saved",friend_request_success:"Friend Request Sent!",friend_request_error:"There was an error sending your friend request. We are both sad and puzzled by this. Try again in a couple of minutes?",friend_confirm_success:"Saved!",url_feed_error_heading:" error(s) prohibited this URL/RSS feed from being saved",blog_link_error_heading:" error(s) prohibited this blog post link from being saved",image_error_heading:" error(s) prohibited this user from uploading/saving this image.",video_error_heading:" error(s) prohibited this user from uploading/saving this video.",update_event_title_label:" error(s) prohibited this user from being saving the title.",update_event_summary_label:" error(s) prohibited this user from being saving the Summary.",event_cancelled_warning:"Your event is not saved yet.",spellchecker_contents:"Do you want to spellcheck your contents?",forgot_password_error_heading:" error(s) prohibited this user to continue the forgot password process",blank_question_answer:"Please select any given option or enter some text in textbox if provided in ",session_time_out:" Your active session is timeout and you have to login again",multi_upload_video_heading:" error(s) prohibited this video from being saved",login_error_heading:" error(s) prohibited this user from being logged in",blogs_error_heading:" error(s) prohibited this blog from performing specified operation",signup_username_free:"The username is available",signup_error_heading:" error(s) caused your registration to fail",signup_country_not_found:"There is no such country.",signup_city_not_found:"There is no such city in that country",signup_username_unavailable:"The username is unfortunately unavailable",limit_exceed:"Your bookmark limit exceeds. Please remove some bookmarks from your profile and try again later.",bookmark_add_error:"Oops, something went wrong while saving your bookmark.",bookmark_remove_error:"Oops, something went wrong while removing your bookmark.",blank_multi_email:"Please enter email adresses.#",blank_city:"Please enter a valid city name",enter_email_address:"Enter email addresses separated by commas",wrong_email_address:"One of the email addresses you have entered is incorrect. Please correct it and try again.",wrong_email:"Please enter correct email address",digits_only:"Please use numbers only in this field. please avoid spaces or other characters such as dots or commas.",blank_country_code:"Country code should not be empty.#",blank_title:"Title cannot be empty.",url_get_content:" error(s) prohibited in getting content from given url.",wrong_email_heading:" error(s) prohibited this user from sharing content.",unknown_img_format:"This image format is not supported yet",blank_email:"You need to specify your email.#",confirm_country_code:"Please confirm country code.#",blank_body:" Body cannot be empty.",url_exist_blacklist:"The URL you entered is blacklisted and cannot be used. Please try another URL",record_not_found:"Could not find the related record.Please try again later",blank_cellphone:"Cellphone should not be empty.#",blank_country:"Please enter a valid country name",blank_url:"URL should not be empty",blank_description:" Description cannot be empty.",url_not_responding:"allvoices was not able to pull any article from the URL you gave us.<br/>Want to fill this out anyway?",no_tag_found:"No suggested tags found.",wrong_cellphone:"Please enter a valid country code and cellphone using numeric values.#",blank_state:"Please enter a valid state name",wrong_url:"Please enter a correctly formatted URL address such as http://www.domain.com",blank_education:"Please select the education in the list",unable_to_retrieve_summary:"We were unable to retrieve summary from the url. Please type in a summary.",wrong_pincode:"Please enter a valid pincode.#",state_not_found:"Please enter a valid state.",blank_password:"Password cannot be empty",blank_agerange:"Please select the age range",satisfied_with_summary:"Are you satisfied with the title and summary we found? If not, you can edit either and then submit.",external_blog_error_heading:" error(s) prohibited this external blog link from being saved",favourite_error_heading:" error(s) prohibited this favourite site from being saved",links_list_error_heading:" error(s) prohibited this list from being saved",update_profile_success_pincode_msg_email:"Now, your email is verified successfully",update_profile_error_heading:" error(s) prohibited this profile from being saved",update_profile_email_success_pincode_msg:"Now, your email is verified successfully",update_profile_success_sendverification:"SMS is successfully sent",clear_history_confirmation:"Are you sure you want to clear your browsing history",update_profile_invitation_error_heading:" error(s) prohibited this invitation from being sent",update_profile_success_sendverification_email:"Email is successfully sent",toggle_history_confirmation:"Are you sure you want to toggle history feature",update_profile_confirm_phone:"Please confirm your Cellphone.#",update_profile_blank_pincode:"The pincode cannot be empty",update_profile_confirm_email:"Please confirm your email.#",update_profile_pincode_error_heading:" error prohibited this cellphone from being verified",update_profile_cellphone_error_heading:" error prohibited us from sending the pincode via SMS",update_profile_success_pincode_msg:"Now, your cellphone is verified successfully",update_profile_email_error_heading:" error prohibited us from emailing the pincode",request_failed_message:"Request is failed, Please try again later.",invalid_submitted_url:"You did not enter a valid url",blank_submitted_url:"Please enter a url",rss_form_title:"Upload rss feed",no_rumor_found:"No rumors found",rss_added_success:"URL/RSS feed is added successfully",file_size_exceeded:"Video file could not be uploaded as it exceeded the size limit of 45MB on allvoices.com.",firsthand_accounts_blank:"<strong>Contribute first hand accounts related to this news event if you are there.</strong> <br/><br/>A first hand account may be as little as a picture, a short comment, or a video.",burying_event:"Please wait while we are burying this event",abuse_report_spinner:"Saving abuse report",invite_success_message:"Your news report has been shared successfully",eventimages_cta:"Do you have a picture? Send it to us.",question_report_form:"Be the first one to ask question on this news event and get real answers.",div_event_update_spinner:"Please wait while we are updating the news event.",unsupported_format:"This video format is not supported.",localnewstories_blank:"We've not found any matching news stories yet! <br/><br/>Contribute a link to a news story related to this report by clicking ADD A NEWS STORY above.",burying_people:"Ashes to ashes, dust to dust...",abuse_report_complete:"Your abuse report has been saved",no_events_found:"Sorry, we did not find any reports.",eventvideos_blank:"We've not found any matching videos yet! <br/><br/>Contribute videos related to this news report by clicking UPLOAD VIDEOS above.",qa_form_spinner_display:"Please wait while we save the question",event_failed_to_create:"The news event has been created successfully.",nonyoutube_video:"The URL does not seem to point to a valid YouTube video. Please check the URL and try again.",localnewstories_cta:"Please help us find websites, news sites or any other sites covering this news event.",no_comments:"Be the first to post a comment on this news report and start the discussion.",eventvideos_cta:"Do you have a video related to this news report? Send it to us.",ans_form_spinner_display:"Please wait while we save the answer",user_event_failed_to_create:"Your news event and blog could not be created.",event_id:"We could not find such an event",submit_blog:"Your blog post is published.",blogcontent_blank:"We've not found any matching blogs yet! <br/><br/>Contribute a link to a blog or an article related to this news report by clicking ADD A BLOG POST above.",form_spinner_display:"Please wait while we save your comment",div_image_upload_spinner:"Your image is available on your profile page. It will appear on the rest of the site shortly.",blog_no_country:"There is no such country",user_event_creation_success:"Your news event and blog have been created successfully",div_urls_rss_spinner:"Please wait while we retrieve a summary for the given URL.",blogcontent_cta:"Please tell us your opinion of the news event.",delete_form_spinner_display:"Please wait while we delete your comment",div_video_upload_spinner:"Your video is being processed and will soon appear on the website and on your profile page.",blog_no_city:"There is no such city",user_updates_for_event:"This news event has no contributions so far.",invite_friend_event:"Take a look at my news report on allvoices.com!",eventimages_blank:"We've not found any matching images yet! <br/><br/>Contribute images related to this news report by clicking UPLOAD IMAGES above.",form_table_header:"Enter your comment below",youtube_video_added_success:" video(s) uploaded successfully. Your video(s) have now been published.",video_event_added_failed:"Your news event or video contribution failed",video_profile_added_success:"Your video is published.",blank_video:"Please enter your video",videos_added_successfully:" video(s) uploaded successfully. Thank you for your contribution.",video_event_added_success:"Your news event has been created successfully. Your video is now being processed and will appear on the site shortly.",video_upload_cancelled:"You cancelled the upload of your video.",video_added_success:" video(s) uploaded successfully. Your video is published and it will appear after it has been processed",vid_form_title:"Upload video",save_blog_deleted_success:"Your blog post has been deleted.",blog_find_failed:"Sorry, that blog post does not exist.",blog_published_success:"Thank you for your blog post. Your blog post has now been published.",blog_event_irrelevant:"Your blog was not relevant to the event.",blog_profile_published_success:"Your blog post is now published.",blog_event_failed:"News event and blog creation failed.",blog_draft_success:"The blog post draft has now been saved.",blog_deleted_failed:"Record could not deleted due to unknown reasons",firsthand_accounts_blank:"<strong>Contribute first hand accounts about this person if you are at his or hers current where-abouts.</strong> <br/><br/>A first hand account may be as little as a picture, a short comment, or a video.",user_updates_for_person:"This person has no contributions so far.",div_person_update_spinner:"Please wait while we updating the person",no_person_found:"Sorry, we did not find any people.",no_comment:"Be the first one to post a comment on this person and start the discussion.",form_title_update:"Update this person.",person_id:"Could not find person with specified id",form_title:"Report your news",form_title_profile:"Do you want to create a news event using your ",form_title_update1:"Update this news event",img_form_title:"Upload images",invitation_sent:"Your invitation to allvoices has been sent.",invitation_progress:"Your invitation is being sent.",share_content_mail:"Email has been sent successfully",edit_event_update_heading:"Please wait while we send a summary of this news event",edit_event_title_heading:"Please wait while we send title of this content",edit_event_summary:"Please enter summary of this event",edit_event_title:"Please enter title of this news event",rumor_update_summary_success:"Summary is updated successfully",event_update_title_success:"Title has been updated successfully",edit_rumor_update_heading:"Please wait while we save the summary for this rummor",event_update_summary_success:"Summary has been updated successfully",edit_rumor_summary:"Please enter a new summary for this rumor",share_spinner_display:"Please wait while we send your shared content",event_update_summary_failure:"Summary has not been updated",no_cellphone_pincode_found:"The cellphone number or pincode does not exist in our records.",no_cell_phone:"Please enter a cellphone number.",no_sms_sent:"The SMS could not be sent. Please try again later.",no_email_sent:"The email could not be sent. Please try again later.",sms_pre_text:"Your%20allvoices%20verification%20code%20is%20XXXXX.%20Std%20charges%20may%20apply%20to%20receive%20messages.%20For%20info%20text%20HELP%2C%20or%20to%20cancel%20text%20STOP%20to%20864237",no_email_pincode_found:"The email address or pincode does not exist in our records.",cell_phone_unique:"This number already taken in use. Please check the cellphone number or choose another number.",edit_title:"Edit your blog post",write_title:"Write your blog post",search_results_empty:"Your search didn't return any results. Try to search for something else.",people_results_empty:"Your search didn't return any results. Try to search for something else.",map_top:"Click on the shapes, browse or zoom the map to discover what's going on in the world.",no_results:"no results. Try to search for something else and broaden your search.",image_event_failed:"News event & image upload contribution failed",image_upload_failed:"The image could not be uploaded.",images_upload_cancelled:"You cancelled the upload of your images.",image_event_thumb:"The event image has been changed successfully.",image_added_success:" image(s) uploaded successfully. Your image(s) have now been published.",image_person_thumb:"The person image has been changed successfully.",image_profile_added_success:"Your image is published.",image_event_added_success:"Your news event has now been created. The image is also uploaded and attached to it.",blank_image:"Please enter your image",image_upload_progress:"Image is being uploaded, Please wait for finishing of uploading.",video_event_thumb:"The news event video has been changed successfully. It will appear after it has been processed.",registration_content_header:"By completing this registration, you will able to report or post news, voice your opinion, share stories, maintain and display your profile.",partial_registration_content_header:"Fill in the form below to start your registration",complete_partial_registration_content_header:"Your email is now activated. Please fill the following to complete your registration.",add_softrequired_information_header:"For your account security and to help us learn more about you, please provide the following to post reports",login_form_label:"Please sign in to start contributing!",login_form_label_register_page:"Already have an account with allvoices?",create_event_message:"You must register in order to create or contribute to an event.<br/><br/> An event is a collection of stories, images and videos organized around a topic. <br/><br/>You create an event by writing a title and a short description for it. We add relevant media and blogs to complete the event's coverage. <br/><br/>Once the event is created, you can share it with your friends, encouraging others to add their perspective. All your events will be featured on your profile page.",ebcontent:"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus in massa. Morbi viverra volutpat leo. Sed vulputate neque. In id quam. Vestibulum non lacus. Praesent pulvinar quam. Cras sagittis felis sit amet felis. Vivamus vitae nisl. Aenean adipiscing risus at enim. Etiam massa. Sed ac pede. Phasellus a pede. Curabitur congue, nunc vitae sollicitudin auctor, elit nisl adipiscing nulla, euismod sollicitudin dolor velit non lacus. Sed pretium elit sed ipsum. Nulla facilisi. Ut pulvinar.",ebh_left:"Already Registered?",login_form_label:"Please enter your login information to continue.",no_answer_found:"Sorry, we did not find any answers. You can be the first one to answer the question.",answer_saved_success:"Your answer has been saved successfully",answer_saved_failed:"Your answer could not be saved",delete_links_list_item_failed:"External link could not be deleted",blog_deleting_progressbar:"Deleting your blog post... ",delete_favourite_failed:"Favourite link could not be deleted",vid_deleting_progressbar:"deleting Video",no_img_posted_by_user:"You've not posted any image yet.",less_privilege_links_list_item:"You do not have right to delete this link.",blog_editing_success:"Your blog post is now updated!",less_privilege_favourite:"You dont have right to delete this favourite link",content_not_found:"content not found",img_deleted_success:"Image will be deleted soon",delete_links_list_failed:"External list could not be deleted",blog_editing_failed:"Sorry, we could not save your edited blog post.",history_limit_exceeded:"Your history items are over the limit of 100, we will delete the oldest history item as new ones come in",user_history_not_found:"No history item found",img_deleted_failed:"Image could not be deleted.Try again later.",less_privilege_links_list:"You do not have right to delete this list.",blog_editing_progressbar:"Saving your edited blog post... ",no_events_found_profile:" does not have any reports.",content_has_error:"User Content Error.",image_deleting_progressbar:"Deleting your image... ",delete_external_blog_failed:"External Blog could not be deleted",vid_deleted_success:"Video will be deleted soon",editing_blog:"Your blog post will be available on your profile page immediately.<br/><br/>There might be a short delay before it appears on the rest of the site.",blog_deleted_success:"Your blog post has been deleted successfully.",less_privilege_external_blog:"You do not have right to delete this blog.",vid_deleted_failed:"Video could not be deleted. Try again later.",blog_deleted_failed:"Your blog post could not be deleted.Try again later.",low_bandwidth_map_not_available:"For the no map version, the map is not available. Please use the search box above for navigation.",div_processing_spinner:"Please wait while we are processing.",no_comment_found:"Be the first one to post a comment on this content and start the discussion.",abuse_reason_label:"Please specify the reason for the abuse report in the dropdown below. A copy of this page will be sent to allvoices.",share_content_multi_email:"Share With Your Friends",no_question_posted:"No one has posted any question yet. Be the first one to ask a question on this content.",save_tag_request_failed:"save image request is failed, please try again later",forgot_duplicate_request:"You already clicked the forgot button. We are processing, please wait...",checkusername_request_failed:"checking UserName request is failed",blogs_duplicate_request:"You already clicked the publish blog button. We are processing, please wait...",save_videos_duplicate_request:"You already clicked the save video button. We are processing, please wait...",forgot_request_failed:"forgot request is failed, please try again later",change_captcha_duplicate_request:"We are changing captcha image, please wait ",blogs_request_failed:"your publish blog request is failed, please try again later",login_duplicate_request:"You already clicked the login button. We are logging you in right now...",save_videos_request_failed:"save video tag request is failed",activation_duplicate_request:"You already clicked the activation button. We are processing, please wait...",change_captcha_request_failed:"captcha image request failed, please open signup again.",tag_images_duplicate_request:"You already clicked the tag images button. We are processing, please wait...",login_request_failed:"login request failed, please try again later",tag_videos_duplicate_request:"You already clicked the save videos button. We are processing, please wait...",activation_request_failed:"activation request is failed, please try again later",tag_images_request_failed:"tag images request is failed, please try again later",signout_duplicate_request:"You already clicked the signout button. We are signing out you right now...",tag_videos_request_failed:"tag video request is failed",signup_duplicate_request:"You already clicked the signup button. We are processing, please wait...",save_tag_duplicate_request:"You already clicked the save image button. We are processing, please wait...",signout_request_failed:"signout request is failed, please try again later",checkusername_duplicate_request:"We are checking UserName whether its available or not, please wait..",signup_request_failed:"Signup request is failed, please try again later",alpha_feedback:"We want your feedback! Please tell us what you think about our beta: ",searchbox:"news, people, contributors",locationbox:"search countries, cities",page_title:"allvoices - events, people, places that matter - tell us your news"};try{var detect=navigator.userAgent.toLowerCase();var OS,browser,version,total,thestring}catch(ex){log_exceptions("Code Block :- detecting user browser "+ex.message)}function getBrowserInfo(){if(checkIt("konqueror")){browser="Konqueror";OS="Linux"}else{if(checkIt("safari")){browser="Safari"}else{if(checkIt("omniweb")){browser="OmniWeb"}else{if(checkIt("opera")){browser="Opera"}else{if(checkIt("webtv")){browser="WebTV"}else{if(checkIt("icab")){browser="iCab"}else{if(checkIt("msie")){browser="Internet Explorer"}else{if(!checkIt("compatible")){browser="Netscape Navigator";version=detect.charAt(8)}else{browser="An unknown browser"}}}}}}}}if(!version){version=detect.charAt(place+thestring.length)}if(!OS){if(checkIt("linux")){OS="Linux"}else{if(checkIt("x11")){OS="Unix"}else{if(checkIt("mac")){OS="Mac"}else{if(checkIt("win")){OS="Windows"}else{OS="an unknown operating system"}}}}}}function checkIt(a){place=detect.indexOf(a)+1;thestring=a;return place}var RedBox={initialize:function(){this.content_div_id=""},showInline:function(a){this.showOverlay(a);if(browser=="Internet Explorer"){$("RB_window").show()}else{new Effect.Appear("RB_window",{duration:0.4})}this.cloneWindowContents(a)},showInlineNoGrey:function(a){this.showOverlayClear();if(browser=="Internet Explorer"){$("RB_window").show()}else{new Effect.Appear("RB_window",{duration:0.4,queue:"end"})}this.cloneWindowContents(a);Element.scrollTo("RB_window")},showInlineTop:function(a){this.showOverlay(a);if(browser=="Internet Explorer"){$("RB_window").show()}else{new Effect.Appear("RB_window",{duration:0.4})}this.cloneWindowContents(a,"top")},loading:function(){this.showOverlay();Element.show("RB_loading");this.setWindowPosition()},addHiddenContent:function(a){this.removeChildrenFromNode($("RB_window"));this.moveChildren($(a),$("RB_window"));Element.hide("RB_loading");new Effect.Appear("RB_window",{duration:0.4,queue:"end"});this.setWindowPosition()},close:function(){try{new Effect.Fade("RB_window",{duration:0.4});new Effect.Fade("RB_overlay",{duration:0.4});$(this.content_div_id).remove();if(browser=="Safari"){}this.showSelectBoxes()}catch(a){log_exceptions("Methods :- redbox        close "+a.message)}},showOverlay:function(a){if($("RB_redbox")){Element.update("RB_redbox","");new Insertion.Top($("RB_redbox"),'<div id="RB_window" style="display: none;"></div><div id="RB_overlay" style="display: none;"></div>')}else{new Insertion.Top(document.body,'<div id="RB_redbox" align="center"><div id="RB_window" style="display: none;"></div><div id="RB_overlay" style="display: none;"></div></div>')}new Insertion.Bottom("RB_redbox",'<div id="RB_loading" style="display: none"></div>');this.setOverlaySize();this.hideSelectBoxes(a);new Effect.Appear("RB_overlay",{duration:0.4,to:0.6,queue:"end"})},showOverlayClear:function(){if($("RB_redbox")){Element.update("RB_redbox","");new Insertion.Top($("RB_redbox"),'<div id="RB_window" style="display: none;"></div><div id="RB_overlay" style="display: none;"></div>')}else{new Insertion.Top(document.body,'<div id="RB_redbox" align="center"><div id="RB_window" style="display: none;"></div><div id="RB_overlay" style="display: none;"></div></div>')}new Insertion.Bottom("RB_redbox",'<div id="RB_loading" style="display: none"></div>');this.setOverlaySize()},setOverlaySize:function(){if(window.innerHeight&&window.scrollMaxY){yScroll=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){yScroll=document.body.scrollHeight}else{yScroll=document.body.offsetHeight}}$("RB_overlay").style.height=yScroll+"px"},setWindowPosition:function(e){var b=this.getPageSize();$("RB_window").style.width="auto";$("RB_window").style.height="auto";var d=Element.getDimensions($("RB_window"));var c=d.width;var a=d.height;$("RB_window").style.top=(this.getScrollY()+((b[1]-a)/2))+"px";getBrowserInfo();if(browser!="Internet Explorer"){$("RB_window").style.left=((b[0]-20-c)/2)+"px"}else{$("RB_window").style.left=((b[0]-c)/2)+"px"}if(e=="top"){$("RB_window").style.top="20px"}else{$("RB_window").style.top=(this.getScrollY()+((b[1]-a)/2))+"px"}},getScrollY:function(){scrOfY=0;if(typeof(window.pageYOffset)=="number"){scrOfY=window.pageYOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop}}}return scrOfY},getPageSize:function(){var c=document.documentElement;var a=window.innerWidth||self.innerWidth||(c&&c.clientWidth)||document.body.clientWidth;var b=window.innerHeight||self.innerHeight||(c&&c.clientHeight)||document.body.clientHeight;arrayPageSize=new Array(a,b);return arrayPageSize},removeChildrenFromNode:function(a){while(a.hasChildNodes()){a.removeChild(a.firstChild)}},moveChildren:function(b,a){while(b.hasChildNodes()){a.appendChild(b.firstChild)}},cloneWindowContents:function(f,d){try{this.content_div_id=f;var a=document.getElementById(f);var b=a.cloneNode(true);b.innerHTML=a.innerHTML;if(browser=="Safari"){}b.style.display="block";$("RB_window").appendChild(b);if(!d){this.setWindowPosition()}else{this.setWindowPosition(d)}}catch(c){log_exceptions("Method :- cloneWindowContents of redbox :: "+c.message)}},hideSelectBoxes:function(c){var a=document.getElementsByTagName("select");for(i=0;i!=a.length;i++){a[i].style.visibility="hidden"}var b=document.getElementById(c).getElementsByTagName("select");for(i=0;i!=b.length;i++){b[i].style.visibility="visible"}},showSelectBoxes:function(){selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="visible"}}};var InfoWindow={showInline:function(a){this.showOverlay();new Effect.Appear("IW_window",{duration:0.4,queue:"end"});this.cloneWindowContents(a);Element.scrollTo("IW_window")},loading:function(){this.showOverlay();Element.show("IW_loading");this.setWindowPosition()},addHiddenContent:function(a){this.removeChildrenFromNode($("IW_window"));this.moveChildren($(a),$("IW_window"));Element.hide("IW_loading");new Effect.Appear("IW_window",{duration:0.4,queue:"end"});this.setWindowPosition()},close:function(){new Effect.Fade("IW_window",{duration:0.4});new Effect.Fade("IW_overlay",{duration:0.4})},showOverlay:function(){if($("IW_redbox")){Element.update("IW_redbox","");new Insertion.Top($("IW_redbox"),'<div id="IW_window" style="display: none;"></div><div id="IW_overlay" style="display: none;"></div>')}else{new Insertion.Top(document.body,'<div id="IW_redbox" align="center"><div id="IW_window" style="display: none;"></div><div id="IW_overlay" style="display: none;"></div></div>')}new Insertion.Bottom("IW_redbox",'<div id="IW_loading" style="display: none"></div>');this.setOverlaySize();new Effect.Appear("IW_overlay",{duration:0.4,to:0.6,queue:"end"})},setOverlaySize:function(){if(window.innerHeight&&window.scrollMaxY){yScroll=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){yScroll=document.body.scrollHeight}else{yScroll=document.body.offsetHeight}}var c=Element.getDimensions($("map"));var a=c.width;var b=c.height;$("IW_overlay").style.height=b+"px";$("IW_overlay").style.width=a+"px";$("IW_overlay").style.top=(24+47*2)+"px"},setWindowPosition:function(){var c=this.getPageSize();var f=Element.getDimensions($("IW_window"));var d=f.width;var a=f.height;var f=Element.getDimensions($("map"));var b=f.width;var e=f.height;$("IW_window").style.top=((24+47*2)+e/2-a/2)+"px"},getPageSize:function(){var c=document.documentElement;var a=window.innerWidth||self.innerWidth||(c&&c.clientWidth)||document.body.clientWidth;var b=window.innerHeight||self.innerHeight||(c&&c.clientHeight)||document.body.clientHeight;arrayPageSize=new Array(a,b);return arrayPageSize},removeChildrenFromNode:function(a){while(a.hasChildNodes()){a.removeChild(a.firstChild)}},moveChildren:function(b,a){while(b.hasChildNodes()){a.appendChild(b.firstChild)}},cloneWindowContents:function(b){var a=$(b).cloneNode(true);a.style.display="block";$("IW_window").appendChild(a);this.setWindowPosition()},hideSelectBoxes:function(){selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="hidden"}},showSelectBoxes:function(){selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="visible"}}};var loading_map=true;function initFlash(){var a=new SWFObject("/masala.swf","masala_swf","100%","100%","9","#000000");a.useExpressInstall("expressinstall.swf");a.addParam("quality","high");a.addParam("AllowScriptAccess","always");a.addParam("wmode","opaque");a.addParam("menu","false");if(readCookie("northeast")==null||readCookie("northeast")==""||readCookie("southwest")==null||readCookie("southwest")==""){reset_map_cookies()}a.addVariable("roadVersion","w2.86");a.addVariable("hybridVersion","w2t.86");a.addVariable("aerialVersion","35");a.addVariable("northeast",readCookie("northeast"));a.addVariable("southwest",readCookie("southwest"));a.addVariable("provider","Google Marble Hybrid");a.addVariable("throttleSpeedMS","500");a.addVariable("requestsPerCycle","10");a.addVariable("debug","false");a.addVariable("serverpath","");a.addVariable("feedpath","/mapservice/map_feed");a.addVariable("refreshPanDelta","75");a.addVariable("blueMarblePath","http://s3.amazonaws.com/com.modestmaps.bluemarble/");a.addVariable("markerSpread","3,5,8,12,16,20,23,26,28,30,31,32,33,34,35,36,37,38,39,40");a.addVariable("doubleClickThrottle","2500");if(readCookie("returning")!="true"){setCookie("returning","true")}else{a.addVariable("message","/welcome")}if(readCookie("low_bandwidth_version")!="yes"){a.write("map")}}function getFlashMovie(b){try{if(navigator.appName.indexOf("Microsoft")!=-1){return window[b]}else{return document[b]}}catch(a){log_exceptions(" Method:- getFlashMovie "+a.message)}return null}function change_category(a){change_category_selection(a);try{switch(a){case -1:getFlashMovie("masala_swf").setCategory("all");break;case 1:getFlashMovie("masala_swf").setCategory("political");break;case 4:getFlashMovie("masala_swf").setCategory("business");break;case 6:getFlashMovie("masala_swf").setCategory("conflict_tragedy");break;case 5:getFlashMovie("masala_swf").setCategory("science");break;case 2:getFlashMovie("masala_swf").setCategory("sports");break;case 3:getFlashMovie("masala_swf").setCategory("entertainment");break}}catch(b){log_exceptions(" Method:- change_category "+b.message)}return true}function change_type(b){try{switch(b){case -1:getFlashMovie("masala_swf").setType("all");break;case 0:getFlashMovie("masala_swf").setType("events");break;case 1:getFlashMovie("masala_swf").setType("rumors");break;case 2:getFlashMovie("masala_swf").setType("people");break}change_type_selection(b)}catch(a){log_exceptions(" Method:- change_type "+a.message)}return true}function change_order(a){try{switch(a){case 1:getFlashMovie("masala_swf").setSort("active");break;case 2:getFlashMovie("masala_swf").setSort("recent");break}change_order_selection(a)}catch(b){log_exceptions(" Method:- change_order "+b.message)}return true}function reloadFlash(){try{getFlashMovie("masala_swf").reloadFlash("esort=1&rsort=2&psort=3&epage=4&rpage=5&ppage=6&masterpage=7");new Ajax.Request("/map/save_map_marker_click?map_action=reload",{method:"get"})}catch(a){log_exceptions(" Method:- reloadFlash "+a.message)}}function onFlashMapMove(e,a,d,c){new Ajax.Request("/map/save_map_marker_click?map_action=moved",{method:"get"});setCookie("northeast",e+","+c);setCookie("southwest",d+","+a);var b=readCookie("type_category_filter");if(b!=null){an_arr=b.split(",");oRequestHandlers[0].setParameters(1,an_arr[0],an_arr[1],an_arr[2])}oRequestHandlers[0].clear_location=true;oRequestHandlers[0].update("all")}function mapMarkerClick(a){new Ajax.Request("/map/save_map_marker_click?map_action=marker_click&url="+escape(a),{method:"get"})}function map_resize(a){if(a=="expand"){new Effect.Scale("map",MAP_EXPANDED_HEIGHT,{scaleY:true,scaleX:false});setCookie("clickstream_external_url","bigger_map");maintain_map_state("bigmap")}else{new Effect.Scale("map",MAP_DEFAULT_HEIGHT,{scaleY:true,scaleX:false});setCookie("clickstream_external_url","smaller_map");maintain_map_state("smallmap")}};var modestMaps={copyrightCallback:function(a){},copyright:function(f,c,d,h,a,e,g,b){switch(f){case"BLUE_MARBLE":this.copyrightCallback("Image courtesy of NASA");break;case"OPEN_STREET_MAP":this.copyrightCallback("Image courtesy of OpenStreetMap");break;case"MICROSOFT_ROAD":this.microsoft.copyright("road",h,a,e,g,b);break;case"MICROSOFT_AERIAL":this.microsoft.copyright("aerial",h,a,e,g,b);break;case"MICROSOFT_HYBRID":this.microsoft.copyright(undefined,h,a,e,g,b);break;case"GOOGLE_ROAD":this.google.copyright("",c,d,e-h,g-a,b);break;case"GOOGLE_AERIAL":this.google.copyright("&t=k",c,d,e-h,g-a,b);break;case"GOOGLE_HYBRID":this.google.copyright("&t=h",c,d,e-h,g-a,b);break}},google:{holders:undefined,addCopyright:function(b){if(!this.holders||!b){return}var c=true;for(var a=0;a<this.holders.length;a+=1){if(b==this.holders[a]){c=false}}if(c){this.holders.push(b);modestMaps.copyrightCallback(this.holders.join(", "))}},copyright:function(b,e,f,g,a,d){this.holders=["&copy; Google"];var c=document.createElement("script");c.src="http://maps.google.com/maps?spn="+g+","+a+"&z="+d+"&vp="+e+","+f+"&ev=p"+b;document.getElementsByTagName("head")[0].appendChild(c)}},microsoft:{holders:{microsoft:"&copy; 2006 Microsoft Corporation",navteq:"&copy; 2006 NAVTEQ",and:"&copy; AND",mds:"&copy; 2006 MapData Sciences Pty Ltd",zenrin:"&copy; 2006 Zenrin",nasa:"Image courtesy of NASA",harris:"&copy; Harris Corp, Earthstar Geographics LLC",usgs:"Image courtesy of USGS",earthdata:"&copy; EarthData",getmap:"&copy; Getmapping plc",geoeye:"&copy; 2006 GeoEye",pasco:"&copy; 2005 Pasco"},tracts:[["road","microsoft",1,20,-90,-180,90,180],["road","navteq",1,9,-90,-180,90,180],["road","navteq",10,19,16,-180,90,-50],["road","navteq",10,19,27,-32,40,-13],["road","navteq",10,19,35,-11,72,20],["road","navteq",10,19,21,20,72,32],["road","navteq",10,17,21.92,113.14,22.79,114.52],["road","navteq",10,17,21.73,119.7,25.65,122.39],["road","navteq",10,17,0,98.7,8,120.17],["road","navteq",10,17,0.86,103.2,1.92,104.45],["road","and",10,19,-90,-180,90,180],["road","mds",5,17,-45,111,-9,156],["road","mds",5,17,-49.7,164.42,-30.82,180],["road","zenrin",4,18,23.5,122.5,46.65,151.66],["road","microsoft",1,20,-90,-180,90,180],["aerial","nasa",1,8,-90,-180,90,180],["aerial","harris",9,13,-90,-180,90,180],["aerial","usgs",14,19,17.99,-150.11,61.39,-65.57],["aerial","earthdata",14,19,21.25,-158.3,21.72,-157.64],["aerial","earthdata",14,19,39.99,-80.53,40.87,-79.43],["aerial","earthdata",14,19,34.86,-90.27,35.39,-89.6],["aerial","earthdata",14,19,40.6,-74.18,41.37,-73.51],["aerial","getmap",14,19,49.94,-6.35,58.71,1.78],["aerial","geoeye",14,17,44.43,-63.75,45.06,-63.45],["aerial","geoeye",14,17,45.39,-73.78,45.66,-73.4],["aerial","geoeye",14,17,45.2,-75.92,45.59,-75.55],["aerial","geoeye",14,17,42.95,-79.81,44.06,-79.42],["aerial","geoeye",14,17,50.35,-114.26,51.25,-113.82],["aerial","geoeye",14,17,48.96,-123.33,49.54,-122.97],["aerial","geoeye",14,17,-35.42,138.32,-34.47,139.07],["aerial","geoeye",14,17,-32.64,115.58,-32.38,115.85],["aerial","geoeye",14,17,-34.44,150.17,-33.27,151.49],["aerial","geoeye",14,17,-28.3,152.62,-26.94,153.64],["aerial","pasco",14,17,23.5,122.5,46.65,151.66]],copyright:function(c,d,j,f,l,m){var h=this.tracts;var b=[];var g={};for(var e=0;e<h.length;e+=1){var k=h[e];if((k[0]==c||!c)&&k[2]<=m&&m<=k[3]&&k[4]<=f&&d<=k[6]&&k[5]<=l&&j<=k[7]){g[k[1]]=true}}for(var a in g){b.push(this.holders[a])}modestMaps.copyrightCallback(b.join(", "))}}};GAddCopyright=function(k,h,j,d,c,f,l,i){modestMaps.google.addCopyright(i)};GVerify=function(a){};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(m,b,n,e,j,k,g,f,d,l){if(!document.getElementById){return}this.DETECT_KEY=l?l:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(m){this.setAttribute("swf",m)}if(b){this.setAttribute("id",b)}if(n){this.setAttribute("width",n)}if(e){this.setAttribute("height",e)}if(j){this.setAttribute("version",new deconcept.PlayerVersion(j.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(k){this.addParam("bgcolor",k)}var a=g?g:"high";this.addParam("quality",a);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var i=(f)?f:window.location;this.setAttribute("xiRedirectUrl",i);this.setAttribute("redirectUrl","");if(d){this.setAttribute("redirectUrl",d)}};deconcept.SWFObject.prototype={useExpressInstall:function(a){this.xiSWFPath=!a?"expressinstall.swf":a;this.setAttribute("useExpressInstall",true)},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[c.length]=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");this.setAttribute("swf",this.xiSWFPath)}b='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';b+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var f=this.getParams();for(var e in f){b+=[e]+'="'+f[e]+'" '}var d=this.getVariablePairs().join("&");if(d.length>0){b+='flashvars="'+d+'"'}b+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}b='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';b+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var c=this.getParams();for(var e in c){b+='<param name="'+e+'" value="'+c[e]+'" />'}var a=this.getVariablePairs().join("&");if(a.length>0){b+='<param name="flashvars" value="'+a+'" />'}b+="</object>"}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 f=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var a=navigator.plugins["Shockwave Flash"];if(a&&a.description){f=new deconcept.PlayerVersion(a.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var b=1;var c=3;while(b){try{c++;b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+c);f=new deconcept.PlayerVersion([c,0,0])}catch(d){b=null}}}else{try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(d){try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");f=new deconcept.PlayerVersion([6,0,21]);b.AllowScriptAccess="always"}catch(d){if(f.major==6){return f}}try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(d){}}if(b!=null){f=new deconcept.PlayerVersion(b.GetVariable("$version").split(" ")[1].split(","))}}}return f};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.major<a.major){return false}if(this.major>a.major){return true}if(this.minor<a.minor){return false}if(this.minor>a.minor){return true}if(this.rev<a.rev){return false}return true};deconcept.util={getRequestParameter:function(c){var d=document.location.search||document.location.hash;if(c==null){return d}if(d){var b=d.substring(1).split("&");for(var a=0;a<b.length;a++){if(b[a].substring(0,b[a].indexOf("="))==c){return b[a].substring((b[a].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var b=document.getElementsByTagName("OBJECT");for(var c=b.length-1;c>=0;c--){b[c].style.display="none";for(var a in b[c]){if(typeof b[c][a]=="function"){b[c][a]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(a){return document.all[a]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var AutoComplete=Class.create({selector:null,input:null,_timeout:null,visible:false,drawn:false,_hideTimeout:null,options:null,initialize:function(a,b){this.locked=false;this.clearFunc=b.clearFunc;this.loadFunc=b.loadFunc;this.doneFunc=b.doneFunc;this.noneFunc=b.noneFunc;this.input=$(a);this.input.setAttribute("autocomplete","off");this.options=new AutoComplete.Options(b||{});this.last_call_params="";if(!this.input){alert("No input field/binding field given or found")}this.selector=document.createElement("select");Event.observe(this.input,"focus",this._onInputFocus.bindAsEventListener(this));Event.observe(this.input,"keyup",this._onInputKeyUp.bindAsEventListener(this));Event.observe(this.input,"blur",this._onInputBlur.bindAsEventListener(this));Event.observe(this.selector,"blur",this._onSelectorBlur.bindAsEventListener(this));Event.observe(this.selector,"focus",this._onSelectorFocus.bindAsEventListener(this));Event.observe(this.selector,"click",this._onSelectorChange.bindAsEventListener(this));Event.observe(window,"resize",this._reposition.bind(this));Event.observe(window,"scroll",this._reposition.bind(this))},_onInputFocus:function(a){this._onSelectorFocus(a)},_onSelectorBlur:function(a){this._onInputBlur(a)},_onInputBlur:function(a){this._hideTimeout=setTimeout(this._checkOnBlur.bind(this),100)},_checkOnBlur:function(){this._hideTimeout=null;this.hide()},_onInputKeyUp:function(a){this._suggest(a)&&Event.stop(a)},_onInputKeyDown:function(a){},_onSelectorFocus:function(a){if(this._hideTimeout){clearTimeout(this._hideTimeout);this._hideTimeout=null}},_onSelectorChange:function(a){this.select()},draw:function(){if(this.drawn){return}if(this.options.cssClass){this.selector.className=this.options.cssClass}Element.setStyle(this.selector,{display:"none",position:"absolute",width:this.input.offsetWidth+(this.options.offsetWidth||0)+"px"});if(this.options.inputLocation=="redbox"){$("RB_redbox").appendChild(this.selector)}else{document.body.appendChild(this.selector)}this.input.autocomplete="off";this.drawn=true},hide:function(){if(!this.drawn||!this.visible){return}this.visible=false;if(window.Scriptaculous){new Effect.BlindUp(this.selector,{duration:this.options.delay,queue:"end",afterFinish:function(a){Element.setStyle(this.selector,{display:"none"});this.selector.options.length=0;setTimeout(this._restoreFocus.bind(this),50)}.bind(this)})}else{Element.setStyle(this.selector,{display:"none"});setTimeout(this._restoreFocus.bind(this),50)}},_restoreFocus:function(){this.input.focus()},show:function(){if(!this.drawn){this.draw()}var a=null;if(this.selector.options.length){if(window.Scriptaculous){new Effect.BlindDown(this.selector,{duration:this.options.delay,queue:"end"})}else{Element.setStyle(this.selector,{display:"inline"})}this._reposition();this.visible=true}},_cancelTimeout:function(){if(this._timeout){clearTimeout(this._timeout);this._timeout=null}},_findMatch:function(){try{var c=false;var e=null;if(this.loadFunc){e=this.loadFunc();if(this.last_call_params!=e.parameters){this.last_call_params=e.parameters;return c}}if(this.selector.options.length!=0){var d=this.input.value.replace(/^\s+|\s+$/g,"");for(i=0;i<this.selector.options.length;i++){var b=this.selector.options[i].innerHTML;if(b.substr(0,d.length).toLowerCase()==d.toLowerCase()){c=true;this.selector.selectedIndex=i;break}}}return c}catch(a){log_exceptions(" Method: - _findMatch "+a.message)}},_suggest:function(d){if(this.locked){return false}if(d){var c=Event.keyPressed(d)}else{var c=65}this._cancelTimeout();var b=[20,16,17,91,121,116,122,123,124,125,126,127,128,129,130,131,132,45,36,35,33,34,144,145,44,19,93,];if(b.indexOf(c)>-1){return false}var e=false;switch(c){case Event.KEY_LEFT:case Event.KEY_RIGHT:return false;break;case Event.KEY_BACKSPACE:e=true;case Event.KEY_TAB:case 46:this.cancel();return false;break;case Event.KEY_RETURN:if(this.visible){this.select();return true}return false;break;case Event.KEY_ESC:this.cancel();return true;break;case Event.KEY_UP:case Event.KEY_DOWN:this._interact(d);return true;break;default:break}if(this._findMatch()){this.show();if(this.clearFunc){this.clearFunc()}return false}if(e){return false}if(this.input.value.length>=this.options.threshold){this.cancel();if(this.loadFunc){var a=this.loadFunc();this.action=a.action;this.parameters=a.parameters}if(this.parameters!=""){this._timeout=setTimeout(this._sendRequest.bind(this),1000*this.options.delay)}}return false},_sendRequest:function(){this.locked=true;this._request=new Ajax.Request(this.action,{onComplete:this._process.bind(this),method:this.options.requestMethod,parameters:this.parameters})},_reposition:function(){if(!this.drawn){return}var a=Position.cumulativeOffset(this.input);a.push(a[0]+this.input.offsetWidth);a.push(a[1]+this.input.offsetHeight);Element.setStyle(this.selector,{left:a[0]+(this.options.offsetLeft||0)+"px",top:a[3]+(this.options.offsetTop||0)+"px"})},_process:function(b,a){this.locked=false;this.selector.options.length=0;switch(this.options.resultFormat){case AutoComplete.Options.RESULT_FORMAT_XML:this._parseXML(b.responseXML);break;case AutoComplete.Options.RESULT_FORMAT_JSON:if(!a){a=b.responseText&&b.responseText.isJSON()?b.responseText.evalJSON():null}this._parseJSON(a);break;case AutoComplete.Options.RESULT_FORMAT_TEXT:this._parseText(b.responseText);break;case AutoComplete.Options.RESULT_FORMAT_HTML:this._parseHTML(b.responseText);break;default:alert("Unable to parse result type. Make sure you've set the resultFormat option correctly");break}if(this.selector.options.length>(this.options.size)){this.selector.size=this.options.size}else{this.selector.size=this.selector.options.length>1?this.selector.options.length:2}if(this.selector.options.length){this.selector.selectedIndex=-1;if(this._findMatch()){if(this.doneFunc){this.doneFunc()}this.show()}else{this._suggest()}}else{if(this.noneFunc){this.noneFunc()}this.cancel()}},_parseXML:function(b){var a=null;for(var c=0;c<b.childNodes.length;c++){if(b.childNodes[c].tagName){a=b.childNodes[c].childNodes}}if(!a){alert("Could not parse response XML.");return}for(c=0;c<a.length;c++){suggestion=a.item(c).firstChild.nodeValue;this._addOption(suggestion)}},_parseJSON:function(a){if(!a){a=[]}for(i=0;i<a.length;i++){this._addOption(a[i])}},_parseText:function(b){var a=(b||"").split(/\n/);for(i=0;i<a.length;i++){this._addOption(a[i])}},_parseHTML:function(b){b=(b||"");b=b.replace("<ul>","");b=b.replace("</ul>","");var d=b.split("<li>");for(var a=0;a<d.length;a++){var c=d[a].replace("</li>","");if(c!=""){this._addOption(c)}}},_addOption:function(a){var b=new Option(a,a);Prototype.Browser.IE?this.selector.add(b):this.selector.add(b,null);this.selector.size=(this.selector.options.length>10)?this.selector.options.length+2:10},cancel:function(){this.hide()},select:function(){if(this.clearFunc){this.clearFunc()}if(this.selector.options.length){this.input.value=this.selector.options[this.selector.selectedIndex].value}this.cancel();if(typeof this.options.onSelect=="function"){this.options.onSelect(this.input)}return false},_interact:function(b){if(!this.visible){return}var a=Event.keyPressed(b);if(a!=Event.KEY_UP&&a!=Event.KEY_DOWN){return}var c=this.selector.options.length;if(a==Event.KEY_UP){if(this.selector.selectedIndex==0){this.selector.selectedIndex=this.selector.options.length-1}else{this.selector.selectedIndex--}}else{if(this.selector.selectedIndex==this.selector.options.length-1){this.selector.selectedIndex=0}else{this.selector.selectedIndex++}}}});AutoComplete.Options=Class.create({size:10,cssClass:"autoCompleteSelList",onSelect:null,threshold:1,delay:0.2,requestMethod:"POST",resultFormat:"xml",initialize:function(a){Object.extend(this,a||{})}});Object.extend(AutoComplete.Options,{RESULT_FORMAT_XML:"xml",RESULT_FORMAT_JSON:"json",RESULT_FORMAT_TEXT:"text"});Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_SHIFT:16,KEY_CONTROL:17,KEY_CAPSLOCK:20,KEY_SPACE:32,keyPressed:function(a){return Prototype.Browser.IE?window.event.keyCode:a.which}});var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function encode64(c){var a="";var k,h,f;var j,g,e,d;var b=0;do{k=c.charCodeAt(b++);h=c.charCodeAt(b++);f=c.charCodeAt(b++);j=k>>2;g=((k&3)<<4)|(h>>4);e=((h&15)<<2)|(f>>6);d=f&63;if(isNaN(h)){e=d=64}else{if(isNaN(f)){d=64}}a=a+keyStr.charAt(j)+keyStr.charAt(g)+keyStr.charAt(e)+keyStr.charAt(d)}while(b<c.length);return a}function decode64(c){var a="";var k,h,f;var j,g,e,d;var b=0;c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{j=keyStr.indexOf(c.charAt(b++));g=keyStr.indexOf(c.charAt(b++));e=keyStr.indexOf(c.charAt(b++));d=keyStr.indexOf(c.charAt(b++));k=(j<<2)|(g>>4);h=((g&15)<<4)|(e>>2);f=((e&3)<<6)|d;a=a+String.fromCharCode(k);if(e!=64){a=a+String.fromCharCode(h)}if(d!=64){a=a+String.fromCharCode(f)}}while(b<c.length);return a};var facebook_debug_allow=false;window.facebook_xd_receiver_location="/xd_receiver.html";var my_facebook_details=null;function facebook_user_details(){this.user_name="";this.id=0;this.email="";this.email_permission=false}function facebooker_debugger(a){if(facebook_debug_allow){log_exceptions(a)}}var facebok_popup_position_button=null;function create_check_facebook_connect_user(b){try{facebok_popup_position_button=b;facebooker_debugger("create_check_facebook_connect_user_callback");FB.ensureInit(function(){var c=getFBUID();if(c==null){return}facebooker_debugger("end create_check_facebook_connect_user_callback");setTimeout("check_facebook_status()",1000);facebooker_debugger("end create_check_facebook_connect_user_callback 22")})}catch(a){facebooker_debugger(" Method:- create_check_facebook_connect_user "+a.message)}}function check_facebook_status(){try{new Ajax.Request("/user/check_facebook_status",{asynchronous:false,evalScripts:false,onComplete:function(transport){var my_eval_data=null;try{my_eval_data=eval("("+transport.responseText+")");if(typeof(my_eval_data)!="undefined"&&(!my_eval_data.user_has_registered)){my_facebook_details=new facebook_user_details();my_facebook_details.user_name=my_eval_data.name;my_facebook_details.id=my_eval_data.id;my_facebook_details.email=my_eval_data.proxied_email;my_facebook_details.email_permission=my_eval_data.email_permission;facebooker_debugger("callback of check_facebook_status :: "+my_facebook_details.user_name+" :: "+my_facebook_details.id+" :: "+my_facebook_details.email+" :: "+my_facebook_details.email_permission);if(my_facebook_details.email_permission=="false"){try{facebook_prompt_permission("email",function(permission){if(typeof(permission)!="undefined"&&permission!=false){createAccountFromFacebookUsingEmail()}else{showRegisterBox()}},my_facebook_details.email_permission)}catch(ex){facebooker_debugger("code block :- facebook_prompt_permission "+ex.message)}}else{if(my_facebook_details.email_permission=="true"){createAccountFromFacebookUsingEmail()}}}}catch(ex){facebooker_debugger("callback of check_facebook_status :: complete exception "+ex.message)}},parameters:"fb_uid="+getFBUID()})}catch(e){facebooker_debugger("Method:- check_facebook_status: "+e.message)}}function createAccountFromFacebookUsingEmail(){try{$("popupFacebookConnectCreateAccount").show();facebooker_debugger(my_facebook_details!=null&&my_facebook_details.user_name&&my_facebook_details.email);if(my_facebook_details!=null&&my_facebook_details.user_name&&my_facebook_details.email){createFacebookAccount(my_facebook_details.user_name,my_facebook_details.email)}else{FB.Facebook.apiClient.users_getInfo(getFBUID(),["name","proxied_email"],function(b){createFacebookAccount(b[0]["name"],b[0]["proxied_email"])})}}catch(a){facebooker_debugger("Method:- createAccountFromFacebookUsingEmail")}}function createFacebookAccount(b,a){try{new Ajax.Request("/user/create_user_from_facebook",{asynchronous:false,evalScripts:false,onComplete:function(d){showFacebookConnectBox(d.responseText)},parameters:"fb_username="+escape(b)+"&fb_email="+a+"&fb_uid="+getFBUID()})}catch(c){facebooker_debugger("Method:- createFacebookAccount: "+c.message)}}function showFacebookConnectBox(a){box_id="popupFacebookConnectCreateAccount";evalStr="$('popup_user_name_fb').value='"+a+"'";get_box("facebook_connect",box_id,evalStr);showBox($(box_id));movePopupBox($(box_id),null)}function create_facebook_account_handler(b){try{facebooker_debugger("create_facebook_account_handler");createFacebookAccount(b)}catch(a){facebooker_debugger("Method:- create_facebook_account_handler "+a.message)}}function ensure_init(b){try{facebooker_debugger("ensure_init");if(!window.facebook_api_key){window.alert("api_key is not set")}if(window.is_initialized){b()}else{}}catch(a){facebooker_debugger(" Method:- ensure_init "+a.message)}}function getFBUID(){facebooker_debugger("getFBUID");var a=null;if(FB.Facebook.apiClient.get_session()){a=FB.Facebook.apiClient.get_session().uid}facebooker_debugger("getFBUID end");return a}function facebook_button_onclick(){try{facebooker_debugger("facebook_button_onclick");ensure_init(button_on_click_callback)}catch(a){facebooker_debugger("Method:- facebook_button_onclick :: "+a.message)}}function facebook_prompt_permission(b,a,d){try{if(d=="false"){FB.Connect.showPermissionDialog(b,a)}else{a(true)}}catch(c){facebooker_debugger(" Method:- facebook_prompt_permission :: "+c.message)}};