/* ---------------------------------------- /includes/jsbin/jquery.js ---------------------------------------- */
/*
 * jQuery 1.2.6 - New Wave Javascript
 *
 * Copyright (c) 2008 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
 * $Rev: 5685 $
 */
(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else
return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else
selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
return(this[0].value||"").replace(/\r/g,"");}return undefined;}if(value.constructor==Number)value+='';return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else
this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){var src=target[name],copy=options[name];if(target===copy)continue;if(deep&&copy&&typeof copy=="object"&&!copy.nodeType)target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)target[name]=copy;}return target;};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else
script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!==undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object)if(callback.apply(object[name],args)===false)break;}else
for(;i<length;)if(callback.apply(object[i++],args)===false)break;}else{if(length==undefined){for(name in object)if(callback.call(object[name],name,object[name])===false)break;}else
for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}if(name=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem+='';if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&&notxml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else
while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]===elem)return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++])if(elem.nodeType!=8)first[pos++]=elem;}else
while(elem=second[i++])first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)if(!inv!=!callback(elems[i],i))ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)ret[ret.length]=value;}return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i<args.length)jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.ready);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!='string')return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else
xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})();
/* ---------------------------------------- /includes/jsbin/pluck.js ---------------------------------------- */
/*---------------------------------------------------*/
/*			Pluck JS			      */
/*	Created 1.09 by Rich Rudzinski		      */
/*---------------------------------------------------*/

/* BEGIN: Pluck Functions */

/**
 * Load the login form from /Static/login_pluck.html
 * in to the Pluck Header Bar (#contentPluckBar).
 * Then animate the login in.
 * @returns {boolean}
 * @author Richard Rudzinski
 */
function login() {
	$.ajax({
		type:'GET',
		url:'/Static/login_pluck.html',
		data:'timestamp='+_now(),
		success: function(data){
			$('#contentPluckBar2').hide();
			$('#contentPluckBar').replaceWith(data);
			$('#loginForm').animate({opacity: 'show'}, 'slow');
		}
	});
	return false;
}

/**
 * Handle login via an "unskinned" AJAX call - so this can be called from wherever we want, firing off whatever callbacks we want.
 * @returns {void}
 * @param {hash} settings Configuration options.
 * @param {string} settings.username The username we wish to try logging in with.
 * @param {string} settings.password The password we wish to try logging in with.
 * @param {function} settings.success Callback for when we have a successful log in.
 * @param {function} settings.failure Callback for when we fail to log in.
 * @author Nick Davison
 */
function unskinnedAJAXLogin(settings) {
	settings=jQuery.extend({
		username: "",
		password: "",
		success: function() {
		},
		failure: function() {
		}
	}, settings);
	
	var dataStr = 'username=' + settings.username + '&password=' + settings.password;
	
	// Send the login info to /Handlers/Login.aspx
	$.ajax({
		type: 'GET',
		url: '/Handlers/Login.aspx',
		data: dataStr,
		dataType: 'json',
		success: function(data) { // If AHAX was successful
			if(data.processed == false) { // If they were unable to login, call the failure callback
				settings.failure();
			} else { // If they did login, update the system and then call the success callback
				// Store the response data in the cookie
				writeCookie(data);
				
				// Update the pluck bar
				loggedIn();
				
				// Fire the success callback.
				settings.success();
			}
		},
		error: function() { // If there is an error, send the failure callback.
			settings.failure();
		}
	});
}

/**
 * Provides in place (static) login functionality.
 * <p>Get the username and password from the login form and submit them to /Handlers/Login.aspx.</p>
 * <p>If the call was successful:<br/>
 * If the login wasn't recognized, display an error message.<br />
 * If the login was recognized, store the response in a cookie then go to either
 * the callback (?url=) if there is one or http://soundersfc.com/ is there is not.</p>
 * <p>If the call failed, notify the user by displaying #pluckFormError</p>
 * @returns {void}
 * @see writeCookie (calls)
 * @see Url.decode (calls)
 * @see loginStatic (very similar)
 * @author Richard Rudzinski
 */
function loginStatic() {
	var callback =  window.location.search.replace('?url=', '');
	callback = Url.decode(callback);
	var user = $('#user_pluck').val(); // Get the username form field value
	var pass = $('#pass_pluck').val(); // Get the password form field value
	var dataStr = 'username=' + user + '&password=' + pass; // Build it in to a data string.
	
	// Send the login info to /Handlers/Login.aspx
	$.ajax({
		type: 'GET',
		url: '/Handlers/Login.aspx',
		data: dataStr,
		dataType: 'json',
		success: function(data) { // If successful
			if(data.processed == false) { // If they were unable to login, inform them.
				$('#user_pluck').next("span").attr("class","errorIcon");
				$('#pass_pluck').next("span").attr("class","errorIcon");
				alert('Your user name or password are incorrect. Please try again.');
				return false;
			} else { // If they did login, 
				// Add the checkIcon class to the following spans for #user_pluck and #pass_pluck
				var userSpan = $('#user_pluck').next("span");
				var passSpan = $('#pass_pluck').next("span");
				$(userSpan).attr("class","checkIcon");
				$(passSpan).attr("class","checkIcon");
				// Store the response data in the cookie
				writeCookie(data);
				// If a callback was specified, go to it. Otherwise, go to the homepage.
				if(callback) window.location = callback;
				else window.location = 'http://soundersfc.com/';
			}
		},
		error: function() { // If there is an error, display the pre build Forgot your password? error area (#pluckFormError)
			$('#pluckFormError').css('display', 'block');
			return false;
		}
	});
	return false;
}
/**
 * Remove cookie.
 * <p>If the "at" cookie is set, erase it. 
 * Load the /Static/loggedout_pluck.html logged out bar.
 * Write it in to #wrapperPluckBar and then slowly display it.</p>
 * @returns {void}
 * @see readCookie (calls)
 * @see _now (calls)
 * @see eraseCookie (calls)
 * @see logoutStatic (almost identical)
 * @author Richard Rudzinski
 */
function logout() {
	if(readCookie("at") != undefined) eraseCookie(true);
	$.ajax({
		type:'GET',
		url:'/Static/loggedout_pluck.html',
		data:'timestamp='+_now(),
		success: function(data) {
			$('#wrapperPluckBar').css('display', 'none');
			$('#wrapperPluckBar').html(data);
			$('#wrapperPluckBar').animate({opacity: 'show'}, 'slow');	
		}
	});
	return false;
}
/**
 * Matches the functionality of logout()
 * but additionally redirects the user to http://soundersfc.com/ when complete.
 * @see logout (almost identical)
 * @see readCookie (calls)
 * @see eraseCookie (calls)
 * @see _now (calls)
 * @author Richard Rudzinski
 */
function logoutStatic() {
	if(readCookie("at") != undefined) eraseCookie(false);
	$.ajax({
		type:'GET',
		url:'/Static/loggedout_pluck.html',
		data:'timestamp='+_now(),
		success: function(data) {
			$('#wrapperPluckBar').css('display', 'none');
			$('#wrapperPluckBar').html(data);
			$('#wrapperPluckBar').animate({opacity: 'show'}, 'slow');
			window.location = 'http://soundersfc.com/';
		}
	});
	return false;
}
/**
 * Close error popover (#pluckErrorCont).
 * @returns {void}
 * @author Richard Rudzinski
 */
function closeError() {
	$('#pluckErrorCont').css('display', 'none');
}
/**
 * Authenticate user for Pluck.
 * Very similar to loginStatic.
 * <p>
 * Gets the username and password from #user_pluck and #pass_pluck.
 * Sends them to /Handlers/Login.aspx.
 * If there was a failure, display the prepopulated #pluckErrorCont
 * If it was successful, store the data in a cookie then call a page reload.
 * </p>
 * @returns {void}
 * @see _now (calls)
 * @see writeCookie (calls)
 * @see loginStatic (very similar)
 * @author Richard Rudzinski
 */
function authenticate() {
	//$('.error', '#contentPluckBar').remove();
	var user = $('#user_pluck').val();
	var pass = $('#pass_pluck').val();
	var dataStr = 'username=' + user + '&password=' + pass;
	$.ajax({
		type: 'GET',
		url: '/Handlers/Login.aspx',
		data: dataStr + '&timestamp='+_now(),
		dataType: 'json',
		success: function(data) {
			if(data.processed == false) { 
				$('#pluckErrorCont').css('display', 'block');
			} else {
				writeCookie(data);
				window.location.reload();
			}
		}
	});
	return false;
}
/**
 * Calls /Static/loggedin_pluck.html 
 * and writes its content in to #wrapperPluckBar,
 * animating its visibility in.
 * @returns {void}
 * @author Richard Rudzinski
 */
function loggedIn() {
	$.ajax({
		type:'GET',
		url:'/Static/loggedin_pluck.html',
		success: function(data) {
			$('#wrapperPluckBar').css('display', 'none');
			$('#wrapperPluckBar').html(data);
			$('#wrapperPluckBar').animate({opacity: 'show'}, 'slow');
		}
	});				
}
/**
 * Return current time 
 * @returns {string}
 * @see login (called by)
 * @see logout (called by)
 * @see logoutStatic (called by)
 * @see authenticate (called by)
 * @author Richard Rudzinski
 */
function _now(){
	return +new Date;
}
/**
 * Parse and create cookies from login data.
 * Stores userId (data.userId), userName (data.userName), at (data.cookie).
 * The cookies are then set to store for 14 days.
 * @returns {void}
 * @param {object} data AJAX response from the login form.
 * @see loginStatic (called by)
 * @see authenticate (called by)
 * @author Richard Rudzinski
 */
function writeCookie(data) {
	dataArray = ['userId=' + data.userId, 'userName=' + data.userName, 'at=' + data.cookie];
	var expiry = new Date();
	expiry.setDate(expiry.getDate() + 14);
	for(i=0; i<dataArray.length; i++) {
		var temp = dataArray[i].split(' : ');
		document.cookie = dataArray[i] + '; expires=' + expiry.toGMTString() + '; path=/; domain='+globalDomain;
	}
}
/**
 * Look for and return a cookie. Return false if it wasn't found.
 * @returns {string}
 * @param {string} name The name of the cookie to look for.
 * @see logout (called by)
 * @see logoutStatic (called by)
 * @see parseUser (called by)
 * @author Richard Rudzinski
 */
function readCookie(name) {
	var name = name + '=';
	var cookieArray = document.cookie.split(';')
	for(i=0; i<cookieArray.length; i++) {
		if(cookieArray[i].indexOf(name) != -1) {
			if(cookieArray[i] == undefined) return false;
			else return cookieArray[i].replace(name, '');
		}
	}
}
/**
 * Erase all pluck cookies
 * (userId, userName, at).
 * Then, if refresh is true, reload the page.
 * @returns {void}
 * @param {boolean} refresh True if you wish the page to reload afterwards.
 * @see logout (called by)
 * @see logoutStatic (called by)
 * @author Richard Rudzinski
 */
function eraseCookie(refresh) {
	var expire = new Date();
	expire.setDate(expire.getDate() - 1);
	document.cookie = 'userId=""; expires=' + expire.toGMTString() + '; path=/; domain=' + globalDomain;
	document.cookie = 'userName=""; expires=' + expire.toGMTString() + '; path=/; domain=' + globalDomain;
	document.cookie = 'at=""; expires=' + expire.toGMTString() + '; path=/; domain=' + globalDomain;
	if(refresh) window.location.reload();
}
/**
 * Parses User ID from cookie.
 * <p>
 * Will first attempt to look in window.location for userid.
 * If it can't find it there, it will look in the cookie.
 * If it can't find it there, it will return '' and pop up an alert asking the user to log in.
 * </p>
 * @returns {string}
 * @see readCookie (calls)
 * @author Richard Rudzinski
 */
function parseUser() {
	var query = window.location.search;
	if(!query || query.indexOf('userid') == -1) { // If there's no user id in the url
		if(readCookie("at") != undefined) { // If the 'at' cookie is set
			var user = readCookie("at");
			user = user.split('&')[0];
			user = user.replace(/(u=)|(\s)/g, '');
			window.location.search = 'userid=' +user + '&plckPersonaPage=PersonaHome';
		} else { // Ask the user to log in
			alert('Please log in to view your profile');
			user = '';
		}
	} else {// 
		var query = window.location.search;
		var user = query.split(/userid=/)[1]; // Get everything after the userid=
		if(user.match(/&|;|\,/)) user = user.split(/&|;|\,/)[0];
	}
	return user;
}
/**
 * Checks to see if user is a season ticket holder.
 * Does so by checking /Handlers/SeasonTickerHolder.aspx for processed == true.
 * If they are it appends a class of "ticketHolder" to the #personas container 
 * @returns {void}
 * @param {string} user The userId to check for.
 * @author Richard Rudzinski
 */
function seasonTicketHolder(user) {
	var container = $('#personas');
	var ticketHolder;
	$.ajax({
		type: 'GET',
		url: '/Handlers/SeasonTickerHolder.aspx',
		data: 'userId=' + user,
		dataType: 'json',
		success: function(data) {
			if(data.processed == true) { 
				container.addClass('ticketHolder');
			} 
		}
	}); 
}
/**
 * @namespace URL encode/decode 
 */
var Url = {
	/**
	 * Public method for url encoding
	 * @returns {string}
	 * @param {string} string The plain string you wish to UTF8 encode and then url escape.
	 * @author Richard Rudzinski
	 */
	encode : function (string) {
		return escape(this._utf8_encode(string));
	},
	/**
	 * public method for url decoding
	 * @returns {string}
	 * @param {string} string UTF8, URL escaped string you wish to decode.
	 * @see loginStatic (called by)
	 * @author Richard Rudzinski
	 */
	decode : function (string) {
		return this._utf8_decode(unescape(string));
	},
	/**
	 * Private method for UTF-8 encoding
	 * @returns {string}
	 * @param {string} string String of text you wish to UTF8 encode
	 * @author Richard Rudzinski
	 */
	_utf8_encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";
		for (var n = 0; n < string.length; n++) {
			var c = string.charCodeAt(n);
			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}
		}
		return utftext;
	},
	/**
	 * Private method for UTF-8 decoding.
	 * @returns {string}
	 * @param {string} utftext UTF8 encoded text you want to decode.
	 * @author Richard Rudzinski
	 */
	_utf8_decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;
		while ( i < utftext.length ) {
			c = utftext.charCodeAt(i);
			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}
		}
		return string;
	}
}
/* END: Pluck Functions */

