/*
This file was automatically generated by:
	/var/www/vhosts/trustlabeldating.com/httpdocs/zp/admin/export.php?to=restore&configurations=1
Don't edit it directly!
*/

var target_direction='ltr';;(function($){$.fn.addOption=function()
{var add=function(el,v,t,sO)
{var option=document.createElement("option");option.value=v,option.text=t;var o=el.options;var oL=o.length;if(!el.cache)
{el.cache={};for(var i=0;i<oL;i++)
{el.cache[o[i].value]=i;}}
if(typeof el.cache[v]=="undefined")el.cache[v]=oL;el.options[el.cache[v]]=option;if(sO)
{option.selected=true;}};var a=arguments;if(a.length==0)return this;var sO=true;var m=false;var items,v,t;if(typeof(a[0])=="object")
{m=true;items=a[0];}
if(a.length>=2)
{if(typeof(a[1])=="boolean")sO=a[1];else if(typeof(a[2])=="boolean")sO=a[2];if(!m)
{v=a[0];t=a[1];}}
this.each(function()
{if(this.nodeName.toLowerCase()!="select")return;if(m)
{for(var item in items)
{add(this,item,items[item],sO);}}
else
{add(this,v,t,sO);}});return this;};$.fn.ajaxAddOption=function(url,params,select,fn,args)
{if(typeof(url)!="string")return this;if(typeof(params)!="object")params={};if(typeof(select)!="boolean")select=true;this.each(function()
{var el=this;$.getJSON(url,params,function(r)
{$(el).addOption(r,select);if(typeof fn=="function")
{if(typeof args=="object")
{fn.apply(el,args);}
else
{fn.call(el);}}});});return this;};$.fn.removeOption=function()
{var a=arguments;if(a.length==0)return this;var ta=typeof(a[0]);var v,index;if(ta=="string"||ta=="object"||ta=="function")
{v=a[0];if(v.constructor==Array)
{var l=v.length;for(var i=0;i<l;i++)
{this.removeOption(v[i],a[1]);}
return this;}}
else if(ta=="number")index=a[0];else return this;this.each(function()
{if(this.nodeName.toLowerCase()!="select")return;if(this.cache)this.cache=null;var remove=false;var o=this.options;if(!!v)
{var oL=o.length;for(var i=oL-1;i>=0;i--)
{if(v.constructor==RegExp)
{if(o[i].value.match(v))
{remove=true;}}
else if(o[i].value==v)
{remove=true;}
if(remove&&a[1]===true)remove=o[i].selected;if(remove)
{o[i]=null;}
remove=false;}}
else
{if(a[1]===true)
{remove=o[index].selected;}
else
{remove=true;}
if(remove)
{this.remove(index);}}});return this;};$.fn.sortOptions=function(ascending)
{var a=typeof(ascending)=="undefined"?true:!!ascending;this.each(function()
{if(this.nodeName.toLowerCase()!="select")return;var o=this.options;var oL=o.length;var sA=[];for(var i=0;i<oL;i++)
{sA[i]={v:o[i].value,t:o[i].text}}
sA.sort(function(o1,o2)
{o1t=o1.t.toLowerCase(),o2t=o2.t.toLowerCase();if(o1t==o2t)return 0;if(a)
{return o1t<o2t?-1:1;}
else
{return o1t>o2t?-1:1;}});for(var i=0;i<oL;i++)
{o[i].text=sA[i].t;o[i].value=sA[i].v;}});return this;};$.fn.selectOptions=function(value,clear)
{var v=value;var vT=typeof(value);var c=clear||false;if(vT!="string"&&vT!="function"&&vT!="object")return this;this.each(function()
{if(this.nodeName.toLowerCase()!="select")return this;var o=this.options;var oL=o.length;for(var i=0;i<oL;i++)
{if(v.constructor==RegExp)
{if(o[i].value.match(v))
{o[i].selected=true;}
else if(c)
{o[i].selected=false;}}
else
{if(o[i].value==v)
{o[i].selected=true;}
else if(c)
{o[i].selected=false;}}}});return this;};$.fn.copyOptions=function(to,which)
{var w=which||"selected";if($(to).size()==0)return this;this.each(function()
{if(this.nodeName.toLowerCase()!="select")return this;var o=this.options;var oL=o.length;for(var i=0;i<oL;i++)
{if(w=="all"||(w=="selected"&&o[i].selected))
{$(to).addOption(o[i].value,o[i].text);}}});return this;};$.fn.containsOption=function(value,fn)
{var found=false;var v=value;var vT=typeof(v);var fT=typeof(fn);if(vT!="string"&&vT!="function"&&vT!="object")return fT=="function"?this:found;this.each(function()
{if(this.nodeName.toLowerCase()!="select")return this;if(found&&fT!="function")return false;var o=this.options;var oL=o.length;for(var i=0;i<oL;i++)
{if(v.constructor==RegExp)
{if(o[i].value.match(v))
{found=true;if(fT=="function")fn.call(o[i],i);}}
else
{if(o[i].value==v)
{found=true;if(fT=="function")fn.call(o[i],i);}}}});return fT=="function"?this:found;};$.fn.selectedValues=function()
{var v=[];this.find("option:selected").each(function()
{v[v.length]=this.value;});return v;};$.fn.selectedOptions=function()
{return this.find("option:selected");};})(jQuery);(function($){var combo_p=function(select_box,options){this.cache={};this.init(select_box,options)}
combo_p.prototype={select_box:null,type_box:null,ul:null,img:null,container:null,close:null,timeout:null,chars:0,url:null,source:null,minchar:0,delay:50,fillin:false,width:200,onSelect:function(){},onKeyPress:function(){},onError:function(){},init:function(select_box,options){$.extend(this,options)
this.container=$(select_box).parent();this.select_box=$(select_box);this.select_box.parent().css("position","relative");this.type_box=$('<input />').attr({autocomplete:"off"}).bind("blur",this,function(e){var d=e.data;clearTimeout(d.close);e.data.close=setTimeout(function(){d.ul.hide();$(".bgiframe").remove();},500);}).addClass('ac_input').insertBefore(this.select_box);this.img=$("<div/>").bind("click",this,function(e){clearTimeout(e.data.close);e.data.ul.toggle();if($(".ac_results").is(":visible")){$(".ac_results:visible").parent().bgiframe({height:$(".ac_results").height()+$(".ac_results").parent().height()});}else{$(".bgiframe").remove();}
e.data.scroll();e.data.select_box.focus();}).addClass('ac_img').css("left",this.type_box.offset().left-this.type_box.offsetParent().offset().left+($("html[dir=rtl]").length?1:this.type_box.outerWidth()-18)+"px").appendTo(this.container);this.ul=$("<div/>").bind("mousedown",this,function(e){var d=e.data;setTimeout(function(){clearTimeout(d.close);d.select_box.focus();},50);}).addClass('ac_results').appendTo(this.container);$(window).bind("resize load",this,function(e){var c=e.data.container;var ie6=($.browser.msie&&$.browser.version<7);var ie7=($.browser.msie&&$.browser.version>=7);var rtl=($("html[dir=rtl]").length>0);var ul_left=e.data.type_box.offset().left-e.data.type_box.offsetParent().offset().left+1;if(ie6){if(rtl)
ul_left=ul_left-3;else
ul_left=ul_left+2;}
if(ie7&&rtl)
ul_left=ul_left-1;if(rtl)
ul_left=ul_left-1;e.data.ul.css({width:e.data.type_box.outerWidth()-2+"px",left:ul_left+"px",top:e.data.type_box.outerHeight()+"px"});}).resize();if($.browser.mozilla)
this.type_box.bind("keypress",this,this.process);else
this.type_box.bind("keydown",this,this.process);if(this.fillin){this.suggest("hide");$(".bgiframe").remove();}
this.type_box.val(this.select_box.find('option:selected').text());$(select_box).hide();$(".bgiframe").remove();},process:function(e){var a=e.data;e.data.onKeyPress.apply(e.data,arguments);if((/27$|38$|40$/.test(e.keyCode)&&a.ul.is(':visible'))||(/^13$|^9$/.test(e.keyCode))){switch(e.keyCode){case 38:e.preventDefault();e.stopPropagation();a.prev();break;case 40:e.preventDefault();e.stopPropagation();a.next();break;case 9:case 13:if(a.get()){e.preventDefault();e.stopPropagation();a.select();break;}else{break;}
case 27:e.preventDefault();e.stopPropagation();a.type_box.val('');a.ul.hide();$(".bgiframe").remove();break;}}else if(a.type_box.val().length!=a.chars||!a.type_box.val().length){a.chars=a.type_box.val().length;if(a.timeout)
clearTimeout(a.timeout);a.timeout=setTimeout(function(){a.suggest("show")},a.delay);}},get:function(){if(!this.ul.is(':visible'))
return false;var current=this.ul.children('div.ac_over');if(!current.length)
return false;return current;},prev:function(){var current=this.get();var prev=current.prev();if(current){current.removeClass('ac_over')
if(prev.text())
prev.addClass('ac_over');}
if(!current||!prev.text())
this.ul.children('div:last-child').addClass('ac_over');this.scroll();},next:function(){var current=this.get();var next=current.next()
if(current){current.removeClass('ac_over')
if(next.text())
next.addClass('ac_over');}
if(!current||!next.text())
this.ul.children('div:first-child').addClass('ac_over');this.scroll();},scroll:function(){if(!this.get())return;var el=this.get().get(0);var list=this.ul.get(0);if(el.offsetTop+el.offsetHeight>list.scrollTop+list.clientHeight)
list.scrollTop=el.offsetTop+el.offsetHeight-list.clientHeight;else if(el.offsetTop<list.scrollTop)
list.scrollTop=el.offsetTop;},select:function(){var current=this.get();if(current){current.removeClass("ac_over");var value=current.attr("class").substring(5);var text=current.text();this.select_box.addOption(value,text);this.select_box.val(value);this.type_box.val(text);this.ul.hide();$(".bgiframe").remove();this.onSelect.apply(this);this.select_box.change();}else{this.type_box.val('');return false;}},suggest:function(show){var a=this;var mask=$.trim(this.type_box.val());this.ul.empty().hide();$(".bgiframe").remove();if(mask.length>=this.minchar){if(this.cache[mask])
this.display(this.cache[mask])[show]();else if(this.url)
$.ajax({type:"GET",url:this.url,data:{mask:mask},success:function(xml){a.prepare(xml,mask)[show]();},error:function(){a.onError.apply(a,arguments);}});else if(this.source)
a.prepare(this.source,mask)[show]();else
a.prepare('<?xml version="1.0" encoding="UTF-8"?><select>'+this.select_box.html()+'</select>',mask)[show]();}else
a.prepare('<?xml version="1.0" encoding="UTF-8"?><select>'+this.select_box.html()+'</select>',mask)[show]();if($(".ac_results").is(":visible")){$(".ac_results:visible").parent().bgiframe({height:$(".ac_results").height()+$(".ac_results").parent().height()});}else{$(".bgiframe").remove();}},prepare:function(xml,mask){var parse=function(text,value){if(new RegExp('^'+mask+'|\\b'+mask+'|\\s'+mask,'ig').test(text))
return'<div class="user_'+value+'">'+
text.replace(new RegExp('^('+mask+')|(\\b)('+mask+')|(\\s)('+mask+')','ig'),'$2$4<span class="ac_match">$1$3$5</span>')+'</div>';}
var map=$.map($(xml).find("option"),function(n){return parse($(n).text(),$(n).val());})
this.cache[mask]=map.join("");return this.display(this.cache[mask]);},display:function(list){if(!list)return this.ul;var a=this;return this.ul.append(list).children('div').mouseover(function(){a.ul.children('div').removeClass('ac_over');$(this).addClass('ac_over');}).click(function(e){e.preventDefault();e.stopPropagation();a.select();}).end().children('div:first-child').addClass('ac_over').end();}}
$.fn.combo=function(options){this.each(function(){new combo_p(this,options);});return this;};})(jQuery);function FABridge(target,bridgeName)
{this.target=target;this.remoteTypeCache={};this.remoteInstanceCache={};this.remoteFunctionCache={};this.localFunctionCache={};this.bridgeID=FABridge.nextBridgeID++;this.name=bridgeName;this.nextLocalFuncID=0;FABridge.instances[this.name]=this;FABridge.idMap[this.bridgeID]=this;return this;}
FABridge.TYPE_ASINSTANCE=1;FABridge.TYPE_ASFUNCTION=2;FABridge.TYPE_JSFUNCTION=3;FABridge.TYPE_ANONYMOUS=4;FABridge.initCallbacks={};FABridge.userTypes={};FABridge.addToUserTypes=function()
{for(var i=0;i<arguments.length;i++)
{FABridge.userTypes[arguments[i]]={'typeName':arguments[i],'enriched':false};}}
FABridge.argsToArray=function(args)
{var result=[];for(var i=0;i<args.length;i++)
{result[i]=args[i];}
return result;}
function instanceFactory(objID)
{this.fb_instance_id=objID;return this;}
function FABridge__invokeJSFunction(args)
{var funcID=args[0];var throughArgs=args.concat();throughArgs.shift();var bridge=FABridge.extractBridgeFromID(funcID);return bridge.invokeLocalFunction(funcID,throughArgs);}
FABridge.addInitializationCallback=function(bridgeName,callback)
{var inst=FABridge.instances[bridgeName];if(inst!=undefined)
{callback.call(inst);return;}
var callbackList=FABridge.initCallbacks[bridgeName];if(callbackList==null)
{FABridge.initCallbacks[bridgeName]=callbackList=[];}
callbackList.push(callback);}
function FABridge__bridgeInitialized(bridgeName)
{var searchStr="bridgeName="+bridgeName;if(/Explorer/.test(navigator.appName)||/Konqueror|Safari|KHTML/.test(navigator.appVersion))
{var flashInstances=document.getElementsByTagName("object");if(flashInstances.length==1)
{FABridge.attachBridge(flashInstances[0],bridgeName);}
else
{for(var i=0;i<flashInstances.length;i++)
{var inst=flashInstances[i];var params=inst.childNodes;var flash_found=false;for(var j=0;j<params.length;j++)
{var param=params[j];if(param.nodeType==1&&param.tagName.toLowerCase()=="param")
{if(param["name"].toLowerCase()=="flashvars"&&param["value"].indexOf(searchStr)>=0)
{FABridge.attachBridge(inst,bridgeName);flash_found=true;break;}}}
if(flash_found){break;}}}}
else
{var flashInstances=document.getElementsByTagName("embed");if(flashInstances.length==1)
{FABridge.attachBridge(flashInstances[0],bridgeName);}
else
{for(var i=0;i<flashInstances.length;i++)
{var inst=flashInstances[i];var flashVars=inst.attributes.getNamedItem("flashVars").nodeValue;if(flashVars.indexOf(searchStr)>=0)
{FABridge.attachBridge(inst,bridgeName);}}}}
return true;}
FABridge.nextBridgeID=0;FABridge.instances={};FABridge.idMap={};FABridge.refCount=0;FABridge.extractBridgeFromID=function(id)
{var bridgeID=(id>>16);return FABridge.idMap[bridgeID];}
FABridge.attachBridge=function(instance,bridgeName)
{var newBridgeInstance=new FABridge(instance,bridgeName);FABridge[bridgeName]=newBridgeInstance;var callbacks=FABridge.initCallbacks[bridgeName];if(callbacks==null)
{return;}
for(var i=0;i<callbacks.length;i++)
{callbacks[i].call(newBridgeInstance);}
delete FABridge.initCallbacks[bridgeName]}
FABridge.blockedMethods={toString:true,get:true,set:true,call:true};FABridge.prototype={root:function()
{return this.deserialize(this.target.getRoot());},releaseASObjects:function()
{return this.target.releaseASObjects();},releaseNamedASObject:function(value)
{if(typeof(value)!="object")
{return false;}
else
{var ret=this.target.releaseNamedASObject(value.fb_instance_id);return ret;}},create:function(className)
{return this.deserialize(this.target.create(className));},makeID:function(token)
{return(this.bridgeID<<16)+token;},getPropertyFromAS:function(objRef,propName)
{if(FABridge.refCount>0)
{throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");}
else
{FABridge.refCount++;var retVal=this.target.getPropFromAS(objRef,propName);retVal=this.handleError(retVal);FABridge.refCount--;return retVal;}},setPropertyInAS:function(objRef,propName,value)
{if(FABridge.refCount>0)
{throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");}
else
{FABridge.refCount++;var retVal=this.target.setPropInAS(objRef,propName,this.serialize(value));retVal=this.handleError(retVal);FABridge.refCount--;return retVal;}},callASFunction:function(funcID,args)
{if(FABridge.refCount>0)
{throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");}
else
{FABridge.refCount++;var retVal=this.target.invokeASFunction(funcID,this.serialize(args));retVal=this.handleError(retVal);FABridge.refCount--;return retVal;}},callASMethod:function(objID,funcName,args)
{if(FABridge.refCount>0)
{throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");}
else
{FABridge.refCount++;args=this.serialize(args);var retVal=this.target.invokeASMethod(objID,funcName,args);retVal=this.handleError(retVal);FABridge.refCount--;return retVal;}},invokeLocalFunction:function(funcID,args)
{var result;var func=this.localFunctionCache[funcID];if(func!=undefined)
{result=this.serialize(func.apply(null,this.deserialize(args)));}
return result;},getUserTypeDescriptor:function(objTypeName)
{var simpleType=objTypeName.replace(/^([^:]*)\:\:([^:]*)$/,"$2");var isUserProto=((typeof window[simpleType]=="function")&&(typeof FABridge.userTypes[simpleType]!="undefined"));var protoEnriched=false;if(isUserProto){protoEnriched=FABridge.userTypes[simpleType].enriched;}
var toret={'simpleType':simpleType,'isUserProto':isUserProto,'protoEnriched':protoEnriched};return toret;},getTypeFromName:function(objTypeName)
{var ut=this.getUserTypeDescriptor(objTypeName);var toret=this.remoteTypeCache[objTypeName];if(ut.isUserProto)
{if(!ut.protoEnriched)
{for(i in window[ut.simpleType].prototype)
{toret[i]=window[ut.simpleType].prototype[i];}
window[ut.simpleType].prototype=toret;this.remoteTypeCache[objTypeName]=toret;FABridge.userTypes[ut.simpleType].enriched=true;}}
return toret;},createProxy:function(objID,typeName)
{var ut=this.getUserTypeDescriptor(typeName);var objType=this.getTypeFromName(typeName);if(ut.isUserProto)
{var instFactory=window[ut.simpleType];var instance=new instFactory(this.name,objID);instance.fb_instance_id=objID;}
else
{instanceFactory.prototype=objType;var instance=new instanceFactory(objID);}
this.remoteInstanceCache[objID]=instance;return instance;},getProxy:function(objID)
{return this.remoteInstanceCache[objID];},addTypeDataToCache:function(typeData)
{var newType=new ASProxy(this,typeData.name);var accessors=typeData.accessors;for(var i=0;i<accessors.length;i++)
{this.addPropertyToType(newType,accessors[i]);}
var methods=typeData.methods;for(var i=0;i<methods.length;i++)
{if(FABridge.blockedMethods[methods[i]]==undefined)
{this.addMethodToType(newType,methods[i]);}}
this.remoteTypeCache[newType.typeName]=newType;return newType;},addPropertyToType:function(ty,propName)
{var c=propName.charAt(0);var setterName;var getterName;if(c>="a"&&c<="z")
{getterName="get"+c.toUpperCase()+propName.substr(1);setterName="set"+c.toUpperCase()+propName.substr(1);}
else
{getterName="get"+propName;setterName="set"+propName;}
ty[setterName]=function(val)
{this.bridge.setPropertyInAS(this.fb_instance_id,propName,val);}
ty[getterName]=function()
{return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id,propName));}},addMethodToType:function(ty,methodName)
{ty[methodName]=function()
{return this.bridge.deserialize(this.bridge.callASMethod(this.fb_instance_id,methodName,FABridge.argsToArray(arguments)));}},getFunctionProxy:function(funcID)
{var bridge=this;if(this.remoteFunctionCache[funcID]==null)
{this.remoteFunctionCache[funcID]=function()
{bridge.callASFunction(funcID,FABridge.argsToArray(arguments));}}
return this.remoteFunctionCache[funcID];},getFunctionID:function(func)
{if(func.__bridge_id__==undefined)
{func.__bridge_id__=this.makeID(this.nextLocalFuncID++);this.localFunctionCache[func.__bridge_id__]=func;}
return func.__bridge_id__;},serialize:function(value)
{var result={};var t=typeof(value);if(t=="number"||t=="string"||t=="boolean"||t==null||t==undefined)
{result=value;}
else if(value instanceof Array)
{result=[];for(var i=0;i<value.length;i++)
{result[i]=this.serialize(value[i]);}}
else if(t=="function")
{result.type=FABridge.TYPE_JSFUNCTION;result.value=this.getFunctionID(value);}
else if(value instanceof ASProxy)
{result.type=FABridge.TYPE_ASINSTANCE;result.value=value.fb_instance_id;}
else
{result.type=FABridge.TYPE_ANONYMOUS;result.value=value;}
return result;},deserialize:function(packedValue)
{var result;var t=typeof(packedValue);if(t=="number"||t=="string"||t=="boolean"||packedValue==null||packedValue==undefined)
{result=this.handleError(packedValue);}
else if(packedValue instanceof Array)
{result=[];for(var i=0;i<packedValue.length;i++)
{result[i]=this.deserialize(packedValue[i]);}}
else if(t=="object")
{for(var i=0;i<packedValue.newTypes.length;i++)
{this.addTypeDataToCache(packedValue.newTypes[i]);}
for(var aRefID in packedValue.newRefs)
{this.createProxy(aRefID,packedValue.newRefs[aRefID]);}
if(packedValue.type==FABridge.TYPE_PRIMITIVE)
{result=packedValue.value;}
else if(packedValue.type==FABridge.TYPE_ASFUNCTION)
{result=this.getFunctionProxy(packedValue.value);}
else if(packedValue.type==FABridge.TYPE_ASINSTANCE)
{result=this.getProxy(packedValue.value);}
else if(packedValue.type==FABridge.TYPE_ANONYMOUS)
{result=packedValue.value;}}
return result;},addRef:function(obj)
{this.target.incRef(obj.fb_instance_id);},release:function(obj)
{this.target.releaseRef(obj.fb_instance_id);},handleError:function(value)
{if(typeof(value)=="string"&&value.indexOf("__FLASHERROR")==0)
{var myErrorMessage=value.split("||");if(FABridge.refCount>0)
{FABridge.refCount--;}
throw new Error(myErrorMessage[1]);return value;}
else
{return value;}}};var ASProxy=function(bridge,typeName)
{this.bridge=bridge;this.typeName=typeName;return this;};ASProxy.prototype={get:function(propName)
{return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id,propName));},set:function(propName,value)
{this.bridge.setPropertyInAS(this.fb_instance_id,propName,value);},call:function(funcName,args)
{this.bridge.callASMethod(this.fb_instance_id,funcName,args);},addRef:function(){this.bridge.addRef(this);},release:function(){this.bridge.release(this);}};(function($){$.get_flash=function(movieName){if(navigator.appName.indexOf("Microsoft")!=-1){return document.getElementById(movieName);}else{return document[movieName];}}})(jQuery);(function($){$.idleTimer=function f(newTimeout){var idle=false,enabled=true,timeout=30000,events='mousemove keydown DOMMouseScroll mousewheel mousedown',toggleIdleState=function(){idle=!idle;f.olddate=+new Date;$(document).trigger($.data(document,'idleTimer',idle?"idle":"active")+'.idleTimer');},stop=function(){enabled=false;clearTimeout($.idleTimer.tId);$(document).unbind('.idleTimer');},handleUserEvent=function(){clearTimeout($.idleTimer.tId);if(enabled){if(idle){toggleIdleState();}
$.idleTimer.tId=setTimeout(toggleIdleState,timeout);}};f.olddate=f.olddate||+new Date;if(typeof newTimeout=="number"){timeout=newTimeout;}else if(newTimeout==='destroy'){stop();return this;}else if(newTimeout==='getElapsedTime'){return(+new Date)-f.olddate;}
$(document).bind($.trim((events+' ').split(' ').join('.idleTimer ')),handleUserEvent);$.idleTimer.tId=setTimeout(toggleIdleState,timeout);$.data(document,'idleTimer',"active");};})(jQuery);function htmlspecialchars(str){str=str.replace(/&/g,'&amp;');str=str.replace(/</g,'&lt;');str=str.replace(/>/g,'&gt;');str=str.replace(/"/g,'&quot;');str=str.replace(/'/g,'&#039;');return str;};(function($){if(!document.hasFocus){document.hasFocusProperty=true;$(window).bind('focus',function(){document.hasFocusProperty=true;});$(window).bind('blur',function(){document.hasFocusProperty=false;});}
$.chat={defaults:{core_opts:{simple:{server_url:'chat_server.php?to=chat',main_window_refresh_rate:7000,chat_window_refresh_rate:3000},flashruby:{server_host:'127.0.0.1',server_port:1935}},core_order:['simple']},listen:function(current_userid,other_userid,options){var o=$.extend({},this.defaults,options);this.other_userid=other_userid;var core_opts={};core_opts.dont_listen=1;core_opts.current_userid=current_userid;core_opts.other_userid=other_userid;if(other_userid){core_opts.sync_ping=1;}else{core_opts.sync_ping=0;}
this.core_order=o.core_order;this.cores={flashruby:$.chat_cores_flashruby,simple:$.chat_cores_simple};for(var order_index in this.core_order){core_name=this.core_order[order_index];var current_core_opts=$.extend({},core_opts,o.core_opts[core_name]);this.cores[core_name].init(current_core_opts);this.cores[core_name].priority_index=order_index;}
$(window).bind('jim_core_listening',function(event,core_name){core_index=$.chat.cores[core_name].priority_index;if($.chat.active_core){active_index=$.chat.cores[this.active_core];if(active_index>core_index){$.chat.cores[$.chat.active_core].kill();$.chat.active_core=core_name;}else{$.chat.cores[core_name].kill();}}else{$.chat.active_core=core_name;}
$.chat.core=$.chat.cores[$.chat.active_core];});$(window).bind('jim_core_killed',function(event,core_name){var killed_index=$.chat.cores[core_name].priority_index;var next_index=++killed_index;console.log($.chat.core_order[next_index]);$.chat.active_core='';if($.chat.core_order[next_index]){new_core=$.chat.core_order[next_index];$.chat.cores[new_core].listen();}
setTimeout("$.chat.reset_core("+killed_index+")",10*1000);});this.core=this.cores[this.core_order[0]];if(other_userid){this.page.init();}else{this.listener.init();}
this.core.listen();$(window).trigger('jim_ready');},reset_core:function(core_index){core_name=this.core_order[core_index];if(this.active_core){active_index=$.chat.cores[this.active_core];if(active_index<=core_index)
return;}
this.cores[core_name].listen();},page:{accepted_before:false,chat_status:'active',my_peer_id:'',other_peer_id:'',max_id:0,init:function(){$('textarea.shout_box').bind('keypress',function(e){if(e.keyCode==13){if(e.shiftKey||e.ctrlKey){return true;}else{$(this).parents("form").submit();return false;}}
return true;});$(window).bind('resize',this.resize_chat_box);this.resize_chat_box();$('.chat_window form').bind('submit',function(){var val=$(this).find(".shout_box").val();if(val=='')
return false;var sender_microtime=$.chat.page.append_a_message_i_wrote($(this).find(".shout_box").val());$.chat.core.send($.chat.other_userid,$(this).find(".shout_box").val(),"message",sender_microtime);$(this).find(".shout_box").val('');return false;});$(window).bind('jim_core_error',function(){$.chat.page.to_pending('no_internet');});$(window).bind('jim_core_orders',function(event,data){$.chat.page.handle_response(data)});$(window).bind('unload',function(){$.chat.core.send_now($.chat.other_userid,'','end_chat',0);});$('a.opener_link').bind('click',function(){try{self.opener.location.href=$(this).attr('href');self.opener.focus();return false;}catch(e){return true;}});$('a.call_again_link').bind('click',function(){$.chat.page.to_pending('pending');$.chat.core.send($.chat.other_userid,'','start',0);return false;}).css("cursor","pointer");$('div.chat_history a').bind('click',function(){$.chat.core.send($.chat.other_userid,$(this).attr("class"),'history',0);return false;});if(!window.just_accepted){this.chat_status='just_started';}else{this.chat_status='just_accepted';this.accepted_before=true;}
$.chat.core.send($.chat.other_userid,'','start',0);},resize_chat_box:function(){$('.chat_box').height($(window).height()-($('body #container').height()-$('.chat_box').innerHeight()));},set_my_peer_id:function(peer_id){this.my_peer_id=peer_id;$.chat.core.send($.chat.other_userid,peer_id,'peer',0);if(this.other_peer_id)
this.start_video();},set_other_peer_id:function(peer_id){this.other_peer_id=peer_id;if(this.my_peer_id)
this.start_video();},start_video:function(){VideoChatBoxManager.call($.chat.other_userid,this.other_peer_id);},disable:function(){$('textarea.shout_box,input.submit').attr('disabled','disabled');},enable:function(){if(this.chat_status!='active'){if(this.chat_status!='just_accepted'&&this.chat_status!='logged_out'){this.notify('accepted',1);}
this.accepted_before=true;this.chat_status='active';$('textarea.shout_box,input.submit').removeAttr('disabled');$('div.system_messages div').hide();}},notify:function(msg_type,growl){$('div.system_messages div').hide();this.chat_status=msg_type;if(msg_type!='accepted'||!$.chat.accepted_before){if(msg_type=='accepted')
$.chat.accepted_before=true;var show_function;if(growl)
show_function=function(){$('div.system_messages div').hide();$.jGrowl($('div.system_messages div.msg_'+msg_type).html());};else
show_function=function(){$('div.system_messages div').hide();$('div.system_messages div.msg_'+msg_type).css('display','inline-block');$.chat.page.resize_chat_box();};if(!growl||document.hasFocusProperty||(document.hasFocus&&document.hasFocus())){show_function();}else{$(window).one('focus',{msg:msg_type},show_function);}}
$(window).trigger('jim_msg_'+msg_type);},append_message:function($message){if($('.'+$message.attr('id')).length)
return false;if($message.attr('sent')=='true'){var sender_microtime=$message.attr('sender_microtime');var message_class='me';var sender=$('.my_name').html();if($('.tm_'+sender_microtime).length){$('<div class="message_'+message_class+' '+$message.attr('id')+'"><span class="name"><span class="ts">'+$message.attr('ts')+'</span>'+sender+': </span><div class="body">'+htmlspecialchars($message.text())+'</div></div>').replaceAll('.tm_'+sender_microtime).trigger('jim_final_message_added');return false;}
var return_value=false;}else{var return_value=true;var message_class='him';var sender=$('.other_name').html();}
$('<div class="message_'+message_class+' '+$message.attr('id')+'"><span class="name"><span class="ts">'+$message.attr('ts')+'</span>'+sender+': </span><div class="body">'+htmlspecialchars($message.text())+'</div></div>').appendTo('.chat_box').trigger('jim_final_message_added');return return_value;},append_a_message_i_wrote:function(text){var sender_microtime=new Date().getTime();$('.chat_box').append('<div class="message_me tm_'+sender_microtime+'"><span class="name">'+$('.my_name').html()+': </span><div class="body">'+htmlspecialchars(text)+'</div></div>');$(".chat_box").attr("scrollTop",$(".chat_box").attr("scrollHeight"));$(window).trigger('jim_outgoing_message');return sender_microtime;},other_closed_window:function(){this.notify('closed_window',0)
$('.msg_call_again').show();this.resize_chat_box();},other_logged_out:function(){this.disable();this.notify('logged_out',0);},other_logged_in:function(){if(this.chat_status=='logged_out'){this.enable();this.other_closed_window();}},to_pending:function(message){this.pending_timeout=setTimeout('$.chat.page.no_response()',1000*30);this.notify(message,0)},no_response:function(){if(this.chat_status=='pending')
this.notify('no_response',0);$('.msg_call_again').show();this.resize_chat_box();},add_history:function($history){var oldest=$('.m_'+$history.attr('oldest'));if(oldest.length)
oldest.prevAll().remove();else
$('div.history').remove();$history.find('hm').each(function(){$.chat.page.append_history_message(oldest,$(this));});if(oldest.length){oldest.prevAll().wrap('<div class="history"></div>');$(window).trigger('jim_history_added',[$('div.history')]);}else{$('div.chat_box').wrapInner('<div class="history"></div>');$(window).trigger('jim_history_added',[$('div.chat_box')]);}},append_history_message:function($add_before,$message){if($('.'+$message.attr('id')).length)
return false;if($message.attr('sent')=='true'){var message_class='me';var sender=$('.my_name').html();}else{var message_class='him';var sender=$('.other_name').html();}
var new_message=$('<div class="message_'+message_class+' '+$message.attr('id')+'"><span class="name"><span class="ts">'+$message.attr('ts')+'</span>'+sender+': </span><div class="body">'+htmlspecialchars($message.text())+'</div></div>');if($add_before.length)
new_message.insertBefore($add_before).trigger('jim_final_message_added');else
new_message.appendTo('.chat_box').trigger('jim_final_message_added');return true;},handle_response:function(data){if(!data)
return;var response=$(data);var min_id=parseInt(response.find("min_id").text());if(min_id){if(min_id<=this.max_id){min_id=this.max_id;response.find('m[id="m_'+min_id+'"]').prevAll('m').andSelf().remove();var first_message_to_update=$(".m_"+min_id).next('m');}else{var first_message_to_update=$(".m_"+min_id);}
first_message_to_update.nextAll(':not([class*="tm_"])').andSelf().remove();}
this.max_id=parseInt(response.find("max_id").text());if(this.max_id)
$.chat.core.update_max_id(this.max_id);var message_added=false;var change_status='';response.find("o").children().each(function(){var $message=$(this);var message=$message.get(0);var tag_name=message.tagName.toLowerCase();var userid=$message.parent("o").attr("uid");switch(tag_name){case'a':$.chat.core.send($.chat.other_userid,'','thanks_got_accept',0);try{clearTimeout($.chat.page.pending_timeout);}catch(e){}
$.chat.page.enable();$(window).trigger('jim_incoming_message',[$('div.system_messages div.msg_new').html()]);break;case's':$.chat.core.send(userid,'','accept',0);if($.chat.page.my_peer_id)
$.chat.core.send(userid,$.chat.page.my_peer_id,'peer',0);break;case'm':var result=$.chat.page.append_message($message);message_added=message_added||result;break;case'l':var stamp=$message.attr('st');var cur_stamp=$message.attr('cst');var difference=Number(cur_stamp)-Number(stamp);if(difference<15&&$.chat.page.chat_status=='active')
change_status='';else if(difference<15)
change_status='active';else if($.chat.page.chat_status=='active')
change_status='other_closed';else if($.chat.page.chat_status=='just_started')
change_status='pending';break;case'e':$.chat.page.other_closed_window();break;case'b':$.chat.core.got_bye();$.chat.page.other_logged_out();break;case'h':$.chat.core.got_hi();$.chat.page.other_logged_in();break;case'history':$.chat.page.add_history($message);break
case'k':$.chat.core.kill();$.chat.page.notify('killed',0);break;case'p':$.chat.page.set_other_peer_id($message.text());break;}});if(this.chat_status=='logged_out')
return;if(message_added){try{clearTimeout(this.pending_timeout);}catch(e){}
$(window).trigger('jim_incoming_message',[$('div.system_messages div.msg_new').html()]);$(".chat_box").attr("scrollTop",$(".chat_box").attr("scrollHeight"));}
switch(change_status){case'active':this.enable();break;case'pending':this.to_pending('pending');break;case'other_closed':this.other_closed_window();break;}}},listener:{defaults:{chat_page_url:'go.php?to=chat',start_request_form_url:'go.php?to=chat&form=start_request&userid=',message_request_form_url:'go.php?to=chat&form=message_request&userid='},init:function(opts){var o=$.extend({},this.defaults,opts);this.start_request_form_url=o.start_request_form_url;this.message_request_form_url=o.message_request_form_url;this.windows={};$(window).bind('jim_core_orders',function(event,data){$.chat.listener.handle_response(data)});$.idleTimer(600000);$(document).bind("idle.idleTimer",function(){$.chat.core.server_url=$.chat.core.server_url.replace(/[&]s=[^&]+/,'');$.chat.core.server_url=$.chat.core.server_url+'&s=idle';});$(document).bind("active.idleTimer",function(){$.chat.core.server_url=$.chat.core.server_url.replace(/[&]s=[^&]+/,'');$.chat.core.server_url=$.chat.core.server_url+'&s=active';});},handle_response:function(data){var response=$(data);response.find('o').each(function(){$other_object=$(this);$other_userid=$other_object.attr("uid");if($.chat.listener.windows&&$.chat.listener.windows[$other_userid]&&!$.chat.listener.windows[$other_userid].closed){}else{$request=$('#chat_request_'+$other_userid);if($request.length==0){var first_message=$other_object.children().get(0);var tag_name=first_message.tagName.toLowerCase();var request='';if(tag_name=='s')
$.post($.chat.listener.start_request_form_url+$other_userid,{ts:$(first_message).attr("ts")},function(data){$.chat.dialog.open_request(data);},'html');else if(tag_name=='m')
$.post($.chat.listener.message_request_form_url+$other_userid,{message:$(first_message).text(),ts:$(first_message).attr("ts")},function(data){$.chat.dialog.open_request(data);},'html');}else{$request.show();$(window).trigger('jim_incoming_request');}}});}},dialog:{open_request:function(data){$other_userid=$(data).find("input[name='other_userid']").val();if(data){$('body').append(data);$request=$('#chat_request_'+$other_userid);if($request.length){var request_title=$request.find('h2').html();$request.find('h2').remove();if(!$request.hasClass("ui-dialog-content")){$request.dialog({modal:false,autoResize:true,width:454,height:"auto",position:["center","middle"],title:request_title,resizable:"disable",draggable:true,bgiframe:true,open:this.init,close:function(event,ui){$(this).remove();}}).show();}
$(window).trigger('jim_incoming_request',request_title);}}
$request.trigger('jim_final_message_added');},init:function(event,ui){$(this).find('div.submit input').bind('click',$.chat.dialog.accept_chat);$(this).find('div.reset input').bind('click',$.chat.dialog.reject_chat);},accept_chat:function(){var userid=$(this).parents('form').find('input[name="other_userid"]').val();$.chat.core.send(userid,'','accept',0);open_chat(userid);$.chat.listener.windows[userid].just_accepted=true;$(this).parents('div.chat_request').dialog("destroy").remove();return false;},reject_chat:function(){var userid=$(this).parents('form').find('input[name="other_userid"]').val();$.chat.core.send(userid,'','ignore',0);$(this).parents('div.chat_request').dialog("destroy").remove();return false;}}}
$.fn.chat=function(action,options){defaults={userid_field:'class',userid_regexp:'chat_userid_(\\d+)'};var o=$.extend({},defaults,options);var userid_regexp=new RegExp(o.userid_regexp);return this.each(function(){make_link($(this),o,userid_regexp);});};function make_link($this,o,userid_regexp){var matches=$this.attr(o.userid_field).match(userid_regexp);var userid=matches[1];$this.one('click',function(){start(userid,$(this));return false;}).css('cursor','pointer');}
function start(userid,$this){open_chat(userid);$this.one('click',function(){start(userid,$(this));})
return false;}
function open_chat(userid){if(!$.chat.listener.windows[userid]||$.chat.listener.windows[userid].closed)
$.chat.listener.windows[userid]=window.open('go.php?to=chat&userid='+userid,'chat_'+userid,'width=330,height='+Math.round((screen.height)*0.8)+',status=0&resizable=1');else
$.chat.listener.windows[userid].focus();}})(jQuery);(function($){$.chat_cores_simple={init:function(opts){if(opts.other_userid){opts.server_url=opts.server_url+'&userid='+opts.other_userid;this.refresh_rate=opts.chat_window_refresh_rate;}else{this.refresh_rate=opts.main_window_refresh_rate;}
this.server_url=opts.server_url;this.update_max_id(0);this.sync_ping=opts.sync_ping;if(!opts.dont_listen){this.listen();}},listen:function(){if(this.sync_ping){$(window).trigger('jim_core_before_first_ping',['simple']);$.ajaxSetup({async:false});this.ping();$.ajaxSetup({async:true});}
this.ping_interval=setInterval("$.chat.cores.simple.ping();",this.refresh_rate);$(window).trigger('jim_core_listening',['simple']);},kill:function(){clearInterval(this.ping_interval);$(window).trigger('jim_core_killed',['simple']);},messages_to_send:[],send:function(userid,message,type,sender_microtime){this.messages_to_send[this.messages_to_send.length]={'userid':userid,'message':message,'type':type,'sender_microtime':sender_microtime};},send_now:function(userid,message,type,sender_microtime){this.send(userid,message,type,sender_microtime);this.ping();},ping:function(){var post_data={};var use_method="GET";var len=this.messages_to_send.length
if(len){var userids=new Array(len);var messages=new Array(len);var types=new Array(len);var sender_microtimes=new Array(len);use_method="POST";for(var i=0;i<len;i++){userids[i]=this.messages_to_send[i].userid;messages[i]=this.messages_to_send[i].message;types[i]=this.messages_to_send[i].type;sender_microtimes[i]=this.messages_to_send[i].sender_microtime;}
post_data={'userid[]':userids,'message[]':messages,'type[]':types,'sender_microtime[]':sender_microtimes};this.messages_to_send=new Array();}
$.ajax({type:use_method,data:post_data,url:this.server_url,dataType:"xml",success:this.ping_response,error:this.ping_error});},errorcount:1,ping_error:function(){this.errorcount++;if(this.errorcount>3){$(window).trigger('jim_core_error',['simple']);this.update_max_id(0);this.errorcount=0;}},ping_response:function(data){this.errorcount=0;$(window).trigger('jim_core_orders',data);},update_max_id:function(max_id){this.server_url=this.server_url.replace(/[&]max_id[=]\d*/,"");if(max_id)
this.server_url=this.server_url+'&max_id='+max_id;this.max_id=max_id;},got_bye:function(){this.server_url=this.server_url.replace(/[&]other_logged_out[=]\d*/,"");this.server_url=this.server_url+'&other_logged_out=1';},got_hi:function(){this.server_url=this.server_url.replace(/[&]other_logged_out[=]\d*/,"");}};})(jQuery);(function($){$.chat_cores_flashruby={listen_now:false,init:function(opts){this.update_max_id(0);this.sync_ping=opts.sync_ping;if(!opts.dont_listen){this.listen_now=true;}
this.socketServerHost=opts.server_host;this.socketServerPort=opts.server_port;this.other_userid=opts.other_userid;this.current_userid=opts.current_userid;var session_regexp=/PHPSESSID=([^;]+)/;var sess_match;$('body').append('<object id="ajaxChatFlashInterface" style="position:absolute; top:-100px;" '
+'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
+'codebase="'
+'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" '
+'height="1" width="1">'
+'<param name="flashvars" value="bridgeName=ajaxChat"/>'
+'<param name="src" value="../_script/FABridge.swf"/>'
+'<embed name="ajaxChatFlashInterface" pluginspage="'
+'http://www.macromedia.com/go/getflashplayer" '
+'src="../_script/FABridge.swf" height="1" width="1" flashvars="bridgeName=ajaxChat"/>'
+'</object>');FABridge.addInitializationCallback('ajaxChat',this.onFABridgeReady);},is_fabridgeready:false,onFABridgeReady:function(){$.chat_cores_flashruby.is_fabridgeready=true;if($.chat_cores_flashruby.listen_now){$.chat_cores_flashruby.listen();}},socketConnectHandler:function(event){$.chat_cores_flashruby.socketIsConnected=true;$(window).trigger('jim_core_listening',['flashruby']);var sender_microtime=new Date().getTime();$.chat_cores_flashruby.socket.send('<message maxid="0" to="'+$.chat_cores_flashruby.other_userid+'" type="register" sender_microtime="0">'+$.chat_cores_flashruby.current_userid+':'+$.chat_cores_flashruby.session_id+'</message>');$.chat_cores_flashruby.send_messages();},socketCloseHandler:function(event){$.chat_cores_flashruby.socketIsConnected=false;if($.chat_cores_flashruby.socket)
clearTimeout($.chat_cores_flashruby.timer);$(window).trigger('jim_core_killed',['flashruby']);},socketDataHandler:function(event){this.errorcount=0;$(window).trigger('jim_core_orders',event.getData());},socketIOErrorHandler:function(event){$(window).trigger('jim_core_killed',['flashruby']);$.chat_cores_flashruby.update_max_id(0);},socketSecurityErrorHandler:function(event){$(window).trigger('jim_core_killed',['flashruby']);$.chat_cores_flashruby.update_max_id(0);},listen:function(){if(!this.is_fabridgeready){this.listen_now=true;return;}
if(!this.socketIsConnected){try{if(!this.socket&&FABridge.ajaxChat){this.socket=FABridge.ajaxChat.create('flash.net.XMLSocket');this.socket.addEventListener('connect',this.socketConnectHandler);this.socket.addEventListener('close',this.socketCloseHandler);this.socket.addEventListener('data',this.socketDataHandler);this.socket.addEventListener('ioError',this.socketIOErrorHandler);this.socket.addEventListener('securityError',this.socketSecurityErrorHandler);}
this.socket.connect(this.socketServerHost,this.socketServerPort);}catch(e){if(console&&console.log)
console.log(e);}}
clearTimeout(this.socketReconnectTimer);this.socketReconnectTimer=null;},kill:function(){$(window).trigger('jim_core_killed',['flashruby']);},messages_to_send:[],send:function(userid,message,type,sender_microtime){this.messages_to_send[this.messages_to_send.length]={'userid':userid,'message':message,'type':type,'sender_microtime':sender_microtime};this.send_messages();},send_now:function(userid,message,type,sender_microtime){this.send(userid,message,type,sender_microtime);},send_messages:function(){if(this.socketIsConnected){var len=this.messages_to_send.length
if(len){for(var i=0;i<len;i++){switch(this.messages_to_send[i].type){case'message':tag_name='m';break;case'start':tag_name='s';break;case'accept':tag_name='a';break;case'end_chat':tag_name='e';break;case'peer':tag_name='p';break;default:tag_name=this.messages_to_send[i].type;break;}
this.socket.send('<'+tag_name+' maxid="'+this.max_id+'" to="'+this.messages_to_send[i].userid+'" sender_microtime="'+this.messages_to_send[i].sender_microtime+'">'+htmlspecialchars(this.messages_to_send[i].message)+'</'+tag_name+'>');}
this.messages_to_send=new Array();}}},got_hi:function(){},got_bye:function(){},update_max_id:function(max_id){this.max_id=max_id;}};})(jQuery);function encodeRE(s){var encoder=new RegExp("([.*+?^${}()|[\\]/\\\\])",'g');return s.replace(encoder,'\\$1');}
(function($){$(window).bind('jim_ready',function(){$.chat.smileys={defaults:{smileys_folder:'style/smileys/tango-emoticons/',smilyes_def:'icondef.xml?MezExp=2'},convert:function($message){var message_html=$message.html();$.chat.smileys.smileys_doc.find('text').each(function(){var search=new RegExp('([>&\\r\\s\\n])'+encodeRE(htmlspecialchars($(this).text()))+'([<&\\r\\s\\n])','g');message_html=message_html.replace(search,'$1<img src="'+$.chat.smileys.defaults.smileys_folder+$(this).siblings('object').text()+'" alt="'+$(this).text()+'" />$2');});$message.html(message_html);$(".chat_box").attr("scrollTop",$(".chat_box").attr("scrollHeight"));}};$.ajax({type:"get",url:$.chat.smileys.defaults.smileys_folder+$.chat.smileys.defaults.smilyes_def,dataType:"xml",success:function(data){$.chat.smileys.smileys_doc=$(data);if($('.chat_box').length)
$.chat.smileys.convert($('.chat_box'));$('.chat_window').live('jim_final_message_added',function(evt){$.chat.smileys.convert($(evt.target));});}});});})(jQuery);(function($){$(window).bind('jim_ready',function(){window.jim_chat_ready=true;if(window.swf_sound_ready)
init_chat_sound();});$(window).bind('sound_ready',function(){window.swf_sound_ready=true;if(window.jim_chat_ready)
init_chat_sound();});function init_chat_sound(){$.chat.sound={sound_timeout:0,defaults:{folder:'sounds/',sound_selector:'#sound_player'},events_and_sounds:{'incoming_request':{file:'incoming_request.mp3',delay:350},'incoming_message':{file:'incoming_message.mp3',delay:350},'outgoing_message':{file:'outgoing_message.mp3'}},play_sound:function(sound){var my_volume=100;if(sound=='incoming_request')
my_volume=50;if(document.hasFocusProperty||(document.hasFocus&&document.hasFocus()))
my_volume=10;soundManager.play(sound,{volume:my_volume});}};for(var event in $.chat.sound.events_and_sounds){var e_name=event;soundManager.createSound(event,$.chat.sound.defaults.folder+$.chat.sound.events_and_sounds[event].file);$(window).bind('jim_'+event,function(evt){var type=evt.type.substring(4);var sound_obj=$.chat.sound.events_and_sounds[type];if(sound_obj.delay){if($.chat.sound.sound_timeout)
clearTimeout($.chat.sound.sound_timeout);$.chat.sound.sound_timeout=setTimeout('$.chat.sound.play_sound("'+type+'");',sound_obj.delay);}else{$.chat.sound.play_sound(type);}});}}})(jQuery);(function($){$(window).bind('jim_ready',function(){$.chat.blink={interval:0,message:'',defaults:{title_blink_rate:1000,events:['incoming_request','incoming_message']},begin:function(message){$.chat.blink.message=message;$(window).one('focus',$.chat.blink.finish);if(!document.hasFocusProperty&&(!document.hasFocus||!document.hasFocus())){if($.chat.blink.interval)
clearInterval($.chat.blink.interval);$.chat.blink.interval=setInterval("$.chat.blink.blink()",1000);$.chat.blink.blink();}},blink:function(){document.title=(document.title==$.chat.blink.message)?(' * '+$.chat.blink.message+' * '):$.chat.blink.message;},finish:function(){if($.chat.blink.interval)
clearInterval($.chat.blink.interval);$.chat.blink.interval=0;document.title=$.chat.blink.original_title;}}
$.chat.blink.original_title=document.title;for(var event in $.chat.blink.defaults.events){$(window).bind('jim_'+$.chat.blink.defaults.events[event],function(evt,message){if(message)
$.chat.blink.begin(message);});}});})(jQuery);(function($){$(window).bind('jim_ready',function(){$.chat.convert_timestamps=function(){$.chat.last_string='';var today=new Date();$('.chat_box .ts, .chat_request .ts').each(function(){var ts=Number($(this).text());var dt=new Date(ts*1000);var new_string='';if(today.toLocaleDateString()!=dt.toLocaleDateString())
new_string=new_string+['Jan','Feb','Mar','Apr','May','Jun','July','Aug','Sep','Oct','Nov','Dec'][dt.getMonth()]+' '+dt.getDate()+' '+dt.getFullYear()+' ';var fullH=dt.getHours();var ampmH=fullH>12?fullH-12:fullH;if(ampmH==0)
ampmH=12;var ampm=fullH>12?'PM':'AM';new_string=new_string+ampmH+':'+('0'+dt.getMinutes()).slice(-2)+' '+ampm;if($.chat.last_string==new_string)
$(this).remove();else
$(this).replace('<span class="tsp">'+new_string+'</span>');$.chat.last_string=new_string;});};$.chat.convert_timestamps();setInterval("$.chat.convert_timestamps();",1000*60);$(window).bind('jim_history_added',function(){$.chat.convert_timestamps();});});})(jQuery);(function($){$.fn.toggleVal=function(theOptions){if(!theOptions||typeof(theOptions)=="object"){theOptions=$.extend({focusClass:"tv-focused",changedClass:"tv-changed",populateFrom:"default",text:null,removeLabels:false},theOptions);}
else if(typeof(theOptions)=="string"&&theOptions.toLowerCase()=="destroy"){var destroy=true;}
return this.each(function(){if(destroy){$(this).unbind("focus.toggleval").unbind("blur.toggleval").removeData("defText");return false;}
var defText="";switch(theOptions.populateFrom){case"alt":defText=$(this).attr("alt");$(this).val(defText);break;case"label":defText=$("label[for='"+$(this).attr("id")+"']").text();$(this).val(defText);break;case"custom":defText=theOptions.text;$(this).val(defText);break;default:defText=$(this).val();}
$(this).addClass("toggleval").data("defText",defText);if(theOptions.removeLabels==true){$("label[for='"+$(this).attr("id")+"']").remove();}
$(this).bind("focus.toggleval",function(){if($(this).val()==$(this).data("defText")){$(this).val("");}
$(this).addClass(theOptions.focusClass).removeClass(theOptions.changedClass);}).bind("blur.toggleval",function(){if($(this).val()==""){$(this).val($(this).data("defText"));}
$(this).removeClass(theOptions.focusClass);if($(this).val()!=$(this).data("defText")){$(this).addClass(theOptions.changedClass);}
else{$(this).removeClass(theOptions.changedClass);}});});};})(jQuery);MSDropDown={settings:{theme:'blue',autoHide:'off',offClass:'aOff',onClass:'aOn',maintainHeight:0,idpostfixmain:'_ms',idpostfixchild:'_child',idpostfixa:'_msa',idposttitlediv:'_divtitle',idposttitle:'_title',idhidden:'_input',showTitle:true,visibleRows:7,iconWithTitle:true},styles:{ddclass:'msDropDown',childclass:'msDropDown_Child',arrow:'style/custom_combo/dd_arrow.gif',arrowclass:'msArrow',titleclass:'msDropdownTitle',disabled:'msDisabled',enabled:'msEnabled'},attributes:{action:"onfocus,onblur,onchange,onclick,ondblclick,onmousedown,onmouseup,onmouseover,onmousemove,onmouseout,onkeypress,onkeydown,onkeyup",prop:"size,multiple,disabled,tabindex"},selected:new Object(),zIndex:999,insideWindow:false,dp_array:new Object(),currentDiv:'',init:function(byID){this.storeNmake(byID);},storeNmake:function(byID){var dps=this.getAllDropDown(byID);var total=dps.length;for(var iCount=0;iCount<total;iCount++){var currentSelect=dps[iCount];if(currentSelect.id!=undefined&&currentSelect.id.length>0){this.addNewEvents(currentSelect.id);var prop=new Array();var selectProp=this.getSelectProperties(currentSelect.id);prop["selectAttributes"]=selectProp.attributes;prop["selectAction"]=selectProp.action;var width=(this.dp_array[currentSelect.id]==undefined)?$(currentSelect).width():this.dp_array[currentSelect.id].width;var height=(this.dp_array[currentSelect.id]==undefined)?$(currentSelect).height():this.dp_array[currentSelect.id].height;$(currentSelect).css({width:width+'px'});var oOptions=$("#"+currentSelect.id+"> *");var totalOptions=oOptions.length;for(var optionCount=0;optionCount<totalOptions;optionCount++){var foundopt=false;if(oOptions[optionCount].nodeName=="OPTION"){var currentOption=oOptions[optionCount];var values=this.getOptionsProperties(currentOption);prop.push(values);}else if(oOptions[optionCount].nodeName=="OPTGROUP"){foundopt=true;var optinit=false;var oCurrentOptGroup=oOptions[optionCount].childNodes;for(var optoptioncount=0;optoptioncount<oCurrentOptGroup.length;optoptioncount++){var currentOption=oCurrentOptGroup[optoptioncount];var values=this.getOptionsProperties(currentOption);if(values!=false){if(optinit==false){optinit=true;var opt=this.getOptGroupProperties(oOptions[optionCount]);values["optstart"]=opt;};prop.push(values);}};if(foundopt){prop[prop.length-1].optend="end";};};};prop["id"]=currentSelect.id;prop["position"]=(this.dp_array[currentSelect.id]==undefined)?$("#"+currentSelect.id).position():this.dp_array[currentSelect.id].position;prop["width"]=width;prop["height"]=height;this.store(currentSelect.id,prop);}else{throw"An id is required!";};};this.makeAdropDown(byID);},setOutOfVision:function(id){$("#"+id).css({position:'absolute',left:'-5000px',top:'-5000px'});},makeAdropDown:function(){var alldps=this.getdps();var idMain=this.settings.idpostfixmain;var idChild=this.settings.idpostfixchild;var idhidden=this.settings.idhidden;var idA=this.settings.idpostfixa;var idtitlediv=this.settings.idposttitlediv;var idtitle=this.settings.idposttitle;var ddclass=this.styles.ddclass;var childclass=this.styles.childclass;var arrowclass=this.styles.arrowclass;var arrow=this.styles.arrow;var titleclass=this.styles.titleclass;var counter=0;for(i in alldps){var id=i;this.setOutOfVision(id);var values=alldps[i];var selectProp=values["selectAttributes"];var selectAction=values["selectAction"];var position=values.position;var width=(values.width)+'px';var titlewidth=values.width-18+'px';var top=position.top+'px';var left=position.left+'px';var dd_id=id+idMain;if($("#"+dd_id).length>0){$("#"+dd_id).remove();}
var childid=dd_id+idChild;var childtitledivid=dd_id+idtitlediv;var titleid=dd_id+idtitle;var hiddeninput=dd_id+idhidden;var onchange=values.onchange;var childheight='';if(values.length>this.getVisibleRows())childheight='120';var ddhtml="";var zIndex=this.zIndex--;var css=(selectProp["disabled"]==true)?" "+this.styles.disabled:this.styles.enabled;ddhtml+="<div  id='"+dd_id+"' class='"+ddclass+"' style='position:relative;width:"+width+";z-Index:"+zIndex+"'>";if(selectProp["disabled"]==true){ddhtml+="<div id='"+childtitledivid+"' class='"+css+"'><div class='"+arrowclass+"'><img src='"+arrow+"' border='0' align='right' /></div><div style='white-space:nowrap;width:"+titlewidth+"' class='"+titleclass+"' id='"+titleid+"'>Loading...</div><input style='text-indent:-400px;position:absolute; top:0; left:0; border:none; background:transparent;cursor:pointer;width:0px;heigh:0px;' type='text' value='' id='"+hiddeninput+"' name='"+hiddeninput+"' /></div>";}else{ddhtml+="<div id='"+childtitledivid+"' class='"+css+"' onclick=\"MSDropDown.openDropDown('"+dd_id+"')\"><div class='"+arrowclass+"'><img src='"+arrow+"' border='0' align='right' /></div><div style='white-space:nowrap;width:"+titlewidth+"' class='"+titleclass+"' id='"+titleid+"'>Loading...</div><input style='position:absolute; top:0; left:0; border:none; background:transparent;cursor:pointer;width:0px;heigh:0px;' type='text' value='' id='"+hiddeninput+"' name='"+hiddeninput+"' /></div>";};ddhtml+="<div id='"+childid+"' class='coloredScroll "+childclass+"' style='width:"+(values.width+2)+"px'>";var ahtml="";var sValue="";var sImg="";for(var aCount=0;aCount<values.length;aCount++){var curretna=values[aCount];var aID=dd_id+"_a_"+aCount;var value=curretna.value;if(aCount==0){var selectedID=aID;};var text=curretna.text;var selected=curretna.selected;var icon=curretna.icon;if($("#"+id+" option:selected").text()==text){sValue=text;selectedID=aID;var showIcon=this.getSetting("iconWithTitle");if(icon!=undefined&&showIcon==true){sImg="<img align='absMiddle' src='"+icon+"' />";};}
var isDisabled=curretna.disabled;var img="";var sTitle=(this.getShowTitle()==true)?text:'';var innerStyle=(curretna.style!=undefined)?curretna.style:'';if(curretna.optstart!=undefined){var optLabel=(curretna.optstart.label==undefined)?'':curretna.optstart.label;ahtml+="<div style='display:block;clear:both;'><span style='font-weight:bold;font-style:italic'>"+optLabel+"</span><div style='display:block;text-indent:10px;clear:both:'>";};if(icon!=undefined){img="<img id='"+aID+"_icon' class='icon' align='left' src='"+icon+"' />";};if(isDisabled==undefined||isDisabled==false){ahtml+="<a id='"+aID+"' title='"+sTitle+"' style='display:block;"+innerStyle+"'+ href='javascript:void(0);' value='"+(value)+"' onclick=\"MSDropDown.setSelected('"+dd_id+"', '"+text+"', '"+aID+"', '"+value+"', '"+icon+"')\">";}else{ahtml+="<a id='"+aID+"' title='"+sTitle+"' style='cursor:pointer;filter:alpha(opacity=50);-moz-opacity:.50;opacity:.50;display:block;"+innerStyle+"' href='javascript:void(0);' value='"+(value)+"'>";};ahtml+=img+'<span>'+text+"</span></a>";if(curretna.optend=="end"){ahtml+="</div></div>";};};sValue=(sValue=='')?values[0].text:sValue;ddhtml+=ahtml;ddhtml+="</div>";ddhtml+="</div>"
counter++;$("#"+id).after(ddhtml);if(selectProp["disabled"]==false){}else{$("#"+dd_id).css({opacity:0.4});};this.applyEvents(dd_id,values,id);if(childheight!='')$("#"+childid).css({overflowY:'scroll',overflowX:'hidden',height:childheight+'px'});$("#"+titleid).html(sImg+sValue);this.manageSelection(id,selectedID);}},hasAction:function(prop,action){var sAction=action;var selectAction=prop;for(var i in selectAction){if(i.toString().toLowerCase()==sAction.toString().toLowerCase()&&selectAction[i]==true){return true;};};return false;},applyEvents:function(id,values,parent){var sID=id;var parent_id=parent;var props=values;var selectProp=props["selectAttributes"];var selectAction=props["selectAction"];if(selectProp["disabled"]==false){for(var i in selectAction){if(selectAction[i]==true){switch(i){case'onfocus':$("#"+sID).bind("focus",function(e){$("#"+parent_id).focus();});break;case'onblur':break;case'onchange':break;case'onclick':$("#"+sID).bind("click",function(e){$("#"+parent_id).click();});break;case'ondblclick':$("#"+sID).bind("dblclick",function(e){$("#"+parent_id).dblclick();});break;case'onmousedown':$("#"+sID).bind("mousedown",function(e){$("#"+parent_id).mousedown();});break;case'onmouseup':$("#"+sID).bind("mouseup",function(e){$("#"+parent_id).mouseup();});break;case'onmouseover':$("#"+sID).bind("mouseover",function(e){$("#"+parent_id).mouseover();});break;case'onmousemove':$("#"+sID).bind("mousemove",function(e){$("#"+parent_id).mousemove();});break;case'onmouseout':$("#"+sID).bind("mouseleave",function(e){$("#"+parent_id).mouseout();});break;case'onkeypress':$("#"+sID).bind("keypress",function(e){$("#"+parent_id).keypress();});break;case'onkeydown':$("#"+sID).bind("keydown",function(e){$("#"+parent_id).keydown();});break;case'onkeyup':$("#"+sID).bind("keyup",function(e){$("#"+parent_id).keyup();});break;};};};};},addNewEvents:function(id){document.getElementById(id).refresh=function(e){MSDropDown.refresh(this.id);}},refresh:function(id){MSDropDown.storeNmake("#"+id);},manageSelection:function(id,selected){if(this.selected[id]==undefined){this.selected[id]={selected:selected,previous:selected};};this.selected[id].selected=selected;if(this.selected[id].previous!=this.selected[id].selected){$("#"+this.selected[id].previous).removeClass('selected');};$("#"+this.selected[id].selected).addClass('selected');this.selected[id].previous=this.selected[id].selected;},setSelected:function(id,value,aID,val,imgsrc){var parentID=id.split("_")[0];this.selected[parentID].current=aID;var sID=id;var oPorop=prop;var targetDiv=sID+this.settings.idposttitle;var hiddeninput=sID+this.settings.idhidden;var prop=this.getdps(parentID);$("#"+parentID+" option:selected").text(value.toString());$("#"+parentID+" option:selected").val(val.toString());if($("#"+parentID).attr("onfocus")!=undefined){$("#"+parentID).focus();$("#"+hiddeninput).focus();};if($("#"+parentID).attr("onchange")!=undefined){$("#"+parentID).change();};$("#"+hiddeninput).val(value);var showIcon=this.getSetting("iconWithTitle");if(imgsrc.toString()!='undefined'&&showIcon==true){value="<img hspace='2' align='absmiddle' src='"+imgsrc+"' />"+value;}
$("#"+targetDiv).html(value);this.manageSelection(parentID,aID);this.closeDropDown();},openDropDown:function(id){var prentDiv=id;var childDiv=id+="_child";if($("#"+childDiv).css("display")=="block"){MSDropDown.closeDropDown();return false;};var position=$("#"+prentDiv).position();var childPosTop=$("#"+prentDiv).height()+parseInt($("#"+prentDiv).css("padding-top"))+'px';var parentWidth=parseInt($("#"+prentDiv).width());var childWidth=parseInt($("#"+childDiv).width());if(childWidth<parentWidth){$("#"+childDiv).css({width:$("#"+prentDiv).width()+'px'});}
this.currentDiv=childDiv;$("#"+childDiv).css({position:'absolute',top:childPosTop,left:'-1px'});$("#"+childDiv).slideDown("fast");$("#"+childDiv).mouseover(function(e){MSDropDown.setInsideWindow(true);});$("#"+childDiv).mouseout(function(e){MSDropDown.setInsideWindow(false);});$(document).bind('mouseup',function(e){if(MSDropDown.insideWindow==false){$(document).unbind('mouseup');MSDropDown.closeDropDown();}});},setInsideWindow:function(set){this.insideWindow=set;},closeDropDown:function(){var curerntDiv=this.currentDiv;var parentID=curerntDiv.split("_")[0];var hiddeninput=curerntDiv+this.settings.idhidden;if($("#"+parentID).attr("onblur")!=undefined){$("#"+parentID).focus();$("#"+hiddeninput).focus();};$("#"+this.currentDiv).slideUp("fast");},store:function(id,prop){this.dp_array[id]=prop;},getdps:function(byID){return(byID==undefined)?this.dp_array:this.dp_array[byID];},getAllDropDown:function(byID){return(byID==undefined)?$("body select"):$(byID);},showTitle:function(show){this.settings.showTitle=show;},getShowTitle:function(){return this.settings.showTitle;},setVisibleRows:function(rows){this.settings.visibleRows=rows;},getVisibleRows:function(){return this.settings.visibleRows;},getSelectProperties:function(id){var currentSelect=id;var attributes=this.attributes.prop;var prop=new Object();var attribs=attributes.split(",");var total=attribs.length;prop.attributes=new Object();for(var iCount=0;iCount<total;iCount++){var key=attribs[iCount].toString();var value=$("#"+currentSelect).attr(key);if(value!=undefined){prop.attributes[key]=value;};};attributes=this.attributes.action;attribs=attributes.split(",");total=attribs.length;prop.action=new Object();for(var iCount=0;iCount<total;iCount++){var key=attribs[iCount].toString();var value=$("#"+currentSelect).attr(key);if(value!=undefined){prop.action[key]=true;}else{prop.action[key]=false;};};return prop;},getOptionsProperties:function(option){var currentOption=option;if(currentOption.text!=undefined){var prop=new Object();prop["text"]=currentOption.text;prop["value"]=(currentOption.value==undefined)?currentOption.text:currentOption.value;var attribs=currentOption.attributes;var total=attribs.length;for(var iCount=0;iCount<total;iCount++){var att=attribs[iCount];prop[att.nodeName]=att.nodeValue;};return prop;}else{return false;};},getOptGroupProperties:function(opt){var oOpt=opt;var prop=new Object();prop["optstart"]="start";var attribs=oOpt.attributes;var total=attribs.length;if(total>0){for(var iCount=0;iCount<total;iCount++){var att=attribs[iCount];prop[att.nodeName]=att.nodeValue;};};return prop;},showIconWithTitle:function(show){this.settings.iconWithTitle=show;},getSetting:function(prop){return this.settings[prop];}}
if(jQuery){(function(a){a.extend(a.fn,{uploadify:function(b){a(this).each(function(){settings=a.extend({id:a(this).attr("id"),uploader:"uploadify.swf",script:"uploadify.php",expressInstall:null,folder:"",height:30,width:110,cancelImg:"cancel.png",wmode:"opaque",scriptAccess:"sameDomain",fileDataName:"Filedata",method:"POST",queueSizeLimit:999,simUploadLimit:1,queueID:false,displayData:"percentage",onInit:function(){},onSelect:function(){},onQueueFull:function(){},onCheck:function(){},onCancel:function(){},onError:function(){},onProgress:function(){},onComplete:function(){},onAllComplete:function(){}},b);var e=location.pathname;e=e.split("/");e.pop();e=e.join("/")+"/";var f={};f.uploadifyID=settings.id;f.pagepath=e;if(settings.buttonImg){f.buttonImg=escape(settings.buttonImg)}if(settings.buttonText){f.buttonText=escape(settings.buttonText)}if(settings.rollover){f.rollover=true}f.script=settings.script;f.folder=escape(settings.folder);if(settings.scriptData){var g="";for(var d in settings.scriptData){g+="&"+d+"="+settings.scriptData[d]}f.scriptData=escape(g.substr(1))}f.width=settings.width;f.height=settings.height;f.wmode=settings.wmode;f.method=settings.method;f.queueSizeLimit=settings.queueSizeLimit;f.simUploadLimit=settings.simUploadLimit;if(settings.hideButton){f.hideButton=true}if(settings.fileDesc){f.fileDesc=settings.fileDesc}if(settings.fileExt){f.fileExt=settings.fileExt}if(settings.multi){f.multi=true}if(settings.auto){f.auto=true}if(settings.sizeLimit){f.sizeLimit=settings.sizeLimit}if(settings.checkScript){f.checkScript=settings.checkScript}if(settings.fileDataName){f.fileDataName=settings.fileDataName}if(settings.queueID){f.queueID=settings.queueID}if(settings.onInit()!==false){a(this).css("display","none");a(this).after('<div id="'+a(this).attr("id")+'Uploader"></div>');swfobject.embedSWF(settings.uploader,settings.id+"Uploader",settings.width,settings.height,"9.0.24",settings.expressInstall,f,{quality:"high",wmode:settings.wmode,allowScriptAccess:settings.scriptAccess});if(settings.queueID==false){a("#"+a(this).attr("id")+"Uploader").after('<div id="'+a(this).attr("id")+'Queue" class="uploadifyQueue"></div>')}}if(typeof(settings.onOpen)=="function"){a(this).bind("uploadifyOpen",settings.onOpen)}a(this).bind("uploadifySelect",{action:settings.onSelect,queueID:settings.queueID},function(j,h,i){if(j.data.action(j,h,i)!==false){var k=Math.round(i.size/1024*100)*0.01;var l="KB";if(k>1000){k=Math.round(k*0.001*100)*0.01;l="MB"}var m=k.toString().split(".");if(m.length>1){k=m[0]+"."+m[1].substr(0,2)}else{k=m[0]}if(i.name.length>20){fileName=i.name.substr(0,20)+"..."}else{fileName=i.name}queue="#"+a(this).attr("id")+"Queue";if(j.data.queueID){queue="#"+j.data.queueID}a(queue).append('<div id="'+a(this).attr("id")+h+'" class="uploadifyQueueItem"><div class="cancel"><a href="javascript:jQuery(\'#'+a(this).attr("id")+"').uploadifyCancel('"+h+'\')"><img src="'+settings.cancelImg+'" border="0" /></a></div><span class="fileName">'+fileName+" ("+k+l+')</span><span class="percentage"></span><div class="uploadifyProgress"><div id="'+a(this).attr("id")+h+'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div></div></div>')}});if(typeof(settings.onSelectOnce)=="function"){a(this).bind("uploadifySelectOnce",settings.onSelectOnce)}a(this).bind("uploadifyQueueFull",{action:settings.onQueueFull},function(h,i){if(h.data.action(h,i)!==false){alert("The queue is full.  The max size is "+i+".")}});a(this).bind("uploadifyCheckExist",{action:settings.onCheck},function(m,l,k,j,o){var i=new Object();i=k;i.folder=e+j;if(o){for(var h in k){var n=h}}a.post(l,i,function(r){for(var p in r){if(m.data.action(m,l,k,j,o)!==false){var q=confirm("Do you want to replace the file "+r[p]+"?");if(!q){document.getElementById(a(m.target).attr("id")+"Uploader").cancelFileUpload(p,true,true)}}}if(o){document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(n,true)}else{document.getElementById(a(m.target).attr("id")+"Uploader").startFileUpload(null,true)}},"json")});a(this).bind("uploadifyCancel",{action:settings.onCancel},function(l,h,k,m,j){if(l.data.action(l,h,k,m,j)!==false){var i=(j==true)?0:250;a("#"+a(this).attr("id")+h).fadeOut(i,function(){a(this).remove()})}});if(typeof(settings.onClearQueue)=="function"){a(this).bind("uploadifyClearQueue",settings.onClearQueue)}var c=[];a(this).bind("uploadifyError",{action:settings.onError},function(l,h,k,j){if(l.data.action(l,h,k,j)!==false){var i=new Array(h,k,j);c.push(i);a("#"+a(this).attr("id")+h+" .percentage").text(" - "+j.type+" Error");a("#"+a(this).attr("id")+h).addClass("uploadifyError")}});a(this).bind("uploadifyProgress",{action:settings.onProgress,toDisplay:settings.displayData},function(j,h,i,k){if(j.data.action(j,h,i,k)!==false){a("#"+a(this).attr("id")+h+"ProgressBar").css("width",k.percentage+"%");if(j.data.toDisplay=="percentage"){displayData=" - "+k.percentage+"%"}if(j.data.toDisplay=="speed"){displayData=" - "+k.speed+"KB/s"}if(j.data.toDisplay==null){displayData=" "}a("#"+a(this).attr("id")+h+" .percentage").text(displayData)}});a(this).bind("uploadifyComplete",{action:settings.onComplete},function(k,h,j,i,l){if(k.data.action(k,h,j,unescape(i),l)!==false){a("#"+a(this).attr("id")+h+" .percentage").text(" - Completed");a("#"+a(this).attr("id")+h).fadeOut(250,function(){a(this).remove()})}});if(typeof(settings.onAllComplete)=="function"){a(this).bind("uploadifyAllComplete",{action:settings.onAllComplete},function(h,i){if(h.data.action(h,i)!==false){c=[]}})}})},uploadifySettings:function(f,j,c){var g=false;a(this).each(function(){if(f=="scriptData"&&j!=null){if(c){var i=j}else{var i=a.extend(settings.scriptData,j)}var l="";for(var k in i){l+="&"+k+"="+escape(i[k])}j=l.substr(1)}g=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(f,j)});if(j==null){if(f=="scriptData"){var b=unescape(g).split("&");var e=new Object();for(var d=0;d<b.length;d++){var h=b[d].split("=");e[h[0]]=h[1]}g=e}return g}},uploadifyUpload:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").startFileUpload(b,false)})},uploadifyCancel:function(b){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").cancelFileUpload(b,true,false)})},uploadifyClearQueue:function(){a(this).each(function(){document.getElementById(a(this).attr("id")+"Uploader").clearFileUploadQueue(false)})}})})(jQuery)};(function($){function History()
{this._curHash='';this._callback=function(hash){};};$.extend(History.prototype,{init:function(callback){this._callback=callback;this._curHash=location.hash;if($.browser.msie){if(this._curHash==''){this._curHash='#';}
$("body").prepend('<iframe id="jQuery_history" style="display: none;"></iframe>');var iframe=$("#jQuery_history")[0].contentWindow.document;iframe.open();iframe.close();iframe.location.hash=this._curHash;}
else if($.browser.safari){this._historyBackStack=[];this._historyBackStack.length=history.length;this._historyForwardStack=[];this._isFirst=true;this._dontCheck=false;}
this._callback(this._curHash.replace(/^#/,''));setInterval(this._check,100);},add:function(hash){this._historyBackStack.push(hash);this._historyForwardStack.length=0;this._isFirst=true;},_check:function(){if($.browser.msie){var ihistory=$("#jQuery_history")[0];var iframe=ihistory.contentDocument||ihistory.contentWindow.document;var current_hash=iframe.location.hash;if(current_hash!=$.history._curHash){location.hash=current_hash;$.history._curHash=current_hash;$.history._callback(current_hash.replace(/^#/,''));}}else if($.browser.safari){if(!$.history._dontCheck){var historyDelta=history.length-$.history._historyBackStack.length;if(historyDelta){$.history._isFirst=false;if(historyDelta<0){for(var i=0;i<Math.abs(historyDelta);i++)$.history._historyForwardStack.unshift($.history._historyBackStack.pop());}else{for(var i=0;i<historyDelta;i++)$.history._historyBackStack.push($.history._historyForwardStack.shift());}
var cachedHash=$.history._historyBackStack[$.history._historyBackStack.length-1];if(cachedHash!=undefined){$.history._curHash=location.hash;$.history._callback(cachedHash);}}else if($.history._historyBackStack[$.history._historyBackStack.length-1]==undefined&&!$.history._isFirst){if(document.URL.indexOf('#')>=0){$.history._callback(document.URL.split('#')[1]);}else{$.history._callback('');}
$.history._isFirst=true;}}}else{var current_hash=location.hash;if(current_hash!=$.history._curHash){$.history._curHash=current_hash;$.history._callback(current_hash.replace(/^#/,''));}}},load:function(hash){var newhash;if($.browser.safari){newhash=hash;}else{newhash='#'+hash;location.hash=newhash;}
this._curHash=newhash;if($.browser.msie){var ihistory=$("#jQuery_history")[0];var iframe=ihistory.contentWindow.document;iframe.open();iframe.close();iframe.location.hash=newhash;this._callback(hash);}
else if($.browser.safari){this._dontCheck=true;this.add(hash);var fn=function(){$.history._dontCheck=false;};window.setTimeout(fn,200);this._callback(hash);location.hash=newhash;}
else{this._callback(hash);}}});$(document).ready(function(){$.history=new History();});})(jQuery);var open_dropdown;var open_dropdown_timeout;function open_card(e){var window_height=$(window).height();var user_box_top_distance_window_top=$(this).parent().offset().top-$(window).scrollTop();var user_box_bottom_distance_window_top=user_box_top_distance_window_top+75;var user_box_bottom_distance_window_bottom=window_height-user_box_bottom_distance_window_top;var dropdown=$(this).parent().find('.UserBox_Dropdown');var dropdown_height=dropdown.height();if($(this).hasClass('ChainAjax')){var userbox_class=$(this).parent().attr('class');var userid_matches=/user(\d+)/.exec(userbox_class);userbox_class=userbox_class.replace(/user(\d+)|UserBox|\s\s+/,'');var userid=userid_matches[1];$.get("?to=dropdown_ajax&background=1&userid="+userid+"&class="+encodeURIComponent(userbox_class));$(this).removeClass('ChainAjax');$(this).parent().find('.EmptyDropdownConnections').show();}
$('.UserBox_Dropdown').hide();$('.UserBox_Dropdown').css('z-index','0');if(user_box_bottom_distance_window_bottom<dropdown_height&&user_box_top_distance_window_top>=dropdown_height){dropdown.css('margin-top','-'+(dropdown_height+72)+'px');}else{dropdown.css('margin-top','0');}
dropdown.css('z-index','99');var offset=$(this).parent().offset();var parentsoffset=$(this).offsetParent().offset();dropdown.css('left',(offset.left-parentsoffset.left)+'px');dropdown.show();dropdown.parent().bgiframe();$(".ui-sortable").css('z-index','0');dropdown.parents(".ui-sortable").css('z-index','99');open_dropdown=dropdown;try{clearTimeout(open_dropdown_timeout);}catch(err){}}
function close_card(){open_dropdown_timeout=setTimeout('close_open_dropdown()',500);}
function close_open_dropdown(){if(open_dropdown){$(".ui-sortable").css('z-index','0');open_dropdown.css('z-index','0');open_dropdown.hide();}}
function init_cards(){$('a.InterestingLink').live('click',on_mark_as_interesting_click);$('div.UserBox_Dropdown:not(.initialized)',$("#main")).siblings('.UserBox_Trigger:has(a)').hoverIntent(open_card,function(){}).css("cursor","pointer").end().addClass('initialized').parent().hoverIntent(function(){},close_card);}
function init_selectable_cards(){$('div.Selectable_UserBox, div.Selectable_Extended_UserBox',$('div#main')).find('*').andSelf().unbind('click mouseenter mouseleave').end().end().bind('click',function(){$(this).toggleClass('SelectedUserBox');if($(this).hasClass('SelectedUserBox'))
$(this).find('input').attr("checked","checked");else
$(this).find('input').removeAttr("checked");return false;}).hover(function(){$(this).addClass('Hover_Selectable_UserBox')},function(){$(this).removeClass('Hover_Selectable_UserBox');}).css("cursor","pointer");}
var fadeTimeout;var fadeSpeed=1000;var haltSpeed=3000;function fade_out_message_box(){clearTimeout(fadeTimeout);$('div.notice').fadeOut(fadeSpeed);}
function init_notice_box(){$('div.notice').bind('click',fade_out_message_box);$('div.notice').fadeIn(fadeSpeed,function(){fadeTimeout=setTimeout('fade_out_message_box()',haltSpeed);});}
var menuTimeout;function menu_over_timeout(){$('#MainMenu>li.temp_here').find('ul').show().end().siblings().find('ul').hide();}
function menu_over(){$(this).addClass('temp_here');menuTimeout=setTimeout('menu_over_timeout()',200);}
function menu_reset(){$('#MainMenu ul').hide();$('#MainMenu li.here ul').show();}
function init_menu(){$('#MainMenu>li').hover(menu_over,function(){$(this).removeClass('temp_here')}).parent().hover(function(){},menu_reset);}
function edit_profile_tags_init(){$('span.TagToAdd').css('cursor','pointer');$('span.TagToAdd').bind('click',edit_profile_tags_add);}
function edit_profile_tags_add(){var current_text=$('textarea[name=tags_box]').val();var tag_to_add=$(this).text();var new_text=current_text+'\n'+tag_to_add;$('textarea[name=tags_box]').val(new_text);if($(this).next('span.tag_comma').size()>0){$(this).next('span.tag_comma').remove();}else if($(this).prev('span.tag_comma').size()>0){$(this).prev('span.tag_comma').remove();}
$(this).remove();$('textarea[name=tags_box]').trigger('change');}
function image_system_init(){$('#mgm_box div.newitem input[type=submit]').attr('disabled','disabled');$('#mgm_box div.newitem input[type=submit]').attr('class','SubmitGrey100');$('#mgm_box div.newitem input[type=file]').bind('change',function(){$('#mgm_box div.newitem input[type=submit]').removeAttr('disabled');$('#mgm_box div.newitem input[type=submit]').attr('class','SubmitOrangeShort');});$('div#mgm_box div.thumb div.mgm_fields').find('div.mgm_field:first span.mgm_field_label').hide();$('div#mgm_box div.thumb div.mgm_fields').find('div.mgm_field:first span.mgm_field_value').attr('style','font-weight:bold');}
function invite_add(){$('table#invite_table tr input').unbind('change.invite_add',invite_add);if($('table#invite_table tr').size()>$('table#invite_table + span').html()){$.jGrowl($('table#invite_table').prev('div').text());}else{$('table#invite_table tr:last').after('<tr class="clean">'+$('table#invite_table tr:last').html()+'</tr>');$('table#invite_table tr:last input').attr('value','');if($('table#invite_table tr').size()>$('table#invite_table + span').html()){$('table#invite_table').prev('div').show();}else{}
$('table#invite_table tr:last input').bind('change',invite_add);}}
function invite_init(){$("table#invite_table tr.clean input").live("change",function(){$(this).parents("tr").removeClass("clean");});$('table#invite_table tr:last input').bind('change.invite_add',invite_add);$('form').bind('submit',invite_validate_names_and_mails);}
function invite_table_row_validate_name_and_email($tr){var field_ok=true;var name_field=$tr.find('[name^=invitee_realname]');var inv_name=name_field.size()?name_field.val():'';var email_field=$tr.find('[name^=invitee_email]');var inv_mail=email_field.size()?email_field.val():'';if(inv_name&&!inv_mail){$.jGrowl('No E-Mail for: '+inv_name,{sticky:true});email_field.parent().css("border","1px solid red");email_field.one('click focus',function(){$(this).parent().css("border","none")});field_ok=false;}
if(inv_mail&&!inv_name){$.jGrowl('No Name for: '+inv_mail,{sticky:true});name_field.parent().css("border","1px solid red");name_field.one('click focus',function(){$(this).parent().css("border","none")});field_ok=false;}
if(inv_name.indexOf('@')>-1){$.jGrowl(inv_name+' isn\'t a valid name. There is a "@" sign.',{sticky:true});name_field.parent().css("border","1px solid red");name_field.one('click focus',function(){$(this).parent().css("border","none")});field_ok=false;}
var mail_error_message;mail_error_message=get_email_string_validation_error_message(inv_mail);if(inv_mail&&mail_error_message){$.jGrowl(mail_error_message,{sticky:true});email_field.parent().css("border","1px solid red");email_field.one('click focus',function(){$(this).parent().css("border","none")});field_ok=false;}
return field_ok;}
function invite_validate_names_and_mails(){var form_ok=true;$('table#invite_table tr').each(function(){form_ok=form_ok&&invite_table_row_validate_name_and_email($(this));});return form_ok;}
function match_makers_init(other_userid){$('input[name="match_friends"]').bind('click',function(){$.post('?to=introduce&userid='+other_userid+'&tiny=1',$(this).parents('form').serialize());return false;});}
function on_review_form_submit(){if($(this.form).find('input[name$="is_correct"]:checkbox').not(':checked').size()){if(confirm($('#areyousure_message').html()))
return true;else
return false;}else
return true;}
function review_form_init(formid){$('form#'+formid+' input[type="submit"]').bind('click',on_review_form_submit);}
function first_letter_navigate(){var first_letter=this.innerHTML;$.get("?to=contacts_importer&phase=3&background=1&start="+first_letter);}
function imported_invite_init(){$("#invite_table td.rem").live("click",function(){var tr=$(this).parents("tr");var email_string=tr.find("input[name=\'invitee_email[]\']").val();if(email_string&&email_string.length>10){var email=$("#imported_friends_table td:contains("+email_string+")");email.parents("tr").find("td input").removeAttr("checked");}
tr.addClass("clean").find("input").val("");});$("#imported_friends_table td").live("click",function(event){var tr=$(this).parents("tr");var $target=$(event.target);var name=tr.find("td.n").text();var email=tr.find("td.e").text();var checkbox=tr.find("td:first input");var invite_line=$(".invite_form tr.clean:first");if(checkbox.attr("checked")==$target.is("input")){if(invite_line.length){invite_line.removeClass("clean");checkbox.attr("checked","checked");var td_offset=$(this).offset();var new_tr_offset=invite_line.offset();$("<div />").html(name).css({"position":"absolute","top":td_offset.top,"left":td_offset.left}).appendTo("body").animate({top:new_tr_offset.top,left:new_tr_offset.left},400,"linear",function(){$(this).remove();invite_line.find("input[name=\'invitee_realname[]\']").val(name);invite_line.find("input[name=\'invitee_email[]\']").val(email).trigger("change");});}}else{$(".invite_form input[value=\'"+email+"\']").parents("tr").addClass("clean").find("input").val("");checkbox.removeAttr("checked");}});}
function imported_invite_form_init(initial_invitations_left){window.invitations_left=initial_invitations_left;$("#imported_friends_table td").live("click",function(event){var tr=$(this).parents("tr");var $target=$(event.target);var checkbox=tr.find("td:first input");if(checkbox.attr("checked")==$target.is("input:checkbox")){if(window.invitations_left==0){$.jGrowl(static_text['no more invitations']);return false;}
checkbox.attr("checked","checked");tr.addClass('checked');var namef=tr.find("td.n");if(!namef.find("input").size())
$('<input name="invitee_realname[]" value="'+namef.find("i").text()+'" />').appendTo(namef).bind('blur',function(){invite_table_row_validate_name_and_email($(this).parents("tr"));});var emailf=tr.find("td.e");if(!emailf.find("input").size())
$('<input name="invitee_email[]" value="'+emailf.find("i").text()+'" />').appendTo(emailf).bind('blur',function(){invite_table_row_validate_name_and_email($(this).parents("tr"));});invite_table_row_validate_name_and_email(tr);window.invitations_left--;}else{if($(this).find("input:not(:checkbox)").size())
return true;checkbox.removeAttr("checked");tr.removeClass('checked');tr.find("td.n").css("border","none").find("input").remove();tr.find("td.e").css("border","none").find("input").remove();window.invitations_left++;}});$('form.contacts_importer').bind('submit',function(){var form_ok=true;$('table#imported_friends_table tr').each(function(){form_ok=form_ok&&invite_table_row_validate_name_and_email($(this));});return form_ok;});}
function user_photo_hover(){$(this).before('<img class="e_user_photo" src="'+$(this).attr('src')+'" style="height:300px; border:2px solid grey; position:absolute;" />');$(this).siblings('img.e_user_photo').bind('mouseout',function(){$(this).remove();});}
function update_gadgets_order(){var serialize_left=$("#ContentLeftColumn").sortable("serialize",{attribute:"class",key:"left[]",expression:"GadgetBox (.*)_gadget"});var serialize_right=$("#ContentRightColumn").sortable("serialize",{attribute:"class",key:"right[]",expression:"GadgetBox (.*)_gadget"});ajax_get_callback(["background=1","property=order_gadgets","value=1",serialize_left,serialize_right]);}
function close_gadget(){var gadget=$(this).parent().parent();var gadget_class=gadget.attr("class");var name_regexp=/GadgetBox (.*)_gadget/i;var gadget_name_match=gadget_class.match(name_regexp);var gadget_name=gadget_name_match[1];ajax_get_callback(["background=1","property=close_gadget","value="+gadget_name]);gadget.find('.GadgetContent').fadeOut("slow",function(){gadget.removeClass('OpenGadget').addClass('ClosedGadget');});}
function minimize_gadget(){var gadget=$(this).parent().parent();var gadget_class=gadget.attr("class");var name_regexp=/(\S*)_gadget/i;var gadget_name_match=gadget_class.match(name_regexp);var gadget_name=gadget_name_match[1];ajax_get_callback(["background=1","property=minimize_gadget","value="+gadget_name]);gadget.find('.GadgetContent').slideUp("slow",function(){gadget.removeClass('OpenGadget').addClass('MinimizedGadget');});}
function open_gadget(){var gadget=$(this).parent().parent();var gadget_class=gadget.attr("class");var name_regexp=/GadgetBox (.*)_gadget/i;var gadget_name_match=gadget_class.match(name_regexp);var gadget_name=gadget_name_match[1];ajax_get_callback(["background=1","property=open_gadget","value="+gadget_name]);gadget.removeClass('MinimizedGadget').addClass('OpenGadget');gadget.find('.GadgetContent').slideDown();}
function init_updates_page(){$("#ContentLeftColumn").sortable({connectWith:["#ContentRightColumn"],handle:"h2",update:update_gadgets_order});$("#ContentRightColumn").sortable({connectWith:["#ContentLeftColumn"],handle:"h2",update:update_gadgets_order});$(".GadgetBox h2 .close").bind("click",close_gadget).css("cursor","pointer");$(".GadgetBox h2 .mini").bind("click",minimize_gadget).css("cursor","pointer");$(".GadgetBox h2 .open").bind("click",open_gadget).css("cursor","pointer");$(".GadgetBox h2 .move").css("cursor","move");$(".MatchesLine").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")});$(".MatchesLine .scroll_fore").hover(function(){start_scroll($(this).siblings(".user_scroller").attr("id"),'left')},function(){stop_scroll($(this).siblings(".user_scroller").attr("id"))});$(".MatchesLine .scroll_back").hover(function(){start_scroll($(this).siblings(".user_scroller").attr("id"),'right')},function(){stop_scroll($(this).siblings(".user_scroller").attr("id"))});}
var scroller_timers={};function start_scroll(user_scroller_id,direction){stop_scroll(user_scroller_id,direction);scroller_timers[user_scroller_id]=setTimeout("scroll_tick('"+user_scroller_id+"','"+direction+"',1,1);",400);}
function stop_scroll(user_scroller_id){try{clearTimeout(scroller_timers[user_scroller_id]);}catch(e){}}
function scroll_tick(user_scroller_id,direction,reset_timer,photos_to_scroll){var user_scroll=$("#"+user_scroller_id);var internal_bar=user_scroll.find(".user_scroller_internal");var offset=user_scroll.scrollLeft()-user_scroll.scrollLeft()%82;var rtl=false;if($('html').css("direction")=='rtl'&&(!$.browser.msie||$.browser.version<7)){rtl=true;}
if((direction=='left'&&!rtl)||(direction=='right'&&rtl)){if(user_scroll.scrollLeft()<=0){user_scroll.scrollLeft(internal_bar.width()-328);offset=internal_bar.width()-328;}
user_scroll.animate({scrollLeft:offset-(82*photos_to_scroll)},(750*photos_to_scroll));}else{if(internal_bar.width()-user_scroll.scrollLeft()-328<=0){user_scroll.scrollLeft(0);offset=0;}
user_scroll.animate({scrollLeft:offset+(82*photos_to_scroll)},(750*photos_to_scroll));}
if(reset_timer)
scroller_timers[user_scroller_id]=setTimeout("scroll_tick('"+user_scroller_id+"','"+direction+"',1,"+photos_to_scroll+");",(750*photos_to_scroll)+100);}
function iterate_search_results(user_scroller_id){var scroller=$("#"+user_scroller_id);if(!scroller.parents(".MatchesLine").hasClass("hover")){scroll_tick(user_scroller_id,'right',0,4);}}
function on_mark_as_interesting_click(e){if(e.button!=0)return true;if($(this).attr("href"))$.get($(this).attr("href")+"&background=1");return false;}
function online_now_reload_comers(){$.getJSON(window.location.toString()+"&background=1",function(json){json.users_left=0;var line_clone=$('#main .MatchesLine').clone(true);line_clone.find(".UserBox").each(function(){var matches=$(this).attr("class").match(user_box_regexp);if(matches){var userid=matches[1];if(json.users[userid]){var status=json.users[userid]==2?'idle':'online';delete json.users[userid];json.user_count--;var online_img="<img src=\"style/icons/"+status+".gif\" class=\"online_icon chatter chat_userid_"+userid+"\" alt=\""+static_text[status]+"\" />";$(this).find("img.online_icon").remove();$(this).find("img.goal_icon").after(online_img);}else{json.users_left++;$(this).find("img.online_icon").remove();$(this).parents(".HighUserBox").find("img.online_icon").remove();}}else{}});line_clone.find(".chatter").chat("link").removeClass("chatter");$('#main .MatchesLine').replaceWith(line_clone);$(".update_online_now_list .users_joined").html(json.user_count);var userList="";for(var i in json.users){if(json.users[i])
userList+=i+",";}
if(userList){userList=userList.substring(0,userList.length-1);}
$(".update_online_now_list .boxes").html(userList);$(".update_online_now_list .users_left").html(json.users_left);if(json.user_count){$.get(window.location.toString()+"&boxes="+$(".update_online_now_list .boxes").html()+"&background=1");}
if(json.users_left)
$(".update_online_now_list a.update").show();else
$(".update_online_now_list a").hide();});};function online_now_update_boxes(){$(".update_online_now_list a").hide();$(this).one("click",online_now_update_boxes);$('.HighUserBox:not(:has(img.online_icon)),.UserBox:not(:has(img.online_icon))').remove();return false;}
var user_box_regexp;var online_now_interval;function init_online_now_page(refresh_rate){user_box_regexp=/UserBox user(\d+)/;online_now_interval=setInterval(online_now_reload_comers,refresh_rate*1000);$(".update_online_now_list a").one("click",online_now_update_boxes);};function init_forum_page(anchor,all_close){$("div.message h3").bind("click",function(){$(this).next(".body").toggle();$(this).toggleClass("close").toggleClass("open");}).css("cursor","pointer");if(!all_close){if(anchor){$("div#m_"+anchor+" h3").click();location.hash="#m_"+anchor;}else{$("#main div.message:first h3").click();}}}
function init_identities_page(){$("input[name='is_primary_for_userid_and_site_email']").bind('click',function(){$this=$("input[name='is_primary_for_userid_and_site_email']:checked");$this.parents('tr').find('.status').html('<span class="sending" title="Sending"></span>');$.get('go.php?to=identities&tiny=1&is_primary_for_userid_and_site_email='+$this.val());});$("input.is_indexed").bind('change',function(){$(this).parents('tr').find('.status').html('<span class="sending" title="Sending"></span>');$.get('go.php?to=identities&tiny=1&'+$(this).attr("name")+'='+($(this).attr("checked")?'1':'0'));});var browser=navigator.userAgent.toLowerCase();var no_tiny=browser.indexOf('chrome')>-1||browser.indexOf('safari')>-1||browser.indexOf('opera')>-1||(target_direction=='rtl'&&/MSIE [1-8]/i.test(browser));if(!no_tiny){$('.emails_table a.TinyFormLink').bind('click',function(){$(this).parents('tr').find('.status').html('<span class="sending" title="Sending"></span>');});}}
function init_iframe_form(){$('a.a_top').attr("target","_top");}
function init_member(){init_menu();$('form.superSearchLine input.q',$('#header')).bind('focus',function(){$(this).addClass('q_focus');}).bind('blur',function(){$(this).removeClass('q_focus');}).bind('change',function(){$(this).addClass('q_changed');});}
var soundManager=null;function SoundManager(b,a){this.flashVersion=8;this.debugMode=true;this.useConsole=true;this.consoleOnly=false;this.waitForWindowLoad=false;this.nullURL="null.mp3";this.allowPolling=true;this.useFastPolling=false;this.useMovieStar=false;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashLoadTimeout=1000;this.wmode=null;this.allowFullScreen=true;this.defaultOptions={autoLoad:false,stream:true,autoPlay:false,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5000,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:true,multiShotEvents:false,position:null,pan:0,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,ondataerror:null};this.movieStarOptions={onmetadata:null,useVideo:false,bufferTime:null};var f=null;var e=this;this.version=null;this.versionNumber="V2.95a.20090717";this.movieURL=null;this.url=null;this.altURL=null;this.swfLoaded=false;this.enabled=false;this.o=null;this.id=(a||"sm2movie");this.oMC=null;this.sounds={};this.soundIDs=[];this.muted=false;this.isFullScreen=false;this.isIE=(navigator.userAgent.match(/MSIE/i));this.isSafari=(navigator.userAgent.match(/safari/i));this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.specialWmodeCase=false;this._onready=[];this._debugOpen=true;this._didAppend=false;this._appendSuccess=false;this._didInit=false;this._disabled=false;this._windowLoaded=false;this._hasConsole=(typeof console!="undefined"&&typeof console.log!="undefined");this._debugLevels=["log","info","warn","error"];this._defaultFlashVersion=8;this._oRemoved=null;this._oRemovedHTML=null;var g=function(h){return document.getElementById(h)};this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=new RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.filePattern=null;this.features={buffering:false,peakData:false,waveformData:false,eqData:false,movieStar:false};this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local + internet access)"},description:null,noRemote:null,noLocal:null};this._setVersionInfo=function(){if(e.flashVersion!=8&&e.flashVersion!=9){alert('soundManager.flashVersion must be 8 or 9. "'+e.flashVersion+'" is invalid. Reverting to '+e._defaultFlashVersion+".");e.flashVersion=e._defaultFlashVersion}e.version=e.versionNumber+(e.flashVersion==9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(e.flashVersion>8){e.defaultOptions=e._mergeObjects(e.defaultOptions,e.flash9Options);e.features.buffering=true}if(e.flashVersion>8&&e.useMovieStar){e.defaultOptions=e._mergeObjects(e.defaultOptions,e.movieStarOptions);e.filePatterns.flash9=new RegExp("\\.(mp3|"+e.netStreamTypes.join("|")+")(\\?.*)?$","i");e.features.movieStar=true}else{e.useMovieStar=false;e.features.movieStar=false}e.filePattern=e.filePatterns[(e.flashVersion!=8?"flash9":"flash8")];e.movieURL=(e.flashVersion==8?"soundmanager2.swf":"soundmanager2_flash9.swf");e.features.peakData=e.features.waveformData=e.features.eqData=(e.flashVersion>8)};this._overHTTP=(document.location?document.location.protocol.match(/http/i):null);this._waitingforEI=false;this._initPending=false;this._tryInitOnFocus=(this.isSafari&&typeof document.hasFocus=="undefined");this._isFocused=(typeof document.hasFocus!="undefined"?document.hasFocus():null);this._okToDisable=!this._tryInitOnFocus;this.useAltURL=!this._overHTTP;var d="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html";this.strings={notReady:"Not loaded yet - wait for soundManager.onload() before calling sound-related methods",appXHTML:"soundManager._createMovie(): appendChild/innerHTML set failed. May be app/xhtml+xml DOM-related.",localFail:'soundManager: Loading this page from local/network file system (not over HTTP?) Flash security likely restricting JS-Flash access. Consider adding current URL to "trusted locations" in the Flash player security settings manager at '+d+", or simply serve this content over HTTP.",waitFocus:"soundManager: Special case: Waiting for focus-related event..",waitImpatient:"soundManager: Getting impatient, still waiting for Flash.. ;)",waitForever:"soundManager: Waiting indefinitely for Flash...",needFunction:"soundManager.onready(): Function object expected"};this.supported=function(){return(e._didInit&&!e._disabled)};this.getMovie=function(h){return e.isIE?window[h]:(e.isSafari?g(h)||document[h]:g(h))};this.loadFromXML=function(h){try{e.o._loadFromXML(h)}catch(i){e._failSafely();return true}};this.createSound=function(i){var l="soundManager.createSound(): ";if(!e._didInit){throw e._complain(l+e.strings.notReady,arguments.callee.caller)}if(arguments.length==2){i={id:arguments[0],url:arguments[1]}}var j=e._mergeObjects(i);var h=j;if(h.id.toString().charAt(0).match(/^[0-9]$/)){var k=l+'Warning: Sound ID "'+h.id+'" should be a string, starting with a non-numeric character'}if(e._idCheck(h.id,true)){return e.sounds[h.id]}if(e.flashVersion>8&&e.useMovieStar){if(h.isMovieStar===null){h.isMovieStar=(h.url.match(e.netStreamPattern)?true:false)}if(h.isMovieStar&&(h.usePeakData||h.useWaveformData||h.useEQData)){h.usePeakData=false;h.useWaveformData=false;h.useEQData=false}}e.sounds[h.id]=new f(h);e.soundIDs[e.soundIDs.length]=h.id;if(e.flashVersion==8){e.o._createSound(h.id,h.onjustbeforefinishtime)}else{e.o._createSound(h.id,h.url,h.onjustbeforefinishtime,h.usePeakData,h.useWaveformData,h.useEQData,h.isMovieStar,(h.isMovieStar?h.useVideo:false),(h.isMovieStar?h.bufferTime:false))}if(h.autoLoad||h.autoPlay){if(e.sounds[h.id]){e.sounds[h.id].load(h)}}if(h.autoPlay){e.sounds[h.id].play()}return e.sounds[h.id]};this.createVideo=function(h){if(arguments.length==2){h={id:arguments[0],url:arguments[1]}}if(e.flashVersion>=9){h.isMovieStar=true;h.useVideo=true}else{return false}return e.createSound(h)};this.destroySound=function(j,h){if(!e._idCheck(j)){return false}for(var k=0;k<e.soundIDs.length;k++){if(e.soundIDs[k]==j){e.soundIDs.splice(k,1);continue}}e.sounds[j].unload();if(!h){e.sounds[j].destruct()}delete e.sounds[j]};this.destroyVideo=this.destroySound;this.load=function(h,i){if(!e._idCheck(h)){return false}e.sounds[h].load(i)};this.unload=function(h){if(!e._idCheck(h)){return false}e.sounds[h].unload()};this.play=function(h,i){if(!e._didInit){throw e._complain("soundManager.play(): "+e.strings.notReady,arguments.callee.caller)}if(!e._idCheck(h)){if(typeof i!="Object"){i={url:i}}if(i&&i.url){i.id=h;e.createSound(i)}else{return false}}e.sounds[h].play(i)};this.start=this.play;this.setPosition=function(h,i){if(!e._idCheck(h)){return false}e.sounds[h].setPosition(i)};this.stop=function(h){if(!e._idCheck(h)){return false}e.sounds[h].stop()};this.stopAll=function(){for(var h in e.sounds){if(e.sounds[h]instanceof f){e.sounds[h].stop()}}};this.pause=function(h){if(!e._idCheck(h)){return false}e.sounds[h].pause()};this.pauseAll=function(){for(var h=e.soundIDs.length;h--;){e.sounds[e.soundIDs[h]].pause()}};this.resume=function(h){if(!e._idCheck(h)){return false}e.sounds[h].resume()};this.resumeAll=function(){for(var h=e.soundIDs.length;h--;){e.sounds[e.soundIDs[h]].resume()}};this.togglePause=function(h){if(!e._idCheck(h)){return false}e.sounds[h].togglePause()};this.setPan=function(h,i){if(!e._idCheck(h)){return false}e.sounds[h].setPan(i)};this.setVolume=function(i,h){if(!e._idCheck(i)){return false}e.sounds[i].setVolume(h)};this.mute=function(h){if(typeof h!="string"){h=null}if(!h){for(var j=e.soundIDs.length;j--;){e.sounds[e.soundIDs[j]].mute()}e.muted=true}else{if(!e._idCheck(h)){return false}e.sounds[h].mute()}};this.muteAll=function(){e.mute()};this.unmute=function(h){if(typeof h!="string"){h=null}if(!h){for(var j=e.soundIDs.length;j--;){e.sounds[e.soundIDs[j]].unmute()}e.muted=false}else{if(!e._idCheck(h)){return false}e.sounds[h].unmute()}};this.unmuteAll=function(){e.unmute()};this.toggleMute=function(h){if(!e._idCheck(h)){return false}e.sounds[h].toggleMute()};this.getMemoryUse=function(){if(e.flashVersion==8){return 0}if(e.o){return parseInt(e.o._getMemoryUse(),10)}};this.disable=function(j){if(typeof j=="undefined"){j=false}if(e._disabled){return false}e._disabled=true;for(var h=e.soundIDs.length;h--;){e._disableObject(e.sounds[e.soundIDs[h]])}e.initComplete(j)};this.canPlayURL=function(h){return(h?(h.match(e.filePattern)?true:false):null)};this.getSoundById=function(i,j){if(!i){throw new Error("SoundManager.getSoundById(): sID is null/undefined")}var h=e.sounds[i];return h};this.onready=function(i,h){if(i&&i instanceof Function){if(!h){h=window}e._addOnReady(i,h);e._processOnReady();return true}else{throw e.strings.needFunction}};this.oninitmovie=function(){};this.onload=function(){soundManager._wD("soundManager.onload()",1)};this.onerror=function(){};this._idCheck=this.getSoundById;this._complain=function(i,k){var j="Error: ";if(!k){return new Error(j+i)}var m=new Error("");var n=null;if(m.stack){try{var o="@";var p=m.stack.split(o);n=p[4]}catch(l){n=m.stack}}if(typeof console!="undefined"&&typeof console.trace!="undefined"){console.trace()}var h=j+i+". \nCaller: "+k.toString()+(m.stack?" \nTop of stacktrace: "+n:(m.message?" \nMessage: "+m.message:""));return new Error(h)};var c=function(){return false};c._protected=true;this._disableObject=function(i){for(var h in i){if(typeof i[h]=="function"&&typeof i[h]._protected=="undefined"){i[h]=c}}h=null};this._failSafely=function(h){if(typeof h=="undefined"){h=false}if(!e._disabled||h){e.disable(h)}};this._normalizeMovieURL=function(h){var i=null;if(h){if(h.match(/\.swf(\?.*)?$/i)){i=h.substr(h.toLowerCase().lastIndexOf(".swf?")+4);if(i){return h}}else{if(h.lastIndexOf("/")!=h.length-1){h=h+"/"}}}return(h&&h.lastIndexOf("/")!=-1?h.substr(0,h.lastIndexOf("/")+1):"./")+e.movieURL};this._getDocument=function(){return(document.body?document.body:(document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]))};this._getDocument._protected=true;this._setPolling=function(h,i){if(!e.o||!e.allowPolling){return false}e.o._setPolling(h,i)};this._createMovie=function(w,m){var r=null;var v=(m?m:e.url);var q=(e.altURL?e.altURL:v);if(e.debugURLParam.test(window.location.href.toString())){e.debugMode=true}if(e._didAppend&&e._appendSuccess){return false}e._didAppend=true;e._setVersionInfo();e.url=e._normalizeMovieURL(e._overHTTP?v:q);m=e.url;if(e.useHighPerformance&&e.useMovieStar&&e.defaultOptions.useVideo===true){r="soundManager note: disabling highPerformance, not applicable with movieStar mode + useVideo";e.useHighPerformance=false}e.wmode=(!e.wmode&&e.useHighPerformance&&!e.useMovieStar?"transparent":e.wmode);if(e.wmode!==null&&e.flashLoadTimeout!==0&&!e.useHighPerformance&&!e.isIE&&navigator.platform.match(/win32/i)){e.specialWmodeCase=true;e.wmode=null}if(e.flashVersion==8){e.allowFullScreen=false}var A={name:w,id:w,src:m,width:"100%",height:"100%",quality:"high",allowScriptAccess:"always",bgcolor:e.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:e.wmode,allowfullscreen:(e.allowFullScreen?"true":"false")};if(!e.wmode){delete A.wmode}var n=null;var z=null;if(e.isIE){n=document.createElement("div");var t='<object id="'+w+'" data="'+m+'" type="application/x-shockwave-flash" width="100%" height="100%"><param name="movie" value="'+m+'" /><param name="AllowScriptAccess" value="always" /><param name="quality" value="high" />'+(e.wmode?'<param name="wmode" value="'+e.wmode+'" /> ':"")+'<param name="bgcolor" value="'+e.bgColor+'" /><param name="allowFullScreen" value="'+(e.allowFullScreen?"true":"false")+'" /><!-- --></object>'}else{n=document.createElement("embed");for(z in A){if(A.hasOwnProperty(z)){n.setAttribute(z,A[z])}}}var i=document.createElement("div");i.id=e.debugID+"-toggle";var j={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001};i.appendChild(document.createTextNode("-"));i.onclick=e._toggleDebug;i.title="Toggle SM2 debug console";if(navigator.userAgent.match(/msie 6/i)){i.style.position="absolute";i.style.cursor="hand"}for(z in j){if(j.hasOwnProperty(z)){i.style[z]=j[z]}}var u=e._getDocument();if(u){e.oMC=g("sm2-container")?g("sm2-container"):document.createElement("div");if(!e.oMC.id){e.oMC.id="sm2-container";e.oMC.className="movieContainer";var o=null;var p=null;if(e.useHighPerformance){o={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}}else{o={position:"absolute",width:"8px",height:"8px",top:"-9999px",left:"-9999px"}}var k=null;for(k in o){if(o.hasOwnProperty(k)){e.oMC.style[k]=o[k]}}try{if(!e.isIE){e.oMC.appendChild(n)}u.appendChild(e.oMC);if(e.isIE){p=e.oMC.appendChild(document.createElement("div"));p.className="sm2-object-box";p.innerHTML=t}e._appendSuccess=true}catch(y){throw new Error(e.strings.appXHTML)}}else{e.oMC.appendChild(n);if(e.isIE){p=e.oMC.appendChild(document.createElement("div"));p.className="sm2-object-box";p.innerHTML=t}e._appendSuccess=true}if(!g(e.debugID)&&((!e._hasConsole||!e.useConsole)||(e.useConsole&&e._hasConsole&&!e.consoleOnly))){var l=document.createElement("div");l.id=e.debugID;l.style.display=(e.debugMode?"block":"none");if(e.debugMode&&!g(i.id)){try{u.appendChild(i)}catch(h){throw new Error(e.strings.appXHTML)}u.appendChild(l)}}u=null}};this._writeDebug=function(i,p,k){if(!e.debugMode){return false}if(typeof k!="undefined"&&k){i=i+" | "+new Date().getTime()}if(e._hasConsole&&e.useConsole){var h=e._debugLevels[p];if(typeof console[h]!="undefined"){console[h](i)}else{console.log(i)}if(e.useConsoleOnly){return true}}var n="soundmanager-debug";try{var m=g(n);if(!m){return false}var l=document.createElement("div");if(++e._wdCount%2===0){l.className="sm2-alt"}if(typeof p=="undefined"){p=0}else{p=parseInt(p,10)}l.appendChild(document.createTextNode(i));if(p){if(p>=2){l.style.fontWeight="bold"}if(p==3){l.style.color="#ff3333"}}m.insertBefore(l,m.firstChild)}catch(j){}m=null};this._writeDebug._protected=true;this._wdCount=0;this._wdCount._protected=true;this._wD=this._writeDebug;this._wDAlert=function(h){alert(h)};if(window.location.href.indexOf("debug=alert")+1&&e.debugMode){e._wD=e._wDAlert}this._toggleDebug=function(){var i=g(e.debugID);var h=g(e.debugID+"-toggle");if(!i){return false}if(e._debugOpen){h.innerHTML="+";i.style.display="none"}else{h.innerHTML="-";i.style.display="block"}e._debugOpen=!e._debugOpen};this._toggleDebug._protected=true;this._debug=function(){for(var k=0,h=e.soundIDs.length;k<h;k++){e.sounds[e.soundIDs[k]]._debug()}};this._debugTS=function(k,h,i){if(typeof sm2Debugger!="undefined"){try{sm2Debugger.handleEvent(k,h,i)}catch(j){}}};this._debugTS._protected=true;this._mergeObjects=function(j,h){var m={};for(var k in j){if(j.hasOwnProperty(k)){m[k]=j[k]}}var l=(typeof h=="undefined"?e.defaultOptions:h);for(var n in l){if(l.hasOwnProperty(n)&&typeof m[n]=="undefined"){m[n]=l[n]}}return m};this.createMovie=function(h){if(h){e.url=h}e._initMovie()};this.go=this.createMovie;this._initMovie=function(){if(e.o){return false}e.o=e.getMovie(e.id);if(!e.o){if(!e.oRemoved){e._createMovie(e.id,e.url)}else{if(!e.isIE){e.oMC.appendChild(e.oRemoved)}else{e.oMC.innerHTML=e.oRemovedHTML}e.oRemoved=null;e._didAppend=true}e.o=e.getMovie(e.id)}if(typeof e.oninitmovie=="function"){setTimeout(e.oninitmovie,1)}};this.waitForExternalInterface=function(){if(e._waitingForEI){return false}e._waitingForEI=true;if(e._tryInitOnFocus&&!e._isFocused){return false}if(e.flashLoadTimeout>0){if(!e._didInit){}setTimeout(function(){if(!e._didInit&&e._okToDisable){e._failSafely(true)}},e.flashLoadTimeout)}};this.handleFocus=function(){if(e._isFocused||!e._tryInitOnFocus){return true}e._okToDisable=true;e._isFocused=true;if(e._tryInitOnFocus){window.removeEventListener("mousemove",e.handleFocus,false)}e._waitingForEI=false;setTimeout(e.waitForExternalInterface,500);if(window.removeEventListener){window.removeEventListener("focus",e.handleFocus,false)}else{if(window.detachEvent){window.detachEvent("onfocus",e.handleFocus)}}};this.initComplete=function(h){if(e._didInit){return false}e._didInit=true;if(e._disabled||h){e._processOnReady();e._debugTS("onload",false);e.onerror.apply(window);return false}else{e._debugTS("onload",true)}if(e.waitForWindowLoad&&!e._windowLoaded){if(window.addEventListener){window.addEventListener("load",e._initUserOnload,false)}else{if(window.attachEvent){window.attachEvent("onload",e._initUserOnload)}}return false}else{e._initUserOnload()}};this._addOnReady=function(i,h){e._onready.push({method:i,scope:(h||null),fired:false})};this._processOnReady=function(){if(!e._didInit){return false}var k={success:(!e._disabled)};var h=[];for(var m=0,l=e._onready.length;m<l;m++){if(e._onready[m].fired!==true){h.push(e._onready[m])}}if(h.length){for(m=0,l=h.length;m<l;m++){if(h[m].scope){h[m].method.apply(h[m].scope,[k])}else{h[m].method(k)}h[m].fired=true}}};this._initUserOnload=function(){window.setTimeout(function(){e._processOnReady();e.onload.apply(window)})};this.init=function(){e._initMovie();if(e._didInit){return false}if(window.removeEventListener){window.removeEventListener("load",e.beginDelayedInit,false)}else{if(window.detachEvent){window.detachEvent("onload",e.beginDelayedInit)}}try{e.o._externalInterfaceTest(false);e._setPolling(true,e.useFastPolling?true:false);if(!e.debugMode){e.o._disableDebug()}e.enabled=true;e._debugTS("jstoflash",true)}catch(h){e._debugTS("jstoflash",false);e._failSafely(true);e.initComplete();return false}e.initComplete()};this.beginDelayedInit=function(){e._windowLoaded=true;setTimeout(e.waitForExternalInterface,500);setTimeout(e.beginInit,20)};this.beginInit=function(){if(e._initPending){return false}e.createMovie();e._initMovie();e._initPending=true;return true};this.domContentLoaded=function(){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",e.domContentLoaded,false)}e.go()};this._externalInterfaceOK=function(){if(e.swfLoaded){return false}e._debugTS("swf",true);e._debugTS("flashtojs",true);e.swfLoaded=true;e._tryInitOnFocus=false;if(e.isIE){setTimeout(e.init,100)}else{e.init()}};this._setSandboxType=function(h){var i=e.sandbox;i.type=h;i.description=i.types[(typeof i.types[h]!="undefined"?h:"unknown")];if(i.type=="localWithFile"){i.noRemote=true;i.noLocal=false}else{if(i.type=="localWithNetwork"){i.noRemote=false;i.noLocal=true}else{if(i.type=="localTrusted"){i.noRemote=false;i.noLocal=false}}}};this.reboot=function(){for(var h=e.soundIDs.length;h--;){e.sounds[e.soundIDs[h]].destruct()}try{if(e.isIE){e.oRemovedHTML=e.o.innerHTML}e.oRemoved=e.o.parentNode.removeChild(e.o)}catch(j){}e.enabled=false;e._didInit=false;e._waitingForEI=false;e._initPending=false;e._didAppend=false;e._appendSuccess=false;e._disabled=false;e._waitingforEI=true;e.swfLoaded=false;e.soundIDs={};e.sounds=[];e.o=null;for(h=e._onready.length;h--;){e._onready[h].fired=false}window.setTimeout(soundManager.beginDelayedInit,20)};this.destruct=function(){e.disable(true)};f=function(h){var i=this;this.sID=h.id;this.url=h.url;this.options=e._mergeObjects(h);this.instanceOptions=this.options;this._iO=this.instanceOptions;this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this._debug=function(){if(e.debugMode){var l=null;var n=[];var k=null;var m=null;var j=64;for(l in i.options){if(i.options[l]!==null){if(i.options[l]instanceof Function){k=i.options[l].toString();k=k.replace(/\s\s+/g," ");m=k.indexOf("{");n[n.length]=" "+l+": {"+k.substr(m+1,(Math.min(Math.max(k.indexOf("\n")-1,j),j))).replace(/\n/g,"")+"... }"}else{n[n.length]=" "+l+": "+i.options[l]}}}}};this._debug();this.id3={};this.resetProperties=function(j){i.bytesLoaded=null;i.bytesTotal=null;i.position=null;i.duration=null;i.durationEstimate=null;i.loaded=false;i.playState=0;i.paused=false;i.readyState=0;i.muted=false;i.didBeforeFinish=false;i.didJustBeforeFinish=false;i.isBuffering=false;i.instanceOptions={};i.instanceCount=0;i.peakData={left:0,right:0};i.waveformData={left:[],right:[]};i.eqData=[]};i.resetProperties();this.load=function(j){if(typeof j!="undefined"){i._iO=e._mergeObjects(j);i.instanceOptions=i._iO}else{j=i.options;i._iO=j;i.instanceOptions=i._iO;if(i._lastURL&&i._lastURL!=i.url){i._iO.url=i.url;i.url=null}}if(typeof i._iO.url=="undefined"){i._iO.url=i.url}if(i._iO.url==i.url&&i.readyState!==0&&i.readyState!=2){return false}i.url=i._iO.url;i._lastURL=i._iO.url;i.loaded=false;i.readyState=1;i.playState=0;try{if(e.flashVersion==8){e.o._load(i.sID,i._iO.url,i._iO.stream,i._iO.autoPlay,(i._iO.whileloading?1:0))}else{e.o._load(i.sID,i._iO.url,i._iO.stream?true:false,i._iO.autoPlay?true:false);if(i._iO.isMovieStar&&i._iO.autoLoad&&!i._iO.autoPlay){i.pause()}}}catch(k){e._debugTS("onload",false);e.onerror();e.disable()}};this.unload=function(){if(i.readyState!==0){if(i.readyState!=2){i.setPosition(0,true)}e.o._unload(i.sID,e.nullURL);i.resetProperties()}};this.destruct=function(){e.o._destroySound(i.sID);e.destroySound(i.sID,true)};this.play=function(k){if(!k){k={}}i._iO=e._mergeObjects(k,i._iO);i._iO=e._mergeObjects(i._iO,i.options);i.instanceOptions=i._iO;if(i.playState==1){var j=i._iO.multiShot;if(!j){return false}}if(!i.loaded){if(i.readyState===0){i._iO.stream=true;i._iO.autoPlay=true;i.load(i._iO)}else{if(i.readyState==2){return false}}}if(i.paused){i.resume()}else{i.playState=1;if(!i.instanceCount||e.flashVersion>8){i.instanceCount++}i.position=(typeof i._iO.position!="undefined"&&!isNaN(i._iO.position)?i._iO.position:0);if(i._iO.onplay){i._iO.onplay.apply(i)}i.setVolume(i._iO.volume,true);i.setPan(i._iO.pan,true);e.o._start(i.sID,i._iO.loop||1,(e.flashVersion==9?i.position:i.position/1000))}};this.start=this.play;this.stop=function(j){if(i.playState==1){i.playState=0;i.paused=false;if(i._iO.onstop){i._iO.onstop.apply(i)}e.o._stop(i.sID,j);i.instanceCount=0;i._iO={}}};this.setPosition=function(k,j){if(typeof k=="undefined"){k=0}var l=Math.min(i.duration,Math.max(k,0));i._iO.position=l;e.o._setPosition(i.sID,(e.flashVersion==9?i._iO.position:i._iO.position/1000),(i.paused||!i.playState))};this.pause=function(){if(i.paused||i.playState===0){return false}i.paused=true;e.o._pause(i.sID);if(i._iO.onpause){i._iO.onpause.apply(i)}};this.resume=function(){if(!i.paused||i.playState===0){return false}i.paused=false;e.o._pause(i.sID);if(i._iO.onresume){i._iO.onresume.apply(i)}};this.togglePause=function(){if(i.playState===0){i.play({position:(e.flashVersion==9?i.position:i.position/1000)});return false}if(i.paused){i.resume()}else{i.pause()}};this.setPan=function(k,j){if(typeof k=="undefined"){k=0}if(typeof j=="undefined"){j=false}e.o._setPan(i.sID,k);i._iO.pan=k;if(!j){i.pan=k}};this.setVolume=function(j,k){if(typeof j=="undefined"){j=100}if(typeof k=="undefined"){k=false}e.o._setVolume(i.sID,(e.muted&&!i.muted)||i.muted?0:j);i._iO.volume=j;if(!k){i.volume=j}};this.mute=function(){i.muted=true;e.o._setVolume(i.sID,0)};this.unmute=function(){i.muted=false;var j=typeof i._iO.volume!="undefined";e.o._setVolume(i.sID,j?i._iO.volume:i.options.volume)};this.toggleMute=function(){if(i.muted){i.unmute()}else{i.mute()}};this._whileloading=function(j,k,l){if(!i._iO.isMovieStar){i.bytesLoaded=j;i.bytesTotal=k;i.duration=Math.floor(l);i.durationEstimate=parseInt((i.bytesTotal/i.bytesLoaded)*i.duration,10);if(i.durationEstimate===undefined){i.durationEstimate=i.duration}if(i.readyState!=3&&i._iO.whileloading){i._iO.whileloading.apply(i)}}else{i.bytesLoaded=j;i.bytesTotal=k;i.duration=Math.floor(l);i.durationEstimate=i.duration;if(i.readyState!=3&&i._iO.whileloading){i._iO.whileloading.apply(i)}}};this._onid3=function(n,k){var o=[];for(var m=0,l=n.length;m<l;m++){o[n[m]]=k[m]}i.id3=e._mergeObjects(i.id3,o);if(i._iO.onid3){i._iO.onid3.apply(i)}};this._whileplaying=function(k,l,n,j,m){if(isNaN(k)||k===null){return false}if(i.playState===0&&k>0){k=0}i.position=k;if(i._iO.usePeakData&&typeof l!="undefined"&&l){i.peakData={left:l.leftPeak,right:l.rightPeak}}if(i._iO.useWaveformData&&typeof n!="undefined"&&n){i.waveformData={left:n.split(","),right:j.split(",")}}if(i._iO.useEQData&&typeof m!="undefined"&&m){i.eqData=m}if(i.playState==1){if(i.isBuffering){i._onbufferchange(0)}if(i._iO.whileplaying){i._iO.whileplaying.apply(i)}if(i.loaded&&i._iO.onbeforefinish&&i._iO.onbeforefinishtime&&!i.didBeforeFinish&&i.duration-i.position<=i._iO.onbeforefinishtime){i._onbeforefinish()}}};this._onload=function(j){j=(j==1?true:false);i.loaded=j;i.readyState=j?3:2;if(i._iO.onload){i._iO.onload.apply(i)}};this._onbeforefinish=function(){if(!i.didBeforeFinish){i.didBeforeFinish=true;if(i._iO.onbeforefinish){i._iO.onbeforefinish.apply(i)}}};this._onjustbeforefinish=function(j){if(!i.didJustBeforeFinish){i.didJustBeforeFinish=true;if(i._iO.onjustbeforefinish){i._iO.onjustbeforefinish.apply(i)}}};this._onfinish=function(){if(i._iO.onbeforefinishcomplete){i._iO.onbeforefinishcomplete.apply(i)}i.didBeforeFinish=false;i.didJustBeforeFinish=false;if(i.instanceCount){i.instanceCount--;if(!i.instanceCount){i.playState=0;i.paused=false;i.instanceCount=0;i.instanceOptions={}}if(!i.instanceCount||i._iO.multiShotEvents){if(i._iO.onfinish){i._iO.onfinish.apply(i)}}}else{if(i.useVideo){}}};this._onmetadata=function(j){if(!j.width&&!j.height){j.width=320;j.height=240}i.metadata=j;i.width=j.width;i.height=j.height;if(i._iO.onmetadata){i._iO.onmetadata.apply(i)}};this._onbufferchange=function(j){if(i.playState===0){return false}if(j==i.isBuffering){return false}i.isBuffering=(j==1?true:false);if(i._iO.onbufferchange){i._iO.onbufferchange.apply(i)}};this._ondataerror=function(j){if(i.playState>0){if(i._iO.ondataerror){i._iO.ondataerror.apply(i)}}}};this._onfullscreenchange=function(h){e.isFullScreen=(h==1?true:false);if(!e.isFullScreen){try{window.focus()}catch(i){}}};if(window.addEventListener){window.addEventListener("focus",e.handleFocus,false);window.addEventListener("load",e.beginDelayedInit,false);window.addEventListener("unload",e.destruct,false);if(e._tryInitOnFocus){window.addEventListener("mousemove",e.handleFocus,false)}}else{if(window.attachEvent){window.attachEvent("onfocus",e.handleFocus);window.attachEvent("onload",e.beginDelayedInit);window.attachEvent("unload",e.destruct)}else{e._debugTS("onload",false);soundManager.onerror();soundManager.disable()}}if(document.addEventListener){document.addEventListener("DOMContentLoaded",e.domContentLoaded,false)}}if(typeof SM2_DEFER=="undefined"||!SM2_DEFER){soundManager=new SoundManager()};