/* ---------------------------------------- /includes/jsbin/swfobject.js ---------------------------------------- */
var swfobject=function(){var Z="undefined",P="object",B="Shockwave Flash",h="ShockwaveFlash.ShockwaveFlash",W="application/x-shockwave-flash",K="SWFObjectExprInst",G=window,g=document,N=navigator,f=[],H=[],Q=null,L=null,T=null,S=false,C=false;var a=function(){var l=typeof g.getElementById!=Z&&typeof g.getElementsByTagName!=Z&&typeof g.createElement!=Z&&typeof g.appendChild!=Z&&typeof g.replaceChild!=Z&&typeof g.removeChild!=Z&&typeof g.cloneNode!=Z,t=[0,0,0],n=null;if(typeof N.plugins!=Z&&typeof N.plugins[B]==P){n=N.plugins[B].description;if(n){n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1");t[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10);t[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10);t[2]=/r/.test(n)?parseInt(n.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof G.ActiveXObject!=Z){var o=null,s=false;try{o=new ActiveXObject(h+".7")}catch(k){try{o=new ActiveXObject(h+".6");t=[6,0,21];o.AllowScriptAccess="always"}catch(k){if(t[0]==6){s=true}}if(!s){try{o=new ActiveXObject(h)}catch(k){}}}if(!s&&o){try{n=o.GetVariable("$version");if(n){n=n.split(" ")[1].split(",");t=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]}}catch(k){}}}}var v=N.userAgent.toLowerCase(),j=N.platform.toLowerCase(),r=/webkit/.test(v)?parseFloat(v.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,i=false,q=j?/win/.test(j):/win/.test(v),m=j?/mac/.test(j):/mac/.test(v);
/*@cc_on i=true;@if(@_win32)q=true;@elif(@_mac)m=true;@end@*/
return{w3cdom:l,pv:t,webkit:r,ie:i,win:q,mac:m}}();var e=function(){if(!a.w3cdom){return}J(I);if(a.ie&&a.win){try{g.write("<script id=__ie_ondomload defer=true src=//:><\/script>");var i=c("__ie_ondomload");if(i){i.onreadystatechange=function(){if(this.readyState=="complete"){this.parentNode.removeChild(this);V()}}}}catch(j){}}if(a.webkit&&typeof g.readyState!=Z){Q=setInterval(function(){if(/loaded|complete/.test(g.readyState)){V()}},10)}if(typeof g.addEventListener!=Z){g.addEventListener("DOMContentLoaded",V,null)}M(V)}();function V(){if(S){return}if(a.ie&&a.win){var m=Y("span");try{var l=g.getElementsByTagName("body")[0].appendChild(m);l.parentNode.removeChild(l)}catch(n){return}}S=true;if(Q){clearInterval(Q);Q=null}var j=f.length;for(var k=0;k<j;k++){f[k]()}}function J(i){if(S){i()}else{f[f.length]=i}}function M(j){j()}function I(){var l=H.length;for(var j=0;j<l;j++){var m=H[j].id;if(a.pv[0]>0){var k=c(m);if(k){H[j].width=k.getAttribute("width")?k.getAttribute("width"):"0";H[j].height=k.getAttribute("height")?k.getAttribute("height"):"0";if(O(H[j].swfVersion)){if(a.webkit&&a.webkit<312){U(k)}X(m,true)}else{if(H[j].expressInstall&&!C&&O("6.0.65")&&(a.win||a.mac)){D(H[j])}else{d(k)}}}}else{X(m,true)}}}function U(m){var k=m.getElementsByTagName(P)[0];if(k){var p=Y("embed"),r=k.attributes;if(r){var o=r.length;for(var n=0;n<o;n++){if(r[n].nodeName.toLowerCase()=="data"){p.setAttribute("src",r[n].nodeValue)}else{p.setAttribute(r[n].nodeName,r[n].nodeValue)}}}var q=k.childNodes;if(q){var s=q.length;for(var l=0;l<s;l++){if(q[l].nodeType==1&&q[l].nodeName.toLowerCase()=="param"){p.setAttribute(q[l].getAttribute("name"),q[l].getAttribute("value"))}}}m.parentNode.replaceChild(p,m)}}function F(i){if(a.ie&&a.win&&O("8.0.0")){G.attachEvent("onunload",function(){var k=c(i);if(k){for(var j in k){if(typeof k[j]=="function"){k[j]=function(){}}}k.parentNode.removeChild(k)}})}}function D(j){C=true;var o=c(j.id);if(o){if(j.altContentId){var l=c(j.altContentId);if(l){L=l;T=j.altContentId}}else{L=b(o)}if(!(/%$/.test(j.width))&&parseInt(j.width,10)<310){j.width="310"}if(!(/%$/.test(j.height))&&parseInt(j.height,10)<137){j.height="137"}g.title=g.title.slice(0,47)+" - Flash Player Installation";var n=a.ie&&a.win?"ActiveX":"PlugIn",k=g.title,m="MMredirectURL="+G.location+"&MMplayerType="+n+"&MMdoctitle="+k,p=j.id;if(a.ie&&a.win&&o.readyState!=4){var i=Y("div");p+="SWFObjectNew";i.setAttribute("id",p);o.parentNode.insertBefore(i,o);o.style.display="none";G.attachEvent("onload",function(){o.parentNode.removeChild(o)})}R({data:j.expressInstall,id:K,width:j.width,height:j.height},{flashvars:m},p)}}function d(j){if(a.ie&&a.win&&j.readyState!=4){var i=Y("div");j.parentNode.insertBefore(i,j);i.parentNode.replaceChild(b(j),i);j.style.display="none";G.attachEvent("onload",function(){j.parentNode.removeChild(j)})}else{j.parentNode.replaceChild(b(j),j)}}function b(n){var m=Y("div");if(a.win&&a.ie){m.innerHTML=n.innerHTML}else{var k=n.getElementsByTagName(P)[0];if(k){var o=k.childNodes;if(o){var j=o.length;for(var l=0;l<j;l++){if(!(o[l].nodeType==1&&o[l].nodeName.toLowerCase()=="param")&&!(o[l].nodeType==8)){m.appendChild(o[l].cloneNode(true))}}}}}return m}function R(AE,AC,q){var p,t=c(q);if(typeof AE.id==Z){AE.id=q}if(a.ie&&a.win){var AD="";for(var z in AE){if(AE[z]!=Object.prototype[z]){if(z=="data"){AC.movie=AE[z]}else{if(z.toLowerCase()=="styleclass"){AD+=' class="'+AE[z]+'"'}else{if(z!="classid"){AD+=" "+z+'="'+AE[z]+'"'}}}}}var AB="";for(var y in AC){if(AC[y]!=Object.prototype[y]){AB+='<param name="'+y+'" value="'+AC[y]+'" />'}}t.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AD+">"+AB+"</object>";F(AE.id);p=c(AE.id)}else{if(a.webkit&&a.webkit<312){var AA=Y("embed");AA.setAttribute("type",W);for(var x in AE){if(AE[x]!=Object.prototype[x]){if(x=="data"){AA.setAttribute("src",AE[x])}else{if(x.toLowerCase()=="styleclass"){AA.setAttribute("class",AE[x])}else{if(x!="classid"){AA.setAttribute(x,AE[x])}}}}}for(var w in AC){if(AC[w]!=Object.prototype[w]){if(w!="movie"){AA.setAttribute(w,AC[w])}}}t.parentNode.replaceChild(AA,t);p=AA}else{var s=Y(P);s.setAttribute("type",W);for(var v in AE){if(AE[v]!=Object.prototype[v]){if(v.toLowerCase()=="styleclass"){s.setAttribute("class",AE[v])}else{if(v!="classid"){s.setAttribute(v,AE[v])}}}}for(var u in AC){if(AC[u]!=Object.prototype[u]&&u!="movie"){E(s,u,AC[u])}}t.parentNode.replaceChild(s,t);p=s}}return p}function E(k,i,j){var l=Y("param");l.setAttribute("name",i);l.setAttribute("value",j);k.appendChild(l)}function c(i){return g.getElementById(i)}function Y(i){return g.createElement(i)}function O(k){var j=a.pv,i=k.split(".");i[0]=parseInt(i[0],10);i[1]=parseInt(i[1],10);i[2]=parseInt(i[2],10);return(j[0]>i[0]||(j[0]==i[0]&&j[1]>i[1])||(j[0]==i[0]&&j[1]==i[1]&&j[2]>=i[2]))?true:false}function A(m,j){if(a.ie&&a.mac){return}var l=g.getElementsByTagName("head")[0],k=Y("style");k.setAttribute("type","text/css");k.setAttribute("media","screen");if(!(a.ie&&a.win)&&typeof g.createTextNode!=Z){k.appendChild(g.createTextNode(m+" {"+j+"}"))}l.appendChild(k);if(a.ie&&a.win&&typeof g.styleSheets!=Z&&g.styleSheets.length>0){var i=g.styleSheets[g.styleSheets.length-1];if(typeof i.addRule==P){i.addRule(m,j)}}}function X(k,i){var j=i?"visible":"hidden";if(S){c(k).style.visibility=j}else{A("#"+k,"visibility:"+j)}}return{registerObject:function(l,i,k){if(!a.w3cdom||!l||!i){return}var j={};j.id=l;j.swfVersion=i;j.expressInstall=k?k:false;H[H.length]=j;X(l,false)},getObjectById:function(l){var i=null;if(a.w3cdom&&S){var j=c(l);if(j){var k=j.getElementsByTagName(P)[0];if(!k||(k&&typeof j.SetVariable!=Z)){i=j}else{if(typeof k.SetVariable!=Z){i=k}}}}return i},embedSWF:function(n,u,r,t,j,m,k,p,s){if(!a.w3cdom||!n||!u||!r||!t||!j){return}r+="";t+="";if(O(j)){X(u,false);var q=(typeof s==P)?s:{};q.data=n;q.width=r;q.height=t;var o=(typeof p==P)?p:{};if(typeof k==P){for(var l in k){if(k[l]!=Object.prototype[l]){if(typeof o.flashvars!=Z){o.flashvars+="&"+l+"="+k[l]}else{o.flashvars=l+"="+k[l]}}}}J(function(){R(q,o,u);if(q.id==u){X(u,true)}})}else{if(m&&!C&&O("6.0.65")&&(a.win||a.mac)){X(u,false);J(function(){var i={};i.id=i.altContentId=u;i.width=r;i.height=t;i.expressInstall=m;D(i)})}}},getFlashPlayerVersion:function(){return{major:a.pv[0],minor:a.pv[1],release:a.pv[2]}},hasFlashPlayerVersion:O,createSWF:function(k,j,i){if(a.w3cdom&&S){return R(k,j,i)}else{return undefined}},createCSS:function(j,i){if(a.w3cdom){A(j,i)}},addDomLoadEvent:J,addLoadEvent:M,getQueryParamValue:function(m){var l=g.location.search||g.location.hash;if(m==null){return l}if(l){var k=l.substring(1).split("&");for(var j=0;j<k.length;j++){if(k[j].substring(0,k[j].indexOf("="))==m){return k[j].substring((k[j].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(C&&L){var i=c(K);if(i){i.parentNode.replaceChild(L,i);if(T){X(T,true);if(a.ie&&a.win){L.style.display="block"}}L=null;T=null;C=false}}}}}();
/* ---------------------------------------- /includes/jsbin/sitelife.js ---------------------------------------- */
/*
 * -------------------------------------------------------------------------
 * START MAIN JS FILE DUPLICATION
 * Included from: Array
 * 
 * See line ~1776, further down, for additional files included from:
 * http://sitelife.soundersfc.com/ver1.0/Direct/DirectProxy
 * 
 * File generated automagically by: http://webdev:9043 (192.168.101.204:9043)
 * This version to be included on: http://www.soundersfc.com
 * This version generated: Wed, Jun 17th 2009 - 10:06
 * -------------------------------------------------------------------------
 */
    document.write("<link href='http://sitelife.soundersfc.com/ver1.0/SiteLifeCss' rel='stylesheet' type='text/css' />");
    document.write("<script type='text/javascript' src='http://sitelife.soundersfc.com/ver1.0/SiteLifeScripts'></script>");
	//document.write("<link href='http://www.soundersfc.com/includes/cssbin/pluck.css' rel='stylesheet' type='text/css' />");

///<summary>constructor to create a new SiteLifeProxy</summary>
function SiteLifeProxy(url) {
    // User Configurable Properties - these can be set at any time

    // your apiKey, this value must be set!
    this.apiKey = null;
    
    this.siteLifeDomainOverride = null;
    this.siteLifeServerBaseOverride = null;
    this.customerCSSOverride = null;
    this.customerForumPagePathOverride = null;

    // sniff the browser for custom behaviors
    this.__isExplorer = navigator.userAgent.toLowerCase().indexOf('msie') != -1;
    this.__isSafari = navigator.userAgent.toLowerCase().indexOf('safari') != -1;
    this.__isMac = navigator.platform.toLowerCase().indexOf('mac') != -1;
    this.__isMacIE = this.__isMac && this.__isExplorer;
    
    // if enabled, spit out debug information through alert()
    this.debug = false;
    
    // used to track the id of the handler expecting the results from the immediately preceeding method invocation
    // this is used only for testing purposes
    this.lastHandlerId = "";
    
    // Methods You can Overide
    //
    // OnSuccess(returnValue) - is passed the return value at the end of a successful call, default does nothing
    // OnError(msg) - is passed an error message if a problem occurs
    // OnDebug(msg) - is called when debugging is enabled
     
    this.__baseUrl = url;
    this.__sendInvokeCount = 0;
    
    this.__eventHandlers = new Object();
};

SiteLifeProxy.prototype.AddEventHandler = function (event_name, callback) {
	var eventList = this.__eventHandlers[event_name];
	if (!eventList){
		eventList = new Array();
		this.__eventHandlers[event_name] = eventList;
	}
	eventList.push(callback);
};

SiteLifeProxy.prototype.FireEvent = function (event_name) {
    var func;
    if(handlers = this.__eventHandlers[event_name]) {
        var A = new Array(); for (var i = 1; i <  this.FireEvent.arguments.length; i++){ A[i - 1] = this.FireEvent.arguments[i];}
        for(var x=0;x<handlers.length;x++){
			func = handlers[x];
			if (func.__Bound){
			   if (handlers.length == 1) return func();
			   func();
			}
			if (handlers.length == 1) return func.apply(this, A);
			func.apply(this, A);
    }
}
};

SiteLifeProxy.prototype.ScriptId = function() { return this.__scriptId = "_bb_script_" + this.__sendInvokeCount++; }

// Default error handler for the proxy object, simple alert
SiteLifeProxy.prototype.OnError = function(msg) {
   alert("OnError: " + msg);
}

// Default debug handler for the proxy object, simple alert
SiteLifeProxy.prototype.OnDebug = function(msg) {
    if (this.debug)
        alert("Debug: " + msg);
}

// fetch a named request parameter from the page URL
SiteLifeProxy.prototype.GetParameter = function(parameterName) {
    var key = parameterName + "=";
    var parameters = document.location.search.substring(1).split("&");
    for (var i = 0; i < parameters.length; i++)
    {
        if (parameters[i].indexOf(key) == 0)
            return parameters[i].substring(key.length);
    }
    return null;
};

// browser independent method to get elements by ID
SiteLifeProxy.prototype.GetElement = function(id) {
    this.OnDebug("GetElement " + id);
    if (document.getElementById)
        return document.getElementById(id);
    if (document.all)
        return document.all[id];
    this.OnError("No support for GetElement() in this browser");
    return null;
}

// browser independent method to get elements by tag name
SiteLifeProxy.prototype.GetTags = function(tagName) {
    this.OnDebug("GetTags " + tagName);
    if (document.getElementsByTagName)
        return document.getElementsByTagName(tagName);
    if (document.all)
       return document.tags(tagName);
    this.OnError("No support for GetTags() in this browser");
    return null;
}

SiteLifeProxy.prototype.Trim = function(s) {
	return s.replace(/^\s+|\s+$/g,"");

};

SiteLifeProxy.prototype.EscapeValue = function(s) {
    if (s == null) return null;
    return encodeURIComponent(s);
};

SiteLifeProxy.prototype.__ArrayValidation = function(s)
{
    if ((typeof s == 'undefined') || (s.length < 1))
    {
        return false;
    }
    return true;
}

SiteLifeProxy.prototype.__CheckErrorHandler = function(onError) {
    this.OnDebug("__CheckErrorHandler " + onError);
    if ((typeof onError == 'undefined') || (eval("window." + onError) == null))
    {
      return "gSiteLife.OnError";
    }
    return onError;
}
SiteLifeProxy.prototype.SetCookie = function SetCookie( name, value) {
    var today = new Date(); today.setTime( today.getTime() );
    
    var expires_date = new Date( today.getTime() + 126144000000 );
    
    document.cookie = name + "=" +escape( value ) +
    ";expires=" + expires_date.toGMTString() + 
    ";path=/" + ";domain=soundersfc.com" ;
}
// validate and fetch arguments, if the argument is missing and optional, we return an empty string        
SiteLifeProxy.prototype.__GetArgument = function(variableName, variableValue, isRequired, isArray) {
    this.OnDebug("__GetArgument " + variableName + "," + variableValue + "," + isRequired + "," + isArray);
    if (typeof variableValue == "undefined" || variableValue == null || variableValue == "")
    {
        if (isRequired)
        {
            this.OnError("Missing required parameter " + variableName);
            this.__isValid = false;
            return "";
        }
        else
            return "";
    }
    if (isRequired && isArray) 
    {
        if (!this.__ArrayValidation(variableValue)) 
        {
            this.OnError("Invalid array parameter " + variableName);
            this.__isValid = false;
            return "";
        }
    }
    return "&" + variableName + "=" + this.EscapeValue(variableValue);
};

SiteLifeProxy.prototype.__StripAnchorFromUrl = function(url) {
    var aIdx = url.indexOf("#");
    return aIdx == -1 ? url : url.substring(0, aIdx);
}

SiteLifeProxy.prototype.__SafeAppendUrlValue = function(url, key, value) {
    url += url.indexOf("?") != -1 ? "&" : "?";
    return url + key + "=" + value;
}

SiteLifeProxy.prototype.__AppendUrlValues = function (url)
{
	time = new Date();
    url += this.__GetArgument("plckNoCache", time.getTime(), false, false);
    url += this.__GetArgument("plckApiKey", this.apiKey, true, false);
    url += this.__GetArgument("pcksld", this.siteLifeDomainOverride, false, false);
    url += this.__GetArgument("pcksbu", this.siteLifeServerBaseOverride, false, false);
    url += this.__GetArgument("pckcss", this.customerCSSOverride, false, false);
    url += this.__GetArgument("pckfpp", this.customerForumPagePathOverride, false, false);
        
    return url;
}

SiteLifeProxy.prototype.ReloadPage = function(params) {
    var sSearch = window.location.search.substring(1);
    var sNVPs = sSearch.split('&');
    var newSearch = "";
    var anchorPoint = "";
    for(var k in params) {
        if(k == "extend") continue;
		if(k == "#") {
			anchorPoint = '#' + params[k];
			continue;
		}		
        if(newSearch == "") newSearch += "?"; else newSearch += "&";
        newSearch += k + '=' + params[k];
    }
    for (var i = 0; i < sNVPs.length; i++) {
        var kv = sNVPs[i].split('=');
        if(kv[0] && kv[0].indexOf('plck') != 0 && ! params[kv[0]]) {
            newSearch += "&" + sNVPs[i];        
        }
    }
            
    if(anchorPoint != ""){ 
        window.location.hash = anchorPoint;
    }
    window.location.search = newSearch;
}

function loadScript (url, callback) {
	var script = document.createElement('script');
	script.type = 'text/javascript';
	script.charset = 'utf-8';
	if (callback)
		script.onload = script.onreadystatechange = function() {
			if (script.readyState && script.readyState != 'loaded' && script.readyState != 'complete')
				return;
			script.onreadystatechange = script.onload = null;
			callback();
		};
	script.src = url;
	document.getElementsByTagName('head')[0].appendChild (script);
}

SiteLifeProxy.prototype.__Send = function(url, scriptToUse, callbackName, args) {
    this.OnDebug("_Send " + url);
    function gLoadScript(url, callbackName) {
      var script = document.createElement('script');
      script.setAttribute('type', 'text/javascript');
    	script.setAttribute('charset', 'utf-8');
    	script.setAttribute('src', url + (callbackName ? '&EVENT_ID=' + callbackName : ''));
    	document.getElementsByTagName('head')[0].appendChild (script);
    }
    function bind(_function, _this, _arguments) {
      var f = function() {
        _function.apply(_this, _arguments);
      };
      f['__Bound'] = true;
      return f;
    };
    var func;
    if ((typeof callbackName == 'string') && (func = this.__eventHandlers[callbackName]) && (typeof func == 'function') && !func['__Bound']) {
      this.__eventHandlers[callbackName] = bind(func, this, args);
    }
    
    //append our various parameters as necessary
    url = this.__AppendUrlValues(url);
    this.OnDebug("_Send (updated) " + url);
    // add the script node to the document
    if (document.createElement && ! this.__isMacIE) {
        gLoadScript(url, callbackName);
        return;
    }

    // could fall back to sync at this point, but will bust if the page is already loaded

    this.OnError("No support for async in this browser");
}

SiteLifeProxy.prototype.Logout = function(ScriptToUse, IsRestPage) {
    var plckRest = IsRestPage ? true : false;
    this.__Send(this.__baseUrl + '/Utility/Logout?plckRedirectUrl=' + escape(window.location.href) + '&plckRest=' + plckRest, ScriptToUse);
    return false;
}

SiteLifeProxy.prototype.AddLoadEvent = function(func) {
if(window.addEventListener){
 window.addEventListener("load", func, false);
}else{
 if(window.attachEvent){
   window.attachEvent("onload", func);
 }else{
   if(document.getElementById){
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
      window.onload = func;
    } else {
      window.onload = function() {
       if (oldonload) {
        oldonload();
       }
       func();
}}}}}}

SiteLifeProxy.prototype.AdInsertHelper = function() {
    for(var src in gSiteLife.__adsToInsert) {
        if(src == "extend") continue;
        var dest = gSiteLife.__adsToInsert[src];
        var parent = document.getElementById(dest);
		var newChild = document.getElementById(src);
		if( ! parent || ! newChild ) {continue; }
		parent.replaceChild( newChild, document.getElementById(dest + "Child"));
		newChild.style.display = "block"; parent.style.display = "block";
    }
}

SiteLifeProxy.prototype.InsertAds = function(source, destination) {
gSiteLife.__adsToInsert = new Object();
for(ii=0; ii< this.InsertAds.arguments.length; ii+=2) { gSiteLife.__adsToInsert[this.InsertAds.arguments[ii]] = this.InsertAds.arguments[ii+1];}
this.AddLoadEvent(gSiteLife.AdInsertHelper);
}

SiteLifeProxy.prototype.TitleTag = function() {
 var titleTag = document.getElementById("plckTitleTag");
 return titleTag ? titleTag.innerText || titleTag.textContent : null;
 }

SiteLifeProxy.prototype.WriteDiv = function(id, divClass) {
    var cssClass = divClass ? divClass : "";
    document.write('<div id="'+id+'" class="'+cssClass+'"></div>'); return id;
}

SiteLifeProxy.prototype.InnerHtmlWrite = function(elementId, innerContents ) {
    var el = document.createElement("div");
    try {
        if(document.location.href.indexOf("debug=true") > -1) {
            el.innerHTML += "<div style='border:1px solid red;'><span style='background-color:red; color:white; position:absolute; cursor:pointer; font-size:8pt;' onclick='DebugShowInnerHTML(\"${plckElementId}\",\"http://172.27.124.99/ver1.0/Proxies/Default.rails\");'> ? </span><div>" + innerContents + "</div></div>";
        } else {
            el.innerHTML += innerContents;
            el.style.display = "inline";
        }
        var destDiv = document.getElementById(elementId);
        while (destDiv.childNodes.length >= 1) {
             destDiv.removeChild(destDiv.childNodes[0]);
        }
        
        destDiv.appendChild(el);
    } catch (error) {
        alert(elementId + " Error "  + error.number + ": " + error.description);
    }
}

SiteLifeProxy.prototype.SortTimeStampDescending = "TimeStampDescending";
SiteLifeProxy.prototype.SortTimeStampAscending = "TimeStampAscending";
SiteLifeProxy.prototype.SortRecommendationsDescending = "RecommendationsDescending";
SiteLifeProxy.prototype.SortRecommendationsAscending = "RecommendationsAscending";
SiteLifeProxy.prototype.SortRatingDescending = "RatingDescending";
SiteLifeProxy.prototype.SortRatingAscending = "RatingAscending";
SiteLifeProxy.prototype.SortAlphabeticalAscending = "AlphabeticalAscending";
SiteLifeProxy.prototype.SortAlphabeticalDescending = "AlphabeticalDescending";
SiteLifeProxy.prototype.KeyTypeExternalResource = "ExternalResource";
        



SiteLifeProxy.prototype.PersonaHeaderRequest = function(UserId) {
    var url = this.__baseUrl + '/Persona/PersonaHeader?plckElementId=personaHDest&plckUserId='+ UserId;
    this.__Send(url, "personaHeaderScript", 'persona:header', arguments);
}
SiteLifeProxy.prototype.PersonaHeader = function(UserId) {
    this.WriteDiv("personaHDest", "Persona_Main");
        this.PersonaHeaderRequest(UserId); 
}
SiteLifeProxy.prototype.PersonaHeaderInbox = function() {
	// if DAAPI proxy is not present, fail gracefully
	if (!document.getElementById('PrivateMessageInbox') || !window.RequestBatch || !window.PrivateMessageFolderList) {
		var pmContainer = document.getElementById('PersonaHeader_PrivateMessageContent');
		if (pmContainer) {
			pmContainer.style.display = 'none';
		}
		return;
	}

	var rb = new RequestBatch();
	rb.AddToRequest(new PrivateMessageFolderList());
	rb.BeginRequest(serverUrl,
		function(responseBatch) {
			var count = '';
			try {
				if (responseBatch && responseBatch.Messages && responseBatch.Messages.length && responseBatch.Messages[0].Message == 'ok') {
					var folders = responseBatch.Responses[0].PrivateMessageFolderList.FolderList;
					for (var i = 0; i < folders.length; i++) {
						var f = folders[i];
						if (f.FolderID == 'Inbox') { count = f.UnreadMessageCount; break; }
					}
				}
			} catch (e) {}
			var inboxStr = "Inbox ({0})";
			var idx = inboxStr.indexOf("{0}");
			if (inboxStr == '' || idx >= -1)
				inboxStr = inboxStr.substring(0, idx) + count + inboxStr.substring(idx+3);
			var inbox = document.getElementById('PrivateMessageInbox');
			inbox.innerHTML = inboxStr;
			if (count > 0) inbox.style.fontWeight = 'bold';
		});
}

SiteLifeProxy.prototype.Persona = function(UserId) {
    this.WriteDiv("personaDest", "Persona_Main");
    var action = this.GetParameter("plckPersonaPage");
    if(action && (typeof this[action] == 'function')) this[action](UserId);
             else this.PersonaHome(UserId);
    }
SiteLifeProxy.prototype.LoadPersonaPage = function(PageName, UserId) {
    var params = new Object(); params['plckPersonaPage'] = PageName; params['plckUserId'] = UserId;
            params['userid'] = UserId;
        for(ii=2; ii< this.LoadPersonaPage.arguments.length; ii+=2) { params[this.LoadPersonaPage.arguments[ii]] = this.LoadPersonaPage.arguments[ii+1];}
    this.ReloadPage(params);
    return false;
}

SiteLifeProxy.prototype.PersonaHome = function(UserId) {

    var me = this;
    this.AddEventHandler('persona:home:complete', function() { me.PopulateGroupsDiv(UserId, 1); });
    return this.PersonaSend('PersonaHome', 'personaDest', 'personaScript', UserId, null, 'persona:home:complete');
	  
}

SiteLifeProxy.htmlEncode = function(str){
	// Fix HTML
	var ret = str;
	var div = document.createElement('div');
	var text = document.createTextNode(str);
	div.appendChild(text);
	ret = new String(div.innerHTML);				
	
	// The above doesn't take care of quotes.
	ret = ret.replace(/"/g, '"');
	
	return ret;
};
			
SiteLifeProxy.prototype.PopulateGroupsDiv = function(UserId, OnPage) {
        // check for DAAPI objects; if not there, fail gracefully
    if (window.RequestBatch && window.CommunityGroupMembershipPage && window.UserKey) {
        var requestBatch = new RequestBatch();
        requestBatch.AddToRequest(new CommunityGroupMembershipPage(new UserKey(UserId+""), 8, OnPage, "TimeStampAscending", "Member"));
        requestBatch.BeginRequest("http://sitelife.soundersfc.com/ver1.0/Direct/Process", function(responseBatch) {   
            if (responseBatch.Responses.length > 0 && responseBatch.Responses[0].CommunityGroupMembershipPage) {
                // create the div that will house all this info
                var groupsDiv = document.createElement('div');
                groupsDiv.className = 'PersonaStyle_ItemContainer';
                var groupsContainer = document.getElementById('PersonaStyle_GroupsContainer');
                // Check groupsContainer is null because PersonaStyle_GroupContainer may be absent due to private persona files.
                if (groupsContainer != null) {
                    groupsContainer.appendChild(groupsDiv);
                        
                    var groupBaseUrl = "http://www.soundersfc.com/social/Groups.aspx";
                    var groupMembershipPage = responseBatch.Responses[0].CommunityGroupMembershipPage;
                    var groupsHtml = "<div class=\"PersonaStyle_SectionHead\">Groups</div>";
                    groupsHtml += "<div class=\"PersonaStyle_GroupList\">";
                    for (var index = 0; index < groupMembershipPage.CommunityGroupMemberships.length; index++) {
                        var currentGroup = groupMembershipPage.CommunityGroupMemberships[index].CommunityGroup;
                        // if current group is private and user is non-member, don't display
                        var display = true;
                        if (currentGroup.CommunityGroupVisibility == 'Private') {
                            display = (currentGroup.RequestingUsersMembershipTier != 'NonMember' && currentGroup.RequestingUsersMembershipTier != 'Banned');
                        }
                        if (display) {
                            var groupUrl = groupBaseUrl + "?slGroupKey=" + currentGroup.CommunityGroupKey.Key;
                                                            groupsHtml += "<a href=\"" + groupUrl + "\"><img height=\"50\" width=\"50\" title=\"" + SiteLifeProxy.htmlEncode(currentGroup.Title) + "\" src=\"" + currentGroup.AvatarImageUrl + "\" /></a>";
                                                    }
                    }
                    //Pagination for Group List
                    groupsHtml += "<p><ul class=\"PersonaStyle_GroupListPagination\">";
                    
                    if (groupMembershipPage.OnPage > 1)                {
                        groupsHtml += "<li><a href='#PreviousGroup' onclick='gSiteLife.PopulateGroupsDiv(\"" + UserId + "\", " + (parseInt(groupMembershipPage.OnPage) - 1) + ");'><<Previous</a></li>";
                    }
                    
                    if (groupMembershipPage.NumberOfCommunityGroupMemberships > (groupMembershipPage.NumberPerPage * groupMembershipPage.OnPage))                {
                        groupsHtml += "<li><a href='#NextGroup' onclick='gSiteLife.PopulateGroupsDiv(\"" + UserId + "\", " + (parseInt(groupMembershipPage.OnPage) + 1) + ");'>Next>></a></li>";
                    }
                    groupsHtml += "</p>";
                    
                    //End Pagination for Group List            
                    groupsHtml += "</ul><div class=\"PersonaStyle_GroupListClear\"></div>";                   
                    groupsHtml += "</div>";                   
                    groupsDiv.innerHTML = groupsHtml;
                    
                    while(groupsContainer.hasChildNodes()) {
                        groupsContainer.removeChild(groupsContainer.childNodes[0]);
                    }
                    groupsContainer.appendChild(groupsDiv);
                }   
            }
        });
    }
    // fire any other events
    this.FireEvent('persona:home');
}

SiteLifeProxy.prototype.WatchItem = function(Controller,Method,WatchKey, targetDiv) {
    var url = this.__baseUrl + '/'+Controller+'/' + Method + '?' + 'plckWatchKey=' + WatchKey + '&plckElementId=' + targetDiv + '&plckWatchUrl=' + this.EscapeValue(window.location.href);
    this.__Send(url, "AddWatchScript");
    return false;
}
SiteLifeProxy.prototype.PersonaRemoveWatchItem= function(UserId, WatchKey, Div, View) {
   return this.PersonaSend('PersonaRemoveWatchItem', Div, 'personaScript', UserId, 'plckWatchView=' + View + '&plckWatchKey=' + WatchKey);
}
SiteLifeProxy.prototype.PersonaAddFriend= function(UserId) {
   return this.PersonaSend('PersonaAddFriend', 'personaHDest', 'personaScript', UserId);
}
SiteLifeProxy.prototype.PersonaRemoveFriend = function(UserId, Friend, Div, View, Expanded, confirmMsg) {
   if(!Expanded) Expanded = "false";
   if (confirm(confirmMsg) == true) {
    return this.PersonaSend('PersonaRemoveFriend', Div, 'personaScript', UserId, 'plckFriendView=' + View + '&plckFriend=' + Friend + '&plckExpanded=' + Expanded);
   }
   return false;
}
SiteLifeProxy.prototype.PersonaRemovePendingFriend = function(UserId, PendingFriend, Div, confirmMsg) {
   if (confirm(confirmMsg) == true) {
    return this.PersonaSend('PersonaRemovePendingFriend', Div, 'personaScript', UserId, 'plckPendingFriend=' + PendingFriend);
   }
   return false;
}
SiteLifeProxy.prototype.PersonaAddPendingFriend = function(UserId, PendingFriend, Div) {
    return this.PersonaSend('PersonaAddPendingFriend', Div, 'personaScript', UserId, 'plckPendingFriend=' + PendingFriend);
}
SiteLifeProxy.prototype.PersonaMessages = function(UserId) {
   var AdParams = this.GetParameter('plckCurrentPage') ? 'plckCurrentPage=' + this.GetParameter('plckCurrentPage') : "";
   var scrl = this.GetParameter('plckScrollToAnchor');  if(scrl){ if(AdParams) {AdParams +='&';} AdParams += 'plckScrollToAnchor=' + scrl;}
   if(this.GetParameter('plckMessageSubmitted')){if(AdParams) {AdParams +='&';} AdParams += 'plckMessageSubmitted=' + this.GetParameter('plckMessageSubmitted');}
   return this.PersonaSend('PersonaMessages', 'personaDest', 'personaScript', UserId, AdParams, 'persona:messages');
}
SiteLifeProxy.prototype.PersonaComments = function(UserId) {
   var AdParams = this.GetParameter('plckCurrentPage') ? 'plckCurrentPage=' + this.GetParameter('plckCurrentPage') : "";
   return this.PersonaSend('PersonaComments', 'personaDest', 'personaScript', UserId, AdParams, 'persona:comments');
}
SiteLifeProxy.prototype.PersonaBlog = function(UserId) {
   var AdParams = this.GetParameter('plckCurrentPage') ? 'plckCurrentPage=' + this.GetParameter('plckCurrentPage') : "";
   if(AdParams) {AdParams +='&';} AdParams += 'plckBlogId=' + UserId;
   var url = this.__baseUrl + '/PersonaBlog/PersonaBlog?plckElementId=personaDest&plckUserId='+ UserId + '&' + AdParams;
   this.__Send(url, 'personaScript', 'persona:blog', arguments);
   return false;
}
SiteLifeProxy.prototype.PersonaProfile = function(UserId) {
    return this.PersonaSend('PersonaProfile', 'personaDest', 'personaScript', UserId, null, 'persona:profile');
}
SiteLifeProxy.prototype.PersonaWatchListPaginate = function(UserId, pageNum) { 
    return this.PersonaPaginate('WatchList', pageNum, UserId);
}
SiteLifeProxy.prototype.PersonaFriendsPaginate = function(UserId, pageNum) { 
	var AdParam = "plckFullFriendsList=true";
    return this.PersonaPaginate('Friends', pageNum, UserId, AdParam);
}

SiteLifeProxy.prototype.PersonaFriendsExpand= function(UserId) { 
    var url = this.__baseUrl + '/Persona/PersonaFriends?plckFullFriendsList=true&plckFriendsPageNum=0&plckElementId=PersonaFriendsDest&plckUserId='+ UserId;
    this.__Send(url, 'PersonaFriendsScript');
    return false;
}
SiteLifeProxy.prototype.PersonaFriendsCollapse= function(UserId, pageNum) { 
    var url = this.__baseUrl + '/Persona/PersonaFriends?plckFullFriendsList=false&plckFriendsPageNum=0&plckElementId=PersonaFriendsDest&plckUserId='+ UserId;
    this.__Send(url, 'PersonaFriendsScript');
    return false;
}

SiteLifeProxy.prototype.PersonaPendingFriendsPaginate = function(UserId, pageNum) { 
    var AdParam = "plckPendingFriendsPageNum=" + pageNum;
    return this.PersonaPaginate('Friends', 0, UserId,AdParam);
}
SiteLifeProxy.prototype.PersonaMessagesPreviewPaginate = function(UserId, pageNum) { 
    return this.PersonaPaginate('MessagesPreview', pageNum, UserId);
}
SiteLifeProxy.prototype.PersonaMessageRemove = function(UserId, pageNum, MessageKey, confirmMsg) { 
   if (confirm(confirmMsg) == true) {
        return this.PersonaSend('PersonaRemoveMessage', 'personaDest', 'PersonaMessagesPageScript', UserId, 'plckCurrentPage='+ pageNum + '&plckMessageKey='+MessageKey);
   }
   return false;
}
SiteLifeProxy.prototype.PersonaSend = function(ApiName, DestDiv, ScriptName, UserId, AddParams, eventId){
    var url = this.__baseUrl + '/Persona/' + ApiName + '?plckElementId=' + DestDiv + '&plckUserId='+ UserId;
    if(AddParams) url += '&' + AddParams;
    this.__Send(url, ScriptName, eventId, arguments);
    return false;
}

SiteLifeProxy.prototype.PersonaPaginate = function(ApiName, PageNum, UserId, AddParams){
    var url = this.__baseUrl + '/Persona/Persona' + ApiName + '?plck' + ApiName + 'PageNum=' + PageNum + '&plckElementId=Persona' + ApiName + 'Dest&plckUserId='+ UserId;
    if(AddParams) url += '&' + AddParams;    
    this.__Send(url, 'Persona'+ ApiName + 'Script');
    return false;
}

SiteLifeProxy.prototype.PersonaPhotoSend = function(ApiName, DestDiv, ScriptName, UserId, AddParams, eventId){
    var url = this.__baseUrl + '/PersonaPhoto/' + ApiName + '?plckElementId=' + DestDiv + '&plckUserId='+ UserId;
    if(AddParams) url += '&' + AddParams;
    this.__Send(url, ScriptName, eventId, arguments);
    return false;
}

SiteLifeProxy.prototype.PersonaMostRecent = function(UserId, PhotoID, DestDiv) {
   return this.PersonaPhotoSend('PersonaMostRecent', DestDiv, 'personaScript', UserId,'plckPhotoID=' + PhotoID);
}

SiteLifeProxy.prototype.PersonaCommunityGroupsPaginate = function(UserId, PageNum){
	return this.PersonaPaginate('CommunityGroups', PageNum, UserId);
}

SiteLifeProxy.prototype.PersonaCreateGallery = function(UserId) {
     return this.PersonaPhotoSend('UserGalleryCreate', 'personaDestPhoto', 'personaScript', UserId);
}

SiteLifeProxy.prototype.PersonaEditGallery = function(UserId,GalleryID) {
     return this.PersonaPhotoSend('UserGalleryEdit', 'userGalleryDest', 'personaScript', UserId,'plckGalleryID=' + GalleryID);
}

SiteLifeProxy.prototype.PersonaUploadToUserGallery = function(GalleryId) {
    var url = this.__baseUrl + '/Photo/PhotoUpload?plckElementId=userGalleryDest&plckGalleryID='+ GalleryId;
    this.__Send(url);
    return false;
}

SiteLifeProxy.prototype.PersonaPhotos = function(UserId) {
     return this.PersonaPhotoSend('PersonaPhotos', 'personaDest', 'personaScript', UserId, null, 'persona:photos');
}
SiteLifeProxy.prototype.PersonaAllPhotos = function(UserId) {
     return this.PersonaPhotoSend('PersonaAllPhotos', 'personaDest', 'personaScript', UserId);
}

SiteLifeProxy.prototype.PersonaGalleryPhoto = function(UserId, plckFindCommentKey) {
	var findCommentKey = gSiteLife.ReadFindCommentKey(findCommentKey, "widget:personaGalleryPhoto");
	
    return this.PersonaPhotoSend('PersonaGalleryPhoto', 'personaDest', 'personaScript', UserId, 'plckFindCommentKey=' + findCommentKey, "widget:personaGalleryPhoto");
}
SiteLifeProxy.prototype.PersonaMyRecentPhotos = function(UserId,ElementId, PageNum) {
     return this.PersonaPhotoSend('PersonaMyRecentPhotos', ElementId, 'personaScript', UserId,'plckPageNum=' + PageNum);
}

SiteLifeProxy.prototype.PersonaGallery = function(UserId,GalleryId,PageNum) {
     if(!PageNum){
        PageNum = gSiteLife.GetParameter("plckPageNum") ? gSiteLife.GetParameter("plckPageNum") : 0;
     }
     if(!GalleryId) {
        GalleryId = gSiteLife.GetParameter("plckGalleryID");
     }
     return this.PersonaPhotoSend('PersonaGallery', 'personaDest', 'personaScript', UserId,'plckGalleryID='+ GalleryId + '&plckPageNum=' + PageNum);
}

SiteLifeProxy.prototype.UserGalleryList = function(UserId,ElementId, PageNum) {
     return this.PersonaPhotoSend('UserGalleryList', ElementId, 'personaScript', UserId,'plckPageNum=' + PageNum);
}
SiteLifeProxy.prototype.PersonaGallerySubmissions = function(UserId,ElementId, PageNum){
     return this.PersonaPhotoSend('PersonaGallerySubmissions', ElementId, 'personaScript', UserId,'plckPageNum=' + PageNum);
} 

SiteLifeProxy.prototype.PersonaGalleryPhoto = function(UserId, plckFindCommentKey) {
	var findCommentKey = gSiteLife.ReadFindCommentKey(findCommentKey, "widget:personaPhoto");
    
    var photoid = gSiteLife.GetParameter('plckPhotoID');
    return this.PersonaPhotoSend('PersonaGalleryPhoto', 'personaDest','personaScript', UserId,'&plckPhotoID=' +photoid + '&plckFindCommentKey=' +findCommentKey, "widget:personaPhoto");
}
SiteLifeProxy.prototype.PersonaRecentGalleryPhoto = function(UserId) {
    var photoid = gSiteLife.GetParameter('plckPhotoID');
    return this.PersonaPhotoSend('PersonaRecentGalleryPhoto', 'personaDest','personaScript', UserId,'&plckPhotoID=' +photoid);
}

SiteLifeProxy.prototype.LoadPersonaGalleryPage = function(UserId,GalleryID) {
    var params = new Object(); params['plckPersonaPage'] = 'PersonaGallery'; params['plckUserId'] = UserId; 
            params['userid'] = UserId;
        params['plckGalleryID'] = GalleryID;
    this.ReloadPage(params);
    return false;
}
SiteLifeProxy.prototype.LoadPersonaPhotoPage = function(UserId,PhotoID) {
    var params = new Object(); params['plckPersonaPage'] = 'PersonaGalleryPhoto'; params['plckUserId'] = UserId;
            params['userid'] = UserId;
        params['plckPhotoID'] = PhotoID;
    this.ReloadPage(params);
    return false;
}
SiteLifeProxy.prototype.LoadPersonaRecentPhotoPage = function(UserId,PhotoID) {
    var params = new Object(); params['plckPersonaPage'] = 'PersonaRecentGalleryPhoto'; params['plckUserId'] = UserId;
            params['userid'] = UserId;
        params['plckPhotoID'] = PhotoID;
    this.ReloadPage(params);
    return false;
}

var fbHelpDialogTimeout;
SiteLifeProxy.prototype.ShowFacebookHelpDialog = function(icon){
	var x = 0;
	var y = icon.clientHeight/2;

	do {
		x += icon.offsetLeft;
		y += icon.offsetTop;
	}
	while(icon = icon.offsetParent);

	var fb_div = document.getElementById("Persona_FacebookHelpDialog");
	
	fb_div.style.position = "absolute";
	fb_div.style.display = "block";
	
	// position div to the left of icon.
	var newX = x - fb_div.clientWidth;
	var newY = y - Math.floor(fb_div.clientHeight/2);
	
	fb_div.style.left = newX + "px";
	fb_div.style.top = newY + "px";

	return false;
}

SiteLifeProxy.prototype.HideFacebookHelpDialog = function(){
	var fb_div = document.getElementById("Persona_FacebookHelpDialog");
	fb_div.style.display = "none";
}

SiteLifeProxy.prototype.CopyRssUrlToClipboard = function(){	
	rssUrl = document.getElementById("rssUrl");
	copy(rssUrl);
	
	return false;
}

/* note: doesn't work with flash 10 */
function copy(inElement) {
  if (inElement.createTextRange) {
    var range = inElement.createTextRange();
    if (range)
      range.execCommand('Copy');
  } else {
    var flashcopier = 'flashcopier';
    if(!document.getElementById(flashcopier)) {
      var divholder = document.createElement('div');
      divholder.id = flashcopier;
      document.body.appendChild(divholder);
    }
    document.getElementById(flashcopier).innerHTML = '';
    var divinfo = '<embed src="' + gSiteLife.__baseUrl + '/Content/swf/clipboard.swf" FlashVars="clipboard='+encodeURIComponent(inElement.value)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
    document.getElementById(flashcopier).innerHTML = divinfo;
  }
}

SiteLifeProxy.prototype.UpdateExternalUserId = function(ExternalSiteName, ExternalSiteUserId) {
	var adParam = this.BaseAdParam();
	adParam += "&externalSiteName=" + ExternalSiteName;
	adParam += "&externalSiteUserId=" + ExternalSiteUserId;
	return this.PersonaSend('UpdateExternalUserId', 'personaHDest', 'personaScript', adParam);
}






SiteLifeProxy.prototype.SolicitPhoto = function(galleryID) {
	var elementId = 'plcksolicit' + galleryID;
	this.WriteDiv(elementId);
    var url = this.__baseUrl + '/Photo/SolicitPhoto?plckElementId=' + elementId + '&plckGalleryID=' +galleryID;
    this.__Send(url);
    return false;
}

SiteLifeProxy.prototype.PhotoUpload = function() {
	var elementId = 'plcksubmit';
	this.WriteDiv(elementId);
    var galleryID = gSiteLife.GetParameter('plckGalleryID');

    var url = this.__baseUrl + '/Photo/PhotoUpload?plckElementId=' + elementId + '&plckGalleryID=' +galleryID;
    this.__Send(url);
    return false;
}

SiteLifeProxy.prototype.PublicGallery = function() {
    var elementId = 'plckgallery';
	this.WriteDiv(elementId);
	var galleryID = gSiteLife.GetParameter('plckGalleryID');
    var pageNum = gSiteLife.GetParameter('plckPageNum');
	
    var url = this.__baseUrl + '/Photo/PublicGallery?plckElementId=' + elementId + '&plckGalleryID=' +galleryID + '&plckPageNum=' +pageNum;
	this.__Send(url);
	return false;
}


SiteLifeProxy.prototype.GalleryPhoto = function() {
	var elementId = 'plckphoto';
	this.WriteDiv(elementId);
    var photoid = gSiteLife.GetParameter('plckPhotoID');
    var findCommentKey = gSiteLife.ReadFindCommentKey(null, "widget:galleryPhoto");

    var url = this.__baseUrl + '/Photo/GalleryPhoto?plckElementId=' + elementId + '&plckPhotoID=' +photoid + '&plckFindCommentKey=' + findCommentKey;
	this.__Send(url, null, "widget:galleryPhoto");
	return false;
}

SiteLifeProxy.prototype.PublicGalleries = function() {
	var elementId = 'plckgalleries';
	this.WriteDiv(elementId);
    var pageNum = gSiteLife.GetParameter('plckPageNum') ?  gSiteLife.GetParameter('plckPageNum') : "0";

    var url = this.__baseUrl + '/Photo/PublicGalleries?plckElementId=' + elementId + '&plckPageNum=' + pageNum;
    this.__Send(url);
    return false;
}

SiteLifeProxy.prototype.PhotoRecommend = function(targetid,recommendDiv,isGallery) {
    var url = this.__baseUrl + '/Photo/Recommend?plckElementId=' + recommendDiv + '&plckTargetid=' +targetid + '&plckIsGallery=' +isGallery ;
    this.__Send(url);
    return false;
}

//<script type="text/javascript">

//parentKeyType can be any gSiteLife.KeyType* value, but for including this widget on an article page the value is 
//typically gSiteLife.KeyTypeExternalResource
SiteLifeProxy.prototype.Comments = function(parentKeyType, parentKey, pageSize, sort, showTabs, tab, parentUrl, parentTitle, refreshPage, findCommentKey)
{
	return this.CommentsInternal(parentKeyType, parentKey, pageSize, sort, showTabs, tab, parentUrl, parentTitle, false, false, null, refreshPage, findCommentKey);
};

SiteLifeProxy.prototype.CommentsInput = function(parentKeyType, parentKey, redirectToUrl)
{    
    return this.CommentsInternal(parentKeyType, parentKey, null, "TimeStampDescending", null, null, null, null, true, false, redirectToUrl, false, null);
};

SiteLifeProxy.prototype.CommentsOutput = function(parentKeyType, parentKey, refreshPage, pageSize, sortOrder)
{
    sortOrder = sortOrder || "TimeStampDescending";
	return this.CommentsInternal(parentKeyType, parentKey, pageSize, sortOrder, null, null, null, null, false, true, null, refreshPage, null);
}

SiteLifeProxy.prototype.CommentsRefresh = function(parentKeyType, parentKey, pageSize, sortOrder)
{
    if (!parentKey || parentKey == "") throw "Must pass in value for parentKey!";
    return this.CommentsInternal(parentKeyType, parentKey, pageSize, sortOrder, null, null, null, null, false, false, null, true, null);
}

SiteLifeProxy.prototype.CommentsInternal = function(parentKeyType, parentKey, pageSize, sort, showTabs, tab, parentUrl, parentTitle, hideView, hideInput, redirectToUrl, refreshPage, findCommentKey)
{
    var divId = 'Comments_Container';
    if(this.numCommentsWidgets){ divId += this.numCommentsWidgets++; } else { this.numCommentsWidgets = 1; }
    
    document.write("<div id='" + divId + "'></div>");
    
    return this.GetComments(parentKeyType, parentKey, parentUrl, parentTitle, 0, pageSize, sort, showTabs, tab, hideView, hideInput, redirectToUrl, refreshPage, divId, findCommentKey);
}

SiteLifeProxy.prototype.ReadFindCommentKey = function(plckFindCommentKey, eventName){
	var findCommentKey = plckFindCommentKey || gSiteLife.GetParameter("plckFindCommentKey") || "";
    if(findCommentKey == "none"){
		findCommentKey = "";
    }
    
    if(findCommentKey != "" && eventName){
		this.AddEventHandler(eventName, function(){gSiteLife.ScrollToComment(findCommentKey)});
    }
    
    return findCommentKey;
}

SiteLifeProxy.prototype.GetComments = function(parentKeyType, parentKey, parentUrl, parentTitle, page, pageSize, sort, showTabs, tab, hideView, hideInput, redirectTo, refreshPage, divId, findCommentKey)
{
    parentKeyType = parentKeyType || "ExternalResource";
    parentUrl = parentUrl || gSiteLife.__StripAnchorFromUrl(window.location.href);
    parentUrl = gSiteLife.EscapeValue(parentUrl);
    parentKey = parentKey || gSiteLife.__StripAnchorFromUrl(window.location.href);
    parentTitle = parentTitle || gSiteLife.EscapeValue(gSiteLife.Trim(document.title));
    page = page || gSiteLife.GetParameter('plckCurrentPage') || 0;
    pageSize = pageSize || 10;
    sort = sort || "TimeStampAscending";
    showTabs = showTabs || false;
    tab = tab || "MostRecent";
    hideView = hideView || false;
    hideInput = hideInput || false;
    redirectTo =gSiteLife.EscapeValue(redirectTo) || "";
    refreshPage = refreshPage || false;
    findCommentKey = gSiteLife.ReadFindCommentKey(findCommentKey, "widget:comments");
    
    var url = this.__baseUrl + 
        '/Comment/GetPage.rails?plckTargetKeyType='+ parentKeyType + 
        '&plckTargetKey=' + escape(parentKey) + 
        "&plckCurrentPage=" + page + 
        "&plckItemsPerPage=" + pageSize + 
        "&plckSort=" + sort + 
        "&plckElementId=" + divId +
        "&plckTargetUrl=" + parentUrl +
        "&plckTargetTitle=" + parentTitle +
        "&plckHideView=" + hideView +
        "&plckHideInput=" + hideInput +
        "&plckRefreshPage=" + refreshPage +
        "&plckRedirectToUrl=" + redirectTo +
        "&plckFindCommentKey=" + findCommentKey;

    if (showTabs) {
        url = url + "&plckShowTabs=true&plckTab=" + tab;
    }
    this.__Send(url, null, "widget:comments");
    return false;
};

SiteLifeProxy.prototype.WaitForImages = function(callback){
	var allImgs = document.images;
	
}

SiteLifeProxy.prototype.ScrollToComment = function(commentKey){
		setTimeout(function(){
		window.location.hash = "#" + commentKey;
	}, 300);
}

SiteLifeProxy.prototype.Blog = function(BlogId) {
    this.WriteDiv("blogDest", "Persona_Main");
    var action = this.GetParameter("plckBlogPage");
    // If BlogId was not explicitly stated, grab it from the URL parameter...
    if(!BlogId){
		BlogId = this.GetParameter('plckBlogId');
    }
    
        
	if(action && action != "Blog" && (typeof this[action] == 'function')){
	 return this[action](BlogId);
	}else{
	   var AdParams = this.GetParameter('plckCurrentPage') ? 'plckCurrentPage=' + this.GetParameter('plckCurrentPage') : "";
	   return this.BlogSend('Blog', 'Blog', 'blogDest', 'blogScript', BlogId, AdParams);
	}
}
SiteLifeProxy.prototype.LoadBlogPage = function(PageName, BlogId) {
    var params = new Object(); params['plckBlogPage'] = PageName; params['plckBlogId'] = BlogId; 
    for(ii=2; ii< this.LoadBlogPage.arguments.length; ii+=2) { params[this.LoadBlogPage.arguments[ii]] = this.LoadBlogPage.arguments[ii+1];}
    this.ReloadPage(params);
    return false;
}

SiteLifeProxy.prototype.BlogViewEdit = function(blogId) {
   return this.BlogSend(null, 'BlogViewEdit', null, null, blogId);
}

SiteLifeProxy.prototype.BlogPostCreate = function(blogId) {
   return this.BlogSend(null, 'BlogPostCreate', null, null, blogId, 'plckRedirectUrl=' + this.GetParameter("plckRedirectUrl"));
}

SiteLifeProxy.prototype.BlogPendingComments = function(blogId, currentPage) {
   if( !currentPage) currentPage = 0;
   return this.BlogSend(null, 'BlogPendingComments', null, null, blogId, 'plckCurrentPage='+currentPage);
}

SiteLifeProxy.prototype.BlogSettings = function(blogId) {
   return this.BlogSend(null, 'BlogSettings', null, null, blogId);
}

SiteLifeProxy.prototype.BlogEditPost = function(blogId, controller, div, script, postId, selection, daysBack) {
	return this.BlogSend(controller, 'BlogPostEdit', div, script, blogId, 'plckPostId=' + postId + '&plckSelection=' + selection + '&plckDaysBack=' + daysBack + '&plckRedirectUrl=' + this.EscapeValue(window.location.href));
}

SiteLifeProxy.prototype.BlogRemovePost = function(blogId, controller, div, script, postId, selection, daysBack, confirmMsg) {
  if (confirm(confirmMsg) == true) {
    return this.BlogSend(controller, 'BlogRemovePost', div, script, blogId, 'plckPostId=' + postId + '&plckSelection=' + selection + '&plckDaysBack=' + daysBack );
  }
  return false;
}

SiteLifeProxy.prototype.BlogViewPost = function(blogId, postId, selection, daysBack) {
    if(!postId ) { postId = gSiteLife.GetParameter('plckPostId'); }
    var findCommentKey = gSiteLife.ReadFindCommentKey(null, "widget:blog");
	return this.BlogSend(null, 'BlogViewPost', null, null, blogId, 'plckPostId=' + postId + '&plckSelection=' + selection + '&plckDaysBack=' + daysBack + '&plckCommentSortOrder=' + this.GetParameter('plckCommentSortOrder') + '&plckFindCommentKey=' + findCommentKey);
}

SiteLifeProxy.prototype.BlogViewMonth = function(blogId, monthId) {
	if(!monthId ) { monthId = gSiteLife.GetParameter('plckMonthId'); }
	var AdParams = 'plckMonthId=' + monthId;
	AdParams += this.GetParameter('plckCurrentPage') ? '&plckCurrentPage=' + this.GetParameter('plckCurrentPage') : "";
	return this.BlogSend(null, 'BlogViewMonth', null, null, blogId,  AdParams);
}

SiteLifeProxy.prototype.AddBlogWatchItem= function(blogId, controller, script, Url, WatchKey) {
   return this.BlogSend(controller, 'AddBlogWatch', 'plckBlogWatchDiv', script, blogId, 'plckWatchKey=' + WatchKey + '&plckWatchUrl=' + this.EscapeValue(Url));
}
SiteLifeProxy.prototype.RemoveBlogWatchItem= function(blogId, controller, script, WatchKey) {
   return this.BlogSend(controller, 'RemoveBlogWatch', 'plckBlogWatchDiv', script, blogId, 'plckWatchKey=' + WatchKey);
}

SiteLifeProxy.prototype.BlogViewTag = function(blogId, tag) {
	if(!tag ) { tag = gSiteLife.GetParameter('plckTag'); }
	var AdParams = 'plckTag=' + tag;
	AdParams += this.GetParameter('plckCurrentPage') ? '&plckCurrentPage=' + this.GetParameter('plckCurrentPage') : "";
	return this.BlogSend(null, 'BlogViewTag', null, null, blogId, AdParams );
}

SiteLifeProxy.prototype.BlogRefreshViewEditList= function(blogId, controller, div, script, selection, daysBack) {
	return this.BlogSend(controller, 'BlogRefreshViewEditList', div, script, blogId, 'plckSelection=' + selection + '&plckDaysBack=' + daysBack  );
}

SiteLifeProxy.prototype.BlogSend = function(controller, apiName, destDiv, scriptName, blogId, addParams){
    if(!controller) controller = this.GetParameter('plckController') || "Blog";
    if(!destDiv) destDiv = this.GetParameter('plckElementId') || "blogDest";
    if(!scriptName) scriptName = this.GetParameter('plckScript') || "blogScript";
    var url = this.__baseUrl + '/' + controller + '/' + apiName + '?plckElementId=' + destDiv + '&plckBlogId=' + blogId + '&' + addParams;
    this.__Send(url, scriptName, 'widget:blog');
    return false;
}

SiteLifeProxy.prototype.Recommend = function(controller, itemId, recommendDiv) {
    var url = this.__baseUrl + '/' + controller + '/Recommend?plckElementId=' + recommendDiv + '&plckItemId=' +itemId;
    this.__Send(url);
    return false;
}
SiteLifeProxy.prototype.BlogSelectPendingComments = function(formId, checked) {   
    var form = document.getElementById(formId);
    for (i=0; i<form.elements.length; i++) {
        var input = form.elements[i];        
        input.checked = checked;
    }
}

SiteLifeProxy.prototype.Forums = function(numPerPage) {    
	this.WriteDiv("forumDest", "Forum_Main");
	
	var action = this.GetParameter("plckForumPage");
		
		
	var forumId = this.GetParameter('plckForumId');        
	if (forumId)
	{
		forumId = unescape(forumId);
		var i = forumId.indexOf('Forum:');
		forumId = forumId.substring(i).replace(':', '_');    
	}
	else
	{
		var discussionId = this.GetParameter('plckDiscussionId');
		if (discussionId)
		{                    
			discussionId = unescape(discussionId);
			var i = discussionId.indexOf('Forum:');
			var j = discussionId.indexOf('Discussion:');
			forumId = discussionId.substring(i, j).replace(':', '_');
		}
	}
    
	var categoryCurrentPage = this.GetParameter('plckCategoryCurrentPage');
	if(action && (typeof this[action] == 'function') && action != 'ForumCategories'){
		this[action]();
	}
	else {     
		if( numPerPage == null ){
			numPerPage = this.GetParameter('plckNumPerPage');
		}
		this.ForumCategories(numPerPage, categoryCurrentPage);
	}
}

SiteLifeProxy.prototype.SetupCallbacks = function(){
	var adParam = "";
    var showFirstUnread = this.GetParameter('plckShowFirstUnread'); 
    var findPostKey = this.GetParameter('plckFindPostKey');
    if(showFirstUnread != null){
		adParam += "&plckShowFirstUnread=" + showFirstUnread;
		this.AddEventHandler("widget:forums", function(){gSiteLife.DiscussionScrollToPost()});
    }
    if(findPostKey != null && findPostKey != ""){
		adParam += "&plckFindPostKey=" + findPostKey;
		this.AddEventHandler("widget:forums", function(){gSiteLife.DiscussionScrollToPost()});
    }
    var showLatestPost = this.GetParameter('plckShowLatestPost'); 
    if(showLatestPost != null){
		adParam += "&plckShowLatestPost=" + showLatestPost;
		this.AddEventHandler("widget:forums", function(){gSiteLife.DiscussionScrollToPost()});
    }
    
    this.AddEventHandler("widget:forums", function(){
		gSiteLife.DiscussionScanForUnread();

		// insert poll widget if the discussion is a poll		

		var me = this;
		var insertPoll = function(retryCount) {
			if (retryCount > 10) {
				return;
			}
			if (typeof(retryCount) === 'undefined') {
				retryCount = 0;
			}
			var pollWidgetDiv = document.getElementById('Discussion_Poll_Container');
			if (pollWidgetDiv) {
				var discussionKey = document.getElementById('DiscussionKeyContainer').value;
				slGetDiscussionPollOnKey = function() {
					return discussionKey;
				}
				window.slPollWidgetDiv = document.getElementById('Discussion_Poll');
				var pollInsertionScript = document.createElement('script');
				pollInsertionScript.type = 'text/javascript';
				pollInsertionScript.src = 'http://sitelife.soundersfc.com/ver1.0/Forums/PollParams?plckDiscussionId=' + discussionKey;
				document.getElementsByTagName('head')[0].appendChild(pollInsertionScript);
			}
			else {
				setTimeout(function() {
					insertPoll(retryCount + 1);
				}, 100);
			}
		}
		insertPoll();

    	});

	// Hack for the anchor on the categories page...

	this.AddEventHandler("widget:forums", function(){
		if(document.location.hash){
			var foo = document.location.hash + "";
			document.location.hash = foo;
		}
	});
    
    return adParam;
}

SiteLifeProxy.prototype.ForumCategories = function(numPerPage, categoryCurrentPage) {
    var pageNum = this.GetParameter('plckCurrentPage'); if(pageNum == null) pageNum = 0;
    var urlPageInfoStr = '';
    urlPageInfoStr = '&plckNumPerPage=' + numPerPage;        
    urlPageInfoStr += '&plckCategoryCurrentPage=' + categoryCurrentPage;
    return this.ForumSend("ForumCategories", "forumDest", "ForumMain", 'plckCurrentPage=' + pageNum + urlPageInfoStr);
}
SiteLifeProxy.prototype.Forum = function() {
    var forumId = this.GetParameter('plckForumId');
    var categoryPageNum = this.GetParameter('plckCategoryCurrentPage');
    if(categoryPageNum == null) { categoryPageNum = 0; }
    var discussionPageNum = this.GetParameter('plckCurrentPage');
    if (discussionPageNum == null) { discussionPageNum = 0; }
    var numPerPage = this.GetParameter('plckNumPerPage');
    var urlPageInfoStr = '';
    if( numPerPage != null ){
        urlPageInfoStr = '&plckNumPerPage=' + numPerPage;
    }
   return this.ForumSend('Forum', 'forumDest', 'ForumMain', 'plckForumId=' + forumId + '&plckCurrentPage=' + discussionPageNum + '&plckCategoryCurrentPage=' + categoryPageNum + urlPageInfoStr );
}
SiteLifeProxy.prototype.ForumDiscussion = function() {
    var dId = this.GetParameter("plckDiscussionId");
    var adParam = "plckDiscussionId=" + dId;
    var showLast = this.GetParameter("plckShowLastPage"); if(showLast) adParam += "&plckShowLastPage=true";
    var pageNum = this.GetParameter('plckCurrentPage'); if(pageNum == null) pageNum = 0;
	adParam += this.SetupCallbacks(); 
    adParam += "&plckCurrentPage=" + pageNum;
    adParam += "&plckCategoryCurrentPage=" + this.GetParameter('plckCategoryCurrentPage');   
    
    return this.ForumSend("ForumDiscussion", "forumDest", "ForumMain", adParam);
}

SiteLifeProxy.prototype.DiscussionScanForUnread = function(discussionKey){
	var postDatesContainer = document.getElementById("PostDateInfoContainer");
	if(!postDatesContainer){
		return;
	}
	
	this.postDates = eval(postDatesContainer.value);
	this.latestPost = new Date(document.getElementById("LastReadContainer").value);
	this.screenBottom = 0;
	if(discussionKey){
		this.discussionKey = discussionKey;
	}
	else if (document.getElementById('DiscussionKeyContainer')){
		this.discussionKey = document.getElementById('DiscussionKeyContainer').value;
	}
	
	this.checkForReadInterval = setInterval(function(){gSiteLife.DiscussionCheckForLatestPost();}, 1000);
}

SiteLifeProxy.prototype.DiscussionScrollToPost = function(){
	if(!document.getElementById("Discussion_ScrollToPostKey")){
		return false;
	}
	
	var postKey = document.getElementById("Discussion_ScrollToPostKey").value;
	var post = document.getElementById(postKey);
	
	if(!post){
		return false;
	}
	
	var postTop = 0;
	if(post.offsetParent){
		obj = post;
		do{
			postTop += obj.offsetTop;
		}
		while(obj = obj.offsetParent);
		window.scrollBy(0, postTop);
	}
}

SiteLifeProxy.prototype.IsPostOnScreen = function(screenBottom, postIndex){
	var postId = "readIndicator_" + this.postDates[postIndex].Key;
	var post = document.getElementById(postId);
	if(post){
		var postTop = 0;
		if(post.offsetParent){
			obj = post;
			do{
				postTop += obj.offsetTop;
			}
			while(obj = obj.offsetParent);
		}
		var postBottom = postTop + post.offsetHeight;
		
		if(postBottom < screenBottom){
			return true;
		}
	}
	
	return false;
}

SiteLifeProxy.prototype.DiscussionCheckForLatestPost = function(){
	var screenTop = 0;
	if (typeof(window.pageYOffset) !== 'undefined') {
		screenTop = window.pageYOffset;
	}
	else if (typeof(document.documentElement) !== 'undefined' && typeof(document.documentElement.scrollTop) !== 'undefined' && document.documentElement.scrollTop > 0) {
		screenTop = document.documentElement.scrollTop;
	}

	else if (typeof(document.body.scrollTop) !== 'undefined' && document.body.scrollTop > 0) {
		screenTop = document.body.scrollTop;
	}
	
	var screenBottom = Math.pow(2,52); /*Supposing our browser can't get the height, we mark everything as read.*/
	if(window.innerHeight){
		screenBottom = screenTop + window.innerHeight;
	}
	else if(document.documentElement.clientHeight && document.documentElement.clientHeight != 0){
		screenBottom = screenTop + document.documentElement.clientHeight;
	}
	else if(document.body.clientHeight){
		screenBottom = screenTop + document.body.clientHeight;
	}
	
	/* Only update if we've scrolled down since last poll. */
	if(screenBottom <= this.screenBottom){
		return;
	}
	
	/* Just give up if there are no posts. */
	if(!this.postDates || this.postDates.length <= 0){
		clearInterval(this.checkForReadInterval);
		return;
	}
	
	/* If the last post is already marked read, don't bother polling. */
	if(this.postDates[(this.postDates.length - 1)].Timestamp <= this.latestPost){
		clearInterval(this.checkForReadInterval);
		return;
	}
	
	this.screenBottom = screenBottom;
	
	var latestKey = null;
	
	for(i=0; i < this.postDates.length; i++){
		if(this.IsPostOnScreen(screenBottom, i)){
			if(this.postDates[i].Timestamp >= this.latestPost){
				latestKey = this.postDates[i].Key;
				this.latestPost = this.postDates[i].Timestamp;
			}
		}
	}

	if(latestKey){
		this.ForumSetLastRead(this.discussionKey, latestKey);
	}
}

SiteLifeProxy.prototype.ForumCreateDiscussion = function() {
    var adParam = "plckRedirectUrl=" + this.GetParameter("plckRedirectUrl");
    var fId = this.GetParameter("plckForumId"); adParam += "&plckForumId=" + fId;
    var curView = this.GetParameter("plckCurrentView"); if(curView) adParam += "&plckCurrentView=" + curView;
    var curPage = this.GetParameter("plckCurrentPage"); if(curPage) adParam += "&plckCurrentPage=" + curPage;
    var dId = this.GetParameter("plckDiscussionId"); if(dId) adParam += "&plckDiscussionId=" + dId;
    adParam += "&plckCategoryCurrentPage=" + this.GetParameter('plckCategoryCurrentPage');    
    return this.ForumSend("ForumCreateDiscussion", "forumDest", "ForumMain", adParam);
}
SiteLifeProxy.prototype.ForumMain = function() {
    return this.ForumSend("ForumMain", "forumDest", "ForumMain");
}
SiteLifeProxy.prototype.ForumCreatePost = function() {
    var adParam = "plckDiscussionId=" + this.GetParameter("plckDiscussionId") + "&plckRedirectUrl=" + this.EscapeValue(window.location.href);
    var PostId = this.GetParameter("plckPostId"); if(PostId) adParam = adParam + "&plckPostId=" + PostId;
    var IsReply = this.GetParameter("plckIsReply"); if(IsReply) adParam = adParam + "&plckIsReply=" + IsReply;
    var curPage = this.GetParameter("plckCurrentPage"); if(curPage) adParam = adParam + "&plckCurrentPage=" + curPage;
    adParam += "&plckCategoryCurrentPage=" + this.GetParameter("plckCategoryCurrentPage"); 
    return this.ForumSend("ForumCreatePost", "forumDest", "ForumMain", adParam);
}
SiteLifeProxy.prototype.ForumEditPost = function() {
    var adParam = "plckDiscussionId=" + this.GetParameter("plckDiscussionId") + "&plckRedirectUrl=" + this.EscapeValue(window.location.href);
    var PostId = this.GetParameter("plckPostId"); if(PostId) adParam = adParam + "&plckPostId=" + PostId;
    var CurrPage = this.GetParameter("plckCurrentPage"); if(!CurrPage) CurrPage="0"; adParam = adParam + "&plckCurrentPage=" + CurrPage;
    adParam += "&plckCategoryCurrentPage=" + this.GetParameter('plckCategoryCurrentPage');    
    return this.ForumSend("ForumEditPost", "forumDest", "ForumMain", adParam);
}
SiteLifeProxy.prototype.ForumEditProfile = function() {
    return this.ForumSend("ForumEditProfile", "forumDest", "ForumMain", "plckRedirectUrl=" + this.EscapeValue(window.location.href));
}
SiteLifeProxy.prototype.ToggleExpand = function(imageId, tableId) {
  if (!this.collapsedCategories) {
    var cookie = document.cookie && document.cookie.match(/forumCatState=([^;]+)/); 
    cookie = (cookie ? cookie[1].replace(/^\s+|\s+$/g, '') : []); 
    this.collapsedCategories = (cookie.length ? unescape(cookie).split('|') : []);
  }
  var tableElem = document.getElementById(tableId), imgElem = document.getElementById(imageId),
      id = tableId.split(':')[1], cats = this.collapsedCategories, expire;
  if (tableElem.style.display == 'none') {
    tableElem.style.display = 'block';
    imgElem.src = this.__baseUrl + '/Content/images/forums/minus.gif';
    for (var i = 0, length = cats.length; i < length; i++) {
      if ((cats[i] == id) || (cats[i] === ''))
        cats.splice(i,1);
    }
  }
  else {
    tableElem.style.display = 'none';
    cats.push(id); 
    imgElem.src = this.__baseUrl + '/Content/images/forums/plus.gif';
  }
  this.SetCookie('forumCatState', cats.join('|'));
}

SiteLifeProxy.prototype.ForumSearch = function(suffix) {
    var searchText = document.getElementById('plckSearchText'+suffix).value;
    searchText = FixSearchString(searchText);
    var searchArea = document.getElementById('plckSearchArea'+suffix).value;
    this.LoadForumPage("ForumSearchPaginate", "plckSearchText", searchText, "plckSearchArea", searchArea, "plckCurrentPage", "0");
    return false;
}
SiteLifeProxy.prototype.ForumSearchKeyPress = function(event, suffix) {
    if(IsEnter(event)){return this.ForumSearch(suffix);}else{return true;}
}
SiteLifeProxy.prototype.ForumSearchPaginate = function() {	
    return this.ForumSend('ForumSearchPaginate', 'forumDest', 'ForumMain', 'plckSearchArea=' + this.GetParameter('plckSearchArea') + '&plckSearchText=' + this.GetParameter('plckSearchText') + '&plckCurrentPage=' + this.GetParameter('plckCurrentPage'));
}

SiteLifeProxy.prototype.ForumSpecificForumSearchKeyPress = function(event, suffix, forumId) {
    if(IsEnter(event)){return this.ForumSpecificForumSearch(suffix, forumId);}else{return true;}
}
SiteLifeProxy.prototype.ForumSpecificForumSearch = function(suffix, forumId) {
    var searchText = document.getElementById('plckSearchText'+suffix).value;
    searchText = FixSearchString(searchText);
    this.LoadForumPage("ForumSearchSpecificForumPaginate", "plckSearchText", searchText, "plckForumId", forumId, "plckCurrentPage", "0");
    return false;
}
SiteLifeProxy.prototype.ForumSearchSpecificForumPaginate = function(title) {	
    return this.ForumSend('ForumSearchSpecificForumPaginate', 'forumDest', 'ForumMain', 'plckForumId=' + this.GetParameter('plckForumId') + '&plckSearchText=' + this.GetParameter('plckSearchText') + '&plckCurrentPage=' + this.GetParameter('plckCurrentPage'));
}

SiteLifeProxy.prototype.LoadForumPage = function(PageName, paramName, paramVal) {
    var params = new Object(); 
    params['plckForumPage'] = PageName;
    for(ii=1; ii< this.LoadForumPage.arguments.length; ii+=2) { params[this.LoadForumPage.arguments[ii]] = this.LoadForumPage.arguments[ii+1];}
    this.ReloadPage(params);
    return false;
}

SiteLifeProxy.prototype.ForumSend = function(ApiName, DestDiv, ScriptName, AddParams){
    var url = this.__baseUrl + '/Forums/' + ApiName + '?plckElementId=' + DestDiv;
    if(AddParams) url += '&' + AddParams;
    var plckPostSort = this.GetParameter('plckPostSort');
    if (plckPostSort != null){
		url += "&plckPostSort=" + plckPostSort;
	}
    this.__Send(url, ScriptName, 'widget:forums', arguments);
    return false;
}

SiteLifeProxy.prototype.ForumDiscussionEdit = function(discussionId, curView, curPage) {
    return this.ForumSend('ForumDiscussionEdit', 'forumDest', 'ForumMain', 'plckDiscussionId=' + discussionId + '&plckCurrentView=' + curView + '&plckCurrentPage=' + curPage + '&plckRedirectUrl=' + this.EscapeValue(window.location.href));
}

SiteLifeProxy.prototype.ForumPostEdit = function(discussionId, postId, curView, curPage) {
    return this.ForumSend('ForumEditPost', 'forumDest', 'ForumMain', 'plckDiscussionId=' + discussionId + '&plckPostId=' + postId + '&plckCurrentView=' + curView + '&plckCurrentPage=' + curPage + '&plckRedirectUrl=' + this.EscapeValue(window.location.href));
}

SiteLifeProxy.prototype.ForumDiscussionToggleIsSticky = function(discussionId, curView, curPage) {
	return this.ForumSend('ForumDiscussionToggleIsSticky', 'forumDest', 'ForumMain', 'plckDiscussionId=' + discussionId + '&plckCurView=' + curView + '&plckCurrentPage=' + curPage);
}

SiteLifeProxy.prototype.ForumDiscussionToggleIsClosed = function(discussionId, curView, curPage) {
    return this.ForumSend('ForumDiscussionToggleIsClosed', 'forumDest', 'ForumMain', 'plckDiscussionId=' + discussionId + '&plckCurView=' + curView + '&plckCurrentPage=' + curPage );
}

SiteLifeProxy.prototype.ForumDiscussionDelete = function(discussionId, curPage, confirmMsg) {
  if (confirm(confirmMsg) == true) {
    return this.ForumSend('ForumDiscussionDelete', 'forumDest', 'ForumMain', 'plckDiscussionId=' + discussionId + '&plckCurrentPage=' + curPage );
  }
  else {
	return false;
  }
}

SiteLifeProxy.prototype.MoveDiscussion = function(discussionKey, toForum, curView, curPage) {
    return this.ForumSend('MoveDiscussion', 'forumDest', 'ForumMain', 'discussionKey=' + discussionKey + '&toForum=' + toForum + '&plckCurView=' + curView + '&plckCurrentPage=' + curPage );
}

SiteLifeProxy.prototype.ForumEdit = function(forumId, curPage) {
    return this.ForumSend('ForumEdit', 'forumDest', 'ForumMain', 'plckForumId=' + forumId + '&plckCurrentPage=' + curPage  );
}

SiteLifeProxy.prototype.ForumToggleIsClosed = function(forumId, curPage) {
    return this.ForumSend('ForumToggleIsClosed', 'forumDest', 'ForumMain', 'plckForumId=' + forumId + '&plckCurrentPage=' + curPage  );
}

SiteLifeProxy.prototype.ForumDelete = function(forumId, confirmMsg) {
  if (confirm(confirmMsg) == true) {
    return this.ForumSend('ForumDelete', 'forumDest', 'ForumMain', 'plckForumId=' + forumId );
  }
  else {
	return false;
  }
}

SiteLifeProxy.prototype.ForumPostDelete = function(postId, curPage, confirmMsg) {
  if (confirm(confirmMsg) == true) {
    return this.ForumSend('ForumPostDelete', 'forumDest', 'ForumMain', 'plckPostId=' + postId + '&plckCurPage=' + curPage);
  }
  else {
	return false;
  }
}

SiteLifeProxy.prototype.ForumBlockUser = function(postId, userId, value, curPage) {
    return this.ForumSend('ForumBlockUser', 'forumDest', 'ForumMain', 'plckPostId=' + postId + '&plckUserId=' + userId + '&plckValue=' + value + '&plckCurPage=' + curPage);
}

SiteLifeProxy.prototype.ForumMyDiscussionsPaginate = function(pageNum) {
    return this.ForumSend('ForumMyDiscussionsPaginate', 'ForumMyDiscussionsDiv', 'ForumMain', 'plckMyDiscussionsPage=' + pageNum);
}

SiteLifeProxy.prototype.ForumImage = function() {
    var adParam = "plckRedirectUrl=" + this.GetParameter("plckRedirectUrl");
    var pId = this.GetParameter("plckPhotoId"); adParam += "&plckPhotoId=" + pId;
    return this.ForumSend('ForumImage', 'forumDest', 'ForumMain', adParam);
}

SiteLifeProxy.prototype.BaseAdParam = function () {
    var adParam = "plckRedirectUrl=" + this.EscapeValue(window.location.href);
    var fId = this.GetParameter("plckForumId"); adParam += "&plckForumId=" + fId;
    var curView = this.GetParameter("plckCurrentView"); if(curView) adParam += "&plckCurrentView=" + curView;
    var curPage = this.GetParameter("plckCurrentPage"); if(curPage) adParam += "&plckCurrentPage=" + curPage;
    return adParam;
}

SiteLifeProxy.prototype.ForumJoinGroup = function() {
    var adParam = this.BaseAdParam();
    var dId = this.GetParameter("plckDiscussionId"); if(dId) adParam += "&plckDiscussionId=" + dId;
    return this.ForumSend("ForumJoinGroup", "forumDest", "ForumMain", adParam);
}

SiteLifeProxy.prototype.ForumLeaveGroup = function() {
    var adParam = this.BaseAdParam();
    var dId = this.GetParameter("plckDiscussionId"); if(dId) adParam += "&plckDiscussionId=" + dId;
    return this.ForumSend("ForumLeaveGroup", "forumDest", "ForumMain", adParam);
}

SiteLifeProxy.prototype.ForumGroupMemberList = function() {
    var adParam = this.BaseAdParam();
    return this.ForumSend("ForumGroupMemberList", "forumDest", "ForumMain", adParam);
}

SiteLifeProxy.prototype.ForumInviteUser = function() {
    var adParam = this.BaseAdParam();
    return this.ForumSend("ForumInviteUser", "forumDest", "ForumMain", adParam);
}

SiteLifeProxy.prototype.ForumGroupConfirm = function() {
    var adParam = this.BaseAdParam();
    var confirmType = this.GetParameter("plckConfirmType"); if (confirmType) adParam += "&plckConfirmType=" + confirmType;
    return this.ForumSend("ForumGroupConfirm", "forumDest", "ForumMain", adParam);
}

SiteLifeProxy.prototype.ForumSendInviteToUser = function(username, email) {
    var adParam = this.BaseAdParam();
    var username = this.GetParameter("plckUsername"); if (username) adParam += "&plckUsername=" + username;
    var email = this.GetParameter("plckUserEmail"); if (email) adParam += "&plckUserEmail" + email;
    return this.ForumSend("ForumSendInviteToUser", "forumDest", "ForumMain", adParam);
}

SiteLifeProxy.prototype.ForumAddEnemy = function(enemyKey) {
    var adParam = this.BaseAdParam();
    adParam += "&enemyKey=" + enemyKey;
    var dId = this.GetParameter("plckDiscussionId"); if(dId) adParam += "&plckDiscussionId=" + dId;
    return this.ForumSend("ForumAddEnemy", "forumDest", "ForumMain", adParam);
}

SiteLifeProxy.prototype.ForumRemoveEnemy = function(enemyKey) {
    var adParam = this.BaseAdParam();
    adParam += "&enemyKey=" + enemyKey;
    var dId = this.GetParameter("plckDiscussionId"); if(dId) adParam += "&plckDiscussionId=" + dId;
    return this.ForumSend("ForumRemoveEnemy", "forumDest", "ForumMain", adParam);
}

function slGetElementsByClassName(classname, node)  {
    if(!node) node = document.getElementsByTagName("body")[0];
    var a = [];
    var re = new RegExp('\\b' + classname + '\\b');
    var els = node.getElementsByTagName("*");
    for(var i=0,j=els.length; i<j; i++)
        if(re.test(els[i].className))a.push(els[i]);
    return a;
}

	function hideAllPostsFromUser(userKey){
	  var posts = slGetElementsByClassName("postVisibilityContainer_"+userKey, document);
	  var hiddenMessages = slGetElementsByClassName("postHiddenMessage_"+userKey, document);
	  
	  for(i=0; i < posts.length; i++){
	    posts[i].style.display = "none";
	    hiddenMessages[i].style.display = "block";
	  }
	  
	  gSiteLife.ForumAddEnemy(userKey);
	}
	
	function showAllPostsFromUser(userKey){
	  var posts = slGetElementsByClassName("postVisibilityContainer_"+userKey, document);
	  var hiddenMessages = slGetElementsByClassName("postHiddenMessage_"+userKey, document);
	  	  
	  for(i=0; i < posts.length; i++){
	    posts[i].style.display = "block";
	    hiddenMessages[i].style.display = "none";
	  }
	  
	  gSiteLife.ForumRemoveEnemy(userKey);
	}
	
SiteLifeProxy.prototype.ForumChangeSort = function(sortParamName, sortDirection) {
		var currentUrl = document.location.href;
		var newUrl;
		// replace the sort param in the url, if found
		var re = new RegExp("([?|&])" + sortParamName + "=.*?(&|$)","i");
		if (currentUrl.match(re)) {
			newUrl = currentUrl.replace(re, '$1' + sortParamName + "=" + sortDirection + '$2');
		}
		else {
			if(currentUrl.indexOf('?') >= 0){
				newUrl = currentUrl + '&' + sortParamName + "=" + sortDirection;
			}
			else{
				newUrl = currentUrl + '?' + sortParamName + "=" + sortDirection;
			}
		}
		document.location.href = newUrl;
}

SiteLifeProxy.prototype.ForumSetLastRead = function(discussionKey, postKey) {
    var adParam = this.BaseAdParam();
    adParam += "&discussionKey=" + discussionKey;
    if(postKey){
		adParam += "&postKey=" + postKey;
	}
    var ret = this.ForumSend("ForumSetLastRead", "forumDest", "ForumMain", adParam);
    
    if(!postKey){
		location.reload();
    }
    
    return ret;
} 

SiteLifeProxy.prototype.ForumDiscussionSubscribe = function(discussionKey, targetDiv) {
    var url = this.__baseUrl + '/Forums/ForumDiscussionSubscribe?' + 'plckDiscussionId=' + discussionKey + '&plckElementId=' + targetDiv;
    this.__Send(url, "ForumDiscussionSubscribe");
    return false;
}

SiteLifeProxy.prototype.ForumDiscussionUnSubscribe = function(discussionKey, targetDiv) {
    var url = this.__baseUrl + '/Forums/ForumDiscussionUnSubscribe?' + 'plckDiscussionId=' + discussionKey + '&plckElementId=' + targetDiv;
    this.__Send(url, "ForumDiscussionUnSubscribe");
    return false;
}


SiteLifeProxy.prototype.Recommend = function(keyType, targetKey, parentUrl) {
    keyType = keyType || "ExternalResource";
    targetKey = targetKey || gSiteLife.__StripAnchorFromUrl(window.location.href);
    parentUrl = parentUrl || window.location.href;
    targetKey = targetKey;
    var divId = "Recommend" + new Date().getTime();
    this.WriteDiv(divId, "Recommend");
    var url = this.__baseUrl + 
        '/Recommend/Recommend?plckElementId=' + divId + 
        '&plckTargetKey=' + gSiteLife.EscapeValue(targetKey) + 
        '&plckTargetKeyType=' + keyType +
        '&plckTargetUrl=' + gSiteLife.EscapeValue(parentUrl);
    this.__Send(url);
    return false;   
}

SiteLifeProxy.prototype.PostRecommendation = function(keyType, targetKey, recommendDiv, parentTitle, parentUrl) {
    parentUrl = parentUrl || window.location.href;
    var url = this.__baseUrl + 
        '/Recommend/PostRecommendation?plckElementId=' + recommendDiv + 
        '&plckTargetKey=' + gSiteLife.EscapeValue(targetKey) + 
        '&plckTargetKeyType=' + keyType +
        '&plckTargetUrl=' + gSiteLife.EscapeValue(parentUrl);
    if(parentTitle) url += '&plckParentTitle=' + gSiteLife.EscapeValue(parentTitle);
    
    this.__Send(url);
    return false;
}


SiteLifeProxy.prototype.RateItem = function (itemId, itemType, rating, targetDiv, parentTitle, parentUrl) {
    var url = this.__baseUrl + '/Rating/Rate?plckElementId=' + targetDiv + 
        '&plckTargetKey=' + gSiteLife.EscapeValue(itemId) + 
        '&plckTargetKeyType=' + itemType + 
        '&plckRating=' + rating +
        '&plckTargetUrl=' + gSiteLife.EscapeValue(parentUrl);
        if(parentTitle) url += '&plckParentTitle=' + parentTitle;
    this.__Send(url);
    return false;
}

SiteLifeProxy.prototype.Rating = function(itemType, itemId, parentUrl) {
    itemType = itemType || "ExternalResource";
    itemId = itemId || gSiteLife.__StripAnchorFromUrl(window.location.href);
    parentUrl = parentUrl || window.location.href;
    var divId = itemId + "_plckRateDiv_" + new Date().getTime() + Math.floor(Math.random()*1000);
    this.WriteDiv(divId, "Rating");
    var url = this.__baseUrl + '/Rating/GetRating?plckElementId=' + divId +
        '&plckTargetKey=' + gSiteLife.EscapeValue(itemId) + 
        '&plckTargetKeyType=' + itemType +
        '&plckTargetUrl=' + gSiteLife.EscapeValue(parentUrl);
    this.__Send(url);
    return false;   
}

SiteLifeProxy.prototype.RatingClickStar = function (index, targetKey, targetKeyType, targetDiv, parentTitle, parentUrl) {
    gSiteLife.RateItem(targetKey, targetKeyType, index, targetDiv, parentTitle, parentUrl);
    
}

SiteLifeProxy.prototype.RatingFillStar = function(index, targetKey, lbl) {
    var stars = document.getElementsByName(targetKey+"Stars");
    var label = document.getElementById(targetKey + "Rating-label");
    var selectedIndex = parseInt(document.getElementById(targetKey+"Rating-value").value);
    
    if (index < 0 && selectedIndex >= 0) index = selectedIndex;
    for(i=1; i <= stars.length; i++) {
        if (index > 0 && i <= index) {
            stars[i-1].src = this.__baseUrl + "/Content/images/icons/fullstar.gif";
        }else {
            stars[i-1].src = this.__baseUrl + "/Content/images/icons/emptystar.gif";
        }
    }
    label.innerHTML = lbl;
}

SiteLifeProxy.prototype.Review = function(parentKeyType, parentKey, reviewedTitle, reviewCategory, pageSize, sort, currentPage) {
    
    var divId = "Reviews_Container";
    this.WriteDiv(divId);
    return this.GetReviews(parentKeyType, parentKey, reviewedTitle, reviewCategory, pageSize, sort, currentPage);
}

SiteLifeProxy.prototype.ReviewClickStar = function (index, targetKey) {
    document.getElementById(targetKey+"Rating-value").value = index;
}

SiteLifeProxy.prototype.GetReviews = function(parentKeyType, parentKey, reviewedTitle, reviewCategory, pageSize, sort, currentPage) {
    parentKeyType = parentKeyType || "ExternalResource";
    parentKey = gSiteLife.EscapeValue(parentKey) || gSiteLife.EscapeValue(gSiteLife.__StripAnchorFromUrl(window.location.href));
    reviewedTitle = gSiteLife.EscapeValue(reviewedTitle) || gSiteLife.EscapeValue(document.title);
    reviewCategory = reviewCategory || "Uncategorized";
    pageSize = pageSize || 10;
    sort = sort || "TimeStampAscending";
    currentPage = currentPage || 0;
    var url = this.__baseUrl + '/Review/Reviews?plckElementId=Reviews_Container' +
        '&plckTargetKey=' + parentKey + 
        '&plckTargetKeyType=' + parentKeyType +
        '&plckReviewedTitle=' + reviewedTitle +
        '&plckReviewCategory=' + reviewCategory +
        '&plckSort=' + sort + 
        '&plckParentUrl=' + gSiteLife.EscapeValue(gSiteLife.__StripAnchorFromUrl(window.location.href)) + 
        '&plckParentTitle=' + gSiteLife.EscapeValue(document.title) +
        '&plckCurrentPage=' + currentPage +
        '&plckPageSize=' + pageSize;
    this.__Send(url);
    return false;   
}

SiteLifeProxy.prototype.SummaryArticlesMostCommented = function(count) {
 return this.SummaryPanel("SummaryArticlesMostCommented", count); 
} 
SiteLifeProxy.prototype.SummaryArticlesMostRecommended = function(count) {
 return this.SummaryPanel("SummaryArticlesMostRecommended", count); 
} 
SiteLifeProxy.prototype.SummaryPhotosRecentPhotosByTag = function(count, tagFilter, filterBySiteOfOrigin) {
 return this.SummaryPanel("SummaryPhotosRecentPhotosByTag", count, tagFilter, filterBySiteOfOrigin); 
} 
SiteLifeProxy.prototype.SummaryPhotosRecentUserPhotos = function(count, tagFilter, filterBySiteOfOrigin) {
 return this.SummaryPanel("SummaryPhotosRecentUserPhotos", count, tagFilter, filterBySiteOfOrigin);
} 
SiteLifeProxy.prototype.SummaryPhotosRecentPhotos = function(count, tagFilter, filterBySiteOfOrigin) {
 return this.SummaryPanel("SummaryPhotosRecentPhotos", count, tagFilter, filterBySiteOfOrigin); 
} 
SiteLifeProxy.prototype.SummaryPhotosMostRecommendedPhotos = function(count, filterBySiteOfOrigin) {
 return this.SummaryPanel("SummaryPhotosMostRecommendedPhotos", count, "", filterBySiteOfOrigin); 
} 
SiteLifeProxy.prototype.SummaryPhotosMostRecommendedUserPhotos = function(count, filterBySiteOfOrigin) {
 return this.SummaryPanel("SummaryPhotosMostRecommendedUserPhotos", count, "", filterBySiteOfOrigin); 
} 
SiteLifeProxy.prototype.SummaryPhotosMostRecommendedGalleries = function(count) {
 return this.SummaryPanel("SummaryPhotosMostRecommendedGalleries", count); 
} 
SiteLifeProxy.prototype.SummaryForumsRecentDiscussions = function(count, filterBySiteOfOrigin, parentIds) {
    var divId= "Summary_Container" + this.SID;
    if(this.numSummaryWidgets){ divId += this.numSummaryWidgets++; } else { this.numSummaryWidgets = 1; }
    this.WriteDiv(divId, divId);
    var methodName = "SummaryForumsRecentDiscussions";
    var tagFilter = "";
    return this.SummarySend(methodName, divId, divId + "Script", "plckCount", count, "plckTagFilter", tagFilter, "plckFilterBySiteOfOrigin", filterBySiteOfOrigin, "plckParentIds", parentIds);
} 
SiteLifeProxy.prototype.SummaryBlogsRecent = function(count, tagFilter) {
    return this.SummaryPanel("SummaryBlogsRecent", count, tagFilter);
}
SiteLifeProxy.prototype.SummaryBlogsRecentPostsByTag = function(count, tagFilter, filterBySiteOfOrigin) {
 return this.SummaryPanel("SummaryBlogsRecentPostsByTag", count, tagFilter, filterBySiteOfOrigin); 
} 
SiteLifeProxy.prototype.SummaryBlogsRecentPosts = function(count, tagFilter, filterBySiteOfOrigin) {
 return this.SummaryPanel("SummaryBlogsRecentPosts", count, tagFilter, filterBySiteOfOrigin); 
} 
SiteLifeProxy.prototype.SummaryBlogsMostRecommendedPosts = function(count, tagFilter, filterBySiteOfOrigin) {
    return this.SummaryPanel("SummaryBlogsMostRecommendedPosts", count, tagFilter, filterBySiteOfOrigin);
}
SiteLifeProxy.prototype.SummaryPersonaProfileRecent = function(count) {
    return this.SummaryPanel("SummaryPersonaProfileRecent", count);
}
SiteLifeProxy.prototype.SummaryPanel = function(methodName, count, tagFilter, filterBySiteOfOrigin) {
    var divId= "Summary_Container" + this.SID;
    if(this.numSummaryWidgets){ divId += this.numSummaryWidgets++; } else { this.numSummaryWidgets = 1; }
    this.WriteDiv(divId, divId);
    return this.SummarySend(methodName, divId, divId + "Script", "plckCount", count, "plckTagFilter", tagFilter, "plckFilterBySiteOfOrigin", filterBySiteOfOrigin);
}
SiteLifeProxy.prototype.SummarySend = function(ApiName, DestDiv, ScriptName) {
    var url = this.__baseUrl + '/Summary/' + ApiName + '?plckElementId=' + DestDiv;
    for(ii=3; ii< this.SummarySend.arguments.length; ii+=2) { if(this.SummarySend.arguments[ii+1]) { url += "&" + this.SummarySend.arguments[ii] + "=" + this.SummarySend.arguments[ii+1];} }
    this.__Send(url, ScriptName);
    return false;
}




var gSiteLife = new SiteLifeProxy("http://sitelife.soundersfc.com/ver1.0");
gSiteLife.apiKey = "${APIKey}";
gSiteLife.SID = "";



    // legacy behavior
    gSiteLife.AddEventHandler('ExternalResourceLink', function(rk) {return rk;});

if(gSiteLife.GetParameter('plckPersonaPage') && gSiteLife.GetParameter('plckPersonaPage').indexOf('PersonaBlog') == 0) {
document.write("<link href=" + "'http://sitelife.soundersfc.com/ver1.0/blog/BlogRss?plckBlogId=" + gSiteLife.GetParameter('userid') + "' title='" + gSiteLife.GetParameter('userid') + " Blog'" + "rel='alternate' type='application/rss+xml' />"); }
/*
 * -------------------------------------------------------------------------
 * START INCLUDES SECTION
 * Includes from: http://sitelife.soundersfc.com/ver1.0/Direct/DirectProxy
 * -------------------------------------------------------------------------
 */

/*
 * -------------------------------------------------------------------------
 * Including: http://sitelife.soundersfc.com/ver1.0/content/direct/scripts/yahoo-min.js
 * As specified in: http://sitelife.soundersfc.com/ver1.0/Direct/DirectProxy
 * -------------------------------------------------------------------------
 */
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.6.0
*/
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]};}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0};var B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var A=YAHOO.lang,C=["toString","valueOf"],B={isArray:function(D){if(D){return A.isNumber(D.length)&&A.isFunction(D.splice);}return false;},isBoolean:function(D){return typeof D==="boolean";},isFunction:function(D){return typeof D==="function";},isNull:function(D){return D===null;},isNumber:function(D){return typeof D==="number"&&isFinite(D);},isObject:function(D){return(D&&(typeof D==="object"||A.isFunction(D)))||false;},isString:function(D){return typeof D==="string";},isUndefined:function(D){return typeof D==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(F,E){for(var D=0;D<C.length;D=D+1){var H=C[D],G=E[H];if(A.isFunction(G)&&G!=Object.prototype[H]){F[H]=G;}}}:function(){},extend:function(H,I,G){if(!I||!H){throw new Error("extend failed, please check that "+"all dependencies are included.");}var E=function(){};E.prototype=I.prototype;H.prototype=new E();H.prototype.constructor=H;H.superclass=I.prototype;if(I.prototype.constructor==Object.prototype.constructor){I.prototype.constructor=I;}if(G){for(var D in G){if(A.hasOwnProperty(G,D)){H.prototype[D]=G[D];}}A._IEEnumFix(H.prototype,G);}},augmentObject:function(H,G){if(!G||!H){throw new Error("Absorb failed, verify dependencies.");}var D=arguments,F,I,E=D[2];if(E&&E!==true){for(F=2;F<D.length;F=F+1){H[D[F]]=G[D[F]];}}else{for(I in G){if(E||!(I in H)){H[I]=G[I];}}A._IEEnumFix(H,G);}},augmentProto:function(G,F){if(!F||!G){throw new Error("Augment failed, verify dependencies.");}var D=[G.prototype,F.prototype];for(var E=2;E<arguments.length;E=E+1){D.push(arguments[E]);}A.augmentObject.apply(this,D);},dump:function(D,I){var F,H,K=[],L="{...}",E="f(){...}",J=", ",G=" => ";if(!A.isObject(D)){return D+"";}else{if(D instanceof Date||("nodeType" in D&&"tagName" in D)){return D;}else{if(A.isFunction(D)){return E;}}}I=(A.isNumber(I))?I:3;if(A.isArray(D)){K.push("[");for(F=0,H=D.length;F<H;F=F+1){if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}if(K.length>1){K.pop();}K.push("]");}else{K.push("{");for(F in D){if(A.hasOwnProperty(D,F)){K.push(F+G);if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}}if(K.length>1){K.pop();}K.push("}");}return K.join("");},substitute:function(S,E,L){var I,H,G,O,P,R,N=[],F,J="dump",M=" ",D="{",Q="}";for(;;){I=S.lastIndexOf(D);if(I<0){break;}H=S.indexOf(Q,I);if(I+1>=H){break;}F=S.substring(I+1,H);O=F;R=null;G=O.indexOf(M);if(G>-1){R=O.substring(G+1);O=O.substring(0,G);}P=E[O];if(L){P=L(O,P,R);}if(A.isObject(P)){if(A.isArray(P)){P=A.dump(P,parseInt(R,10));}else{R=R||"";var K=R.indexOf(J);if(K>-1){R=R.substring(4);}if(P.toString===Object.prototype.toString||K>-1){P=A.dump(P,parseInt(R,10));}else{P=P.toString();}}}else{if(!A.isString(P)&&!A.isNumber(P)){P="~-"+N.length+"-~";N[N.length]=F;}}S=S.substring(0,I)+P+S.substring(H+1);}for(I=N.length-1;I>=0;I=I-1){S=S.replace(new RegExp("~-"+I+"-~"),"{"+N[I]+"}","g");}return S;},trim:function(D){try{return D.replace(/^\s+|\s+$/g,"");}catch(E){return D;}},merge:function(){var G={},E=arguments;for(var F=0,D=E.length;F<D;F=F+1){A.augmentObject(G,E[F],true);}return G;},later:function(K,E,L,G,H){K=K||0;E=E||{};var F=L,J=G,I,D;if(A.isString(L)){F=E[L];}if(!F){throw new TypeError("method undefined");}if(!A.isArray(J)){J=[G];}I=function(){F.apply(E,J);};D=(H)?setInterval(I,K):setTimeout(I,K);return{interval:H,cancel:function(){if(this.interval){clearInterval(D);}else{clearTimeout(D);}}};},isValue:function(D){return(A.isObject(D)||A.isString(D)||A.isNumber(D)||A.isBoolean(D));}};A.hasOwnProperty=(Object.prototype.hasOwnProperty)?function(D,E){return D&&D.hasOwnProperty(E);}:function(D,E){return !A.isUndefined(D[E])&&D.constructor.prototype[E]!==D[E];};B.augmentObject(A,B,true);YAHOO.util.Lang=A;A.augment=A.augmentProto;YAHOO.augment=A.augmentProto;YAHOO.extend=A.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.6.0",build:"1321"});

/*
 * -------------------------------------------------------------------------
 * Including: http://sitelife.soundersfc.com/ver1.0/content/direct/scripts/json-min.js
 * As specified in: http://sitelife.soundersfc.com/ver1.0/Direct/DirectProxy
 * -------------------------------------------------------------------------
 */
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.6.0
*/
YAHOO.lang.JSON=(function(){var l=YAHOO.lang,_UNICODE_EXCEPTIONS=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_ESCAPES=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,_VALUES=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS=/(?:^|:|,)(?:\s*\[)+/g,_INVALID=/^[\],:{}\s]*$/,_SPECIAL_CHARS=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_CHARS={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function _revive(data,reviver){var walk=function(o,key){var k,v,value=o[key];if(value&&typeof value==="object"){for(k in value){if(l.hasOwnProperty(value,k)){v=walk(value,k);if(v===undefined){delete value[k];}else{value[k]=v;}}}}return reviver.call(o,key,value);};return typeof reviver==="function"?walk({"":data},""):data;}function _char(c){if(!_CHARS[c]){_CHARS[c]="\\u"+("0000"+(+(c.charCodeAt(0))).toString(16)).slice(-4);}return _CHARS[c];}function _prepare(s){return s.replace(_UNICODE_EXCEPTIONS,_char);}function _isValid(str){return l.isString(str)&&_INVALID.test(str.replace(_ESCAPES,"@").replace(_VALUES,"]").replace(_BRACKETS,""));}function _string(s){return'"'+s.replace(_SPECIAL_CHARS,_char)+'"';}function _stringify(h,key,d,w,pstack){var o=typeof w==="function"?w.call(h,key,h[key]):h[key],i,len,j,k,v,isArray,a;if(o instanceof Date){o=l.JSON.dateToString(o);}else{if(o instanceof String||o instanceof Boolean||o instanceof Number){o=o.valueOf();}}switch(typeof o){case"string":return _string(o);case"number":return isFinite(o)?String(o):"null";case"boolean":return String(o);case"object":if(o===null){return"null";}for(i=pstack.length-1;i>=0;--i){if(pstack[i]===o){return"null";}}pstack[pstack.length]=o;a=[];isArray=l.isArray(o);if(d>0){if(isArray){for(i=o.length-1;i>=0;--i){a[i]=_stringify(o,i,d-1,w,pstack)||"null";}}else{j=0;if(l.isArray(w)){for(i=0,len=w.length;i<len;++i){k=w[i];v=_stringify(o,k,d-1,w,pstack);if(v){a[j++]=_string(k)+":"+v;}}}else{for(k in o){if(typeof k==="string"&&l.hasOwnProperty(o,k)){v=_stringify(o,k,d-1,w,pstack);if(v){a[j++]=_string(k)+":"+v;}}}}a.sort();}}pstack.pop();return isArray?"["+a.join(",")+"]":"{"+a.join(",")+"}";}return undefined;}return{isValid:function(s){return _isValid(_prepare(s));},parse:function(s,reviver){s=_prepare(s);if(_isValid(s)){return _revive(eval("("+s+")"),reviver);}throw new SyntaxError("parseJSON");},stringify:function(o,w,d){if(o!==undefined){if(l.isArray(w)){w=(function(a){var uniq=[],map={},v,i,j,len;for(i=0,j=0,len=a.length;i<len;++i){v=a[i];if(typeof v==="string"&&map[v]===undefined){uniq[(map[v]=j++)]=v;}}return uniq;})(w);}d=d>=0?d:1/0;return _stringify({"":o},"",d,w,[]);}return undefined;},dateToString:function(d){function _zeroPad(v){return v<10?"0"+v:v;}return d.getUTCFullYear()+"-"+_zeroPad(d.getUTCMonth()+1)+"-"+_zeroPad(d.getUTCDate())+"T"+_zeroPad(d.getUTCHours())+":"+_zeroPad(d.getUTCMinutes())+":"+_zeroPad(d.getUTCSeconds())+"Z";},stringToDate:function(str){if(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/.test(str)){var d=new Date();d.setUTCFullYear(RegExp.$1,(RegExp.$2|0)-1,RegExp.$3);d.setUTCHours(RegExp.$4,RegExp.$5,RegExp.$6);return d;}return str;}};})();YAHOO.register("json",YAHOO.lang.JSON,{version:"2.6.0",build:"1321"});

/*
 * -------------------------------------------------------------------------
 * Including: http://sitelife.soundersfc.com/ver1.0/content/direct/scripts/pork.iframe.js
 * As specified in: http://sitelife.soundersfc.com/ver1.0/Direct/DirectProxy
 * -------------------------------------------------------------------------
 */
document.iframeLoaders = {};

iframe = function() { this.initialize.apply(this, arguments); };
iframe.prototype = {
	initialize: function(form, options,count){
		if (!options) options = {};
		this.form = form;
		this.uniqueId = count;
		document.iframeLoaders[this.uniqueId] = this;
		var url = form.action + '?jsonRequest=' + escape(form.elements[0].value); // change form submit to string; similar to changing form method to get
		var firstSlash = url.indexOf("/", url.indexOf("//")+2);
		this.transport = this.getTransport((firstSlash > 0) ? url.substring(0, firstSlash) : "");
		this.onComplete = options.onComplete || null;
		this.update = this.$(options.update) || null;
		this.updateMultiple = options.multiple || false;
		if (((navigator.vendor && (navigator.vendor.indexOf('Apple')) > -1) || window.opera) // safari and opera only
     && (/\/Direct\/Process(\?|$)/.test(form.action)) && form.elements && (form.elements.length == 1)) { // only change calls that contain 1 element and whose actions end with /Direct/Process
			var doc = this.transport.contentWindow || this.transport.contentDocument; // retrieve the document of the iframe
			if (url.length < 80000) { // allow fallback to normal submission (80k is the max length for urls in safari)
				if (doc.document) // make sure we have the document and not the window
					doc = doc.document;
				
				try { // if this fails, fallback to normal submission
					doc.location.replace(url); // use location.replace to overwrite elements in history 
					return;
				} catch (e) { };
			}
		}
		form.target= 'frame_'+this.uniqueId;
		form.setAttribute("target", 'frame_'+this.uniqueId); // in case the other one fails.
		form.submit();
	},

	onStateChange: function() {
		this.transport = this.$('frame_'+this.uniqueId);
		try {	 var doc = this.transport.contentDocument.body.innerHTML; this.transport.contentDocument.close(); }	// For NS6
		catch (e){ 
			try{ var doc = this.transport.contentWindow.document.body.innerHTML; this.transport.contentWindow.document.close(); } // For IE5.5 and IE6
			 catch (e){
				 try { var doc = this.transport.document.body.innerHTML; this.transport.document.body.close(); } // for IE5
					catch (e) {
						try	{ var doc = window.frames['frame_'+this.uniqueId].document.body.innerText; } // for really nasty browsers
						catch (e) { //alert(e); 
						} // forget it.
				 }
			}
		}
		this.transport.responseText = doc;
		if (this.onComplete) setTimeout(this.bind(function(){this.onComplete(this.transport);}, this), 10);
		if (this.update) setTimeout(this.bind(function(){this.update.innerHTML = this.transport.responseText;}, this), 10);
		if (this.updateMultiple){ setTimeout(this.bind(function(){ // JSON support!
				try	{ var hasscript = false; eval("var inputObject = "+this.transport.responseText);	// we're expecting a JSON object, eval it to inputObject
					for (var i in inputObject) { if (i == 'script') { hasscript = true; } // check if we passed some javascript along too
						else {if ( elm = this.$(i)) { elm.innerHTML = inputObject[i]; } else { 
						//alert("element "+i+" not found!"); 
						} } // if it's not script, update the corresponding div
					} if (hasscript) eval(inputObject['script']); // some on-the-fly-javascript exchanging support too
				} catch (e) { //alert('There was an error processing: '+this.transport.responseText); 
				} // in case of an error					
			}, this), 10);
		}	
	},

	getTransport: function(baseUrl) {
		var divElm = document.createElement('DIV'), frame;
		divElm.setAttribute('style', 'width: 0; height: 0; margin: 0; padding: 0; visibility: hidden; overflow: hidden');
		if (navigator.userAgent.indexOf('MSIE') > 0 && navigator.userAgent.indexOf('Opera') == -1) {// switch to the crappy solution for IE
			divElm.style.width = 0;
			divElm.style.height = 0;
			divElm.style.margin = 0;
			divElm.style.padding = 0;
			divElm.style.visibility = 'hidden';
			divElm.style.overflow = 'hidden';
			divElm.innerHTML = '<iframe name=\"frame_'+this.uniqueId+'\" id=\"frame_'+this.uniqueId+'\" src=\"' + baseUrl + '/ver1.0/Content/blank.html\" onload=\"setTimeout(function(){document.iframeLoaders['+this.uniqueId+'].onStateChange()},20);"></iframe>';
		} else {
			frame = document.createElement("iframe");
			frame.setAttribute("name", "frame_"+this.uniqueId);
			frame.setAttribute("id", "frame_"+this.uniqueId);
			frame.addEventListener("load", this.bind(function(){ this.onStateChange(); }, this), false);
			divElm.appendChild(frame);
		}
    (RequestBatch.container || document.body).appendChild(divElm);
		return frame;
	},
  
  bind: function(functionObject, referenceObject) {
    return function() {
      return functionObject.apply(referenceObject, arguments);
    }
  },
  
  '$': function(id) {
    return document.getElementById(id);
  }
};


/*
 * -------------------------------------------------------------------------
 * Including: http://sitelife.soundersfc.com/ver1.0/content/direct/scripts/requestbatch.js
 * As specified in: http://sitelife.soundersfc.com/ver1.0/Direct/DirectProxy
 * -------------------------------------------------------------------------
 */
if (typeof(RequestBatch) === 'undefined') {
    RequestBatch = function() {
      this.initialize.apply(this, arguments);
    };
    // for unique id
    var counter = 0;

    // how many requests are still pending?
    var pendingRequests = 0;

    function DirectAccessErrorHandler(msg,ex){
    //alert(msg);
    }
    (function() {

        function buildJsonpUrl(serverUrl, jsonString, callbackName) {
            var separator = serverUrl.indexOf('?') == -1 ? "?" : "&";
            // use Jsonp endpoint instead of Process
            serverUrl = serverUrl.replace('/Process', '/Jsonp');
            return serverUrl + separator + "r=" + encodeURIComponent(jsonString) + '&cb=' + callbackName;
        }

        function useJsonp(serverUrl, jsonString, callbackName) {
            // use Jsonp endpoint instead of Process
            serverUrl = buildJsonpUrl(serverUrl, jsonString, callbackName);
            var isIE = /*@cc_on!@*/false;
            if ((isIE && serverUrl.length < 2083) || (!isIE && serverUrl.length < 4000)) {
                return serverUrl;
            }
            return false;
        }

        // the core object to request batches
        RequestBatch.prototype = {
            initialize: function() {
                this.UniqueId = counter++;
                this.Requests = new Array()
            },

            HasTemplate: function() {
                return typeof (this["Template"]) != "undefined";
            },

            AddToRequest: function(requestThis) {
                this.Requests[this.Requests.length] = requestThis;
            },

            BeginRequest: function(serverUrl, callback) {
                pendingRequests++;

                if (!RequestBatch.callbacks) {
                    RequestBatch.callbacks = {};
                }

                // the cc_on comment below is important.. if you remove it, it will change the processing of the script
                // see http://msdn.microsoft.com/en-us/library/8ka90k2e(VS.85).aspx for details of conditional compilation
                var jsonString = YAHOO.lang.JSON.stringify(this), ie = /*@cc_on!@*/false;
                if (ie && !RequestBatch.container) { // forcibly take this route only for ie
                    var body = document.body, div;
                    RequestBatch.container = div = body.insertBefore(document.createElement('div'), body.firstChild);
                    div.style.height = div.style.width = div.style.margin = div.style.padding = 0;
                    div.style.visibility = div.style.overflow = 'hidden';
                    div.style.display = 'none';
                }
                // generate our callback function that will call their callback function via closure semantics
                var daapiCallbackName = 'daapiCallback' + this.UniqueId;
                var thisRequest = this;
                if (jsonpServerUrl = useJsonp(serverUrl, jsonString, 'RequestBatch.callbacks.' + daapiCallbackName)) {
                    // insert script node with callback function = daapiCallbackName
                    var jsonpScriptNode = document.createElement('script');
                    jsonpScriptNode.type = "text/javascript";
                    jsonpScriptNode.src = jsonpServerUrl;
                    var headElem = document.getElementsByTagName('head')[0];
                    RequestBatch.callbacks[daapiCallbackName] = (function(userCallback, headElem, scriptNode) {
                        return function(responses) {
                            if (thisRequest.HasTemplate()) {
                                userCallback(responses);
                            } else {
                                // clean up after ourselves
                                userCallback(responses.ResponseBatch);
                                userCallback = headElem = scriptNode = null;
                            }
                        }
                    })(callback, headElem, jsonpScriptNode);
                    headElem.appendChild(jsonpScriptNode);
                }
                else {
                    var form = generateForm(this.UniqueId, serverUrl, jsonString);
                    new iframe(form, { onComplete: function(request) { processResponse(callback, request, thisRequest.HasTemplate()); } }, this.UniqueId);
                }
                // in case they reuse the requestbatch
                this.UniqueId = counter++;
            }
        };
    })();
}

function generateForm(formId, serverUrl, inputVal) {
    // create the form
	var form = document.createElement("form");
	form.acceptCharset = "UTF-8";
	form.name = "f" + formId;
	form.id = "f" + formId;
	form.action = serverUrl;

	// create the input element on the form
	var inputElem = document.createElement("input");
	inputElem.name = "jsonRequest";
	inputElem.type = "hidden";
	inputElem.value = inputVal;
	form.appendChild(inputElem);

	// Firefox has a behavior on refresh that displays a popup confirming that is it reloading a form.
	// We work around this by attempting to perform a get action if the size is below a threshold, else
	// we will run as a post
	form.method = "post";
    if(navigator.userAgent.toLowerCase().indexOf('firefox') != -1) {
        var separator = serverUrl.indexOf('?') == -1 ? "?" : "&";
        var fullRequestURL = serverUrl + separator + "jsonRequest="+ escape(inputVal);
        if (fullRequestURL.length < 4000) {
            // we plan to perform a get, so we need to parse the sid out of the url and place it
            // inside the form
            var sidPos = serverUrl.indexOf('sid=');
            if (sidPos != -1) {
                var endPos = serverUrl.indexOf('&', sidPos);
                var sid = serverUrl.substring(sidPos + 'sid='.length, endPos == -1 ? serverUrl.length : endPos);
	            var sidInputElem = document.createElement("input");
	            sidInputElem.name = "sid";
	            sidInputElem.type = "hidden";
	            sidInputElem.value = sid;
	            form.appendChild(sidInputElem);
	            // remove the sid from the url
	            form.action = serverUrl.substring(0, sidPos-1);
            }
            form.method = "get";
        }
    }

	(RequestBatch.container || document.body).appendChild(form);
	return form;
}

function processResponse(callback, request, isTemplated)
{
    pendingRequests--;
    try {
        if (isTemplated) {
            callback(request.ResponseText);
        } else {
            var jsonResponse = unescape(request.responseText);
            jsonResponse = jsonResponse.replace(/\\\>/g, ">");
            var responseObject = YAHOO.lang.JSON.parse(jsonResponse);
            try {
                callback(responseObject.ResponseBatch);
            } catch (e) {
                DirectAccessErrorHandler("exception during client callback", e);
            }
        }
    } catch (e) {
        DirectAccessErrorHandler("exception during processResponse", e);
    }
}

function getPendingRequestCount()
{
    return pendingRequests;
}


/*
 * -------------------------------------------------------------------------
 * Including: http://sitelife.soundersfc.com/ver1.0/content/direct/scripts/requesttypes.js
 * As specified in: http://sitelife.soundersfc.com/ver1.0/Direct/DirectProxy
 * -------------------------------------------------------------------------
 */

// ------------------------------------------------------------------------------------
// This file contains all the request type objects for the SiteLife JSON Direct API.
// Create instances of these objects, place them in a RequestBatch, and send them off.
// ------------------------------------------------------------------------------------

(function() { // wrapped in a function to keep the Class variable out of the global scope
var Class = function() {
  return function() {
    this.initialize.apply(this, arguments);
  }
};
// Identify a user
UserKey = Class();
UserKey.prototype = {
   initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.UserKey = data;
   }
};
// Identify a comment
CommentKey = Class();
CommentKey.prototype = {
   initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.CommentKey = data;
   }
};
// Identify an article
ArticleKey = Class();
ArticleKey.prototype = {
   initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.ArticleKey = data;
   }
};

// Identify a persona message
PersonaMessageKey = Class();
PersonaMessageKey.prototype = {
   initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.PersonaMessageKey = data;
   }
};

// Identify a review
ReviewKey = Class();
ReviewKey.prototype = {
   initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.ReviewKey = data;
   }
};

// Identify a gallery
GalleryKey = Class();
GalleryKey.prototype = {
    initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.GalleryKey = data;
    }
};

// Identify a photo
PhotoKey = Class();
PhotoKey.prototype = {
    initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.PhotoKey = data;
    }
};

// Identify a video
VideoKey = Class();
VideoKey.prototype = {
    initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.VideoKey = data;
    }
};

// Identify a blog with this blog key
BlogKey = Class();
BlogKey.prototype = {
   initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.BlogKey = data;
   }
};

// Identify a blog post with this blog post key
BlogPostKey = Class();
BlogPostKey.prototype = {
   initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.BlogPostKey = data;
   }
};

// Identify a custom item with this CustomItemKey
CustomItemKey = Class();
CustomItemKey.prototype = {
   initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.CustomItemKey = data;
   }
};

// Identify a custom collection with this CustomCollectionKey
CustomCollectionKey = Class();
CustomCollectionKey.prototype = {
   initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.CustomCollectionKey = data;
   }
};


// Identify a Forum Category
ForumCategoryKey = Class();
ForumCategoryKey.prototype = {
    initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.ForumCategoryKey = data;
    }
};

// Identify a Forum
ForumKey = Class();
ForumKey.prototype = {
    initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.ForumKey = data;
    }
};

// Identify a forum discussion with this DiscussionKey 
DiscussionKey = Class();
DiscussionKey.prototype = {
   initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.DiscussionKey = data;
   }
};

// Identify a Forum Post
ForumPostKey = Class();
ForumPostKey.prototype = {
    initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.ForumPostKey = data;
    }
};

// Identify an Event
EventKey = Class();
EventKey.prototype = {
    initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.EventKey = data;
    }
};

// Identify an Event
EventSetKey = Class();
EventSetKey.prototype = {
    initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.EventSetKey = data;
    }
};

// Identify a Community Group
CommunityGroupKey = Class();
CommunityGroupKey.prototype = {
    initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.CommunityGroupKey = data;
    }
};

// Identify a CommunityGroup Membership
CommunityGroupMembershipKey = Class();
CommunityGroupMembershipKey.prototype = {
    initialize: function(communityGroupKey, userKey) {
        var data = new Object();
        data.CommunityGroupKey = communityGroupKey;
        data.UserKey = userKey;
        this.CommunityGroupMembershipKey = data;
    }
};


// Identify a CommunityGroup Invitation
CommunityGroupInvitationKey = Class();
CommunityGroupInvitationKey.prototype = {
    initialize: function(communityGroupKey, userKey) {
        var data = new Object();
        data.CommunityGroupKey = communityGroupKey;
        data.UserKey = userKey;
        this.CommunityGroupInvitationKey = data;
    }
};

// Identify a CommunityGroup Registrant
CommunityGroupRegistrantKey = Class();
CommunityGroupRegistrantKey.prototype = {
    initialize: function(communityGroupKey, userKey) {
        var data = new Object();
        data.CommunityGroupKey = communityGroupKey;
        data.UserKey = userKey;
        this.CommunityGroupRegistrantKey = data;
    }
};

// Identify a CommunityGroup Banned User
CommunityGroupBannedUserKey = Class();
CommunityGroupBannedUserKey.prototype = {
    initialize: function(communityGroupKey, userKey) {
        var data = new Object();
        data.CommunityGroupKey = communityGroupKey;
        data.UserKey = userKey;
        this.CommunityGroupBannedUserKey = data;
    }
};

PollKey = Class();
PollKey.prototype = {
    initialize: function(pollKey) {
        var data = new Object();
        data.Key = pollKey;
        this.PollKey = data;
    }
}

// Points/Badging
BadgeFamilyKey = Class();
BadgeFamilyKey.prototype = {
    initialize: function(badgeFamilyKey) {
        var data = new Object();
        data.Key = badgeFamilyKey;
        this.BadgeFamilyKey = data;
    }
}

LeaderboardKey = Class();
LeaderboardKey.prototype = {
    initialize: function(leaderboardKey) {
        var data = new Object();
        data.Key = leaderboardKey;
        this.LeaderboardKey = data;
    }
}

// Wrapper to request a comment page
CommentPage = Class();
CommentPage.prototype = {
   initialize: function(articleKey, numberPerPage, onPage, sort, findCommentKey) {
        var data = new Object();
        data.ArticleKey = articleKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.Sort = sort;
        data.FindCommentKey = findCommentKey;
        this.CommentPage = data;
   }
};

// Wrapper to request a persona message page
PersonaMessagePage = Class();
PersonaMessagePage.prototype = {
   initialize: function(userKey, numberPerPage, onPage, sort) {
        var data = new Object();
        data.UserKey = userKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.Sort = sort;
        this.PersonaMessagePage = data;
   }
};

// Wrapper to request a review page
ReviewPage = Class();
ReviewPage.prototype = {
   initialize: function(articleKey, numberPerPage, onPage,sort) {
        var data = new Object();
        data.ArticleKey = articleKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.Sort = sort;
        this.ReviewPage = data;
   }
};

// wrapper to request a page of reviews by user
UserReviewPage = Class();
UserReviewPage.prototype = {
    initialize: function(userKey, numberPerPage, onPage, sort) {
        var data = new Object();
        data.UserKey = userKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.Sort = sort;
        this.UserReviewPage = data;
    }
};

// Wrapper of types a gallery can contain
MediaType = Class();
MediaType.prototype = {
    initialize: function(name) {
        var data = new Object();
        data.Name = name;
        this.MediaType = data;
    }
};
// Wrapper to request a page of public galleries
PublicGalleryPage = Class();
PublicGalleryPage.prototype = {
    initialize: function(numberPerPage, onPage, mediaType) {
        var data = new Object();
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.MediaType = mediaType;
        this.PublicGalleryPage = data;
    }
};
// Wrapper to request a page of user galleries
UserGalleryPage = Class();
UserGalleryPage.prototype = {
    initialize: function(userKey, numberPerPage, onPage, mediaType) {
        var data = new Object();
        data.UserKey = userKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.MediaType = mediaType;
        this.UserGalleryPage = data;
    }
};
// Wrapper to request a page of photos
PhotoPage = Class();
PhotoPage.prototype = {
    initialize: function(galleryKey, numberPerPage, onPage, sort) {
        var data = new Object();
        data.GalleryKey = galleryKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.Sort = sort;
        this.PhotoPage = data;
    }
};
// Wrapper to request a page of videos
VideoPage = Class();
VideoPage.prototype = {
    initialize: function(galleryKey, numberPerPage, onPage, sort) {
        var data = new Object();
        data.GalleryKey = galleryKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.Sort = sort;
        this.VideoPage = data;
    }
};
// Wrapper to request a comment action
CommentAction = Class();
CommentAction.prototype = {
   initialize: function(commentOnKey, onPageUrl, onPageTitle, commentBody) {
        var data = new Object();
        data.CommentOnKey = commentOnKey;
        data.OnPageUrl = onPageUrl;
        data.OnPageTitle = onPageTitle;
        data.CommentBody = commentBody;
        this.CommentAction = data;
   }
};
// Wrapper to request a review action
ReviewAction = Class();
ReviewAction.prototype = {
   initialize: function(reviewOnThisKey, onPageUrl, onPageTitle, 
                        reviewTitle, reviewRating, reviewBody, reviewPros, reviewCons) {
        var data = new Object();
        data.ReviewOnKey = reviewOnThisKey;
        data.OnPageUrl = onPageUrl;
        data.OnPageTitle = onPageTitle;
        data.ReviewTitle = reviewTitle;
        data.ReviewRating = reviewRating;
        data.ReviewBody = reviewBody;
        data.ReviewPros = reviewPros;
        data.ReviewCons = reviewCons;
        this.ReviewAction = data;
   }
};
// Wrapper to request a recommend action
RecommendAction = Class();
RecommendAction.prototype = {
   initialize: function(recommendThisKey, articleTitle) {
        var data = new Object();
        data.RecommendThisKey = recommendThisKey;
        if(articleTitle){
			data.OnPageTitle = articleTitle;
		}
		
        this.RecommendAction = data;
   }
};
// Wrapper to request a rate action
RateAction = Class();
RateAction.prototype = {
   initialize: function(rateThisKey, rating) {
        var data = new Object();
        data.RateThisKey = rateThisKey;
        data.Rating = rating;
        this.RateAction = data;
   }
};

// Permanently delete a gallery, video or photo
DeleteContentAction = Class();
DeleteContentAction.prototype = {
   initialize: function(deleteThisContent) {
        var data = new Object();
        data.DeleteThisContent = deleteThisContent;
        this.DeleteContentAction = data;
   }
};

// Email from the SiteLife system
EmailContentAction = Class();
EmailContentAction.prototype = {
   initialize: function(toAddress, subject, body) {
        var data = new Object();
        data.ToAddress = toAddress;
        data.Subject = subject;
        data.Body = body;
        this.EmailContentAction = data;
   }
};

// Email from the SiteLife system with user key as target
EmailContentWithUserIDAction = Class();
EmailContentWithUserIDAction.prototype = {
   initialize: function(toUserKey, subject, body) {
        var data = new Object();
        data.UserKey = toUserKey;
        data.Subject = subject;
        data.Body = body;
        this.EmailContentWithUserIDAction = data;
   }
};

// Wrapper to request a report abuse action
ReportAbuseAction = Class();
ReportAbuseAction.prototype = {
   initialize: function(reportThisKey, abuseReason, abuseDescription) {
        var data = new Object();
        data.ReportThisKey = reportThisKey;
        data.AbuseReason = abuseReason;
        data.AbuseDescription = abuseDescription;
        this.ReportAbuseAction = data;
   }
};
// Category used for discovery
Category = Class();
Category.prototype = {
   initialize: function(name) {
        var data = new Object();
        data.Name = name;
        this.Category = data;
   }
};
// Section used for discovery
Section = Class();
Section.prototype = {
    initialize: function(name) {
        var data = new Object();
        data.Name = name;
        this.Section = data;
    }
};
// Update or create an article
UpdateArticleAction = Class();
UpdateArticleAction.prototype = {
   initialize: function(updateArticle, onPageUrl, onPageTitle, section,categories) {
        var data = new Object();
        data.UpdateArticle = updateArticle;
        data.OnPageUrl = onPageUrl;
        data.OnPageTitle = onPageTitle;
        data.Section = section;
        data.Categories = categories;
        this.UpdateArticleAction = data;
   }
};
// Update or create a gallery
UpdateGalleryAction = Class();
UpdateGalleryAction.prototype = {
    initialize: function(updateGallery, galleryType, mediaType, title, description, tags, section, galleryPromo) {
        var data = new Object();
        data.UpdateGallery = updateGallery;
        data.GalleryType = galleryType;
        data.MediaType = mediaType;
        data.Title = title;
        data.Description = description;
        data.Tags = tags;
        data.Section = section;
        data.GalleryPromo = galleryPromo;
        this.UpdateGalleryAction = data;
    }
};
// Update or create a photo
UpdatePhotoAction = Class();
UpdatePhotoAction.prototype = {
    initialize: function(updatePhoto, title, description, tags, section) {
        var data = new Object();
        data.UpdatePhoto = updatePhoto;
        data.Title = title;
        data.Description = description;
        data.Tags = tags;
        data.Section = section;
        this.UpdatePhotoAction = data;
    }
};
// Update or create a video
UpdateVideoAction = Class();
UpdateVideoAction.prototype = {
    initialize: function(updateVideo, title, description, tags, section) {
        var data = new Object();
        data.UpdateVideo = updateVideo;
        data.Title = title;
        data.Description = description;
        data.Tags = tags;
        data.Section = section;
        this.UpdateVideoAction = data;
    }
};
// 
GalleryType = Class();
GalleryType.prototype = {
    initialize: function(name) {
        var data = new Object();
        data.Name = name;
        this.GalleryType = data;
    }
};
// GalleryPromo used for setting promotional text for public galleries
GalleryPromo = Class();
GalleryPromo.prototype = {
    initialize: function(title, body, photoKey) {
        var data = new Object();
        data.Title = title;
        data.Body = body;
        data.PhotoKey = photoKey;
        this.GalleryPromo = data;
    }
};
// UserTier used for discovery
UserTier = Class();
UserTier.prototype = {
    initialize: function(name) {
        var data = new Object();
        data.Name = name;
        this.UserTier = data;
    }
};
// MembershipTier used for community groups
MembershipTier = Class();
MembershipTier.prototype = {
    initialize: function(name) {
        var data = new Object();
        data.Name = name;
        this.MembershipTier = data;
    }
};
// Activity used for discovery
Activity = Class();
Activity.prototype = {
    initialize: function(name) {
        var data = new Object();
        data.Name = name;
        this.Activity = data;
    }
};
// Discovery on articles
DiscoverArticlesAction = Class();
DiscoverArticlesAction.prototype = {
   initialize: function(searchSections,searchCategories,limitToContributors,activity,age,maximumNumberOfDiscoveries) {
        var data = new Object();
        data.SearchSections = searchSections;
        data.SearchCategories = searchCategories;
        data.LimitToContributors = limitToContributors;
        data.Activity = activity;
        data.Age = age;
        data.MaximumNumberOfDiscoveries = maximumNumberOfDiscoveries;

        this.DiscoverArticlesAction = data;
   }
};

// Action used to add a friend
AddFriendAction = Class();
AddFriendAction.prototype = {
    initialize: function(friendUserKey) {
        var data = new Object();
        data.FriendUserKey = friendUserKey;
        this.AddFriendAction = data;
    }
};

// Action used to add a message
AddPersonaMessageAction = Class();
AddPersonaMessageAction.prototype = {
    initialize: function(toUserKey, body) {
        var data = new Object();
        data.ToUserKey = toUserKey;
        data.Body = body;
        this.AddPersonaMessageAction = data;
    }
};

// Action used to remove a message
RemovePersonaMessageAction = Class();
RemovePersonaMessageAction.prototype = {
    initialize: function(personaMessageKey) {
        var data = new Object();
        data.PersonaMessageKey = personaMessageKey;
        this.RemovePersonaMessageAction = data;
    }
};

// Action used to approve a friend
ApproveFriendAction = Class();
ApproveFriendAction.prototype = {
    initialize: function(friendUserKey, isApproved) {
        var data = new Object();
        data.FriendUserKey = friendUserKey;
        data.IsApproved = isApproved;
        this.ApproveFriendAction = data;
    }
};

// Action used to remove a friend
RemoveFriendAction = Class();
RemoveFriendAction.prototype = {
    initialize: function(friendUserKey) {
        var data = new Object();
        data.FriendUserKey = friendUserKey;
        this.RemoveFriendAction = data;
    }
};

// Action used to add an enemy
AddEnemyAction = Class();
AddEnemyAction.prototype = {
    initialize: function(enemyUserKey) {
        var data = new Object();
        data.EnemyUserKey = enemyUserKey;
        this.AddEnemyAction = data;
    }
};

// Action used to remove an enemy
RemoveEnemyAction = Class();
RemoveEnemyAction.prototype = {
    initialize: function(enemyUserKey) {
        var data = new Object();
        data.EnemyUserKey = enemyUserKey;
        this.RemoveEnemyAction = data;
    }
};

// Wrapper to request a friend page
FriendPage = Class();
FriendPage.prototype = {
   initialize: function(userKey, numberPerPage, onPage, isPendingList, filterKey, filterValue) {
        var data = new Object();
        data.UserKey = userKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.IsPendingList = isPendingList;
        data.FilterKey = filterKey;
        data.FilterValue = filterValue;
        this.FriendPage = data;
   }
};

// Wrapper to request if a given user key is a friend of the user specified by the second parameter
// if the userKey parameter is not specified, the currently logged-in user is used
IsFriend = Class();
IsFriend.prototype = {
   initialize: function(friendUserKey, userKey) {
        var data = new Object();
        data.FriendUserKey = friendUserKey;
        data.UserKey = userKey;
        this.IsFriend = data;
   }
};
												
// Wrapper to request a friend page
EnemyPage = Class();
EnemyPage.prototype = {
   initialize: function(userKey, numberPerPage, onPage, sort) {
        var data = new Object();
        data.UserKey = userKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.Sort = sort;
        this.EnemyPage = data;
   }
};
												
// Discovery on content
DiscoverContentAction = Class();
DiscoverContentAction.prototype = {
   initialize: function(searchSections,searchCategories,limitToContributors,activity,contentType,age,maximumNumberOfDiscoveries, filterBySiteOfOrigin, parentKeys) {
        var data = new Object();
        data.SearchSections = searchSections;
        data.SearchCategories = searchCategories;
        data.LimitToContributors = limitToContributors;
        data.Activity = activity;
        data.ContentType = contentType;
        data.Age = age;
        data.MaximumNumberOfDiscoveries = maximumNumberOfDiscoveries;
        data.FilterBySiteOfOrigin = filterBySiteOfOrigin;
        if(parentKeys){
			data.ParentKeys = parentKeys;
		}	
        this.DiscoverContentAction = data;
   }
};

// Content type for discovery
ContentType = Class();
ContentType.prototype = {
    initialize: function(name) {
        var data = new Object();
        data.Name = name;
        this.ContentType = data;
    }
};
												
UpdateUserProfileAction = Class();
UpdateUserProfileAction.prototype = {
   initialize: function(   userKey, 
                            aboutMe, 
                            location,
                            signature,
                            dateOfBirth, 
                            sex, 
                            personaPrivacyMode, 
                            commentsTabVisible, 
                            photosTabVisible, 
                            messagesOpenToEveryone, 
                            isEmailNotificationsEnabled, 
                            selectedStyleId, 
                            customAnswers, 
                            extendedProfile) {
                            
        var data = new Object();
        data.UserKey = userKey;
        data.AboutMe = aboutMe;
        data.Location = location;
        data.Signature = signature;
        data.DateOfBirth = dateOfBirth;
        data.Sex = sex;
		data.PersonaPrivacyMode = personaPrivacyMode;
		data.CommentsTabVisible = commentsTabVisible;
		data.PhotosTabVisible = photosTabVisible;
		data.MessagesOpenToEveryone = messagesOpenToEveryone;
		data.IsEmailNotificationsEnabled = isEmailNotificationsEnabled;
		data.SelectedStyleId = selectedStyleId;
		data.CustomAnswers = customAnswers;
		data.ExtendedProfile = extendedProfile;        
        this.UpdateUserProfileAction = data;
   }
};

UpdateUserBlockedSettingAction = Class();
UpdateUserBlockedSettingAction.prototype = {
    initialize: function( userKey, isBlocked ){
        var data = new Object;
        data.UserKey = userKey;
        data.IsBlocked = isBlocked;
        this.UpdateUserBlockedSettingAction = data;
    }    
};

SearchAction = Class();
SearchAction.prototype = {
   initialize: function(searchType, searchString, numberPerPage, onPage ) {
        var data = new Object();
        data.SearchType = searchType;
        data.SearchString = searchString;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        this.SearchAction = data;
   }
};

// Wrapper to request a watch item page
WatchItemPage = Class();
WatchItemPage.prototype = {
   initialize: function(userKey, numberPerPage, onPage) {
        var data = new Object();
        data.UserKey = userKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        this.WatchItemPage = data;
   }
};

// Wrapper to add a watch item
AddWatchItemAction = Class();
AddWatchItemAction.prototype = {
   initialize: function(userKey, watchTargetKey, title, url ) {
        var data = new Object();
        data.UserKey = userKey;
        data.WatchTargetKey = watchTargetKey;
        data.WatchItemTitle = title;
        data.WatchItemUrl = url;
        this.AddWatchItemAction = data;
   }
};

// Wrapper to delete a watch item
DeleteWatchItemAction = Class();
DeleteWatchItemAction.prototype = {
   initialize: function(userKey, watchTargetKey) {
        var data = new Object();
        data.UserKey = userKey;
        data.WatchTargetKey = watchTargetKey;
        this.DeleteWatchItemAction = data;
   }
};

// Wrapper to request a blog post page
BlogPostPage = Class();
BlogPostPage.prototype = {
   initialize: function(blogKey, numberPerPage, onPage, sort, blogPostState, restrictToOwner, includeFuturePosts) {
        var data = new Object();
        data.BlogKey = blogKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.Sort = sort;
        data.BlogPostState = blogPostState;
        if ((typeof(restrictToOwner) == 'undefined') || (restrictToOwner == null)) {
            // Default to false for backwards compatibility
            restrictToOwner = false;
        }
        data.RestrictToOwner = restrictToOwner.toString();
        if ((typeof(includeFuturePosts) == 'undefined') || (includeFuturePosts == null)) {
            // Default to false for backwards compatibility
            includeFuturePosts = false;
        }
        data.IncludeFuturePosts = includeFuturePosts.toString();
        this.BlogPostPage = data;
   }
};

// Wrapper to request a blog post page by Tag
BlogPostsByTagPage = Class();
BlogPostsByTagPage.prototype = {
   initialize: function(blogKey, tag, numberPerPage, onPage, sort) {
        var data = new Object();
        data.BlogKey = blogKey;
        data.Tag = tag;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.Sort = sort;
        this.BlogPostsByTagPage = data;
   }
};


// Wrapper to request a blog post archive count
BlogPostArchiveCount = Class();
BlogPostArchiveCount.prototype = {
   initialize: function(blogKey) {
        var data = new Object();
        data.BlogKey = blogKey;
        this.BlogPostArchiveCount = data;
   }
};


// Wrapper to request a blog post archive content page
BlogPostArchiveContentPage = Class();
BlogPostArchiveContentPage .prototype = {
   initialize: function(blogKey, month, numberPerPage, onPage, sort) {
        var data = new Object();
        data.BlogKey = blogKey;
        data.Month = month;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.Sort = sort;
        this.BlogPostArchiveContentPage = data;
   }
};


// Wrapper to request a user comment page
UserCommentPage = Class();
UserCommentPage.prototype = {
   initialize: function(userKey, numberPerPage, onPage, sort, commentsOnly) {
        var data = new Object();
        data.UserKey = userKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.Sort = sort;
        data.CommentsOnly = commentsOnly;
        this.UserCommentPage = data;
   }
};


// Wrapper to request blog tag 
RecentBlogTag = Class();
RecentBlogTag.prototype = {
   initialize: function(blogKey) {
        var data = new Object();
        data.BlogKey = blogKey;
        this.RecentBlogTag = data;
   }
};


// Wrapper to request recent user photo page
RecentUserPhotoPage = Class();
RecentUserPhotoPage.prototype = {
   initialize: function(userKey, numberPerPage, onPage) {
        var data = new Object();
        data.UserKey = userKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        this.RecentUserPhotoPage = data;
   }
};

// Wrapper to request recent user video page
RecentUserVideoPage = Class();
RecentUserVideoPage .prototype = {
   initialize: function(userKey, numberPerPage, onPage) {
        var data = new Object();
        data.UserKey = userKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        this.RecentUserVideoPage  = data;
   }
};


// Wrapper to request recent public gallery page
RecentPublicGalleryPage = Class();
RecentPublicGalleryPage .prototype = {
   initialize: function(userKey, numberPerPage, onPage) {
        var data = new Object();
        data.UserKey = userKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        this.RecentPublicGalleryPage  = data;
   }
};
    
    
// Wrapper to request recent user activity page
RecentUserActivity = Class();
RecentUserActivity .prototype = {
   initialize: function(userKey) {
        var data = new Object();
        data.UserKey = userKey;
       this.RecentUserActivity  = data;
   }
};

  
// Wrapper to request page of user media submission counts
UserMediaSubmissionsCountPage = Class();
UserMediaSubmissionsCountPage .prototype = {
    initialize: function(userKey, mediaType, numberPerPage, onPage) {
        var data = new Object();
        data.UserKey = userKey;
        data.MediaType = mediaType;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        this.UserMediaSubmissionsCountPage = data;
    }
};


// Wrapper to request recent forum discussion page
RecentForumDiscussionPage = Class();
RecentForumDiscussionPage .prototype = {
   initialize: function(userKey, numberPerPage, onPage) {
        var data = new Object();
        data.UserKey = userKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        this.RecentForumDiscussionPage = data;
   }
};

    
// Wrapper to request user group forum page
UserGroupForumPage = Class();
UserGroupForumPage .prototype = {
   initialize: function(userKey, numberPerPage, onPage, sort) {
        var data = new Object();
        data.UserKey = userKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.Sort = sort;
        this.UserGroupForumPage = data;
   }
};

// The blogRollEntry used in UpdateBlogAction
BlogRollEntry = Class();
BlogRollEntry.prototype = {
   initialize: function(name, url) {
        var data = new Object();
        data.Name = name;
        data.Url = url;
        this.BlogRollEntry = data;
   }
};

// Bookmark used in UpdateCommunityGroupAction
Bookmark = Class();
Bookmark.prototype = {
    initialize: function(title, link) {
        var data = new Object();
        data.Title = title;
        data.Link = link;
        this.Bookmark = data;
   }
};

// CommunityGroupVisibility used in UpdateCommunityGroupAction
CommunityGroupVisibility = Class();
CommunityGroupVisibility.prototype = {
    initialize: function(name) {
        var data = new Object();
        data.Name = name;
        this.CommunityGroupVisibility = data;
    }
};

// Update or create a blog
UpdateBlogAction = Class();
UpdateBlogAction.prototype = {
   initialize: function(updateBlog, title, tagline, blogRollEntries, blogType) {
        var data = new Object();
        data.BlogKey = updateBlog;
        data.Title = title;
        data.Tagline = tagline;
        data.BlogRollEntries = blogRollEntries;
        data.BlogType = blogType;
        this.UpdateBlogAction = data;
   }
};

// Update or create a blog post, key can be either a post key (update case)
// or a blog key (create case)
UpdateBlogPostAction = Class();
UpdateBlogPostAction.prototype = {
   initialize: function(key, title, body, tags, publishDate, published) {
        var data = new Object();
        data.TargetThis = key;
        data.Title = title;
        data.Body = body;
        data.Tags = tags;
        data.Date = publishDate;
        data.Published = published;
        this.UpdateBlogPostAction = data;
   }
};

// Identify a forum discussion with this DiscussionKey 
DiscussionKey = Class();
DiscussionKey.prototype = {
   initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.DiscussionKey = data;
   }
};

// Identify a custom item with this CustomItemKey
CustomItemKey = Class();
CustomItemKey.prototype = {
   initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.CustomItemKey = data;
   }
};

// Identify a custom collection with this CustomCollectionKey
CustomCollectionKey = Class();
CustomCollectionKey.prototype = {
   initialize: function(key) {
        var data = new Object();
        data.Key = key;
        this.CustomCollectionKey = data;
   }
};

// Update or create a custom item in storage
UpdateCustomItemAction = Class();
UpdateCustomItemAction.prototype = {
   initialize: function(customItemKey, name, mimeType, displayText, content, includeInRecentActivity) {
        var data = new Object();
        data.CustomItemKey = customItemKey;
        data.Name = name;
        data.MimeType = mimeType;
        data.DisplayText = displayText;
        data.Content = content;
        if ((typeof(includeInRecentActivity) == 'undefined') || (includeInRecentActivity == null)) {
            // Default to true for backwards compatibility
            includeInRecentActivity = true;
        }
        data.IncludeInRecentActivity = includeInRecentActivity
        this.UpdateCustomItemAction = data;
   }
};

// Add a new custom collection to storage
AddCustomCollectionAction = Class();
AddCustomCollectionAction.prototype = {
   initialize: function(customCollectionKey, customCollectionName) {
        var data = new Object();
        data.CustomCollectionKey = customCollectionKey;
        data.CustomCollectionName = customCollectionName;
        this.AddCustomCollectionAction = data;
   }
};

// Insert an item into a custom collection
InsertIntoCollectionAction = Class();
InsertIntoCollectionAction.prototype = {
   initialize: function(customCollectionKey, insertThisKey, position) {
        var data = new Object();
        data.CustomCollectionKey = customCollectionKey;
        data.InsertThisKey = insertThisKey;
        data.Position = position;
        this.InsertIntoCollectionAction = data;
   }
};

// Remove an item from a custom collection (position can be null to specify to remove all occurrences of item)
RemoveFromCollectionAction = Class();
RemoveFromCollectionAction.prototype = {
   initialize: function(customCollectionKey, removeThisKey, position) {
        var data = new Object();
        data.CustomCollectionKey = customCollectionKey;
        data.RemoveThisKey = removeThisKey;
        data.Position = position;
        this.RemoveFromCollectionAction = data;
   }
};

// Get a page of items out of a custom collection
CustomCollectionPage = Class();
CustomCollectionPage.prototype = {
   initialize: function(customCollectionKey, numberPerPage, onPage, sort) {
        var data = new Object();
        data.CustomCollectionKey = customCollectionKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.Sort = sort;
        this.CustomCollectionPage = data;
   }
};


// Get a page of items out of a custom collection
EditorMessageRequest = Class();
EditorMessageRequest.prototype = {
   initialize: function() {
      this.EditorMessageRequest = new Object();
   }
};

// Retrieve a user's tags for the given content type
UserTags = Class();
UserTags.prototype = {
   initialize: function(userKey, contentType) {
      var data = new Object();
      data.UserKey = userKey;
      data.ContentType = contentType;
      this.UserTags = data;
   }
};


// Get an item's ContentPolicy
GetContentPolicyAction = Class();
GetContentPolicyAction.prototype = {
    initialize: function(targetKey, userTier, action) {
        var data = new Object();
        data.TargetKey = targetKey;
        data.UserTier = userTier;
        data.ContentPolicyActionType = action;
        this.GetContentPolicyAction = data;
    }
}

// Set an item's ContentPolicy
SetContentPolicyAction = Class();
SetContentPolicyAction.prototype = {
    initialize: function(targetKey, userTier, action, policy) {
        var data = new Object();
        data.TargetKey = targetKey;
        data.UserTier = userTier;
        data.ContentPolicyActionType = action;
        data.ContentPolicy = policy;
        this.SetContentPolicyAction = data;
    }
}

ContentPolicy = Class();
ContentPolicy.prototype = {
    initialize: function(name) {
        var data = new Object();
        data.Name = name;
        this.ContentPolicy = data;
    }
};

ContentPolicyActionType = Class();
ContentPolicyActionType.prototype = {
    initialize: function(name) {
        var data = new Object();
        data.Name = name;
        this.ContentPolicyActionType = data;
    }
};

// Updates a Forum's meta data
UpdateForumAction = Class();
UpdateForumAction.prototype = {
    initialize: function(forumKey, title, description) {
        var data = new Object();
        data.ForumKey = forumKey;
        data.Title = title;
        data.Description = description;
        this.UpdateForumAction = data;
    }
};

//Adds/Updates a Forum Discussion's meta data. If the key is a ForumKey, it will be added as a new Discussion.
//If the key is a ForumDiscussionKey, the existing forum discussion will be updated.
UpdateForumDiscussionAction = Class();
UpdateForumDiscussionAction.prototype = {
    initialize: function(key, title, body, isQuestion, isPoll) {
        var data = new Object();
        data.TargetThis = key;
        data.Title = title;
        data.Body = body;
        data.IsQuestion = typeof(isQuestion) == 'string' ? isQuestion : (isQuestion ? "true" : "false");
        data.IsPoll = typeof(isPoll) == 'string' ? isPoll : (isPoll ? "true" : "false");
        this.UpdateForumDiscussionAction = data;
    }
};

//Adds/Updates a Forum Post's meta data. If the key is a ForumDiscussionKey, it will be added as a new Post.
//If the key is a ForumPostKey, the existing forum post will be updated.
UpdateForumPostAction = Class();
UpdateForumPostAction.prototype = {
    initialize: function(key, title, body, isQuestion) {
        var data = new Object();
        data.TargetThis = key;
        data.Title = title;
        data.Body = body;
        data.IsQuestion = isQuestion;
        this.UpdateForumPostAction = data;
    }
};

//Updates a Forum Discussion's Sticky flag
ForumToggleDiscussionStickyAction = Class();
ForumToggleDiscussionStickyAction.prototype = {
    initialize: function(discussionKey) {
        var data = new Object();
        data.DiscussionKey = discussionKey;
        this.ForumToggleDiscussionStickyAction = data;
    }
};

//Opens/Closes a Forum Discussion
ForumToggleDiscussionClosedAction = Class();
ForumToggleDiscussionClosedAction.prototype = {
    initialize: function(discussionKey) {
        var data = new Object();
        data.DiscussionKey = discussionKey;
        this.ForumToggleDiscussionClosedAction = data;
    }
};

//Retrieves a paginated list of Discussions for a particular Forum
ForumDiscussionsPage = Class();
ForumDiscussionsPage.prototype = {
    initialize: function(forumKey, numberPerPage, oneBasedOnPage, sort) {
        var data = new Object();
        data.ForumKey = forumKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = oneBasedOnPage;
        data.Sort = sort;
        this.ForumDiscussionsPage = data;
    }
};

//Retrieves a paginated list of Posts for a particular Forum
ForumPostsPage = Class();
ForumPostsPage.prototype = {
    initialize: function(forumDiscussionKey, numberPerPage, oneBasedOnPage, sort, findPostKey) {
        var data = new Object();
        data.DiscussionKey = forumDiscussionKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = oneBasedOnPage;
        data.Sort = sort;
        data.FindPostKey = findPostKey;
        this.ForumPostsPage = data;
    }
};

//Retrieves a paginated list of forums for a particular category
ForumCategoriesPage = Class();
ForumCategoriesPage.prototype = {
    initialize: function(numberPerPage, oneBasedOnPage) {
        var data = new Object();
        data.NumberPerPage = numberPerPage;
        data.OnPage = oneBasedOnPage;
        this.ForumCategoriesPage = data;
    }
};

//Retrieves a paginated list of forums for a particular category
ForumsPage = Class();
ForumsPage.prototype = {
    initialize: function(categoryKey, numberPerPage, oneBasedOnPage, sort) {
        var data = new Object();
        data.ForumCategoryKey = categoryKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = oneBasedOnPage;
        data.Sort = sort;
        this.ForumsPage = data;
    }
};

ForumSearchAction = Class();
ForumSearchAction.prototype = {
    initialize: function(searchKey, searchString, numberPerPage, onPage) {
        var data = new Object();
        data.TargetThis = searchKey;
        data.SearchString = searchString;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        this.ForumSearchAction = data;
    }
};

// Retrieves a paginated list of community groups
CommunityGroupPage = Class();
CommunityGroupPage.prototype = {
    initialize: function(numberPerPage, oneBasedOnPage, sort, section) {
        var data = new Object();
        data.NumberPerPage = numberPerPage;
        data.OnPage = oneBasedOnPage;
        data.Sort = sort;
        if ((typeof(section) == 'undefined') || (section == null)) {
            // Default section to All
            section = new Section("All");
        }
        data.Section = section;
        this.CommunityGroupPage = data;
    }
};

// Retrieves a paginated list of community groups
CommunityGroupMembership = Class();
CommunityGroupMembership.prototype = {
    initialize: function(groupKey, userKey) {
        var data = new Object();
        data.CommunityGroupKey = groupKey;
        data.UserKey = userKey;
        this.CommunityGroupMembership = data;
    }
};


// Retrieves a paginated list of community groups
CommunityGroupMembershipPage = Class();
CommunityGroupMembershipPage.prototype = {
    initialize: function(key, numberPerPage, oneBasedOnPage, sort, membershipFilter) {
        var data = new Object();
        data.Key = key;
        data.NumberPerPage = numberPerPage;
        data.OnPage = oneBasedOnPage;
        data.Sort = sort;
        data.MembershipFilter = membershipFilter;
        this.CommunityGroupMembershipPage = data;
    }
};

// Retrieves a paginated list of registrants
CommunityGroupRegistrantPage = Class();
CommunityGroupRegistrantPage.prototype = {
    initialize: function(key, numberPerPage, oneBasedOnPage, sort) {
        var data = new Object();
        data.CommunityGroupKey = key;
        data.NumberPerPage = numberPerPage;
        data.OnPage = oneBasedOnPage;
        data.Sort = sort;
        this.CommunityGroupRegistrantPage = data;
    }
};

// Retrieves a paginated list of banned users
CommunityGroupBannedUserPage = Class();
CommunityGroupBannedUserPage.prototype = {
    initialize: function(key, numberPerPage, oneBasedOnPage, sort) {
        var data = new Object();
        data.CommunityGroupKey = key;
        data.NumberPerPage = numberPerPage;
        data.OnPage = oneBasedOnPage;
        data.Sort = sort;
        this.CommunityGroupBannedUserPage = data;
    }
};

// Retrieves a paginated list of invited users
CommunityGroupInvitedUserPage = Class();
CommunityGroupInvitedUserPage.prototype = {
    initialize: function(key, numberPerPage, oneBasedOnPage, sort) {
        var data = new Object();
        data.CommunityGroupKey = key;
        data.NumberPerPage = numberPerPage;
        data.OnPage = oneBasedOnPage;
        data.Sort = sort;
        this.CommunityGroupInvitedUserPage = data;
    }
};



// Creates a new or updates an existing community group
UpdateCommunityGroupAction = Class();
UpdateCommunityGroupAction.prototype = {
    initialize: function(key, title, description, categories, visibility, bookmarks, section, photoKey) {
        var data = new Object();
        data.CommunityGroupKey = key;
        data.Title = title;
        data.Description = description;
        data.Categories = categories;
        data.Visibility = visibility,
        data.Bookmarks = bookmarks;        
        data.Section = section;
        data.PhotoKey = photoKey;
        this.UpdateCommunityGroupAction = data;
    }
};

// Updates an existing commnity group's bookmarks
UpdateCommunityGroupBookmarksAction = Class();
UpdateCommunityGroupBookmarksAction.prototype = {
    initialize: function(key, bookmarks) {
        var data = new Object();
        data.CommunityGroupKey = key;
        data.Bookmarks = bookmarks;        
        this.UpdateCommunityGroupBookmarksAction = data;
    }
};

// Creates or updates a user's membership in a group, with options to ban the user from the group.
UpdateCommunityGroupMembershipAction = Class();
UpdateCommunityGroupMembershipAction.prototype = {
    initialize: function(communityGroupKey, userKey, membershipTier, isBanned, banMessage) {
        var data = new Object();
        data.CommunityGroupKey = communityGroupKey;
        data.UserKey = userKey;
        data.MembershipTier = membershipTier;
        data.IsBanned = isBanned;
        data.BanMessage = banMessage;
        this.UpdateCommunityGroupMembershipAction = data;
    }
};

// Enables a user to request membership in a community group or an admin to invite a non-member.
RequestCommunityGroupMembershipAction = Class();
RequestCommunityGroupMembershipAction.prototype = {
    initialize: function(communityGroupKey, userKey, message) {
        var data = new Object();
        data.CommunityGroupKey = communityGroupKey;
        data.UserKey = userKey;
        data.Message = message;
        this.RequestCommunityGroupMembershipAction = data;
    }
};

//Retrieves a paginated list of Events for a particular EventSetKey
EventsPage = Class();
EventsPage.prototype = {
    initialize: function(eventSetKey, startDate, endDate,numberPerPage, oneBasedOnPage, sort) {
        var data = new Object();
        data.EventSetKey = eventSetKey;
        data.StartDate = startDate;
        data.EndDate = endDate;
        data.NumberPerPage = numberPerPage;
        data.OnPage = oneBasedOnPage;
        data.Sort = sort;
        this.EventsPage = data;
    }
};

// Update or creates an Event, key can be either an EventKey (update case)
// or an EventSetKey (create case)
UpdateEventAction = Class();
UpdateEventAction.prototype = {
    initialize: function(key, title, description, location, bookmarkName, bookmarkUrl, startDate, endDate, utcOffset) {
        var data = new Object();
        data.TargetThis = key;
        data.Title = title;
        data.Description = description;
        data.Location = location;
        data.BookmarkName = bookmarkName;
        data.BookmarkUrl = bookmarkUrl;
        data.StartDate = startDate;
        data.EndDate = endDate;
        data.UtcOffset = utcOffset;
        this.UpdateEventAction = data;
    }
};


// Retrieve a paginated list of recent group activities
RecentMiniFeedActivity = Class();
RecentMiniFeedActivity.prototype = {
    initialize: function(communityGroupKey, onPage, numberPerPage) {
        var data = new Object();
        data.CommunityGroupKey = communityGroupKey;
        data.OnPage = onPage;
        data.NumberPerPage = numberPerPage
        this.RecentMiniFeedActivity = data;
    }
}

//Retrieve a list of Most Active Users in a CommunityGroup
CommunityGroupMostActiveMembers = Class();
CommunityGroupMostActiveMembers.prototype = {
    initialize: function(communityGroupKey, age, maximumNumberOfMembers) {
        var data = new Object();
        data.CommunityGroupKey = communityGroupKey;
        data.Age = age;
        data.MaximumNumberOfMembers = maximumNumberOfMembers
        this.CommunityGroupMostActiveMembers = data;
    }
}

// perform a search for content within a specific community group
CommunityGroupSearchAction = Class();
CommunityGroupSearchAction.prototype = {
    initialize: function(communityGroupKey, searchType, searchString, numberPerPage, onPage) {
        var data = new Object();
        data.CommunityGroupKey = communityGroupKey;
        data.SearchType = searchType;
        data.SearchString = searchString;
        data.OnPage = onPage;
        data.NumberPerPage = numberPerPage;
        this.CommunityGroupSearchAction = data;
    }
}

// perform a search for content within a specific community group
RequestDeleteCommunityGroupAction = Class();
RequestDeleteCommunityGroupAction.prototype = {
    initialize: function(communityGroupKey, deleteReason) {
        var data = new Object();
        data.CommunityGroupKey = communityGroupKey;
        data.DeleteReason = deleteReason;
        this.RequestDeleteCommunityGroupAction = data;
    }
}

CommunityGroupRecentForumDiscussions = Class();
CommunityGroupRecentForumDiscussions.prototype = {
    initialize: function(communityGroupKey, age, maximumNumberOfDiscussions) {
        var data = new Object();
        data.CommunityGroupKey = communityGroupKey;
        data.Age = age;
        data.MaximumNumberOfDiscussions = maximumNumberOfDiscussions;
        this.CommunityGroupRecentForumDiscussions = data;
    }
}


SystemTimeInfo = Class();
SystemTimeInfo.prototype = {
    initialize: function(){
        var data = new Object();
        this.SystemTimeInfo = data;
    }
}

PrivateMessageFolderList = Class();
PrivateMessageFolderList.prototype = {
    initialize: function(){
        var data = new Object();
        this.PrivateMessageFolderList = data;
    }
}


PrivateMessage = Class();
PrivateMessage.prototype = {
    initialize: function(folderID, messageID){
        var data = new Object();
        data.FolderID = folderID;
        data.MessageID = messageID;
        this.PrivateMessage = data;
    }
}

PrivateMessagePage = Class();
PrivateMessagePage.prototype = {
    initialize: function(folderID, numberPerPage, onPage, messageReadState){
        var data = new Object();
        data.FolderID = folderID;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.MessageReadState = messageReadState;
        this.PrivateMessagePage = data;
    }
}

PrivateMessageSendAction = Class();
PrivateMessageSendAction.prototype = {
    initialize: function(subject, body, recipientList){
        var data = new Object();
        data.Subject = subject;
        data.Body = body;
        data.RecipientList = recipientList;
        this.PrivateMessageSendAction = data;
    }
}

PrivateMessageMoveMessageAction = Class();
PrivateMessageMoveMessageAction.prototype = {
    initialize: function(sourceFolderID, destinationFolderID, messageIDList){
        var data = new Object();
        data.SourceFolderID = sourceFolderID;
        data.DestinationFolderID = destinationFolderID;
        data.MessageIDList = messageIDList;
        this.PrivateMessageMoveMessageAction = data;
    }
}

PrivateMessageDeleteMessageAction = Class();
PrivateMessageDeleteMessageAction.prototype = {
    initialize: function(sourceFolderID, messageIDList){
        var data = new Object();
        data.SourceFolderID = sourceFolderID;
        data.MessageIDList = messageIDList;
        this.PrivateMessageDeleteMessageAction = data;
    }
}

PrivateMessageEmptyTrashAction = Class();
PrivateMessageEmptyTrashAction.prototype = {
    initialize: function(){
        var data = new Object();
        this.PrivateMessageEmptyTrashAction = data;
    }
}


PrivateMessageCreateFolderAction = Class();
PrivateMessageCreateFolderAction.prototype = {
    initialize: function(){
        var data = new Object();
        data.FolderID = "Inbox";
        this.PrivateMessageCreateFolderAction = data;
    }
}

FirstUnreadPost = Class();
FirstUnreadPost.prototype = {
	initialize: function(discussionKey, numberPerPage, sort){
		var data = new Object();
		data.DiscussionKey = discussionKey;
        data.NumberPerPage = numberPerPage;
        data.Sort = sort;
        this.FirstUnreadPost = data;
	}
}

LatestPost = Class();
LatestPost.prototype = {
	initialize: function(discussionKey, numberPerPage, sort){
		var data = new Object();
		data.DiscussionKey = discussionKey;
        data.NumberPerPage = numberPerPage;
        data.Sort = sort;
        this.LatestPost = data;
	}
}

UpdateDiscussionLastReadAction = Class();
UpdateDiscussionLastReadAction.prototype = {
	initialize: function(discussionKey, postKey, forceUpdate){
		var data = new Object();
		data.DiscussionKey = discussionKey;
		if(postKey){
			data.ForumPostKey = postKey;
		}
		if(forceUpdate){
			data.ForceUpdate = true;
		}
		else{
			data.ForceUpdate = false;
		}
		this.UpdateDiscussionLastReadAction = data;
	}
}

UpdateExternalUserIdAction = Class();
UpdateExternalUserIdAction.prototype = {
	initialize: function(externalSiteName, externalSiteUserId, forUser){
		var data = new Object();
		data.ExternalSiteName = externalSiteName;
		data.ExternalSiteUserId = externalSiteUserId;
		data.ForUser = forUser;
		this.UpdateExternalUserIdAction = data;
	}
}

UpdateSubscriptionAction = Class();
UpdateSubscriptionAction.prototype = {
    initialize: function(discussionKey, subscribe){
        var data = new Object();
        data.DiscussionKey = discussionKey;
        data.Subscribe = subscribe;
        this.UpdateSubscriptionAction = data;
    }
}

UpdatePollAction = Class();
UpdatePollAction.prototype = {
    initialize: function(pollOnKey, question, answers) {
        var data = new Object();
        data.PollOnKey = pollOnKey;
        data.Question = question;
        data.Answers = answers;
        this.UpdatePollAction = data;
    }
}

TogglePollIsClosedAction = Class();
TogglePollIsClosedAction.prototype = {
    initialize: function(pollKey) {
        var data = new Object();
        data.ToggleThisPoll = pollKey;
        this.TogglePollIsClosedAction = data;
    }
}

PostPollAnswerAction = Class();
PostPollAnswerAction.prototype = {
    initialize: function(pollToAnswer, indexOfAnswer) {
        var data = new Object();
        data.PollToAnswer = pollToAnswer;
        data.IndexOfAnswer = indexOfAnswer;
        this.PostPollAnswerAction = data;
    }
}

PollPage = Class();
PollPage.prototype = {
    initialize: function(pollOnKey, numberPerPage, onPage, sort) {
        var data = new Object();
        data.PollOnKey = pollOnKey;
        data.NumberPerPage = numberPerPage;
        data.OnPage = onPage;
        data.Sort = sort;
        this.PollPage = data;
    }
}

CheckFilteredWords = Class();
CheckFilteredWords.prototype = {
    initialize: function(keyValueDictionary) { // key is the string ID, value is the string to be checked - formatted like { "key1":"string1", "key2":"string2" }.
        var data = new Object();
        data.WordDictionary = keyValueDictionary;
        this.CheckFilteredWords = data;
    }
}

//Points&Badging
AwardPointsAction = Class();
AwardPointsAction.prototype = {
    initialize: function(userKey, points, currencyType) { 
        var data = new Object();
        data.UserKey = userKey;
        data.Points = points;
        data.CurrencyType = currencyType;
        this.AwardPointsAction = data;
    }
}

BadgeFamily = Class();
BadgeFamily.prototype = {
    initialize: function(badgeFamilyKey) { 
        var data = new Object();
        data.BadgeFamilyKey = badgeFamilyKey;
        this.BadgeFamily = data;
    }
}

BadgeFamilies = Class();
BadgeFamilies.prototype = {
    initialize: function() { 
        var data = new Object();        
        this.BadgeFamilies = data;
    }
}

BadgingEventAction = Class();
BadgingEventAction.prototype = {
    initialize: function(activityName, activityTags, userTags) { 
        var data = new Object();
        data.ActivityName = activityName;
        data.ActivityTags = activityTags
        data.UserTags = userTags;
        this.BadgingEventAction = data;
    }
}

GrantBadgeAction = Class();
GrantBadgeAction.prototype = {
    initialize: function(userKey, badgeFamilyKey, badgeKey) { 
        var data = new Object();
        data.UserKey = userKey;
        data.BadgeFamilyKey = badgeFamilyKey
        data.BadgeKey = badgeKey;
        this.GrantBadgeAction = data;
    }
}

Leaderboard = Class();
Leaderboard.prototype = {
    initialize: function(leaderboardKey) { 
        var data = new Object();
        data.LeaderboardKey = leaderboardKey;
        this.Leaderboard = data;
    }
}

Leaderboards = Class();
Leaderboards.prototype = {
    initialize: function() { 
        var data = new Object();        
        this.Leaderboards = data;
    }
}

LeaderboardRankingsPage = Class();
LeaderboardRankingsPage.prototype = {
    initialize: function(leaderboardKey, oneBasedOnPage) { 
        var data = new Object();
        data.LeaderboardKey = leaderboardKey;
        data.OnPage = oneBasedOnPage;
        this.LeaderboardRankingsPage = data;
    }
}

RevokeBadgeAction = Class();
RevokeBadgeAction.prototype = {
    initialize: function(userKey, badgeFamilyKey, badgeKey) { 
        var data = new Object();
        data.UserKey = userKey;
        data.BadgeFamilyKey = badgeFamilyKey
        data.BadgeKey = badgeKey;
        this.RevokeBadgeAction = data;
    }
}

PointsAndBadgingRuleValidationAction = Class();
PointsAndBadgingRuleValidationAction.prototype = {
    initialize: function(rules) { 
        var data = new Object();
        data.Rules = rules;
        this.PointsAndBadgingRuleValidationAction = data;
    }
}

AbuseItemPage = Class();
AbuseItemPage.prototype = {
	initialize: function(numberPerPage, onPage, section, maxReportsPerItem){
		var data = new Object();
		data.NumberPerPage = numberPerPage;
		data.OnPage = onPage;
		data.Section = section;
		data.MaxReportsPerItem = maxReportsPerItem;
		this.AbuseItemPage = data;
	}
}

AbuseItem = Class();
AbuseItem.prototype =  {
	initialize: function(targetKey){
		var data = new Object();
		data.TargetKey = targetKey;
		this.AbuseItem = data;
	}
}

ClearAbuseAction = Class();
ClearAbuseAction.prototype =  {
	initialize: function(targetKey){
		var data = new Object();
		data.TargetKey = targetKey;
		this.ClearAbuseAction = data;
	}
}

SetCommentBlockingStateAction = Class();
SetCommentBlockingStateAction.prototype = {
	initialize: function(commentKey, blockingState){
		var data = new Object();
		data.CommentKey = commentKey;
		data.CommentBlockingState = blockingState;
		this.SetCommentBlockingStateAction = data;
	}
}
//Community feed 
RecentActivityRequest = Class();
RecentActivityRequest.prototype = {
    initialize: function(activityForTypes, count) { 
        var data = new Object();
        data.ActivityForTypes = activityForTypes;
        data.Count = count;
        this.RecentActivityRequest = data;
    }
}	
})();
