var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(data){for(var i=0;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1)
return data[i].identity;}
else if(dataProp)
return data[i].identity;}},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1)return;return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();if(!window.Silverlight)
{window.Silverlight={};}
Silverlight._silverlightCount=0;Silverlight.__onSilverlightInstalledCalled=false;Silverlight.fwlinkRoot='http://go2.microsoft.com/fwlink/?LinkID=';Silverlight.__installationEventFired=false;Silverlight.onGetSilverlight=null;Silverlight.onSilverlightInstalled=function(){window.location.reload(false);};Silverlight.isInstalled=function(version)
{if(version==undefined)
version=null;var isVersionSupported=false;var container=null;try
{var control=null;var tryNS=false;if(window.ActiveXObject)
{try
{control=new ActiveXObject('AgControl.AgControl');if(version===null)
{isVersionSupported=true;}
else if(control.IsVersionSupported(version))
{isVersionSupported=true;}
control=null;}
catch(e)
{tryNS=true;}}
else
{tryNS=true;}
if(tryNS)
{var plugin=navigator.plugins["Silverlight Plug-In"];if(plugin)
{if(version===null)
{isVersionSupported=true;}
else
{var actualVer=plugin.description;if(actualVer==="1.0.30226.2")
actualVer="2.0.30226.2";var actualVerArray=actualVer.split(".");while(actualVerArray.length>3)
{actualVerArray.pop();}
while(actualVerArray.length<4)
{actualVerArray.push(0);}
var reqVerArray=version.split(".");while(reqVerArray.length>4)
{reqVerArray.pop();}
var requiredVersionPart;var actualVersionPart;var index=0;do
{requiredVersionPart=parseInt(reqVerArray[index]);actualVersionPart=parseInt(actualVerArray[index]);index++;}
while(index<reqVerArray.length&&requiredVersionPart===actualVersionPart);if(requiredVersionPart<=actualVersionPart&&!isNaN(requiredVersionPart))
{isVersionSupported=true;}}}}}
catch(e)
{isVersionSupported=false;}
return isVersionSupported;};Silverlight.WaitForInstallCompletion=function()
{if(!Silverlight.isBrowserRestartRequired&&Silverlight.onSilverlightInstalled)
{try
{navigator.plugins.refresh();}
catch(e)
{}
if(Silverlight.isInstalled(null)&&!Silverlight.__onSilverlightInstalledCalled)
{Silverlight.onSilverlightInstalled();Silverlight.__onSilverlightInstalledCalled=true;}
else
{setTimeout(Silverlight.WaitForInstallCompletion,3000);}}};Silverlight.__startup=function()
{navigator.plugins.refresh();Silverlight.isBrowserRestartRequired=Silverlight.isInstalled(null);if(!Silverlight.isBrowserRestartRequired)
{Silverlight.WaitForInstallCompletion();if(!Silverlight.__installationEventFired)
{Silverlight.onInstallRequired();Silverlight.__installationEventFired=true;}}
else if(window.navigator.mimeTypes)
{var mimeSL2=navigator.mimeTypes["application/x-silverlight-2"];var mimeSL2b2=navigator.mimeTypes["application/x-silverlight-2-b2"];var mimeSL2b1=navigator.mimeTypes["application/x-silverlight-2-b1"];var mimeHighestBeta=mimeSL2b1;if(mimeSL2b2)
mimeHighestBeta=mimeSL2b2;if(!mimeSL2&&(mimeSL2b1||mimeSL2b2))
{if(!Silverlight.__installationEventFired)
{Silverlight.onUpgradeRequired();Silverlight.__installationEventFired=true;}}
else if(mimeSL2&&mimeHighestBeta)
{if(mimeSL2.enabledPlugin&&mimeHighestBeta.enabledPlugin)
{if(mimeSL2.enabledPlugin.description!=mimeHighestBeta.enabledPlugin.description)
{if(!Silverlight.__installationEventFired)
{Silverlight.onRestartRequired();Silverlight.__installationEventFired=true;}}}}}
if(!Silverlight.disableAutoStartup)
{if(window.removeEventListener)
{window.removeEventListener('load',Silverlight.__startup,false);}
else
{window.detachEvent('onload',Silverlight.__startup);}}};if(!Silverlight.disableAutoStartup)
{if(window.addEventListener)
{window.addEventListener('load',Silverlight.__startup,false);}
else
{window.attachEvent('onload',Silverlight.__startup);}}
Silverlight.createObject=function(source,parentElement,id,properties,events,initParams,userContext)
{var slPluginHelper=new Object();var slProperties=properties;var slEvents=events;slPluginHelper.version=slProperties.version;slProperties.source=source;slPluginHelper.alt=slProperties.alt;slPluginHelper.altInvoke=slProperties.altInvoke;if(initParams)
slProperties.initParams=initParams;if(slProperties.isWindowless&&!slProperties.windowless)
slProperties.windowless=slProperties.isWindowless;if(slProperties.framerate&&!slProperties.maxFramerate)
slProperties.maxFramerate=slProperties.framerate;if(id&&!slProperties.id)
slProperties.id=id;delete slProperties.ignoreBrowserVer;delete slProperties.inplaceInstallPrompt;delete slProperties.version;delete slProperties.isWindowless;delete slProperties.framerate;delete slProperties.data;delete slProperties.src;delete slProperties.alt;if(Silverlight.isInstalled(slPluginHelper.version))
{for(var name in slEvents)
{if(slEvents[name])
{if(name=="onLoad"&&typeof slEvents[name]=="function"&&slEvents[name].length!=1)
{var onLoadHandler=slEvents[name];slEvents[name]=function(sender){return onLoadHandler(document.getElementById(id),userContext,sender)};}
var handlerName=Silverlight.__getHandlerName(slEvents[name]);if(handlerName!=null)
{slProperties[name]=handlerName;slEvents[name]=null;}
else
{throw"typeof events."+name+" must be 'function' or 'string'";}}}
slPluginHTML=Silverlight.buildHTML(slProperties);}
else
{if(slPluginHelper.altInvoke!=undefined){slPluginHelper.altInvoke();return;}else{slPluginHTML=Silverlight.buildPromptHTML(slPluginHelper);}}
if(parentElement)
{parentElement.innerHTML=slPluginHTML;}
else
{return slPluginHTML;}};Silverlight.buildHTML=function(slProperties)
{var htmlBuilder=[];htmlBuilder.push('<object type=\"application/x-silverlight\" data="data:application/x-silverlight,"');if(slProperties.id!=null)
{htmlBuilder.push(' id="'+Silverlight.HtmlAttributeEncode(slProperties.id)+'"');}
if(slProperties.width!=null)
{htmlBuilder.push(' width="'+slProperties.width+'"');}
if(slProperties.height!=null)
{htmlBuilder.push(' height="'+slProperties.height+'"');}
htmlBuilder.push(' >');delete slProperties.id;delete slProperties.width;delete slProperties.height;for(var name in slProperties)
{if(slProperties[name])
{htmlBuilder.push('<param name="'+Silverlight.HtmlAttributeEncode(name)+'" value="'+Silverlight.HtmlAttributeEncode(slProperties[name])+'" />');}}
htmlBuilder.push('<\/object>');return htmlBuilder.join('');};Silverlight.createObjectEx=function(params)
{var parameters=params;var html=Silverlight.createObject(parameters.source,parameters.parentElement,parameters.id,parameters.properties,parameters.events,parameters.initParams,parameters.context);if(parameters.parentElement==null)
{return html;}};Silverlight.buildPromptHTML=function(slPluginHelper)
{var slPluginHTML="";var urlRoot=Silverlight.fwlinkRoot;var version=slPluginHelper.version;if(slPluginHelper.alt)
{slPluginHTML=slPluginHelper.alt;}
else
{if(!version)
{version="";}
slPluginHTML="<a href='javascript:Silverlight.getSilverlight(\"{1}\");' style='text-decoration: none;'><img src='{2}' alt='Get Microsoft Silverlight' style='border-style: none'/></a>";slPluginHTML=slPluginHTML.replace('{1}',version);slPluginHTML=slPluginHTML.replace('{2}',urlRoot+'108181');}
return slPluginHTML;};Silverlight.getSilverlight=function(version)
{if(Silverlight.onGetSilverlight)
{Silverlight.onGetSilverlight();}
var shortVer="";var reqVerArray=String(version).split(".");if(reqVerArray.length>1)
{var majorNum=parseInt(reqVerArray[0]);if(isNaN(majorNum)||majorNum<2)
{shortVer="1.0";}
else
{shortVer=reqVerArray[0]+'.'+reqVerArray[1];}}
var verArg="";if(shortVer.match(/^\d+\056\d+$/))
{verArg="&v="+shortVer;}
Silverlight.followFWLink("114576"+verArg);};Silverlight.followFWLink=function(linkid)
{top.location=Silverlight.fwlinkRoot+String(linkid);};Silverlight.HtmlAttributeEncode=function(strInput)
{var c;var retVal='';if(strInput==null)
{return null;}
for(var cnt=0;cnt<strInput.length;cnt++)
{c=strInput.charCodeAt(cnt);if(((c>96)&&(c<123))||((c>64)&&(c<91))||((c>43)&&(c<58)&&(c!=47))||(c==95))
{retVal=retVal+String.fromCharCode(c);}
else
{retVal=retVal+'&#'+c+';';}}
return retVal;};Silverlight.default_error_handler=function(sender,args)
{var iErrorCode;var errorType=args.ErrorType;iErrorCode=args.ErrorCode;var errMsg="\nSilverlight error message     \n";errMsg+="ErrorCode: "+iErrorCode+"\n";errMsg+="ErrorType: "+errorType+"       \n";errMsg+="Message: "+args.ErrorMessage+"     \n";if(errorType=="ParserError")
{errMsg+="XamlFile: "+args.xamlFile+"     \n";errMsg+="Line: "+args.lineNumber+"     \n";errMsg+="Position: "+args.charPosition+"     \n";}
else if(errorType=="RuntimeError")
{if(args.lineNumber!=0)
{errMsg+="Line: "+args.lineNumber+"     \n";errMsg+="Position: "+args.charPosition+"     \n";}
errMsg+="MethodName: "+args.methodName+"     \n";}
alert(errMsg);};Silverlight.__cleanup=function()
{for(var i=Silverlight._silverlightCount-1;i>=0;i--){window['__slEvent'+i]=null;}
Silverlight._silverlightCount=0;if(window.removeEventListener){window.removeEventListener('unload',Silverlight.__cleanup,false);}
else{window.detachEvent('onunload',Silverlight.__cleanup);}};Silverlight.__getHandlerName=function(handler)
{var handlerName="";if(typeof handler=="string")
{handlerName=handler;}
else if(typeof handler=="function")
{if(Silverlight._silverlightCount==0)
{if(window.addEventListener)
{window.addEventListener('onunload',Silverlight.__cleanup,false);}
else
{window.attachEvent('onunload',Silverlight.__cleanup);}}
var count=Silverlight._silverlightCount++;handlerName="__slEvent"+count;window[handlerName]=handler;}
else
{handlerName=null;}
return handlerName;};Silverlight.onRequiredVersionAvailable=function(){};Silverlight.onRestartRequired=function(){document.getElementById("SilverlightControlHost").innerHTML=RestartRequiredNotification;};Silverlight.onUpgradeRequired=function()
{document.getElementById("SilverlightControlHost").innerHTML=UpgradeRequiredNotification;};Silverlight.onInstallRequired=function()
{};Silverlight.IsVersionAvailableOnError=function(sender,args)
{var retVal=false;try
{if(args.ErrorCode==8001&&!Silverlight.__installationEventFired)
{Silverlight.onUpgradeRequired();Silverlight.__installationEventFired=true;}
else if(args.ErrorCode==8002&&!Silverlight.__installationEventFired)
{Silverlight.onRestartRequired();Silverlight.__installationEventFired=true;}
else if(args.ErrorCode==5014||args.ErrorCode==2106)
{if(Silverlight.__verifySilverlight2UpgradeSuccess(args.getHost()))
{retVal=true;}}
else
{retVal=true;}}
catch(e)
{}
return retVal;};Silverlight.IsVersionAvailableOnLoad=function(sender)
{var retVal=false;try
{if(Silverlight.__verifySilverlight2UpgradeSuccess(sender.getHost()))
{retVal=true;}}
catch(e)
{}
return retVal;};Silverlight.__verifySilverlight2UpgradeSuccess=function(host)
{var retVal=false;var version="2.0.31005";var installationEvent=null;try
{if(host.IsVersionSupported(version+".99"))
{installationEvent=Silverlight.onRequiredVersionAvailable;retVal=true;}
else if(host.IsVersionSupported(version+".0"))
{installationEvent=Silverlight.onRestartRequired;}
else
{installationEvent=Silverlight.onUpgradeRequired;}
if(installationEvent&&!Silverlight.__installationEventFired)
{installationEvent();Silverlight.__installationEventFired=true;}}
catch(e)
{}
return retVal;};if(!window.Silverlight)
{window.Silverlight={};}
Silverlight.supportedUserAgent=function(version,userAgent)
{try
{var ua=null;if(userAgent)
{ua=userAgent;}
else
{ua=window.navigator.userAgent;}
var slua={OS:'Unsupported',Browser:'Unsupported'};if(ua.indexOf('Windows NT')>=0||ua.indexOf('Mozilla/4.0 (compatible; MSIE 6.0)')>=0){slua.OS='Windows';}
else if(ua.indexOf('PPC Mac OS X')>=0){slua.OS='MacPPC';}
else if(ua.indexOf('Intel Mac OS X')>=0){slua.OS='MacIntel';}
if(slua.OS!='Unsupported')
{if(ua.indexOf('MSIE')>=0){if(navigator.userAgent.indexOf('Win64')==-1)
{if(parseInt(ua.split('MSIE')[1])>=6){slua.Browser='MSIE';}}}
else if(ua.indexOf('Firefox')>=0){var versionArr=ua.split('Firefox/')[1].split('.');var major=parseInt(versionArr[0]);if(major>=2){slua.Browser='Firefox';}
else{var minor=parseInt(versionArr[1]);if((major==1)&&(minor>=5)){slua.Browser='Firefox';}}}
else if(ua.indexOf('Safari')>=0){slua.Browser='Safari';}}
var supUA=(!(slua.OS=='Unsupported'||slua.Browser=='Unsupported'||(slua.OS=='Windows'&&slua.Browser=='Safari')||(slua.OS.indexOf('Mac')>=0&&slua.Browser=='MSIE')));if(version=='2.0')
{return(supUA&&(slua.OS!='MacPPC'));}
else if(version=='1.0')
{return(supUA&&(ua.indexOf('Windows NT 5.0')<0));}
else
{return(supUA);}}
catch(e)
{return false;}};(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return!!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return!!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return+new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return!o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return-1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return!!T.firstChild},empty:function(T){return!T.firstChild},has:function(V,U,T){return!!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex"in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return!F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(isNaN(E.now)){E.elem[E.prop]=E.end;return;}if(E.elem.style&&E.elem.style[E.prop]!=null){try{E.elem.style[E.prop]=E.now+((E.prop!='zIndex')?E.unit:"")}catch(e){alert('problema con el css en una animacion, usando:'+E.prop+', valor destino:'+E.end+', valor actual:'+E.now);}}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();;jQuery.ui||(function($){var _remove=$.fn.remove,isFF2=$.browser.mozilla&&(parseFloat($.browser.version)<1.9);$.ui={version:"1.7.2",plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set||!instance.element[0].parentNode){return;}
for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b);},hasScroll:function(el,a){if($(el).css('overflow')=='hidden'){return false;}
var scroll=(a&&a=='left')?'scrollLeft':'scrollTop',has=false;if(el[scroll]>0){return true;}
el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has;},isOverAxis:function(x,reference,size){return(x>reference)&&(x<(reference+size));},isOver:function(y,x,top,left,height,width){return $.ui.isOverAxis(y,top,height)&&$.ui.isOverAxis(x,left,width);},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(isFF2){var attr=$.attr,removeAttr=$.fn.removeAttr,ariaNS="http://www.w3.org/2005/07/aaa",ariaState=/^aria-/,ariaRole=/^wairole:/;$.attr=function(elem,name,value){var set=value!==undefined;return(name=='role'?(set?attr.call(this,elem,name,"wairole:"+value):(attr.apply(this,arguments)||"").replace(ariaRole,"")):(ariaState.test(name)?(set?elem.setAttributeNS(ariaNS,name.replace(ariaState,"aaa:"),value):attr.call(this,elem,name.replace(ariaState,"aaa:"))):attr.apply(this,arguments)));};$.fn.removeAttr=function(name){return(ariaState.test(name)?this.each(function(){this.removeAttributeNS(ariaNS,name.replace(ariaState,""));}):removeAttr.call(this,name));};}
$.fn.extend({remove:function(){$("*",this).add(this).each(function(){$(this).triggerHandler("remove");});return _remove.apply(this,arguments);},enableSelection:function(){return this.attr('unselectable','off').css('MozUserSelect','').unbind('selectstart.ui');},disableSelection:function(){return this.attr('unselectable','on').css('MozUserSelect','none').bind('selectstart.ui',function(){return false;});},scrollParent:function(){var scrollParent;if(($.browser.msie&&(/(static|relative)/).test(this.css('position')))||(/absolute/).test(this.css('position'))){scrollParent=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test($.curCSS(this,'position',1))&&(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}else{scrollParent=this.parents().filter(function(){return(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}
return(/fixed/).test(this.css('position'))||!scrollParent.length?$(document):scrollParent;}});$.extend($.expr[':'],{data:function(elem,i,match){return!!$.data(elem,match[3]);},focusable:function(element){var nodeName=element.nodeName.toLowerCase(),tabIndex=$.attr(element,'tabindex');return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:'a'==nodeName||'area'==nodeName?element.href||!isNaN(tabIndex):!isNaN(tabIndex))&&!$(element)['area'==nodeName?'parents':'closest'](':hidden').length;},tabbable:function(element){var tabIndex=$.attr(element,'tabindex');return(isNaN(tabIndex)||tabIndex>=0)&&$(element).is(':focusable');}});function getter(namespace,plugin,method,args){function getMethods(type){var methods=$[namespace][plugin][type]||[];return(typeof methods=='string'?methods.split(/,?\s+/):methods);}
var methods=getMethods('getter');if(args.length==1&&typeof args[0]=='string'){methods=methods.concat(getMethods('getterSetter'));}
return($.inArray(method,methods)!=-1);}
$.widget=function(name,prototype){var namespace=name.split(".")[0];name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options=='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&options.substring(0,1)=='_'){return this;}
if(isMethodCall&&getter(namespace,name,options,args)){var instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options))._init());(instance&&isMethodCall&&$.isFunction(instance[options])&&instance[options].apply(instance,args));});};$[namespace]=$[namespace]||{};$[namespace][name]=function(element,options){var self=this;this.namespace=namespace;this.widgetName=name;this.widgetEventPrefix=$[namespace][name].eventPrefix||name;this.widgetBaseClass=namespace+'-'+name;this.options=$.extend({},$.widget.defaults,$[namespace][name].defaults,$.metadata&&$.metadata.get(element)[name],options);this.element=$(element).bind('setData.'+name,function(event,key,value){if(event.target==element){return self._setData(key,value);}}).bind('getData.'+name,function(event,key){if(event.target==element){return self._getData(key);}}).bind('remove',function(){return self.destroy();});};$[namespace][name].prototype=$.extend({},$.widget.prototype,prototype);$[namespace][name].getterSetter='option';};$.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+'-disabled'+' '+this.namespace+'-state-disabled').removeAttr('aria-disabled');},option:function(key,value){var options=key,self=this;if(typeof key=="string"){if(value===undefined){return this._getData(key);}
options={};options[key]=value;}
$.each(options,function(key,value){self._setData(key,value);});},_getData:function(key){return this.options[key];},_setData:function(key,value){this.options[key]=value;if(key=='disabled'){this.element
[value?'addClass':'removeClass'](this.widgetBaseClass+'-disabled'+' '+
this.namespace+'-state-disabled').attr("aria-disabled",value);}},enable:function(){this._setData('disabled',false);},disable:function(){this._setData('disabled',true);},_trigger:function(type,event,data){var callback=this.options[type],eventName=(type==this.widgetEventPrefix?type:this.widgetEventPrefix+type);event=$.Event(event);event.type=eventName;if(event.originalEvent){for(var i=$.event.props.length,prop;i;){prop=$.event.props[--i];event[prop]=event.originalEvent[prop];}}
this.element.trigger(event,data);return!($.isFunction(callback)&&callback.call(this.element[0],event,data)===false||event.isDefaultPrevented());}};$.widget.defaults={disabled:false};$.ui.mouse={_mouseInit:function(){var self=this;this.element.bind('mousedown.'+this.widgetName,function(event){return self._mouseDown(event);}).bind('click.'+this.widgetName,function(event){if(self._preventClickEvent){self._preventClickEvent=false;event.stopImmediatePropagation();return false;}});if($.browser.msie){this._mouseUnselectable=this.element.attr('unselectable');this.element.attr('unselectable','on');}
this.started=false;},_mouseDestroy:function(){this.element.unbind('.'+this.widgetName);($.browser.msie&&this.element.attr('unselectable',this._mouseUnselectable));},_mouseDown:function(event){event.originalEvent=event.originalEvent||{};if(event.originalEvent.mouseHandled){return;}
(this._mouseStarted&&this._mouseUp(event));this._mouseDownEvent=event;var self=this,btnIsLeft=(event.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(event.target).parents().add(event.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true;}
this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self.mouseDelayMet=true;},this.options.delay);}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);if(!this._mouseStarted){event.preventDefault();return true;}}
this._mouseMoveDelegate=function(event){return self._mouseMove(event);};this._mouseUpDelegate=function(event){return self._mouseUp(event);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);($.browser.safari||event.preventDefault());event.originalEvent.mouseHandled=true;return true;},_mouseMove:function(event){if($.browser.msie&&!event.button){return this._mouseUp(event);}
if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault();}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event));}
return!this._mouseStarted;},_mouseUp:function(event){$(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(event.target==this._mouseDownEvent.target);this._mouseStop(event);}
return false;},_mouseDistanceMet:function(event){return(Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance);},_mouseDelayMet:function(event){return this.mouseDelayMet;},_mouseStart:function(event){},_mouseDrag:function(event){},_mouseStop:function(event){},_mouseCapture:function(event){return true;}};$.ui.mouse.defaults={cancel:null,distance:1,delay:0};})(jQuery);(function($){$.widget("ui.draggable",$.extend({},$.ui.mouse,{_init:function(){if(this.options.helper=='original'&&!(/^(?:r|a|f)/).test(this.element.css("position")))
this.element[0].style.position='relative';(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit();},destroy:function(){if(!this.element.data('draggable'))return;this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable"
+" ui-draggable-dragging"
+" ui-draggable-disabled");this._mouseDestroy();},_mouseCapture:function(event){var o=this.options;if(this.helper||o.disabled||$(event.target).is('.ui-resizable-handle'))
return false;this.handle=this._getHandle(event);if(!this.handle)
return false;return true;},_mouseStart:function(event){var o=this.options;this.helper=this._createHelper(event);this._cacheHelperProportions();if($.ui.ddmanager)
$.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;if(o.cursorAt)
this._adjustOffsetFromHelper(o.cursorAt);if(o.containment)
this._setContainment();this._trigger("start",event);this._cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(this,event);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(event,true);return true;},_mouseDrag:function(event,noPropagation){this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!noPropagation){var ui=this._uiHash();this._trigger('drag',event,ui);this.position=ui.position;}
if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+'px';if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+'px';if($.ui.ddmanager)$.ui.ddmanager.drag(this,event);return false;},_mouseStop:function(event){var dropped=false;if($.ui.ddmanager&&!this.options.dropBehaviour)
dropped=$.ui.ddmanager.drop(this,event);if(this.dropped){dropped=this.dropped;this.dropped=false;}
if((this.options.revert=="invalid"&&!dropped)||(this.options.revert=="valid"&&dropped)||this.options.revert===true||($.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped))){var self=this;$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){self._trigger("stop",event);self._clear();});}else{this._trigger("stop",event);this._clear();}
return false;},_getHandle:function(event){var handle=!this.options.handle||!$(this.options.handle,this.element).length?true:false;$(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==event.target)handle=true;});return handle;},_createHelper:function(event){var o=this.options;var helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event])):(o.helper=='clone'?this.element.clone():this.element);if(!helper.parents('body').length)
helper.appendTo((o.appendTo=='parent'?this.element[0].parentNode:o.appendTo));if(helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position")))
helper.css("position","absolute");return helper;},_adjustOffsetFromHelper:function(obj){if(obj.left!=undefined)this.offset.click.left=obj.left+this.margins.left;if(obj.right!=undefined)this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;if(obj.top!=undefined)this.offset.click.top=obj.top+this.margins.top;if(obj.bottom!=undefined)this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition=='absolute'&&this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();}
if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=='html'&&$.browser.msie))
po={top:0,left:0};return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var p=this.element.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var o=this.options;if(o.containment=='parent')o.containment=this.helper[0].parentNode;if(o.containment=='document'||o.containment=='window')this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$(o.containment=='document'?document:window).width()-this.helperProportions.width-this.margins.left,($(o.containment=='document'?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!(/^(document|window|parent)$/).test(o.containment)&&o.containment.constructor!=Array){var ce=$(o.containment)[0];if(!ce)return;var co=$(o.containment).offset();var over=($(ce).css("overflow")!='hidden');this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top];}else if(o.containment.constructor==Array){this.containment=o.containment;}},_convertPositionTo:function(d,pos){if(!pos)pos=this.position;var mod=d=="absolute"?1:-1;var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top
+this.offset.relative.top*mod
+this.offset.parent.top*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left
+this.offset.relative.left*mod
+this.offset.parent.left*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))};},_generatePosition:function(event){var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);if(this.cssPosition=='relative'&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset();}
var pageX=event.pageX;var pageY=event.pageY;if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0])pageX=this.containment[0]+this.offset.click.left;if(event.pageY-this.offset.click.top<this.containment[1])pageY=this.containment[1]+this.offset.click.top;if(event.pageX-this.offset.click.left>this.containment[2])pageX=this.containment[2]+this.offset.click.left;if(event.pageY-this.offset.click.top>this.containment[3])pageY=this.containment[3]+this.offset.click.top;}
if(o.grid){var top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?(!(top-this.offset.click.top<this.containment[1]||top-this.offset.click.top>this.containment[3])?top:(!(top-this.offset.click.top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?(!(left-this.offset.click.left<this.containment[0]||left-this.offset.click.left>this.containment[2])?left:(!(left-this.offset.click.left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}}
return{top:(pageY
-this.offset.click.top
-this.offset.relative.top
-this.offset.parent.top
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX
-this.offset.click.left
-this.offset.relative.left
-this.offset.parent.left
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())))};},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval)this.helper.remove();this.helper=null;this.cancelHelperRemoval=false;},_trigger:function(type,event,ui){ui=ui||this._uiHash();$.ui.plugin.call(this,type,[event,ui]);if(type=="drag")this.positionAbs=this._convertPositionTo("absolute");return $.widget.prototype._trigger.call(this,type,event,ui);},plugins:{},_uiHash:function(event){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs};}}));$.extend($.ui.draggable,{version:"1.7.2",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui){var inst=$(this).data("draggable"),o=inst.options,uiSortable=$.extend({},ui,{item:inst.element});inst.sortables=[];$(o.connectToSortable).each(function(){var sortable=$.data(this,'sortable');if(sortable&&!sortable.options.disabled){inst.sortables.push({instance:sortable,shouldRevert:sortable.options.revert});sortable._refreshItems();sortable._trigger("activate",event,uiSortable);}});},stop:function(event,ui){var inst=$(this).data("draggable"),uiSortable=$.extend({},ui,{item:inst.element});$.each(inst.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;inst.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(event);this.instance.options.helper=this.instance.options._helper;if(inst.options.helper=='original')
this.instance.currentItem.css({top:'auto',left:'auto'});}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",event,uiSortable);}});},drag:function(event,ui){var inst=$(this).data("draggable"),self=this;var checkPos=function(o){var dyClick=this.offset.click.top,dxClick=this.offset.click.left;var helperTop=this.positionAbs.top,helperLeft=this.positionAbs.left;var itemHeight=o.height,itemWidth=o.width;var itemTop=o.top,itemLeft=o.left;return $.ui.isOver(helperTop+dyClick,helperLeft+dxClick,itemTop,itemLeft,itemHeight,itemWidth);};$.each(inst.sortables,function(i){this.instance.positionAbs=inst.positionAbs;this.instance.helperProportions=inst.helperProportions;this.instance.offset.click=inst.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=$(self).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return ui.helper[0];};event.target=this.instance.currentItem[0];this.instance._mouseCapture(event,true);this.instance._mouseStart(event,true,true);this.instance.offset.click.top=inst.offset.click.top;this.instance.offset.click.left=inst.offset.click.left;this.instance.offset.parent.left-=inst.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=inst.offset.parent.top-this.instance.offset.parent.top;inst._trigger("toSortable",event);inst.dropped=this.instance.element;inst.currentItem=inst.element;this.instance.fromOutside=inst;}
if(this.instance.currentItem)this.instance._mouseDrag(event);}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger('out',event,this.instance._uiHash(this.instance));this.instance._mouseStop(event,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder)this.instance.placeholder.remove();inst._trigger("fromSortable",event);inst.dropped=false;}};});}});$.ui.plugin.add("draggable","cursor",{start:function(event,ui){var t=$('body'),o=$(this).data('draggable').options;if(t.css("cursor"))o._cursor=t.css("cursor");t.css("cursor",o.cursor);},stop:function(event,ui){var o=$(this).data('draggable').options;if(o._cursor)$('body').css("cursor",o._cursor);}});$.ui.plugin.add("draggable","iframeFix",{start:function(event,ui){var o=$(this).data('draggable').options;$(o.iframeFix===true?"iframe":o.iframeFix).each(function(){$('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css($(this).offset()).appendTo("body");});},stop:function(event,ui){$("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this);});}});$.ui.plugin.add("draggable","opacity",{start:function(event,ui){var t=$(ui.helper),o=$(this).data('draggable').options;if(t.css("opacity"))o._opacity=t.css("opacity");t.css('opacity',o.opacity);},stop:function(event,ui){var o=$(this).data('draggable').options;if(o._opacity)$(ui.helper).css('opacity',o._opacity);}});$.ui.plugin.add("draggable","scroll",{start:function(event,ui){var i=$(this).data("draggable");if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!='HTML')i.overflowOffset=i.scrollParent.offset();},drag:function(event,ui){var i=$(this).data("draggable"),o=i.options,scrolled=false;if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!='HTML'){if(!o.axis||o.axis!='x'){if((i.overflowOffset.top+i.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity)
i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop+o.scrollSpeed;else if(event.pageY-i.overflowOffset.top<o.scrollSensitivity)
i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop-o.scrollSpeed;}
if(!o.axis||o.axis!='y'){if((i.overflowOffset.left+i.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity)
i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft+o.scrollSpeed;else if(event.pageX-i.overflowOffset.left<o.scrollSensitivity)
i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft-o.scrollSpeed;}}else{if(!o.axis||o.axis!='x'){if(event.pageY-$(document).scrollTop()<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);}
if(!o.axis||o.axis!='y'){if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}}
if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(i,event);}});$.ui.plugin.add("draggable","snap",{start:function(event,ui){var i=$(this).data("draggable"),o=i.options;i.snapElements=[];$(o.snap.constructor!=String?(o.snap.items||':data(draggable)'):o.snap).each(function(){var $t=$(this);var $o=$t.offset();if(this!=i.element[0])i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left});});},drag:function(event,ui){var inst=$(this).data("draggable"),o=inst.options;var d=o.snapTolerance;var x1=ui.offset.left,x2=x1+inst.helperProportions.width,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(var i=inst.snapElements.length-1;i>=0;i--){var l=inst.snapElements[i].left,r=l+inst.snapElements[i].width,t=inst.snapElements[i].top,b=t+inst.snapElements[i].height;if(!((l-d<x1&&x1<r+d&&t-d<y1&&y1<b+d)||(l-d<x1&&x1<r+d&&t-d<y2&&y2<b+d)||(l-d<x2&&x2<r+d&&t-d<y1&&y1<b+d)||(l-d<x2&&x2<r+d&&t-d<y2&&y2<b+d))){if(inst.snapElements[i].snapping)(inst.options.snap.release&&inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));inst.snapElements[i].snapping=false;continue;}
if(o.snapMode!='inner'){var ts=Math.abs(t-y2)<=d;var bs=Math.abs(b-y1)<=d;var ls=Math.abs(l-x2)<=d;var rs=Math.abs(r-x1)<=d;if(ts)ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top-inst.margins.top;if(bs)ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top-inst.margins.top;if(ls)ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left-inst.margins.left;if(rs)ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left-inst.margins.left;}
var first=(ts||bs||ls||rs);if(o.snapMode!='outer'){var ts=Math.abs(t-y1)<=d;var bs=Math.abs(b-y2)<=d;var ls=Math.abs(l-x1)<=d;var rs=Math.abs(r-x2)<=d;if(ts)ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top-inst.margins.top;if(bs)ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top-inst.margins.top;if(ls)ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left-inst.margins.left;if(rs)ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left-inst.margins.left;}
if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first))
(inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));inst.snapElements[i].snapping=(ts||bs||ls||rs||first);};}});$.ui.plugin.add("draggable","stack",{start:function(event,ui){var o=$(this).data("draggable").options;var group=$.makeArray($(o.stack.group)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||o.stack.min)-(parseInt($(b).css("zIndex"),10)||o.stack.min);});$(group).each(function(i){this.style.zIndex=o.stack.min+i;});this[0].style.zIndex=o.stack.min+group.length;}});$.ui.plugin.add("draggable","zIndex",{start:function(event,ui){var t=$(ui.helper),o=$(this).data("draggable").options;if(t.css("zIndex"))o._zIndex=t.css("zIndex");t.css('zIndex',o.zIndex);},stop:function(event,ui){var o=$(this).data("draggable").options;if(o._zIndex)$(ui.helper).css('zIndex',o._zIndex);}});})(jQuery);(function($){$.widget("ui.droppable",{_init:function(){var o=this.options,accept=o.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&$.isFunction(this.options.accept)?this.options.accept:function(d){return d.is(accept);};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};$.ui.ddmanager.droppables[this.options.scope]=$.ui.ddmanager.droppables[this.options.scope]||[];$.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.addClasses&&this.element.addClass("ui-droppable"));},destroy:function(){var drop=$.ui.ddmanager.droppables[this.options.scope];for(var i=0;i<drop.length;i++)
if(drop[i]==this)
drop.splice(i,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");},_setData:function(key,value){if(key=='accept'){this.options.accept=value&&$.isFunction(value)?value:function(d){return d.is(value);};}else{$.widget.prototype._setData.apply(this,arguments);}},_activate:function(event){var draggable=$.ui.ddmanager.current;if(this.options.activeClass)this.element.addClass(this.options.activeClass);(draggable&&this._trigger('activate',event,this.ui(draggable)));},_deactivate:function(event){var draggable=$.ui.ddmanager.current;if(this.options.activeClass)this.element.removeClass(this.options.activeClass);(draggable&&this._trigger('deactivate',event,this.ui(draggable)));},_over:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]==this.element[0])return;if(this.options.accept.call(this.element[0],(draggable.currentItem||draggable.element))){if(this.options.hoverClass)this.element.addClass(this.options.hoverClass);this._trigger('over',event,this.ui(draggable));}},_out:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]==this.element[0])return;if(this.options.accept.call(this.element[0],(draggable.currentItem||draggable.element))){if(this.options.hoverClass)this.element.removeClass(this.options.hoverClass);this._trigger('out',event,this.ui(draggable));}},_drop:function(event,custom){var draggable=custom||$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]==this.element[0])return false;var childrenIntersection=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var inst=$.data(this,'droppable');if(inst.options.greedy&&$.ui.intersect(draggable,$.extend(inst,{offset:inst.element.offset()}),inst.options.tolerance)){childrenIntersection=true;return false;}});if(childrenIntersection)return false;if(this.options.accept.call(this.element[0],(draggable.currentItem||draggable.element))){if(this.options.activeClass)this.element.removeClass(this.options.activeClass);if(this.options.hoverClass)this.element.removeClass(this.options.hoverClass);this._trigger('drop',event,this.ui(draggable));return this.element;}
return false;},ui:function(c){return{draggable:(c.currentItem||c.element),helper:c.helper,position:c.position,absolutePosition:c.positionAbs,offset:c.positionAbs};}});$.extend($.ui.droppable,{version:"1.7.2",eventPrefix:'drop',defaults:{accept:'*',activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:'default',tolerance:'intersect'}});$.ui.intersect=function(draggable,droppable,toleranceMode){if(!droppable.offset)return false;var x1=(draggable.positionAbs||draggable.position.absolute).left,x2=x1+draggable.helperProportions.width,y1=(draggable.positionAbs||draggable.position.absolute).top,y2=y1+draggable.helperProportions.height;var l=droppable.offset.left,r=l+droppable.proportions.width,t=droppable.offset.top,b=t+droppable.proportions.height;switch(toleranceMode){case'fit':return(l<x1&&x2<r&&t<y1&&y2<b);break;case'intersect':return(l<x1+(draggable.helperProportions.width/2)&&x2-(draggable.helperProportions.width/2)<r&&t<y1+(draggable.helperProportions.height/2)&&y2-(draggable.helperProportions.height/2)<b);break;case'pointer':var draggableLeft=((draggable.positionAbs||draggable.position.absolute).left+(draggable.clickOffset||draggable.offset.click).left),draggableTop=((draggable.positionAbs||draggable.position.absolute).top+(draggable.clickOffset||draggable.offset.click).top),isOver=$.ui.isOver(draggableTop,draggableLeft,t,l,droppable.proportions.height,droppable.proportions.width);return isOver;break;case'touch':return((y1>=t&&y1<=b)||(y2>=t&&y2<=b)||(y1<t&&y2>b))&&((x1>=l&&x1<=r)||(x2>=l&&x2<=r)||(x1<l&&x2>r));break;default:return false;break;}};$.ui.ddmanager={current:null,droppables:{'default':[]},prepareOffsets:function(t,event){var m=$.ui.ddmanager.droppables[t.options.scope];var type=event?event.type:null;var list=(t.currentItem||t.element).find(":data(droppable)").andSelf();droppablesLoop:for(var i=0;i<m.length;i++){if(m[i].options.disabled||(t&&!m[i].options.accept.call(m[i].element[0],(t.currentItem||t.element))))continue;for(var j=0;j<list.length;j++){if(list[j]==m[i].element[0]){m[i].proportions.height=0;continue droppablesLoop;}};m[i].visible=m[i].element.css("display")!="none";if(!m[i].visible)continue;m[i].offset=m[i].element.offset();m[i].proportions={width:m[i].element[0].offsetWidth,height:m[i].element[0].offsetHeight};if(type=="mousedown")m[i]._activate.call(m[i],event);}},drop:function(draggable,event){var dropped=false;$.each($.ui.ddmanager.droppables[draggable.options.scope],function(){if(!this.options)return;if(!this.options.disabled&&this.visible&&$.ui.intersect(draggable,this,this.options.tolerance))
dropped=this._drop.call(this,event);if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this.isout=1;this.isover=0;this._deactivate.call(this,event);}});return dropped;},drag:function(draggable,event){if(draggable.options.refreshPositions)$.ui.ddmanager.prepareOffsets(draggable,event);$.each($.ui.ddmanager.droppables[draggable.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var intersects=$.ui.intersect(draggable,this,this.options.tolerance);var c=!intersects&&this.isover==1?'isout':(intersects&&this.isover==0?'isover':null);if(!c)return;var parentInstance;if(this.options.greedy){var parent=this.element.parents(':data(droppable):eq(0)');if(parent.length){parentInstance=$.data(parent[0],'droppable');parentInstance.greedyChild=(c=='isover'?1:0);}}
if(parentInstance&&c=='isover'){parentInstance['isover']=0;parentInstance['isout']=1;parentInstance._out.call(parentInstance,event);}
this[c]=1;this[c=='isout'?'isover':'isout']=0;this[c=="isover"?"_over":"_out"].call(this,event);if(parentInstance&&c=='isout'){parentInstance['isout']=0;parentInstance['isover']=1;parentInstance._over.call(parentInstance,event);}});}};})(jQuery);(function($){$.widget("ui.resizable",$.extend({},$.ui.mouse,{_init:function(){var self=this,o=this.options;this.element.addClass("ui-resizable");$.extend(this,{_aspectRatio:!!(o.aspectRatio),aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||'ui-resizable-helper':null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css('position'))&&$.browser.opera)
this.element.css({position:'relative',top:'auto',left:'auto'});this.element.wrap($('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css('position'),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css('top'),left:this.element.css('left')}));this.element=this.element.parent().data("resizable",this.element.data('resizable'));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css('resize');this.originalElement.css('resize','none');this._proportionallyResizeElements.push(this.originalElement.css({position:'static',zoom:1,display:'block'}));this.originalElement.css({margin:this.originalElement.css('margin')});this._proportionallyResize();}
this.handles=o.handles||(!$('.ui-resizable-handle',this.element).length?"e,s,se":{n:'.ui-resizable-n',e:'.ui-resizable-e',s:'.ui-resizable-s',w:'.ui-resizable-w',se:'.ui-resizable-se',sw:'.ui-resizable-sw',ne:'.ui-resizable-ne',nw:'.ui-resizable-nw'});if(this.handles.constructor==String){if(this.handles=='all')this.handles='n,e,s,w,se,sw,ne,nw';var n=this.handles.split(",");this.handles={};for(var i=0;i<n.length;i++){var handle=$.trim(n[i]),hname='ui-resizable-'+handle;var axis=$('<div class="ui-resizable-handle '+hname+'"></div>');if(/sw|se|ne|nw/.test(handle))axis.css({zIndex:++o.zIndex});if('se'==handle){axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');};this.handles[handle]='.ui-resizable-'+handle;this.element.append(axis);}}
this._renderAxis=function(target){target=target||this.element;for(var i in this.handles){if(this.handles[i].constructor==String)
this.handles[i]=$(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var axis=$(this.handles[i],this.element),padWrapper=0;padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth();var padPos=['padding',/ne|nw|n/.test(i)?'Top':/se|sw|s/.test(i)?'Bottom':/^e$/.test(i)?'Right':'Left'].join("");target.css(padPos,padWrapper);this._proportionallyResize();}
if(!$(this.handles[i]).length)
continue;}};this._renderAxis(this.element);this._handles=$('.ui-resizable-handle',this.element).disableSelection();this._handles.mouseover(function(){if(!self.resizing){if(this.className)
var axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);self.axis=axis&&axis[1]?axis[1]:'se';}});if(o.autoHide){this._handles.hide();$(this.element).addClass("ui-resizable-autohide").hover(function(){$(this).removeClass("ui-resizable-autohide");self._handles.show();},function(){if(!self.resizing){$(this).addClass("ui-resizable-autohide");self._handles.hide();}});}
this._mouseInit();},destroy:function(){this._mouseDestroy();var _destroy=function(exp){$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();};if(this.elementIsWrapper){_destroy(this.element);var wrapper=this.element;wrapper.parent().append(this.originalElement.css({position:wrapper.css('position'),width:wrapper.outerWidth(),height:wrapper.outerHeight(),top:wrapper.css('top'),left:wrapper.css('left')})).end().remove();}
this.originalElement.css('resize',this.originalResizeStyle);_destroy(this.originalElement);},_mouseCapture:function(event){var handle=false;for(var i in this.handles){if($(this.handles[i])[0]==event.target)handle=true;}
return this.options.disabled||!!handle;},_mouseStart:function(event){var o=this.options,iniPos=this.element.position(),el=this.element;this.resizing=true;this.documentScroll={top:$(document).scrollTop(),left:$(document).scrollLeft()};if(el.is('.ui-draggable')||(/absolute/).test(el.css('position'))){el.css({position:'absolute',top:iniPos.top,left:iniPos.left});}
if($.browser.opera&&(/relative/).test(el.css('position')))
el.css({position:'relative',top:'auto',left:'auto'});this._renderProxy();var curleft=num(this.helper.css('left')),curtop=num(this.helper.css('top'));if(o.containment){curleft+=$(o.containment).scrollLeft()||0;curtop+=$(o.containment).scrollTop()||0;}
this.offset=this.helper.offset();this.position={left:curleft,top:curtop};this.size=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.originalSize=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.originalPosition={left:curleft,top:curtop};this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()};this.originalMousePosition={left:event.pageX,top:event.pageY};this.aspectRatio=(typeof o.aspectRatio=='number')?o.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var cursor=$('.ui-resizable-'+this.axis).css('cursor');$('body').css('cursor',cursor=='auto'?this.axis+'-resize':cursor);el.addClass("ui-resizable-resizing");this._propagate("start",event);return true;},_mouseDrag:function(event){var el=this.helper,o=this.options,props={},self=this,smp=this.originalMousePosition,a=this.axis;var dx=(event.pageX-smp.left)||0,dy=(event.pageY-smp.top)||0;var trigger=this._change[a];if(!trigger)return false;var data=trigger.apply(this,[event,dx,dy]),ie6=$.browser.msie&&$.browser.version<7,csdif=this.sizeDiff;if(this._aspectRatio||event.shiftKey)
data=this._updateRatio(data,event);data=this._respectSize(data,event);this._propagate("resize",event);el.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length)
this._proportionallyResize();this._updateCache(data);this._trigger('resize',event,this.ui());return false;},_mouseStop:function(event){this.resizing=false;var o=this.options,self=this;if(this._helper){var pr=this._proportionallyResizeElements,ista=pr.length&&(/textarea/i).test(pr[0].nodeName),soffseth=ista&&$.ui.hasScroll(pr[0],'left')?0:self.sizeDiff.height,soffsetw=ista?0:self.sizeDiff.width;var s={width:(self.size.width-soffsetw),height:(self.size.height-soffseth)},left=(parseInt(self.element.css('left'),10)+(self.position.left-self.originalPosition.left))||null,top=(parseInt(self.element.css('top'),10)+(self.position.top-self.originalPosition.top))||null;if(!o.animate)
this.element.css($.extend(s,{top:top,left:left}));self.helper.height(self.size.height);self.helper.width(self.size.width);if(this._helper&&!o.animate)this._proportionallyResize();}
$('body').css('cursor','auto');this.element.removeClass("ui-resizable-resizing");this._propagate("stop",event);if(this._helper)this.helper.remove();return false;},_updateCache:function(data){var o=this.options;this.offset=this.helper.offset();if(isNumber(data.left))this.position.left=data.left;if(isNumber(data.top))this.position.top=data.top;if(isNumber(data.height))this.size.height=data.height;if(isNumber(data.width))this.size.width=data.width;},_updateRatio:function(data,event){var o=this.options,cpos=this.position,csize=this.size,a=this.axis;if(data.height)data.width=(csize.height*this.aspectRatio);else if(data.width)data.height=(csize.width/this.aspectRatio);if(a=='sw'){data.left=cpos.left+(csize.width-data.width);data.top=null;}
if(a=='nw'){data.top=cpos.top+(csize.height-data.height);data.left=cpos.left+(csize.width-data.width);}
return data;},_respectSize:function(data,event){var el=this.helper,o=this.options,pRatio=this._aspectRatio||event.shiftKey,a=this.axis,ismaxw=isNumber(data.width)&&o.maxWidth&&(o.maxWidth<data.width),ismaxh=isNumber(data.height)&&o.maxHeight&&(o.maxHeight<data.height),isminw=isNumber(data.width)&&o.minWidth&&(o.minWidth>data.width),isminh=isNumber(data.height)&&o.minHeight&&(o.minHeight>data.height);if(isminw)data.width=o.minWidth;if(isminh)data.height=o.minHeight;if(ismaxw)data.width=o.maxWidth;if(ismaxh)data.height=o.maxHeight;var dw=this.originalPosition.left+this.originalSize.width,dh=this.position.top+this.size.height;var cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);if(isminw&&cw)data.left=dw-o.minWidth;if(ismaxw&&cw)data.left=dw-o.maxWidth;if(isminh&&ch)data.top=dh-o.minHeight;if(ismaxh&&ch)data.top=dh-o.maxHeight;var isNotwh=!data.width&&!data.height;if(isNotwh&&!data.left&&data.top)data.top=null;else if(isNotwh&&!data.top&&data.left)data.left=null;return data;},_proportionallyResize:function(){var o=this.options;if(!this._proportionallyResizeElements.length)return;var element=this.helper||this.element;for(var i=0;i<this._proportionallyResizeElements.length;i++){var prel=this._proportionallyResizeElements[i];if(!this.borderDif){var b=[prel.css('borderTopWidth'),prel.css('borderRightWidth'),prel.css('borderBottomWidth'),prel.css('borderLeftWidth')],p=[prel.css('paddingTop'),prel.css('paddingRight'),prel.css('paddingBottom'),prel.css('paddingLeft')];this.borderDif=$.map(b,function(v,i){var border=parseInt(v,10)||0,padding=parseInt(p[i],10)||0;return border+padding;});}
if($.browser.msie&&!(!($(element).is(':hidden')||$(element).parents(':hidden').length)))
continue;prel.css({height:(element.height()-this.borderDif[0]-this.borderDif[2])||0,width:(element.width()-this.borderDif[1]-this.borderDif[3])||0});};},_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset();if(this._helper){this.helper=this.helper||$('<div style="overflow:hidden;"></div>');var ie6=$.browser.msie&&$.browser.version<7,ie6offset=(ie6?1:0),pxyoffset=(ie6?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+pxyoffset,height:this.element.outerHeight()+pxyoffset,position:'absolute',left:this.elementOffset.left-ie6offset+'px',top:this.elementOffset.top-ie6offset+'px',zIndex:++o.zIndex});this.helper.appendTo("body").disableSelection();}else{this.helper=this.element;}},_change:{e:function(event,dx,dy){return{width:this.originalSize.width+dx};},w:function(event,dx,dy){var o=this.options,cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx};},n:function(event,dx,dy){var o=this.options,cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy};},s:function(event,dx,dy){return{height:this.originalSize.height+dy};},se:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]));},sw:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]));},ne:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]));},nw:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]));}},_propagate:function(n,event){$.ui.plugin.call(this,n,[event,this.ui()]);(n!="resize"&&this._trigger(n,event,this.ui()));},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition};}}));$.extend($.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});$.ui.plugin.add("resizable","alsoResize",{start:function(event,ui){var self=$(this).data("resizable"),o=self.options;_store=function(exp){$(exp).each(function(){$(this).data("resizable-alsoresize",{width:parseInt($(this).width(),10),height:parseInt($(this).height(),10),left:parseInt($(this).css('left'),10),top:parseInt($(this).css('top'),10)});});};if(typeof(o.alsoResize)=='object'&&!o.alsoResize.parentNode){if(o.alsoResize.length){o.alsoResize=o.alsoResize[0];_store(o.alsoResize);}
else{$.each(o.alsoResize,function(exp,c){_store(exp);});}}else{_store(o.alsoResize);}},resize:function(event,ui){var self=$(this).data("resizable"),o=self.options,os=self.originalSize,op=self.originalPosition;var delta={height:(self.size.height-os.height)||0,width:(self.size.width-os.width)||0,top:(self.position.top-op.top)||0,left:(self.position.left-op.left)||0},_alsoResize=function(exp,c){$(exp).each(function(){var el=$(this),start=$(this).data("resizable-alsoresize"),style={},css=c&&c.length?c:['width','height','top','left'];$.each(css||['width','height','top','left'],function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);if(sum&&sum>=0)
style[prop]=sum||null;});if(/relative/.test(el.css('position'))&&$.browser.opera){self._revertToRelativePosition=true;el.css({position:'absolute',top:'auto',left:'auto'});}
el.css(style);});};if(typeof(o.alsoResize)=='object'&&!o.alsoResize.nodeType){$.each(o.alsoResize,function(exp,c){_alsoResize(exp,c);});}else{_alsoResize(o.alsoResize);}},stop:function(event,ui){var self=$(this).data("resizable");if(self._revertToRelativePosition&&$.browser.opera){self._revertToRelativePosition=false;el.css({position:'relative'});}
$(this).removeData("resizable-alsoresize-start");}});$.ui.plugin.add("resizable","animate",{stop:function(event,ui){var self=$(this).data("resizable"),o=self.options;var pr=self._proportionallyResizeElements,ista=pr.length&&(/textarea/i).test(pr[0].nodeName),soffseth=ista&&$.ui.hasScroll(pr[0],'left')?0:self.sizeDiff.height,soffsetw=ista?0:self.sizeDiff.width;var style={width:(self.size.width-soffsetw),height:(self.size.height-soffseth)},left=(parseInt(self.element.css('left'),10)+(self.position.left-self.originalPosition.left))||null,top=(parseInt(self.element.css('top'),10)+(self.position.top-self.originalPosition.top))||null;self.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration,easing:o.animateEasing,step:function(){var data={width:parseInt(self.element.css('width'),10),height:parseInt(self.element.css('height'),10),top:parseInt(self.element.css('top'),10),left:parseInt(self.element.css('left'),10)};if(pr&&pr.length)$(pr[0]).css({width:data.width,height:data.height});self._updateCache(data);self._propagate("resize",event);}});}});$.ui.plugin.add("resizable","containment",{start:function(event,ui){var self=$(this).data("resizable"),o=self.options,el=self.element;var oc=o.containment,ce=(oc instanceof $)?oc.get(0):(/parent/.test(oc))?el.parent().get(0):oc;if(!ce)return;self.containerElement=$(ce);if(/document/.test(oc)||oc==document){self.containerOffset={left:0,top:0};self.containerPosition={left:0,top:0};self.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight};}
else{var element=$(ce),p=[];$(["Top","Right","Left","Bottom"]).each(function(i,name){p[i]=num(element.css("padding"+name));});self.containerOffset=element.offset();self.containerPosition=element.position();self.containerSize={height:(element.innerHeight()-p[3]),width:(element.innerWidth()-p[1])};var co=self.containerOffset,ch=self.containerSize.height,cw=self.containerSize.width,width=($.ui.hasScroll(ce,"left")?ce.scrollWidth:cw),height=($.ui.hasScroll(ce)?ce.scrollHeight:ch);self.parentData={element:ce,left:co.left,top:co.top,width:width,height:height};}},resize:function(event,ui){var self=$(this).data("resizable"),o=self.options,ps=self.containerSize,co=self.containerOffset,cs=self.size,cp=self.position,pRatio=self._aspectRatio||event.shiftKey,cop={top:0,left:0},ce=self.containerElement;if(ce[0]!=document&&(/static/).test(ce.css('position')))cop=co;if(cp.left<(self._helper?co.left:0)){self.size.width=self.size.width+(self._helper?(self.position.left-co.left):(self.position.left-cop.left));if(pRatio)self.size.height=self.size.width/o.aspectRatio;self.position.left=o.helper?co.left:0;}
if(cp.top<(self._helper?co.top:0)){self.size.height=self.size.height+(self._helper?(self.position.top-co.top):self.position.top);if(pRatio)self.size.width=self.size.height*o.aspectRatio;self.position.top=self._helper?co.top:0;}
self.offset.left=self.parentData.left+self.position.left;self.offset.top=self.parentData.top+self.position.top;var woset=Math.abs((self._helper?self.offset.left-cop.left:(self.offset.left-cop.left))+self.sizeDiff.width),hoset=Math.abs((self._helper?self.offset.top-cop.top:(self.offset.top-co.top))+self.sizeDiff.height);var isParent=self.containerElement.get(0)==self.element.parent().get(0),isOffsetRelative=/relative|absolute/.test(self.containerElement.css('position'));if(isParent&&isOffsetRelative)woset-=self.parentData.left;if(woset+self.size.width>=self.parentData.width){self.size.width=self.parentData.width-woset;if(pRatio)self.size.height=self.size.width/self.aspectRatio;}
if(hoset+self.size.height>=self.parentData.height){self.size.height=self.parentData.height-hoset;if(pRatio)self.size.width=self.size.height*self.aspectRatio;}},stop:function(event,ui){var self=$(this).data("resizable"),o=self.options,cp=self.position,co=self.containerOffset,cop=self.containerPosition,ce=self.containerElement;var helper=$(self.helper),ho=helper.offset(),w=helper.outerWidth()-self.sizeDiff.width,h=helper.outerHeight()-self.sizeDiff.height;if(self._helper&&!o.animate&&(/relative/).test(ce.css('position')))
$(this).css({left:ho.left-cop.left-co.left,width:w,height:h});if(self._helper&&!o.animate&&(/static/).test(ce.css('position')))
$(this).css({left:ho.left-cop.left-co.left,width:w,height:h});}});$.ui.plugin.add("resizable","ghost",{start:function(event,ui){var self=$(this).data("resizable"),o=self.options,cs=self.size;self.ghost=self.originalElement.clone();self.ghost.css({opacity:.25,display:'block',position:'relative',height:cs.height,width:cs.width,margin:0,left:0,top:0}).addClass('ui-resizable-ghost').addClass(typeof o.ghost=='string'?o.ghost:'');self.ghost.appendTo(self.helper);},resize:function(event,ui){var self=$(this).data("resizable"),o=self.options;if(self.ghost)self.ghost.css({position:'relative',height:self.size.height,width:self.size.width});},stop:function(event,ui){var self=$(this).data("resizable"),o=self.options;if(self.ghost&&self.helper)self.helper.get(0).removeChild(self.ghost.get(0));}});$.ui.plugin.add("resizable","grid",{resize:function(event,ui){var self=$(this).data("resizable"),o=self.options,cs=self.size,os=self.originalSize,op=self.originalPosition,a=self.axis,ratio=o._aspectRatio||event.shiftKey;o.grid=typeof o.grid=="number"?[o.grid,o.grid]:o.grid;var ox=Math.round((cs.width-os.width)/(o.grid[0]||1))*(o.grid[0]||1),oy=Math.round((cs.height-os.height)/(o.grid[1]||1))*(o.grid[1]||1);if(/^(se|s|e)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;}
else if(/^(ne)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.top=op.top-oy;}
else if(/^(sw)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.left=op.left-ox;}
else{self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.top=op.top-oy;self.position.left=op.left-ox;}}});var num=function(v){return parseInt(v,10)||0;};var isNumber=function(value){return!isNaN(parseInt(value,10));};})(jQuery);(function($){$.widget("ui.selectable",$.extend({},$.ui.mouse,{_init:function(){var self=this;this.element.addClass("ui-selectable");this.dragged=false;var selectees;this.refresh=function(){selectees=$(self.options.filter,self.element[0]);selectees.each(function(){var $this=$(this);var pos=$this.offset();$.data(this,"selectable-item",{element:this,$element:$this,left:pos.left,top:pos.top,right:pos.left+$this.outerWidth(),bottom:pos.top+$this.outerHeight(),startselected:false,selected:$this.hasClass('ui-selected'),selecting:$this.hasClass('ui-selecting'),unselecting:$this.hasClass('ui-unselecting')});});};this.refresh();this.selectees=selectees.addClass("ui-selectee");this._mouseInit();this.helper=$(document.createElement('div')).css({border:'1px dotted black'}).addClass("ui-selectable-helper");},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();},_mouseStart:function(event){var self=this;this.opos=[event.pageX,event.pageY];if(this.options.disabled)
return;var options=this.options;this.selectees=$(options.filter,this.element[0]);this._trigger("start",event);$(options.appendTo).append(this.helper);this.helper.css({"z-index":100,"position":"absolute","left":event.clientX,"top":event.clientY,"width":0,"height":0});if(options.autoRefresh){this.refresh();}
this.selectees.filter('.ui-selected').each(function(){var selectee=$.data(this,"selectable-item");selectee.startselected=true;if(!event.metaKey){selectee.$element.removeClass('ui-selected');selectee.selected=false;selectee.$element.addClass('ui-unselecting');selectee.unselecting=true;self._trigger("unselecting",event,{unselecting:selectee.element});}});$(event.target).parents().andSelf().each(function(){var selectee=$.data(this,"selectable-item");if(selectee){selectee.$element.removeClass("ui-unselecting").addClass('ui-selecting');selectee.unselecting=false;selectee.selecting=true;selectee.selected=true;self._trigger("selecting",event,{selecting:selectee.element});return false;}});},_mouseDrag:function(event){var self=this;this.dragged=true;if(this.options.disabled)
return;var options=this.options;var x1=this.opos[0],y1=this.opos[1],x2=event.pageX,y2=event.pageY;if(x1>x2){var tmp=x2;x2=x1;x1=tmp;}
if(y1>y2){var tmp=y2;y2=y1;y1=tmp;}
this.helper.css({left:x1,top:y1,width:x2-x1,height:y2-y1});this.selectees.each(function(){var selectee=$.data(this,"selectable-item");if(!selectee||selectee.element==self.element[0])
return;var hit=false;if(options.tolerance=='touch'){hit=(!(selectee.left>x2||selectee.right<x1||selectee.top>y2||selectee.bottom<y1));}else if(options.tolerance=='fit'){hit=(selectee.left>x1&&selectee.right<x2&&selectee.top>y1&&selectee.bottom<y2);}
if(hit){if(selectee.selected){selectee.$element.removeClass('ui-selected');selectee.selected=false;}
if(selectee.unselecting){selectee.$element.removeClass('ui-unselecting');selectee.unselecting=false;}
if(!selectee.selecting){selectee.$element.addClass('ui-selecting');selectee.selecting=true;self._trigger("selecting",event,{selecting:selectee.element});}}else{if(selectee.selecting){if(event.metaKey&&selectee.startselected){selectee.$element.removeClass('ui-selecting');selectee.selecting=false;selectee.$element.addClass('ui-selected');selectee.selected=true;}else{selectee.$element.removeClass('ui-selecting');selectee.selecting=false;if(selectee.startselected){selectee.$element.addClass('ui-unselecting');selectee.unselecting=true;}
self._trigger("unselecting",event,{unselecting:selectee.element});}}
if(selectee.selected){if(!event.metaKey&&!selectee.startselected){selectee.$element.removeClass('ui-selected');selectee.selected=false;selectee.$element.addClass('ui-unselecting');selectee.unselecting=true;self._trigger("unselecting",event,{unselecting:selectee.element});}}}});return false;},_mouseStop:function(event){var self=this;this.dragged=false;var options=this.options;$('.ui-unselecting',this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");selectee.$element.removeClass('ui-unselecting');selectee.unselecting=false;selectee.startselected=false;self._trigger("unselected",event,{unselected:selectee.element});});$('.ui-selecting',this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");selectee.$element.removeClass('ui-selecting').addClass('ui-selected');selectee.selecting=false;selectee.selected=true;selectee.startselected=true;self._trigger("selected",event,{selected:selectee.element});});this._trigger("stop",event);this.helper.remove();return false;}}));$.extend($.ui.selectable,{version:"1.7.2",defaults:{appendTo:'body',autoRefresh:true,cancel:":input,option",delay:0,distance:0,filter:'*',tolerance:'touch'}});})(jQuery);(function($){$.widget("ui.sortable",$.extend({},$.ui.mouse,{_init:function(){var o=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css('float')):false;this.offset=this.element.offset();this._mouseInit();},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var i=this.items.length-1;i>=0;i--)
this.items[i].item.removeData("sortable-item");},_mouseCapture:function(event,overrideHandle){if(this.reverting){return false;}
if(this.options.disabled||this.options.type=='static')return false;this._refreshItems(event);var currentItem=null,self=this,nodes=$(event.target).parents().each(function(){if($.data(this,'sortable-item')==self){currentItem=$(this);return false;}});if($.data(event.target,'sortable-item')==self)currentItem=$(event.target);if(!currentItem)return false;if(this.options.handle&&!overrideHandle){var validHandle=false;$(this.options.handle,currentItem).find("*").andSelf().each(function(){if(this==event.target)validHandle=true;});if(!validHandle)return false;}
this.currentItem=currentItem;this._removeCurrentsFromItems();return true;},_mouseStart:function(event,overrideHandle,noActivation){var o=this.options,self=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(event);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;if(o.cursorAt)
this._adjustOffsetFromHelper(o.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide();}
this._createPlaceholder();if(o.containment)
this._setContainment();if(o.cursor){if($('body').css("cursor"))this._storedCursor=$('body').css("cursor");$('body').css("cursor",o.cursor);}
if(o.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",o.opacity);}
if(o.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",o.zIndex);}
if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!='HTML')
this.overflowOffset=this.scrollParent.offset();this._trigger("start",event,this._uiHash());if(!this._preserveHelperProportions)
this._cacheHelperProportions();if(!noActivation){for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("activate",event,self._uiHash(this));}}
if($.ui.ddmanager)
$.ui.ddmanager.current=this;if($.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(this,event);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(event);return true;},_mouseDrag:function(event){this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs;}
if(this.options.scroll){var o=this.options,scrolled=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!='HTML'){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity)
this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop+o.scrollSpeed;else if(event.pageY-this.overflowOffset.top<o.scrollSensitivity)
this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop-o.scrollSpeed;if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity)
this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft+o.scrollSpeed;else if(event.pageX-this.overflowOffset.left<o.scrollSensitivity)
this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft-o.scrollSpeed;}else{if(event.pageY-$(document).scrollTop()<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}
if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(this,event);}
this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+'px';if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+'px';for(var i=this.items.length-1;i>=0;i--){var item=this.items[i],itemElement=item.item[0],intersection=this._intersectsWithPointer(item);if(!intersection)continue;if(itemElement!=this.currentItem[0]&&this.placeholder[intersection==1?"next":"prev"]()[0]!=itemElement&&!$.ui.contains(this.placeholder[0],itemElement)&&(this.options.type=='semi-dynamic'?!$.ui.contains(this.element[0],itemElement):true)){this.direction=intersection==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(item)){this._rearrange(event,item);}else{break;}
this._trigger("change",event,this._uiHash());break;}}
this._contactContainers(event);if($.ui.ddmanager)$.ui.ddmanager.drag(this,event);this._trigger('sort',event,this._uiHash());this.lastPositionAbs=this.positionAbs;return false;},_mouseStop:function(event,noPropagation){if(!event)return;if($.ui.ddmanager&&!this.options.dropBehaviour)
$.ui.ddmanager.drop(this,event);if(this.options.revert){var self=this;var cur=self.placeholder.offset();self.reverting=true;$(this.helper).animate({left:cur.left-this.offset.parent.left-self.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:cur.top-this.offset.parent.top-self.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){self._clear(event);});}else{this._clear(event,noPropagation);}
return false;},cancel:function(){var self=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original")
this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");else
this.currentItem.show();for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("deactivate",null,self._uiHash(this));if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",null,self._uiHash(this));this.containers[i].containerCache.over=0;}}}
if(this.placeholder[0].parentNode)this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode)this.helper.remove();$.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){$(this.domPosition.prev).after(this.currentItem);}else{$(this.domPosition.parent).prepend(this.currentItem);}
return true;},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected);var str=[];o=o||{};$(items).each(function(){var res=($(o.item||this).attr(o.attribute||'id')||'').match(o.expression||(/(.+)[-=_](.+)/));if(res)str.push((o.key||res[1]+'[]')+'='+(o.key&&o.expression?res[1]:res[2]));});return str.join('&');},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected);var ret=[];o=o||{};items.each(function(){ret.push($(o.item||this).attr(o.attribute||'id')||'');});return ret;},_intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height;var l=item.left,r=l+item.width,t=item.top,b=t+item.height;var dyClick=this.offset.click.top,dxClick=this.offset.click.left;var isOverElement=(y1+dyClick)>t&&(y1+dyClick)<b&&(x1+dxClick)>l&&(x1+dxClick)<r;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?'width':'height']>item[this.floating?'width':'height'])){return isOverElement;}else{return(l<x1+(this.helperProportions.width/2)&&x2-(this.helperProportions.width/2)<r&&t<y1+(this.helperProportions.height/2)&&y2-(this.helperProportions.height/2)<b);}},_intersectsWithPointer:function(item){var isOverElementHeight=$.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,item.top,item.height),isOverElementWidth=$.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,item.left,item.width),isOverElement=isOverElementHeight&&isOverElementWidth,verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(!isOverElement)
return false;return this.floating?(((horizontalDirection&&horizontalDirection=="right")||verticalDirection=="down")?2:1):(verticalDirection&&(verticalDirection=="down"?2:1));},_intersectsWithSides:function(item){var isOverBottomHalf=$.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,item.top+(item.height/2),item.height),isOverRightHalf=$.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,item.left+(item.width/2),item.width),verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(this.floating&&horizontalDirection){return((horizontalDirection=="right"&&isOverRightHalf)||(horizontalDirection=="left"&&!isOverRightHalf));}else{return verticalDirection&&((verticalDirection=="down"&&isOverBottomHalf)||(verticalDirection=="up"&&!isOverBottomHalf));}},_getDragVerticalDirection:function(){var delta=this.positionAbs.top-this.lastPositionAbs.top;return delta!=0&&(delta>0?"down":"up");},_getDragHorizontalDirection:function(){var delta=this.positionAbs.left-this.lastPositionAbs.left;return delta!=0&&(delta>0?"right":"left");},refresh:function(event){this._refreshItems(event);this.refreshPositions();},_connectWith:function(){var options=this.options;return options.connectWith.constructor==String?[options.connectWith]:options.connectWith;},_getItemsAsjQuery:function(connected){var self=this;var items=[];var queries=[];var connectWith=this._connectWith();if(connectWith&&connected){for(var i=connectWith.length-1;i>=0;i--){var cur=$(connectWith[i]);for(var j=cur.length-1;j>=0;j--){var inst=$.data(cur[j],'sortable');if(inst&&inst!=this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element):$(inst.options.items,inst.element).not(".ui-sortable-helper"),inst]);}};};}
queries.push([$.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var i=queries.length-1;i>=0;i--){queries[i][0].each(function(){items.push(this);});};return $(items);},_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data(sortable-item)");for(var i=0;i<this.items.length;i++){for(var j=0;j<list.length;j++){if(list[j]==this.items[i].item[0])
this.items.splice(i,1);};};},_refreshItems:function(event){this.items=[];this.containers=[this];var items=this.items;var self=this;var queries=[[$.isFunction(this.options.items)?this.options.items.call(this.element[0],event,{item:this.currentItem}):$(this.options.items,this.element),this]];var connectWith=this._connectWith();if(connectWith){for(var i=connectWith.length-1;i>=0;i--){var cur=$(connectWith[i]);for(var j=cur.length-1;j>=0;j--){var inst=$.data(cur[j],'sortable');if(inst&&inst!=this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element[0],event,{item:this.currentItem}):$(inst.options.items,inst.element),inst]);this.containers.push(inst);}};};}
for(var i=queries.length-1;i>=0;i--){var targetData=queries[i][1];var _queries=queries[i][0];for(var j=0,queriesLength=_queries.length;j<queriesLength;j++){var item=$(_queries[j]);item.data('sortable-item',targetData);items.push({item:item,instance:targetData,width:0,height:0,left:0,top:0});};};},refreshPositions:function(fast){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset();}
for(var i=this.items.length-1;i>=0;i--){var item=this.items[i];if(item.instance!=this.currentContainer&&this.currentContainer&&item.item[0]!=this.currentItem[0])
continue;var t=this.options.toleranceElement?$(this.options.toleranceElement,item.item):item.item;if(!fast){item.width=t.outerWidth();item.height=t.outerHeight();}
var p=t.offset();item.left=p.left;item.top=p.top;};if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this);}else{for(var i=this.containers.length-1;i>=0;i--){var p=this.containers[i].element.offset();this.containers[i].containerCache.left=p.left;this.containers[i].containerCache.top=p.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight();};}},_createPlaceholder:function(that){var self=that||this,o=self.options;if(!o.placeholder||o.placeholder.constructor==String){var className=o.placeholder;o.placeholder={element:function(){var el=$(document.createElement(self.currentItem[0].nodeName)).addClass(className||self.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!className)
el.style.visibility="hidden";return el;},update:function(container,p){if(className&&!o.forcePlaceholderSize)return;if(!p.height()){p.height(self.currentItem.innerHeight()-parseInt(self.currentItem.css('paddingTop')||0,10)-parseInt(self.currentItem.css('paddingBottom')||0,10));};if(!p.width()){p.width(self.currentItem.innerWidth()-parseInt(self.currentItem.css('paddingLeft')||0,10)-parseInt(self.currentItem.css('paddingRight')||0,10));};}};}
self.placeholder=$(o.placeholder.element.call(self.element,self.currentItem));self.currentItem.after(self.placeholder);o.placeholder.update(self,self.placeholder);},_contactContainers:function(event){for(var i=this.containers.length-1;i>=0;i--){if(this._intersectsWith(this.containers[i].containerCache)){if(!this.containers[i].containerCache.over){if(this.currentContainer!=this.containers[i]){var dist=10000;var itemWithLeastDistance=null;var base=this.positionAbs[this.containers[i].floating?'left':'top'];for(var j=this.items.length-1;j>=0;j--){if(!$.ui.contains(this.containers[i].element[0],this.items[j].item[0]))continue;var cur=this.items[j][this.containers[i].floating?'left':'top'];if(Math.abs(cur-base)<dist){dist=Math.abs(cur-base);itemWithLeastDistance=this.items[j];}}
if(!itemWithLeastDistance&&!this.options.dropOnEmpty)
continue;this.currentContainer=this.containers[i];itemWithLeastDistance?this._rearrange(event,itemWithLeastDistance,null,true):this._rearrange(event,null,this.containers[i].element,true);this._trigger("change",event,this._uiHash());this.containers[i]._trigger("change",event,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);}
this.containers[i]._trigger("over",event,this._uiHash(this));this.containers[i].containerCache.over=1;}}else{if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",event,this._uiHash(this));this.containers[i].containerCache.over=0;}}};},_createHelper:function(event){var o=this.options;var helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event,this.currentItem])):(o.helper=='clone'?this.currentItem.clone():this.currentItem);if(!helper.parents('body').length)
$(o.appendTo!='parent'?o.appendTo:this.currentItem[0].parentNode)[0].appendChild(helper[0]);if(helper[0]==this.currentItem[0])
this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(helper[0].style.width==''||o.forceHelperSize)helper.width(this.currentItem.width());if(helper[0].style.height==''||o.forceHelperSize)helper.height(this.currentItem.height());return helper;},_adjustOffsetFromHelper:function(obj){if(obj.left!=undefined)this.offset.click.left=obj.left+this.margins.left;if(obj.right!=undefined)this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;if(obj.top!=undefined)this.offset.click.top=obj.top+this.margins.top;if(obj.bottom!=undefined)this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition=='absolute'&&this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();}
if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=='html'&&$.browser.msie))
po={top:0,left:0};return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var p=this.currentItem.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var o=this.options;if(o.containment=='parent')o.containment=this.helper[0].parentNode;if(o.containment=='document'||o.containment=='window')this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$(o.containment=='document'?document:window).width()-this.helperProportions.width-this.margins.left,($(o.containment=='document'?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!(/^(document|window|parent)$/).test(o.containment)){var ce=$(o.containment)[0];var co=$(o.containment).offset();var over=($(ce).css("overflow")!='hidden');this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top];}},_convertPositionTo:function(d,pos){if(!pos)pos=this.position;var mod=d=="absolute"?1:-1;var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top
+this.offset.relative.top*mod
+this.offset.parent.top*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left
+this.offset.relative.left*mod
+this.offset.parent.left*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))};},_generatePosition:function(event){var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);if(this.cssPosition=='relative'&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset();}
var pageX=event.pageX;var pageY=event.pageY;if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0])pageX=this.containment[0]+this.offset.click.left;if(event.pageY-this.offset.click.top<this.containment[1])pageY=this.containment[1]+this.offset.click.top;if(event.pageX-this.offset.click.left>this.containment[2])pageX=this.containment[2]+this.offset.click.left;if(event.pageY-this.offset.click.top>this.containment[3])pageY=this.containment[3]+this.offset.click.top;}
if(o.grid){var top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?(!(top-this.offset.click.top<this.containment[1]||top-this.offset.click.top>this.containment[3])?top:(!(top-this.offset.click.top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?(!(left-this.offset.click.left<this.containment[0]||left-this.offset.click.left>this.containment[2])?left:(!(left-this.offset.click.left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}}
return{top:(pageY
-this.offset.click.top
-this.offset.relative.top
-this.offset.parent.top
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX
-this.offset.click.left
-this.offset.relative.left
-this.offset.parent.left
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())))};},_rearrange:function(event,i,a,hardRefresh){a?a[0].appendChild(this.placeholder[0]):i.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=='down'?i.item[0]:i.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var self=this,counter=this.counter;window.setTimeout(function(){if(counter==self.counter)self.refreshPositions(!hardRefresh);},0);},_clear:function(event,noPropagation){this.reverting=false;var delayedTriggers=[],self=this;if(!this._noFinalSort&&this.currentItem[0].parentNode)this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var i in this._storedCSS){if(this._storedCSS[i]=='auto'||this._storedCSS[i]=='static')this._storedCSS[i]='';}
this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");}else{this.currentItem.show();}
if(this.fromOutside&&!noPropagation)delayedTriggers.push(function(event){this._trigger("receive",event,this._uiHash(this.fromOutside));});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!noPropagation)delayedTriggers.push(function(event){this._trigger("update",event,this._uiHash());});if(!$.ui.contains(this.element[0],this.currentItem[0])){if(!noPropagation)delayedTriggers.push(function(event){this._trigger("remove",event,this._uiHash());});for(var i=this.containers.length-1;i>=0;i--){if($.ui.contains(this.containers[i].element[0],this.currentItem[0])&&!noPropagation){delayedTriggers.push((function(c){return function(event){c._trigger("receive",event,this._uiHash(this));};}).call(this,this.containers[i]));delayedTriggers.push((function(c){return function(event){c._trigger("update",event,this._uiHash(this));};}).call(this,this.containers[i]));}};};for(var i=this.containers.length-1;i>=0;i--){if(!noPropagation)delayedTriggers.push((function(c){return function(event){c._trigger("deactivate",event,this._uiHash(this));};}).call(this,this.containers[i]));if(this.containers[i].containerCache.over){delayedTriggers.push((function(c){return function(event){c._trigger("out",event,this._uiHash(this));};}).call(this,this.containers[i]));this.containers[i].containerCache.over=0;}}
if(this._storedCursor)$('body').css("cursor",this._storedCursor);if(this._storedOpacity)this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=='auto'?'':this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!noPropagation){this._trigger("beforeStop",event,this._uiHash());for(var i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event);};this._trigger("stop",event,this._uiHash());}
return false;}
if(!noPropagation)this._trigger("beforeStop",event,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0])this.helper.remove();this.helper=null;if(!noPropagation){for(var i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event);};this._trigger("stop",event,this._uiHash());}
this.fromOutside=false;return true;},_trigger:function(){if($.widget.prototype._trigger.apply(this,arguments)===false){this.cancel();}},_uiHash:function(inst){var self=inst||this;return{helper:self.helper,placeholder:self.placeholder||$([]),position:self.position,absolutePosition:self.positionAbs,offset:self.positionAbs,item:self.currentItem,sender:inst?inst.element:null};}}));$.extend($.ui.sortable,{getter:"serialize toArray",version:"1.7.2",eventPrefix:"sort",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectWith:false,containment:false,cursor:'auto',cursorAt:false,delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:'> *',opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}});})(jQuery);(function($){$.widget("ui.accordion",{_init:function(){var o=this.options,self=this;this.running=0;if(o.collapsible==$.ui.accordion.defaults.collapsible&&o.alwaysOpen!=$.ui.accordion.defaults.alwaysOpen){o.collapsible=!o.alwaysOpen;}
if(o.navigation){var current=this.element.find("a").filter(o.navigationFilter);if(current.length){if(current.filter(o.header).length){this.active=current;}else{this.active=current.parent().parent().prev();current.addClass("ui-accordion-content-active");}}}
this.element.addClass("ui-accordion ui-widget ui-helper-reset");if(this.element[0].nodeName=="UL"){this.element.children("li").addClass("ui-accordion-li-fix");}
this.headers=this.element.find(o.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){$(this).addClass('ui-state-hover');}).bind("mouseleave.accordion",function(){$(this).removeClass('ui-state-hover');}).bind("focus.accordion",function(){$(this).addClass('ui-state-focus');}).bind("blur.accordion",function(){$(this).removeClass('ui-state-focus');});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");this.active=this._findActive(this.active||o.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass('ui-accordion-content-active');$("<span/>").addClass("ui-icon "+o.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(o.icons.header).toggleClass(o.icons.headerSelected);if($.browser.msie){this.element.find('a').css('zoom','1');}
this.resize();this.element.attr('role','tablist');this.headers.attr('role','tab').bind('keydown',function(event){return self._keydown(event);}).next().attr('role','tabpanel');this.headers.not(this.active||"").attr('aria-expanded','false').attr("tabIndex","-1").next().hide();if(!this.active.length){this.headers.eq(0).attr('tabIndex','0');}else{this.active.attr('aria-expanded','true').attr('tabIndex','0');}
if(!$.browser.safari)
this.headers.find('a').attr('tabIndex','-1');if(o.event){this.headers.bind((o.event)+".accordion",function(event){return self._clickHandler.call(self,event,this);});}},destroy:function(){var o=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind('.accordion').removeData('accordion');this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");this.headers.find("a").removeAttr("tabindex");this.headers.children(".ui-icon").remove();var contents=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(o.autoHeight||o.fillHeight){contents.css("height","");}},_setData:function(key,value){if(key=='alwaysOpen'){key='collapsible';value=!value;}
$.widget.prototype._setData.apply(this,arguments);},_keydown:function(event){var o=this.options,keyCode=$.ui.keyCode;if(o.disabled||event.altKey||event.ctrlKey)
return;var length=this.headers.length;var currentIndex=this.headers.index(event.target);var toFocus=false;switch(event.keyCode){case keyCode.RIGHT:case keyCode.DOWN:toFocus=this.headers[(currentIndex+1)%length];break;case keyCode.LEFT:case keyCode.UP:toFocus=this.headers[(currentIndex-1+length)%length];break;case keyCode.SPACE:case keyCode.ENTER:return this._clickHandler({target:event.target},event.target);}
if(toFocus){$(event.target).attr('tabIndex','-1');$(toFocus).attr('tabIndex','0');toFocus.focus();return false;}
return true;},resize:function(){var o=this.options,maxHeight;if(o.fillSpace){if($.browser.msie){var defOverflow=this.element.parent().css('overflow');this.element.parent().css('overflow','hidden');}
maxHeight=this.element.parent().height();if($.browser.msie){this.element.parent().css('overflow',defOverflow);}
this.headers.each(function(){maxHeight-=$(this).outerHeight();});var maxPadding=0;this.headers.next().each(function(){maxPadding=Math.max(maxPadding,$(this).innerHeight()-$(this).height());}).height(Math.max(0,maxHeight-maxPadding)).css('overflow','auto');}else if(o.autoHeight){maxHeight=0;this.headers.next().each(function(){maxHeight=Math.max(maxHeight,$(this).outerHeight());}).height(maxHeight);}},activate:function(index){var active=this._findActive(index)[0];this._clickHandler({target:active},active);},_findActive:function(selector){return selector?typeof selector=="number"?this.headers.filter(":eq("+selector+")"):this.headers.not(this.headers.not(selector)):selector===false?$([]):this.headers.filter(":eq(0)");},_clickHandler:function(event,target){var o=this.options;if(o.disabled)return false;if(!event.target&&o.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);this.active.next().addClass('ui-accordion-content-active');var toHide=this.active.next(),data={options:o,newHeader:$([]),oldHeader:o.active,newContent:$([]),oldContent:toHide},toShow=(this.active=$([]));this._toggle(toShow,toHide,data);return false;}
var clicked=$(event.currentTarget||target);var clickedIsActive=clicked[0]==this.active[0];if(this.running||(!o.collapsible&&clickedIsActive)){return false;}
this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);this.active.next().addClass('ui-accordion-content-active');if(!clickedIsActive){clicked.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(o.icons.header).addClass(o.icons.headerSelected);clicked.next().addClass('ui-accordion-content-active');}
var toShow=clicked.next(),toHide=this.active.next(),data={options:o,newHeader:clickedIsActive&&o.collapsible?$([]):clicked,oldHeader:this.active,newContent:clickedIsActive&&o.collapsible?$([]):toShow.find('> *'),oldContent:toHide.find('> *')},down=this.headers.index(this.active[0])>this.headers.index(clicked[0]);this.active=clickedIsActive?$([]):clicked;this._toggle(toShow,toHide,data,clickedIsActive,down);return false;},_toggle:function(toShow,toHide,data,clickedIsActive,down){var o=this.options,self=this;this.toShow=toShow;this.toHide=toHide;this.data=data;var complete=function(){if(!self)return;return self._completed.apply(self,arguments);};this._trigger("changestart",null,this.data);this.running=toHide.size()===0?toShow.size():toHide.size();if(o.animated){var animOptions={};if(o.collapsible&&clickedIsActive){animOptions={toShow:$([]),toHide:toHide,complete:complete,down:down,autoHeight:o.autoHeight||o.fillSpace};}else{animOptions={toShow:toShow,toHide:toHide,complete:complete,down:down,autoHeight:o.autoHeight||o.fillSpace};}
if(!o.proxied){o.proxied=o.animated;}
if(!o.proxiedDuration){o.proxiedDuration=o.duration;}
o.animated=$.isFunction(o.proxied)?o.proxied(animOptions):o.proxied;o.duration=$.isFunction(o.proxiedDuration)?o.proxiedDuration(animOptions):o.proxiedDuration;var animations=$.ui.accordion.animations,duration=o.duration,easing=o.animated;if(!animations[easing]){animations[easing]=function(options){this.slide(options,{easing:easing,duration:duration||700});};}
animations[easing](animOptions);}else{if(o.collapsible&&clickedIsActive){toShow.toggle();}else{toHide.hide();toShow.show();}
complete(true);}
toHide.prev().attr('aria-expanded','false').attr("tabIndex","-1").blur();toShow.prev().attr('aria-expanded','true').attr("tabIndex","0").focus();},_completed:function(cancel){var o=this.options;this.running=cancel?0:--this.running;if(this.running)return;if(o.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""});}
this._trigger('change',null,this.data);}});$.extend($.ui.accordion,{version:"1.7.2",defaults:{active:null,alwaysOpen:true,animated:'slide',autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase();}},animations:{slide:function(options,additions){options=$.extend({easing:"swing",duration:300},options,additions);if(!options.toHide.size()){options.toShow.animate({height:"show"},options);return;}
if(!options.toShow.size()){options.toHide.animate({height:"hide"},options);return;}
var overflow=options.toShow.css('overflow'),percentDone,showProps={},hideProps={},fxAttrs=["height","paddingTop","paddingBottom"],originalWidth;var s=options.toShow;originalWidth=s[0].style.width;s.width(parseInt(s.parent().width(),10)-parseInt(s.css("paddingLeft"),10)-parseInt(s.css("paddingRight"),10)-(parseInt(s.css("borderLeftWidth"),10)||0)-(parseInt(s.css("borderRightWidth"),10)||0));$.each(fxAttrs,function(i,prop){hideProps[prop]='hide';var parts=(''+$.css(options.toShow[0],prop)).match(/^([\d+-.]+)(.*)$/);showProps[prop]={value:parts[1],unit:parts[2]||'px'};});options.toShow.css({height:0,overflow:'hidden'}).show();options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate(hideProps,{step:function(now,settings){if(settings.prop=='height'){percentDone=(settings.now-settings.start)/(settings.end-settings.start);}
options.toShow[0].style[settings.prop]=(percentDone*showProps[settings.prop].value)+showProps[settings.prop].unit;},duration:options.duration,easing:options.easing,complete:function(){if(!options.autoHeight){options.toShow.css("height","");}
options.toShow.css("width",originalWidth);options.toShow.css({overflow:overflow});options.complete();}});},bounceslide:function(options){this.slide(options,{easing:options.down?"easeOutBounce":"swing",duration:options.down?1000:200});},easeslide:function(options){this.slide(options,{easing:"easeinout",duration:700});}}});})(jQuery);(function($){var setDataSwitch={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},uiDialogClasses='ui-dialog '+'ui-widget '+'ui-widget-content '+'ui-corner-all ';$.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr('title');var self=this,options=this.options,title=options.title||this.originalTitle||'&nbsp;',titleId=$.ui.dialog.getTitleId(this.element),uiDialog=(this.uiDialog=$('<div/>')).appendTo(document.body).hide().addClass(uiDialogClasses+options.dialogClass).css({position:'absolute',overflow:'hidden',zIndex:options.zIndex}).attr('tabIndex',-1).css('outline',0).keydown(function(event){(options.closeOnEscape&&event.keyCode&&event.keyCode==$.ui.keyCode.ESCAPE&&self.close(event));}).attr({role:'dialog','aria-labelledby':titleId}).mousedown(function(event){self.moveToTop(false,event);}),uiDialogContent=this.element.show().removeAttr('title').addClass('ui-dialog-content '+'ui-widget-content').appendTo(uiDialog),uiDialogTitlebar=(this.uiDialogTitlebar=$('<div></div>')).addClass('ui-dialog-titlebar '+'ui-widget-header '+'ui-corner-all '+'ui-helper-clearfix').prependTo(uiDialog),uiDialogTitlebarClose=$('<a href="#"/>').addClass('ui-dialog-titlebar-close '+'ui-corner-all').attr('role','button').hover(function(){uiDialogTitlebarClose.addClass('ui-state-hover');},function(){uiDialogTitlebarClose.removeClass('ui-state-hover');}).focus(function(){uiDialogTitlebarClose.addClass('ui-state-focus');}).blur(function(){uiDialogTitlebarClose.removeClass('ui-state-focus');}).mousedown(function(ev){ev.stopPropagation();}).click(function(event){self.close(event);return false;}).appendTo(uiDialogTitlebar),uiDialogTitlebarCloseText=(this.uiDialogTitlebarCloseText=$('<span/>')).addClass('ui-icon '+'ui-icon-closethick').text(options.closeText).appendTo(uiDialogTitlebarClose),uiDialogTitle=$('<span/>').addClass('ui-dialog-title').attr('id',titleId).html(title).prependTo(uiDialogTitlebar);uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();(options.draggable&&$.fn.draggable&&this._makeDraggable());(options.resizable&&$.fn.resizable&&this._makeResizable());this._createButtons(options.buttons);this._isOpen=false;(options.bgiframe&&$.fn.bgiframe&&uiDialog.bgiframe());(options.autoOpen&&this.open());},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind('.dialog').removeData('dialog').removeClass('ui-dialog-content ui-widget-content').hide().appendTo('body');this.uiDialog.remove();(this.originalTitle&&this.element.attr('title',this.originalTitle));},close:function(event){var self=this;if(false===self._trigger('beforeclose',event)){return;}
(self.overlay&&self.overlay.destroy());self.uiDialog.unbind('keypress.ui-dialog');(self.options.hide?self.uiDialog.hide(self.options.hide,function(){self._trigger('close',event);}):self.uiDialog.hide()&&self._trigger('close',event));$.ui.dialog.overlay.resize();self._isOpen=false;if(self.options.modal){var maxZ=0;$('.ui-dialog').each(function(){if(this!=self.uiDialog[0]){maxZ=Math.max(maxZ,$(this).css('z-index'));}});$.ui.dialog.maxZ=maxZ;}},isOpen:function(){return this._isOpen;},moveToTop:function(force,event){if((this.options.modal&&!force)||(!this.options.stack&&!this.options.modal)){return this._trigger('focus',event);}
if(this.options.zIndex>$.ui.dialog.maxZ){$.ui.dialog.maxZ=this.options.zIndex;}
(this.overlay&&this.overlay.$el.css('z-index',$.ui.dialog.overlay.maxZ=++$.ui.dialog.maxZ));var saveScroll={scrollTop:this.element.attr('scrollTop'),scrollLeft:this.element.attr('scrollLeft')};this.uiDialog.css('z-index',++$.ui.dialog.maxZ);this.element.attr(saveScroll);this._trigger('focus',event);},open:function(){if(this._isOpen){return;}
var options=this.options,uiDialog=this.uiDialog;this.overlay=options.modal?new $.ui.dialog.overlay(this):null;(uiDialog.next().length&&uiDialog.appendTo('body'));this._size();this._position(options.position);uiDialog.show(options.show);this.moveToTop(true);(options.modal&&uiDialog.bind('keypress.ui-dialog',function(event){if(event.keyCode!=$.ui.keyCode.TAB){return;}
var tabbables=$(':tabbable',this),first=tabbables.filter(':first')[0],last=tabbables.filter(':last')[0];if(event.target==last&&!event.shiftKey){setTimeout(function(){first.focus();},1);}else if(event.target==first&&event.shiftKey){setTimeout(function(){last.focus();},1);}}));$([]).add(uiDialog.find('.ui-dialog-content :tabbable:first')).add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first')).add(uiDialog).filter(':first').focus();this._trigger('open');this._isOpen=true;},_createButtons:function(buttons){var self=this,hasButtons=false,uiDialogButtonPane=$('<div></div>').addClass('ui-dialog-buttonpane '+'ui-widget-content '+'ui-helper-clearfix');this.uiDialog.find('.ui-dialog-buttonpane').remove();(typeof buttons=='object'&&buttons!==null&&$.each(buttons,function(){return!(hasButtons=true);}));if(hasButtons){$.each(buttons,function(name,fn){$('<button type="button"></button>').addClass('ui-state-default '+'ui-corner-all').text(name).click(function(){fn.apply(self.element[0],arguments);}).hover(function(){$(this).addClass('ui-state-hover');},function(){$(this).removeClass('ui-state-hover');}).focus(function(){$(this).addClass('ui-state-focus');}).blur(function(){$(this).removeClass('ui-state-focus');}).appendTo(uiDialogButtonPane);});uiDialogButtonPane.appendTo(this.uiDialog);}},_makeDraggable:function(){var self=this,options=this.options,heightBeforeDrag;this.uiDialog.draggable({cancel:'.ui-dialog-content',handle:'.ui-dialog-titlebar',containment:'document',start:function(){heightBeforeDrag=options.height;$(this).height($(this).height()).addClass("ui-dialog-dragging");(options.dragStart&&options.dragStart.apply(self.element[0],arguments));},drag:function(){(options.drag&&options.drag.apply(self.element[0],arguments));},stop:function(){$(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);(options.dragStop&&options.dragStop.apply(self.element[0],arguments));$.ui.dialog.overlay.resize();}});},_makeResizable:function(handles){handles=(handles===undefined?this.options.resizable:handles);var self=this,options=this.options,resizeHandles=typeof handles=='string'?handles:'n,e,s,w,se,sw,ne,nw';this.uiDialog.resizable({cancel:'.ui-dialog-content',alsoResize:this.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:options.minHeight,start:function(){$(this).addClass("ui-dialog-resizing");(options.resizeStart&&options.resizeStart.apply(self.element[0],arguments));},resize:function(){(options.resize&&options.resize.apply(self.element[0],arguments));},handles:resizeHandles,stop:function(){$(this).removeClass("ui-dialog-resizing");options.height=$(this).height();options.width=$(this).width();(options.resizeStop&&options.resizeStop.apply(self.element[0],arguments));$.ui.dialog.overlay.resize();}}).find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');},_position:function(pos){var wnd=$(window),doc=$(document),pTop=doc.scrollTop(),pLeft=doc.scrollLeft(),minTop=pTop;if($.inArray(pos,['center','top','right','bottom','left'])>=0){pos=[pos=='right'||pos=='left'?pos:'center',pos=='top'||pos=='bottom'?pos:'middle'];}
if(pos.constructor!=Array){pos=['center','middle'];}
if(pos[0].constructor==Number){pLeft+=pos[0];}else{switch(pos[0]){case'left':pLeft+=0;break;case'right':pLeft+=wnd.width()-this.uiDialog.outerWidth();break;default:case'center':pLeft+=(wnd.width()-this.uiDialog.outerWidth())/2;}}
if(pos[1].constructor==Number){pTop+=pos[1];}else{switch(pos[1]){case'top':pTop+=0;break;case'bottom':pTop+=wnd.height()-this.uiDialog.outerHeight();break;default:case'middle':pTop+=(wnd.height()-this.uiDialog.outerHeight())/2;}}
pTop=Math.max(pTop,minTop);this.uiDialog.css({top:pTop,left:pLeft});},_setData:function(key,value){(setDataSwitch[key]&&this.uiDialog.data(setDataSwitch[key],value));switch(key){case"buttons":this._createButtons(value);break;case"closeText":this.uiDialogTitlebarCloseText.text(value);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(uiDialogClasses+value);break;case"draggable":(value?this._makeDraggable():this.uiDialog.draggable('destroy'));break;case"height":this.uiDialog.height(value);break;case"position":this._position(value);break;case"resizable":var uiDialog=this.uiDialog,isResizable=this.uiDialog.is(':data(resizable)');(isResizable&&!value&&uiDialog.resizable('destroy'));(isResizable&&typeof value=='string'&&uiDialog.resizable('option','handles',value));(isResizable||this._makeResizable(value));break;case"title":$(".ui-dialog-title",this.uiDialogTitlebar).html(value||'&nbsp;');break;case"width":this.uiDialog.width(value);break;}
$.widget.prototype._setData.apply(this,arguments);},_size:function(){var options=this.options;this.element.css({height:0,minHeight:0,width:'auto'});var nonContentHeight=this.uiDialog.css({height:'auto',width:options.width}).height();this.element.css({minHeight:Math.max(options.minHeight-nonContentHeight,0),height:options.height=='auto'?'auto':Math.max(options.height-nonContentHeight,0)});}});$.extend($.ui.dialog,{version:"1.7.2",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:'close',dialogClass:'',draggable:true,hide:null,height:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:'center',resizable:true,show:null,stack:true,title:'',width:300,zIndex:1000},getter:'isOpen',uuid:0,maxZ:0,getTitleId:function($el){return'ui-dialog-title-'+($el.attr('id')||++this.uuid);},overlay:function(dialog){this.$el=$.ui.dialog.overlay.create(dialog);}});$.extend($.ui.dialog.overlay,{instances:[],maxZ:0,events:$.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),function(event){return event+'.dialog-overlay';}).join(' '),create:function(dialog){if(this.instances.length===0){setTimeout(function(){if($.ui.dialog.overlay.instances.length){$(document).bind($.ui.dialog.overlay.events,function(event){var dialogZ=$(event.target).parents('.ui-dialog').css('zIndex')||0;return(dialogZ>$.ui.dialog.overlay.maxZ);});}},1);$(document).bind('keydown.dialog-overlay',function(event){(dialog.options.closeOnEscape&&event.keyCode&&event.keyCode==$.ui.keyCode.ESCAPE&&dialog.close(event));});$(window).bind('resize.dialog-overlay',$.ui.dialog.overlay.resize);}
var $el=$('<div></div>').appendTo(document.body).addClass('ui-widget-overlay').css({width:this.width(),height:this.height()});(dialog.options.bgiframe&&$.fn.bgiframe&&$el.bgiframe());this.instances.push($el);return $el;},destroy:function($el){this.instances.splice($.inArray(this.instances,$el),1);if(this.instances.length===0){$([document,window]).unbind('.dialog-overlay');}
$el.remove();var maxZ=0;$.each(this.instances,function(){maxZ=Math.max(maxZ,this.css('z-index'));});this.maxZ=maxZ;},height:function(){if($.browser.msie&&$.browser.version<7){var scrollHeight=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var offsetHeight=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(scrollHeight<offsetHeight){return $(window).height()+'px';}else{return scrollHeight+'px';}}else{return $(document).height()+'px';}},width:function(){if($.browser.msie&&$.browser.version<7){var scrollWidth=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var offsetWidth=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(scrollWidth<offsetWidth){return $(window).width()+'px';}else{return scrollWidth+'px';}}else{return $(document).width()+'px';}},resize:function(){var $overlays=$([]);$.each($.ui.dialog.overlay.instances,function(){$overlays=$overlays.add(this);});$overlays.css({width:0,height:0}).css({width:$.ui.dialog.overlay.width(),height:$.ui.dialog.overlay.height()});}});$.extend($.ui.dialog.overlay.prototype,{destroy:function(){$.ui.dialog.overlay.destroy(this.$el);}});})(jQuery);(function($){$.widget("ui.slider",$.extend({},$.ui.mouse,{_init:function(){var self=this,o=this.options;this._keySliding=false;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider"
+" ui-slider-"+this.orientation
+" ui-widget"
+" ui-widget-content"
+" ui-corner-all");this.range=$([]);if(o.range){if(o.range===true){this.range=$('<div></div>');if(!o.values)o.values=[this._valueMin(),this._valueMin()];if(o.values.length&&o.values.length!=2){o.values=[o.values[0],o.values[0]];}}else{this.range=$('<div></div>');}
this.range.appendTo(this.element).addClass("ui-slider-range");if(o.range=="min"||o.range=="max"){this.range.addClass("ui-slider-range-"+o.range);}
this.range.addClass("ui-widget-header");}
if($(".ui-slider-handle",this.element).length==0)
$('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle");if(o.values&&o.values.length){while($(".ui-slider-handle",this.element).length<o.values.length)
$('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle");}
this.handles=$(".ui-slider-handle",this.element).addClass("ui-state-default"
+" ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(event){event.preventDefault();}).hover(function(){if(!o.disabled){$(this).addClass('ui-state-hover');}},function(){$(this).removeClass('ui-state-hover');}).focus(function(){if(!o.disabled){$(".ui-slider .ui-state-focus").removeClass('ui-state-focus');$(this).addClass('ui-state-focus');}else{$(this).blur();}}).blur(function(){$(this).removeClass('ui-state-focus');});this.handles.each(function(i){$(this).data("index.ui-slider-handle",i);});this.handles.keydown(function(event){var ret=true;var index=$(this).data("index.ui-slider-handle");if(self.options.disabled)
return;switch(event.keyCode){case $.ui.keyCode.HOME:case $.ui.keyCode.END:case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:ret=false;if(!self._keySliding){self._keySliding=true;$(this).addClass("ui-state-active");self._start(event,index);}
break;}
var curVal,newVal,step=self._step();if(self.options.values&&self.options.values.length){curVal=newVal=self.values(index);}else{curVal=newVal=self.value();}
switch(event.keyCode){case $.ui.keyCode.HOME:newVal=self._valueMin();break;case $.ui.keyCode.END:newVal=self._valueMax();break;case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:if(curVal==self._valueMax())return;newVal=curVal+step;break;case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:if(curVal==self._valueMin())return;newVal=curVal-step;break;}
self._slide(event,index,newVal);return ret;}).keyup(function(event){var index=$(this).data("index.ui-slider-handle");if(self._keySliding){self._stop(event,index);self._change(event,index);self._keySliding=false;$(this).removeClass("ui-state-active");}});this._refreshValue();},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider"
+" ui-slider-horizontal"
+" ui-slider-vertical"
+" ui-slider-disabled"
+" ui-widget"
+" ui-widget-content"
+" ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();},_mouseCapture:function(event){var o=this.options;if(o.disabled)
return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var position={x:event.pageX,y:event.pageY};var normValue=this._normValueFromMouse(position);var distance=this._valueMax()-this._valueMin()+1,closestHandle;var self=this,index;this.handles.each(function(i){var thisDistance=Math.abs(normValue-self.values(i));if(distance>thisDistance){distance=thisDistance;closestHandle=$(this);index=i;}});if(o.range==true&&this.values(1)==o.min){closestHandle=$(this.handles[++index]);}
this._start(event,index);self._handleIndex=index;closestHandle.addClass("ui-state-active").focus();var offset=closestHandle.offset();var mouseOverHandle=!$(event.target).parents().andSelf().is('.ui-slider-handle');this._clickOffset=mouseOverHandle?{left:0,top:0}:{left:event.pageX-offset.left-(closestHandle.width()/2),top:event.pageY-offset.top
-(closestHandle.height()/2)
-(parseInt(closestHandle.css('borderTopWidth'),10)||0)
-(parseInt(closestHandle.css('borderBottomWidth'),10)||0)
+(parseInt(closestHandle.css('marginTop'),10)||0)};normValue=this._normValueFromMouse(position);this._slide(event,index,normValue);return true;},_mouseStart:function(event){return true;},_mouseDrag:function(event){var position={x:event.pageX,y:event.pageY};var normValue=this._normValueFromMouse(position);this._slide(event,this._handleIndex,normValue);return false;},_mouseStop:function(event){this.handles.removeClass("ui-state-active");this._stop(event,this._handleIndex);this._change(event,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false;},_detectOrientation:function(){this.orientation=this.options.orientation=='vertical'?'vertical':'horizontal';},_normValueFromMouse:function(position){var pixelTotal,pixelMouse;if('horizontal'==this.orientation){pixelTotal=this.elementSize.width;pixelMouse=position.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0);}else{pixelTotal=this.elementSize.height;pixelMouse=position.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0);}
var percentMouse=(pixelMouse/pixelTotal);if(percentMouse>1)percentMouse=1;if(percentMouse<0)percentMouse=0;if('vertical'==this.orientation)
percentMouse=1-percentMouse;var valueTotal=this._valueMax()-this._valueMin(),valueMouse=percentMouse*valueTotal,valueMouseModStep=valueMouse%this.options.step,normValue=this._valueMin()+valueMouse-valueMouseModStep;if(valueMouseModStep>(this.options.step/2))
normValue+=this.options.step;return parseFloat(normValue.toFixed(5));},_start:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values();}
this._trigger("start",event,uiHash);},_slide:function(event,index,newVal){var handle=this.handles[index];if(this.options.values&&this.options.values.length){var otherVal=this.values(index?0:1);if((this.options.values.length==2&&this.options.range===true)&&((index==0&&newVal>otherVal)||(index==1&&newVal<otherVal))){newVal=otherVal;}
if(newVal!=this.values(index)){var newValues=this.values();newValues[index]=newVal;var allowed=this._trigger("slide",event,{handle:this.handles[index],value:newVal,values:newValues});var otherVal=this.values(index?0:1);if(allowed!==false){this.values(index,newVal,(event.type=='mousedown'&&this.options.animate),true);}}}else{if(newVal!=this.value()){var allowed=this._trigger("slide",event,{handle:this.handles[index],value:newVal});if(allowed!==false){this._setData('value',newVal,(event.type=='mousedown'&&this.options.animate));}}}},_stop:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values();}
this._trigger("stop",event,uiHash);},_change:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values();}
this._trigger("change",event,uiHash);},value:function(newValue){if(arguments.length){this._setData("value",newValue);this._change(null,0);}
return this._value();},values:function(index,newValue,animated,noPropagation){if(arguments.length>1){this.options.values[index]=newValue;this._refreshValue(animated);if(!noPropagation)this._change(null,index);}
if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(index);}else{return this.value();}}else{return this._values();}},_setData:function(key,value,animated){$.widget.prototype._setData.apply(this,arguments);switch(key){case'disabled':if(value){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");}else{this.handles.removeAttr("disabled");}
case'orientation':this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(animated);break;case'value':this._refreshValue(animated);break;}},_step:function(){var step=this.options.step;return step;},_value:function(){var val=this.options.value;if(val<this._valueMin())val=this._valueMin();if(val>this._valueMax())val=this._valueMax();return val;},_values:function(index){if(arguments.length){var val=this.options.values[index];if(val<this._valueMin())val=this._valueMin();if(val>this._valueMax())val=this._valueMax();return val;}else{return this.options.values;}},_valueMin:function(){var valueMin=this.options.min;return valueMin;},_valueMax:function(){var valueMax=this.options.max;return valueMax;},_refreshValue:function(animate){var oRange=this.options.range,o=this.options,self=this;if(this.options.values&&this.options.values.length){var vp0,vp1;this.handles.each(function(i,j){var valPercent=(self.values(i)-self._valueMin())/(self._valueMax()-self._valueMin())*100;var _set={};_set[self.orientation=='horizontal'?'left':'bottom']=valPercent+'%';$(this).stop(1,1)[animate?'animate':'css'](_set,o.animate);if(self.options.range===true){if(self.orientation=='horizontal'){(i==0)&&self.range.stop(1,1)[animate?'animate':'css']({left:valPercent+'%'},o.animate);(i==1)&&self.range[animate?'animate':'css']({width:(valPercent-lastValPercent)+'%'},{queue:false,duration:o.animate});}else{(i==0)&&self.range.stop(1,1)[animate?'animate':'css']({bottom:(valPercent)+'%'},o.animate);(i==1)&&self.range[animate?'animate':'css']({height:(valPercent-lastValPercent)+'%'},{queue:false,duration:o.animate});}}
lastValPercent=valPercent;});}else{var value=this.value(),valueMin=this._valueMin(),valueMax=this._valueMax(),valPercent=valueMax!=valueMin?(value-valueMin)/(valueMax-valueMin)*100:0;var _set={};_set[self.orientation=='horizontal'?'left':'bottom']=valPercent+'%';this.handle.stop(1,1)[animate?'animate':'css'](_set,o.animate);(oRange=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[animate?'animate':'css']({width:valPercent+'%'},o.animate);(oRange=="max")&&(this.orientation=="horizontal")&&this.range[animate?'animate':'css']({width:(100-valPercent)+'%'},{queue:false,duration:o.animate});(oRange=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[animate?'animate':'css']({height:valPercent+'%'},o.animate);(oRange=="max")&&(this.orientation=="vertical")&&this.range[animate?'animate':'css']({height:(100-valPercent)+'%'},{queue:false,duration:o.animate});}}}));$.extend($.ui.slider,{getter:"value values",version:"1.7.2",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:'horizontal',range:false,step:1,value:0,values:null}});})(jQuery);(function($){$.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable;}
this._tabify(true);},_setData:function(key,value){if(key=='selected'){if(this.options.collapsible&&value==this.options.selected){return;}
this.select(value);}
else{this.options[key]=value;if(key=='deselectable'){this.options.collapsible=value;}
this._tabify();}},_tabId:function(a){return a.title&&a.title.replace(/\s/g,'_').replace(/[^A-Za-z0-9\-_:\.]/g,'')||this.options.idPrefix+$.data(a);},_sanitizeSelector:function(hash){return hash.replace(/:/g,'\\:');},_cookie:function(){var cookie=this.cookie||(this.cookie=this.options.cookie.name||'ui-tabs-'+$.data(this.list[0]));return $.cookie.apply(null,[cookie].concat($.makeArray(arguments)));},_ui:function(tab,panel){return{tab:tab,panel:panel,index:this.anchors.index(tab)};},_cleanup:function(){this.lis.filter('.ui-state-processing').removeClass('ui-state-processing').find('span:data(label.tabs)').each(function(){var el=$(this);el.html(el.data('label.tabs')).removeData('label.tabs');});},_tabify:function(init){this.list=this.element.children('ul:first');this.lis=$('li:has(a[href])',this.list);this.anchors=this.lis.map(function(){return $('a',this)[0];});this.panels=$([]);var self=this,o=this.options;var fragmentId=/^#.+/;this.anchors.each(function(i,a){var href=$(a).attr('href');var hrefBase=href.split('#')[0],baseEl;if(hrefBase&&(hrefBase===location.toString().split('#')[0]||(baseEl=$('base')[0])&&hrefBase===baseEl.href)){href=a.hash;a.href=href;}
if(fragmentId.test(href)){self.panels=self.panels.add(self._sanitizeSelector(href));}
else if(href!='#'){$.data(a,'href.tabs',href);$.data(a,'load.tabs',href.replace(/#.*$/,''));var id=self._tabId(a);a.href='#'+id;var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass('ui-tabs-panel ui-widget-content ui-corner-bottom').insertAfter(self.panels[i-1]||self.list);$panel.data('destroy.tabs',true);}
self.panels=self.panels.add($panel);}
else{o.disabled.push(i);}});if(init){this.element.addClass('ui-tabs ui-widget ui-widget-content ui-corner-all');this.list.addClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all');this.lis.addClass('ui-state-default ui-corner-top');this.panels.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom');if(o.selected===undefined){if(location.hash){this.anchors.each(function(i,a){if(a.hash==location.hash){o.selected=i;return false;}});}
if(typeof o.selected!='number'&&o.cookie){o.selected=parseInt(self._cookie(),10);}
if(typeof o.selected!='number'&&this.lis.filter('.ui-tabs-selected').length){o.selected=this.lis.index(this.lis.filter('.ui-tabs-selected'));}
o.selected=o.selected||0;}
else if(o.selected===null){o.selected=-1;}
o.selected=((o.selected>=0&&this.anchors[o.selected])||o.selected<0)?o.selected:0;o.disabled=$.unique(o.disabled.concat($.map(this.lis.filter('.ui-state-disabled'),function(n,i){return self.lis.index(n);}))).sort();if($.inArray(o.selected,o.disabled)!=-1){o.disabled.splice($.inArray(o.selected,o.disabled),1);}
this.panels.addClass('ui-tabs-hide');this.lis.removeClass('ui-tabs-selected ui-state-active');if(o.selected>=0&&this.anchors.length){this.panels.eq(o.selected).removeClass('ui-tabs-hide');this.lis.eq(o.selected).addClass('ui-tabs-selected ui-state-active');self.element.queue("tabs",function(){self._trigger('show',null,self._ui(self.anchors[o.selected],self.panels[o.selected]));});this.load(o.selected);}
$(window).bind('unload',function(){self.lis.add(self.anchors).unbind('.tabs');self.lis=self.anchors=self.panels=null;});}
else{o.selected=this.lis.index(this.lis.filter('.ui-tabs-selected'));}
this.element[o.collapsible?'addClass':'removeClass']('ui-tabs-collapsible');if(o.cookie){this._cookie(o.selected,o.cookie);}
for(var i=0,li;(li=this.lis[i]);i++){$(li)[$.inArray(i,o.disabled)!=-1&&!$(li).hasClass('ui-tabs-selected')?'addClass':'removeClass']('ui-state-disabled');}
if(o.cache===false){this.anchors.removeData('cache.tabs');}
this.lis.add(this.anchors).unbind('.tabs');if(o.event!='mouseover'){var addState=function(state,el){if(el.is(':not(.ui-state-disabled)')){el.addClass('ui-state-'+state);}};var removeState=function(state,el){el.removeClass('ui-state-'+state);};this.lis.bind('mouseover.tabs',function(){addState('hover',$(this));});this.lis.bind('mouseout.tabs',function(){removeState('hover',$(this));});this.anchors.bind('focus.tabs',function(){addState('focus',$(this).closest('li'));});this.anchors.bind('blur.tabs',function(){removeState('focus',$(this).closest('li'));});}
var hideFx,showFx;if(o.fx){if($.isArray(o.fx)){hideFx=o.fx[0];showFx=o.fx[1];}
else{hideFx=showFx=o.fx;}}
function resetStyle($el,fx){$el.css({display:''});if($.browser.msie&&fx.opacity){$el[0].style.removeAttribute('filter');}}
var showTab=showFx?function(clicked,$show){$(clicked).closest('li').removeClass('ui-state-default').addClass('ui-tabs-selected ui-state-active');$show.hide().removeClass('ui-tabs-hide').animate(showFx,showFx.duration||'normal',function(){resetStyle($show,showFx);self._trigger('show',null,self._ui(clicked,$show[0]));});}:function(clicked,$show){$(clicked).closest('li').removeClass('ui-state-default').addClass('ui-tabs-selected ui-state-active');$show.removeClass('ui-tabs-hide');self._trigger('show',null,self._ui(clicked,$show[0]));};var hideTab=hideFx?function(clicked,$hide){$hide.animate(hideFx,hideFx.duration||'normal',function(){self.lis.removeClass('ui-tabs-selected ui-state-active').addClass('ui-state-default');$hide.addClass('ui-tabs-hide');resetStyle($hide,hideFx);self.element.dequeue("tabs");});}:function(clicked,$hide,$show){self.lis.removeClass('ui-tabs-selected ui-state-active').addClass('ui-state-default');$hide.addClass('ui-tabs-hide');self.element.dequeue("tabs");};this.anchors.bind(o.event+'.tabs',function(){var el=this,$li=$(this).closest('li'),$hide=self.panels.filter(':not(.ui-tabs-hide)'),$show=$(self._sanitizeSelector(this.hash));if(($li.hasClass('ui-tabs-selected')&&!o.collapsible)||$li.hasClass('ui-state-disabled')||$li.hasClass('ui-state-processing')||self._trigger('select',null,self._ui(this,$show[0]))===false){this.blur();return false;}
o.selected=self.anchors.index(this);self.abort();if(o.collapsible){if($li.hasClass('ui-tabs-selected')){o.selected=-1;if(o.cookie){self._cookie(o.selected,o.cookie);}
self.element.queue("tabs",function(){hideTab(el,$hide);}).dequeue("tabs");this.blur();return false;}
else if(!$hide.length){if(o.cookie){self._cookie(o.selected,o.cookie);}
self.element.queue("tabs",function(){showTab(el,$show);});self.load(self.anchors.index(this));this.blur();return false;}}
if(o.cookie){self._cookie(o.selected,o.cookie);}
if($show.length){if($hide.length){self.element.queue("tabs",function(){hideTab(el,$hide);});}
self.element.queue("tabs",function(){showTab(el,$show);});self.load(self.anchors.index(this));}
else{throw'jQuery UI Tabs: Mismatching fragment identifier.';}
if($.browser.msie){this.blur();}});this.anchors.bind('click.tabs',function(){return false;});},destroy:function(){var o=this.options;this.abort();this.element.unbind('.tabs').removeClass('ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible').removeData('tabs');this.list.removeClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all');this.anchors.each(function(){var href=$.data(this,'href.tabs');if(href){this.href=href;}
var $this=$(this).unbind('.tabs');$.each(['href','load','cache'],function(i,prefix){$this.removeData(prefix+'.tabs');});});this.lis.unbind('.tabs').add(this.panels).each(function(){if($.data(this,'destroy.tabs')){$(this).remove();}
else{$(this).removeClass(['ui-state-default','ui-corner-top','ui-tabs-selected','ui-state-active','ui-state-hover','ui-state-focus','ui-state-disabled','ui-tabs-panel','ui-widget-content','ui-corner-bottom','ui-tabs-hide'].join(' '));}});if(o.cookie){this._cookie(null,o.cookie);}},add:function(url,label,index){if(index===undefined){index=this.anchors.length;}
var self=this,o=this.options,$li=$(o.tabTemplate.replace(/#\{href\}/g,url).replace(/#\{label\}/g,label)),id=!url.indexOf('#')?url.replace('#',''):this._tabId($('a',$li)[0]);$li.addClass('ui-state-default ui-corner-top').data('destroy.tabs',true);var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).data('destroy.tabs',true);}
$panel.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide');if(index>=this.lis.length){$li.appendTo(this.list);$panel.appendTo(this.list[0].parentNode);}
else{$li.insertBefore(this.lis[index]);$panel.insertBefore(this.panels[index]);}
o.disabled=$.map(o.disabled,function(n,i){return n>=index?++n:n;});this._tabify();if(this.anchors.length==1){$li.addClass('ui-tabs-selected ui-state-active');$panel.removeClass('ui-tabs-hide');this.element.queue("tabs",function(){self._trigger('show',null,self._ui(self.anchors[0],self.panels[0]));});this.load(0);}
this._trigger('add',null,this._ui(this.anchors[index],this.panels[index]));},remove:function(index){var o=this.options,$li=this.lis.eq(index).remove(),$panel=this.panels.eq(index).remove();if($li.hasClass('ui-tabs-selected')&&this.anchors.length>1){this.select(index+(index+1<this.anchors.length?1:-1));}
o.disabled=$.map($.grep(o.disabled,function(n,i){return n!=index;}),function(n,i){return n>=index?--n:n;});this._tabify();this._trigger('remove',null,this._ui($li.find('a')[0],$panel[0]));},enable:function(index){var o=this.options;if($.inArray(index,o.disabled)==-1){return;}
this.lis.eq(index).removeClass('ui-state-disabled');o.disabled=$.grep(o.disabled,function(n,i){return n!=index;});this._trigger('enable',null,this._ui(this.anchors[index],this.panels[index]));},disable:function(index){var self=this,o=this.options;if(index!=o.selected){this.lis.eq(index).addClass('ui-state-disabled');o.disabled.push(index);o.disabled.sort();this._trigger('disable',null,this._ui(this.anchors[index],this.panels[index]));}},select:function(index){if(typeof index=='string'){index=this.anchors.index(this.anchors.filter('[href$='+index+']'));}
else if(index===null){index=-1;}
if(index==-1&&this.options.collapsible){index=this.options.selected;}
this.anchors.eq(index).trigger(this.options.event+'.tabs');},load:function(index){var self=this,o=this.options,a=this.anchors.eq(index)[0],url=$.data(a,'load.tabs');this.abort();if(!url||this.element.queue("tabs").length!==0&&$.data(a,'cache.tabs')){this.element.dequeue("tabs");return;}
this.lis.eq(index).addClass('ui-state-processing');if(o.spinner){var span=$('span',a);span.data('label.tabs',span.html()).html(o.spinner);}
this.xhr=$.ajax($.extend({},o.ajaxOptions,{url:url,success:function(r,s){$(self._sanitizeSelector(a.hash)).html(r);self._cleanup();if(o.cache){$.data(a,'cache.tabs',true);}
self._trigger('load',null,self._ui(self.anchors[index],self.panels[index]));try{o.ajaxOptions.success(r,s);}
catch(e){}
self.element.dequeue("tabs");}}));},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr;}
this._cleanup();},url:function(index,url){this.anchors.eq(index).removeData('cache.tabs').data('load.tabs',url);},length:function(){return this.anchors.length;}});$.extend($.ui.tabs,{version:'1.7.2',getter:'length',defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:'click',fx:null,idPrefix:'ui-tabs-',panelTemplate:'<div></div>',spinner:'<em>Loading&#8230;</em>',tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});$.extend($.ui.tabs.prototype,{rotation:null,rotate:function(ms,continuing){var self=this,o=this.options;var rotate=self._rotate||(self._rotate=function(e){clearTimeout(self.rotation);self.rotation=setTimeout(function(){var t=o.selected;self.select(++t<self.anchors.length?t:0);},ms);if(e){e.stopPropagation();}});var stop=self._unrotate||(self._unrotate=!continuing?function(e){if(e.clientX){self.rotate(null);}}:function(e){t=o.selected;rotate();});if(ms){this.element.bind('tabsshow',rotate);this.anchors.bind(o.event+'.tabs',stop);rotate();}
else{clearTimeout(self.rotation);this.element.unbind('tabsshow',rotate);this.anchors.unbind(o.event+'.tabs',stop);delete this._rotate;delete this._unrotate;}}});})(jQuery);(function($){$.extend($.ui,{datepicker:{version:"1.7.2"}});var PROP_NAME='datepicker';function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId='ui-datepicker-div';this._inlineClass='ui-datepicker-inline';this._appendClass='ui-datepicker-append';this._triggerClass='ui-datepicker-trigger';this._dialogClass='ui-datepicker-dialog';this._disableClass='ui-datepicker-disabled';this._unselectableClass='ui-datepicker-unselectable';this._currentClass='ui-datepicker-current-day';this._dayOverClass='ui-datepicker-days-cell-over';this.regional=[];this.regional['']={closeText:'Done',prevText:'Prev',nextText:'Next',currentText:'Today',monthNames:['January','February','March','April','May','June','July','August','September','October','November','December'],monthNamesShort:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],dayNames:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],dayNamesShort:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],dayNamesMin:['Su','Mo','Tu','We','Th','Fr','Sa'],dateFormat:'mm/dd/yy',firstDay:0,isRTL:false};this._defaults={showOn:'focus',showAnim:'show',showOptions:{},defaultDate:null,appendText:'',buttonText:'...',buttonImage:'',buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,showMonthAfterYear:false,yearRange:'-10:+10',showOtherMonths:false,calculateWeek:this.iso8601Week,shortYearCutoff:'+10',minDate:null,maxDate:null,duration:'normal',beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:'',altFormat:'',constrainInput:true,showButtonPanel:false};$.extend(this._defaults,this.regional['']);this.dpDiv=$('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>');}
$.extend(Datepicker.prototype,{markerClassName:'hasDatepicker',log:function(){if(this.debug)
console.log.apply('',arguments);},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this;},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute('date:'+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue);}catch(err){inlineSettings[attrName]=attrValue;}}}
var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=='div'||nodeName=='span');if(!target.id)
target.id='dp'+(++this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=='input'){this._connectDatepicker(target,inst);}else if(inline){this._inlineDatepicker(target,inst);}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,'\\\\$1');return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))};},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName))
return;var appendText=this._get(inst,'appendText');var isRTL=this._get(inst,'isRTL');if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+'</span>');input[isRTL?'before':'after'](inst.append);}
var showOn=this._get(inst,'showOn');if(showOn=='focus'||showOn=='both')
input.focus(this._showDatepicker);if(showOn=='button'||showOn=='both'){var buttonText=this._get(inst,'buttonText');var buttonImage=this._get(inst,'buttonImage');inst.trigger=$(this._get(inst,'buttonImageOnly')?$('<img/>').addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==''?buttonText:$('<img/>').attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?'before':'after'](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target)
$.datepicker._hideDatepicker();else
$.datepicker._showDatepicker(target);return false;});}
input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value;}).bind("getData.datepicker",function(event,key){return this._get(inst,key);});$.data(target,PROP_NAME,inst);},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName))
return;divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value;}).bind("getData.datepicker",function(event,key){return this._get(inst,key);});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst);},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id='dp'+(++this.uuid);this._dialogInput=$('<input type="text" id="'+id+'" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$('body').append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst);}
extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY];}
this._dialogInput.css('left',this._pos[0]+'px').css('top',this._pos[1]+'px');inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI)
$.blockUI(this.dpDiv);$.data(this._dialogInput[0],PROP_NAME,inst);return this;},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return;}
var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=='input'){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind('focus',this._showDatepicker).unbind('keydown',this._doKeyDown).unbind('keypress',this._doKeyPress);}else if(nodeName=='div'||nodeName=='span')
$target.removeClass(this.markerClassName).empty();},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return;}
var nodeName=target.nodeName.toLowerCase();if(nodeName=='input'){target.disabled=false;inst.trigger.filter('button').each(function(){this.disabled=false;}).end().filter('img').css({opacity:'1.0',cursor:''});}
else if(nodeName=='div'||nodeName=='span'){var inline=$target.children('.'+this._inlineClass);inline.children().removeClass('ui-state-disabled');}
this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value);});},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return;}
var nodeName=target.nodeName.toLowerCase();if(nodeName=='input'){target.disabled=true;inst.trigger.filter('button').each(function(){this.disabled=true;}).end().filter('img').css({opacity:'0.5',cursor:'default'});}
else if(nodeName=='div'||nodeName=='span'){var inline=$target.children('.'+this._inlineClass);inline.children().addClass('ui-state-disabled');}
this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value);});this._disabledInputs[this._disabledInputs.length]=target;},_isDisabledDatepicker:function(target){if(!target){return false;}
for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target)
return true;}
return false;},_getInst:function(target){try{return $.data(target,PROP_NAME);}
catch(err){throw'Missing instance data for this datepicker';}},_optionDatepicker:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=='string'){return(name=='defaults'?$.extend({},$.datepicker._defaults):(inst?(name=='all'?$.extend({},inst.settings):this._get(inst,name)):null));}
var settings=name||{};if(typeof name=='string'){settings={};settings[name]=value;}
if(inst){if(this._curInst==inst){this._hideDatepicker(null);}
var date=this._getDateDatepicker(target);extendRemove(inst.settings,settings);this._setDateDatepicker(target,date);this._updateDatepicker(inst);}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value);},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst);}},_setDateDatepicker:function(target,date,endDate){var inst=this._getInst(target);if(inst){this._setDate(inst,date,endDate);this._updateDatepicker(inst);this._updateAlternate(inst);}},_getDateDatepicker:function(target){var inst=this._getInst(target);if(inst&&!inst.inline)
this._setDateFromField(inst);return(inst?this._getDate(inst):null);},_doKeyDown:function(event){var inst=$.datepicker._getInst(event.target);var handled=true;var isRTL=inst.dpDiv.is('.ui-datepicker-rtl');inst._keyEvent=true;if($.datepicker._datepickerShowing)
switch(event.keyCode){case 9:$.datepicker._hideDatepicker(null,'');break;case 13:var sel=$('td.'+$.datepicker._dayOverClass+', td.'+$.datepicker._currentClass,inst.dpDiv);if(sel[0])
$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0]);else
$.datepicker._hideDatepicker(null,$.datepicker._get(inst,'duration'));return false;break;case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,'duration'));break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,'stepBigMonths'):-$.datepicker._get(inst,'stepMonths')),'M');break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,'stepBigMonths'):+$.datepicker._get(inst,'stepMonths')),'M');break;case 35:if(event.ctrlKey||event.metaKey)$.datepicker._clearDate(event.target);handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey)$.datepicker._gotoToday(event.target);handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey)$.datepicker._adjustDate(event.target,(isRTL?+1:-1),'D');handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey)$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,'stepBigMonths'):-$.datepicker._get(inst,'stepMonths')),'M');break;case 38:if(event.ctrlKey||event.metaKey)$.datepicker._adjustDate(event.target,-7,'D');handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey)$.datepicker._adjustDate(event.target,(isRTL?-1:+1),'D');handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey)$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,'stepBigMonths'):+$.datepicker._get(inst,'stepMonths')),'M');break;case 40:if(event.ctrlKey||event.metaKey)$.datepicker._adjustDate(event.target,+7,'D');handled=event.ctrlKey||event.metaKey;break;default:handled=false;}
else if(event.keyCode==36&&event.ctrlKey)
$.datepicker._showDatepicker(this);else{handled=false;}
if(handled){event.preventDefault();event.stopPropagation();}},_doKeyPress:function(event){var inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,'constrainInput')){var chars=$.datepicker._possibleChars($.datepicker._get(inst,'dateFormat'));var chr=String.fromCharCode(event.charCode==undefined?event.keyCode:event.charCode);return event.ctrlKey||(chr<' '||!chars||chars.indexOf(chr)>-1);}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!='input')
input=$('input',input.parentNode)[0];if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input)
return;var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,'beforeShow');extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,'');$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog)
input.value='';if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight;}
var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css('position')=='fixed';return!isFixed;});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop;}
var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:'absolute',display:'block',top:'-1000px'});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?'static':(isFixed?'fixed':'absolute')),display:'none',left:offset.left+'px',top:offset.top+'px'});if(!inst.inline){var showAnim=$.datepicker._get(inst,'showAnim')||'show';var duration=$.datepicker._get(inst,'duration');var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7)
$('iframe.ui-datepicker-cover').css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4});};if($.effects&&$.effects[showAnim])
inst.dpDiv.show(showAnim,$.datepicker._get(inst,'showOptions'),duration,postProcess);else
inst.dpDiv[showAnim](duration,postProcess);if(duration=='')
postProcess();if(inst.input[0].type!='hidden')
inst.input[0].focus();$.datepicker._curInst=inst;}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find('iframe.ui-datepicker-cover').css({width:dims.width,height:dims.height}).end().find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a').bind('mouseout',function(){$(this).removeClass('ui-state-hover');if(this.className.indexOf('ui-datepicker-prev')!=-1)$(this).removeClass('ui-datepicker-prev-hover');if(this.className.indexOf('ui-datepicker-next')!=-1)$(this).removeClass('ui-datepicker-next-hover');}).bind('mouseover',function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover');$(this).addClass('ui-state-hover');if(this.className.indexOf('ui-datepicker-prev')!=-1)$(this).addClass('ui-datepicker-prev-hover');if(this.className.indexOf('ui-datepicker-next')!=-1)$(this).addClass('ui-datepicker-next-hover');}}).end().find('.'+this._dayOverClass+' a').trigger('mouseover').end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass('ui-datepicker-multi-'+cols).css('width',(width*cols)+'em');}else{inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width('');}
inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?'add':'remove')+'Class']('ui-datepicker-multi');inst.dpDiv[(this._get(inst,'isRTL')?'add':'remove')+'Class']('ui-datepicker-rtl');if(inst.input&&inst.input[0].type!='hidden'&&inst==$.datepicker._curInst)
$(inst.input[0]).focus();},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,'isRTL')?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset;},_findPos:function(obj){while(obj&&(obj.type=='hidden'||obj.nodeType!=1)){obj=obj.nextSibling;}
var position=$(obj).offset();return[position.left,position.top];},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME)))
return;if(inst.stayOpen)
this._selectDate('#'+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,'duration'));var showAnim=this._get(inst,'showAnim');var postProcess=function(){$.datepicker._tidyDialog(inst);};if(duration!=''&&$.effects&&$.effects[showAnim])
inst.dpDiv.hide(showAnim,$.datepicker._get(inst,'showOptions'),duration,postProcess);else
inst.dpDiv[(duration==''?'hide':(showAnim=='slideDown'?'slideUp':(showAnim=='fadeIn'?'fadeOut':'hide')))](duration,postProcess);if(duration=='')
this._tidyDialog(inst);var onClose=this._get(inst,'onClose');if(onClose)
onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():''),inst]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:'absolute',left:'0',top:'-100px'});if($.blockUI){$.unblockUI();$('body').append(this.dpDiv);}}
this._inDialog=false;}
this._curInst=null;},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar');},_checkExternalClick:function(event){if(!$.datepicker._curInst)
return;var $target=$(event.target);if(($target.parents('#'+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI))
$.datepicker._hideDatepicker(null,'');},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return;}
this._adjustInstDate(inst,offset+
(period=='M'?this._get(inst,'showCurrentAtPos'):0),period);this._updateDatepicker(inst);},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,'gotoCurrent')&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear;}
else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();}
this._notifyChange(inst);this._adjustDate(target);},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst['selected'+(period=='M'?'Month':'Year')]=inst['draw'+(period=='M'?'Month':'Year')]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target);},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie)
inst.input[0].focus();inst._selectingMonthYear=!inst._selectingMonthYear;},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return;}
var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$('a',td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null;}
this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst);}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,'');},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input)
inst.input.val(dateStr);this._updateAlternate(inst);var onSelect=this._get(inst,'onSelect');if(onSelect)
onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst]);else if(inst.input)
inst.input.trigger('change');if(inst.inline)
this._updateDatepicker(inst);else if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,'duration'));this._lastInput=inst.input[0];if(typeof(inst.input[0])!='object')
inst.input[0].focus();this._lastInput=null;}},_updateAlternate:function(inst){var altField=this._get(inst,'altField');if(altField){var altFormat=this._get(inst,'altFormat')||this._get(inst,'dateFormat');var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr);});}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),''];},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate);}else if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){return 1;}}
return Math.floor(((checkDate-firstMon)/86400000)/7)+1;},parseDate:function(format,value,settings){if(format==null||value==null)
throw'Invalid arguments';value=(typeof value=='object'?value.toString():value+'');if(value=='')
return null;var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches)
iFormat++;return matches;};var getNumber=function(match){lookAhead(match);var origSize=(match=='@'?14:(match=='y'?4:(match=='o'?3:2)));var size=origSize;var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>='0'&&value.charAt(iValue)<='9'){num=num*10+parseInt(value.charAt(iValue++),10);size--;}
if(size==origSize)
throw'Missing number at position '+iValue;return num;};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++)
size=Math.max(size,names[j].length);var name='';var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++)
if(name==names[i])
return i+1;size--;}
throw'Unknown name at position '+iInit;};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat))
throw'Unexpected literal at position '+iValue;iValue++;};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal)
if(format.charAt(iFormat)=="'"&&!lookAhead("'"))
literal=false;else
checkLiteral();else
switch(format.charAt(iFormat)){case'd':day=getNumber('d');break;case'D':getName('D',dayNamesShort,dayNames);break;case'o':doy=getNumber('o');break;case'm':month=getNumber('m');break;case'M':month=getName('M',monthNamesShort,monthNames);break;case'y':year=getNumber('y');break;case'@':var date=new Date(getNumber('@'));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'"))
checkLiteral();else
literal=true;break;default:checkLiteral();}}
if(year==-1)
year=new Date().getFullYear();else if(year<100)
year+=new Date().getFullYear()-new Date().getFullYear()%100+
(year<=shortYearCutoff?0:-100);if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim)
break;month++;day-=dim;}while(true);}
var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day)
throw'Invalid date';return date;},ATOM:'yy-mm-dd',COOKIE:'D, dd M yy',ISO_8601:'yy-mm-dd',RFC_822:'D, d M y',RFC_850:'DD, dd-M-y',RFC_1036:'D, d M y',RFC_1123:'D, d M yy',RFC_2822:'D, d M yy',RSS:'D, d M y',TIMESTAMP:'@',W3C:'yy-mm-dd',formatDate:function(format,date,settings){if(!date)
return'';var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches)
iFormat++;return matches;};var formatNumber=function(match,value,len){var num=''+value;if(lookAhead(match))
while(num.length<len)
num='0'+num;return num;};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value]);};var output='';var literal=false;if(date)
for(var iFormat=0;iFormat<format.length;iFormat++){if(literal)
if(format.charAt(iFormat)=="'"&&!lookAhead("'"))
literal=false;else
output+=format.charAt(iFormat);else
switch(format.charAt(iFormat)){case'd':output+=formatNumber('d',date.getDate(),2);break;case'D':output+=formatName('D',date.getDay(),dayNamesShort,dayNames);break;case'o':var doy=date.getDate();for(var m=date.getMonth()-1;m>=0;m--)
doy+=this._getDaysInMonth(date.getFullYear(),m);output+=formatNumber('o',doy,3);break;case'm':output+=formatNumber('m',date.getMonth()+1,2);break;case'M':output+=formatName('M',date.getMonth(),monthNamesShort,monthNames);break;case'y':output+=(lookAhead('y')?date.getFullYear():(date.getYear()%100<10?'0':'')+date.getYear()%100);break;case'@':output+=date.getTime();break;case"'":if(lookAhead("'"))
output+="'";else
literal=true;break;default:output+=format.charAt(iFormat);}}
return output;},_possibleChars:function(format){var chars='';var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++)
if(literal)
if(format.charAt(iFormat)=="'"&&!lookAhead("'"))
literal=false;else
chars+=format.charAt(iFormat);else
switch(format.charAt(iFormat)){case'd':case'm':case'y':case'@':chars+='0123456789';break;case'D':case'M':return null;case"'":if(lookAhead("'"))
chars+="'";else
literal=true;break;default:chars+=format.charAt(iFormat);}
return chars;},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name];},_setDateFromField:function(inst){var dateFormat=this._get(inst,'dateFormat');var dates=inst.input?inst.input.val():null;inst.endDay=inst.endMonth=inst.endYear=null;var date=defaultDate=this._getDefaultDate(inst);var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate;}catch(event){this.log(event);date=defaultDate;}
inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst);},_getDefaultDate:function(inst){var date=this._determineDate(this._get(inst,'defaultDate'),new Date());var minDate=this._getMinMaxDate(inst,'min',true);var maxDate=this._getMinMaxDate(inst,'max');date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date;},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date;};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||'d'){case'd':case'D':day+=parseInt(matches[1],10);break;case'w':case'W':day+=parseInt(matches[1],10)*7;break;case'm':case'M':month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case'y':case'Y':year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;}
matches=pattern.exec(offset);}
return new Date(year,month,day);};date=(date==null?defaultDate:(typeof date=='string'?offsetString(date,this._getDaysInMonth):(typeof date=='number'?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=='Invalid Date'?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0);}
return this._daylightSavingAdjust(date);},_daylightSavingAdjust:function(date){if(!date)return null;date.setHours(date.getHours()>12?date.getHours()+2:0);return date;},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear)
this._notifyChange(inst);this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?'':this._formatDate(inst));}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=='')?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate;},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,'isRTL');var showButtonPanel=this._get(inst,'showButtonPanel');var hideIfNoPrevNext=this._get(inst,'hideIfNoPrevNext');var navigationAsDateFormat=this._get(inst,'navigationAsDateFormat');var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,'showCurrentAtPos');var stepMonths=this._get(inst,'stepMonths');var stepBigMonths=this._get(inst,'stepBigMonths');var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,'min',true);var maxDate=this._getMinMaxDate(inst,'max');var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--;}
if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--;}}}
inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,'prevText');prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+'\', -'+stepMonths+', \'M\');"'+' title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?'e':'w')+'">'+prevText+'</span></a>':(hideIfNoPrevNext?'':'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?'e':'w')+'">'+prevText+'</span></a>'));var nextText=this._get(inst,'nextText');nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+'\', +'+stepMonths+', \'M\');"'+' title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?'w':'e')+'">'+nextText+'</span></a>':(hideIfNoPrevNext?'':'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?'w':'e')+'">'+nextText+'</span></a>'));var currentText=this._get(inst,'currentText');var gotoDate=(this._get(inst,'gotoCurrent')&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">'+this._get(inst,'closeText')+'</button>':'');var buttonPanel=(showButtonPanel)?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(isRTL?controls:'')+
(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#'+inst.id+'\');"'+'>'+currentText+'</button>':'')+(isRTL?'':controls)+'</div>':'';var firstDay=parseInt(this._get(inst,'firstDay'),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,'dayNames');var dayNamesShort=this._get(inst,'dayNamesShort');var dayNamesMin=this._get(inst,'dayNamesMin');var monthNames=this._get(inst,'monthNames');var monthNamesShort=this._get(inst,'monthNamesShort');var beforeShowDay=this._get(inst,'beforeShowDay');var showOtherMonths=this._get(inst,'showOtherMonths');var calculateWeek=this._get(inst,'calculateWeek')||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html='';for(var row=0;row<numMonths[0];row++){var group='';for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));var cornerClass=' ui-corner-all';var calender='';if(isMultiMonth){calender+='<div class="ui-datepicker-group ui-datepicker-group-';switch(col){case 0:calender+='first';cornerClass=' ui-corner-'+(isRTL?'right':'left');break;case numMonths[1]-1:calender+='last';cornerClass=' ui-corner-'+(isRTL?'left':'right');break;default:calender+='middle';cornerClass='';break;}
calender+='">';}
calender+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+cornerClass+'">'+
(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):'')+
(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):'')+
this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead>'+'<tr>';var thead='';for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+='<th'+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':'')+'>'+'<span title="'+dayNames[day]+'">'+dayNamesMin[day]+'</span></th>';}
calender+=thead+'</tr></thead><tbody>';var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth)
inst.selectedDay=Math.min(inst.selectedDay,daysInMonth);var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){calender+='<tr>';var tbody='';for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,'']);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+='<td class="'+
((dow+firstDay+6)%7>=5?' ui-datepicker-week-end':'')+
(otherMonth?' ui-datepicker-other-month':'')+
((printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==selectedDate.getTime())?' '+this._dayOverClass:'')+
(unselectable?' '+this._unselectableClass+' ui-state-disabled':'')+
(otherMonth&&!showOtherMonths?'':' '+daySettings[1]+
(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?' '+this._currentClass:'')+
(printDate.getTime()==today.getTime()?' ui-datepicker-today':''))+'"'+
((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':'')+
(unselectable?'':' onclick="DP_jQuery.datepicker._selectDay(\'#'+
inst.id+'\','+drawMonth+','+drawYear+', this);return false;"')+'>'+
(otherMonth?(showOtherMonths?printDate.getDate():'&#xa0;'):(unselectable?'<span class="ui-state-default">'+printDate.getDate()+'</span>':'<a class="ui-state-default'+
(printDate.getTime()==today.getTime()?' ui-state-highlight':'')+
(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?' ui-state-active':'')+'" href="#">'+printDate.getDate()+'</a>'))+'</td>';printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate);}
calender+=tbody+'</tr>';}
drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++;}
calender+='</tbody></table>'+(isMultiMonth?'</div>'+
((numMonths[0]>0&&col==numMonths[1]-1)?'<div class="ui-datepicker-row-break"></div>':''):'');group+=calender;}
html+=group;}
html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':'');inst._keyEvent=false;return html;},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var changeMonth=this._get(inst,'changeMonth');var changeYear=this._get(inst,'changeYear');var showMonthAfterYear=this._get(inst,'showMonthAfterYear');var html='<div class="ui-datepicker-title">';var monthHtml='';if(secondary||!changeMonth)
monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+'</span> ';else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-month" '+'onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+'\', this, \'M\');" '+'onclick="DP_jQuery.datepicker._clickMonthYear(\'#'+inst.id+'\');"'+'>';for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth()))
monthHtml+='<option value="'+month+'"'+
(month==drawMonth?' selected="selected"':'')+'>'+monthNamesShort[month]+'</option>';}
monthHtml+='</select>';}
if(!showMonthAfterYear)
html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?'&#xa0;':'');if(secondary||!changeYear)
html+='<span class="ui-datepicker-year">'+drawYear+'</span>';else{var years=this._get(inst,'yearRange').split(':');var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10;}else if(years[0].charAt(0)=='+'||years[0].charAt(0)=='-'){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10);}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10);}
year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-year" '+'onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+'\', this, \'Y\');" '+'onclick="DP_jQuery.datepicker._clickMonthYear(\'#'+inst.id+'\');"'+'>';for(;year<=endYear;year++){html+='<option value="'+year+'"'+
(year==drawYear?' selected="selected"':'')+'>'+year+'</option>';}
html+='</select>';}
if(showMonthAfterYear)
html+=(secondary||changeMonth||changeYear?'&#xa0;':'')+monthHtml;html+='</div>';return html;},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=='Y'?offset:0);var month=inst.drawMonth+(period=='M'?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+
(period=='D'?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,'min',true);var maxDate=this._getMinMaxDate(inst,'max');date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=='M'||period=='Y')
this._notifyChange(inst);},_notifyChange:function(inst){var onChange=this._get(inst,'onChangeMonthYear');if(onChange)
onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst]);},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,'numberOfMonths');return(numMonths==null?[1,1]:(typeof numMonths=='number'?[1,numMonths]:numMonths));},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+'Date'),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date));},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate();},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay();},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0)
date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()));return this._isInRange(inst,date);},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate(inst,'min');var maxDate=this._getMinMaxDate(inst,'max');return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate));},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,'shortYearCutoff');shortYearCutoff=(typeof shortYearCutoff!='string'?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,'dayNamesShort'),dayNames:this._get(inst,'dayNames'),monthNamesShort:this._get(inst,'monthNamesShort'),monthNames:this._get(inst,'monthNames')};},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear;}
var date=(day?(typeof day=='object'?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,'dateFormat'),date,this._getFormatConfig(inst));}});function extendRemove(target,props){$.extend(target,props);for(var name in props)
if(props[name]==null||props[name]==undefined)
target[name]=props[name];return target;};function isArray(a){return(a&&(($.browser.safari&&typeof a=='object'&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))));};$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find('body').append($.datepicker.dpDiv);$.datepicker.initialized=true;}
var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=='string'&&(options=='isDisabled'||options=='getDate'))
return $.datepicker['_'+options+'Datepicker'].apply($.datepicker,[this[0]].concat(otherArgs));if(options=='option'&&arguments.length==2&&typeof arguments[1]=='string')
return $.datepicker['_'+options+'Datepicker'].apply($.datepicker,[this[0]].concat(otherArgs));return this.each(function(){typeof options=='string'?$.datepicker['_'+options+'Datepicker'].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options);});};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.2";window.DP_jQuery=$;})(jQuery);(function($){$.widget("ui.progressbar",{_init:function(){this.element.addClass("ui-progressbar"
+" ui-widget"
+" ui-widget-content"
+" ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=$('<div class="ui-progressbar-value ui-widget-header ui-corner-left"></div>').appendTo(this.element);this._refreshValue();},destroy:function(){this.element.removeClass("ui-progressbar"
+" ui-widget"
+" ui-widget-content"
+" ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeData("progressbar").unbind(".progressbar");this.valueDiv.remove();$.widget.prototype.destroy.apply(this,arguments);},value:function(newValue){if(newValue===undefined){return this._value();}
this._setData('value',newValue);return this;},_setData:function(key,value){switch(key){case'value':this.options.value=value;this._refreshValue();this._trigger('change',null,{});break;}
$.widget.prototype._setData.apply(this,arguments);},_value:function(){var val=this.options.value;if(val<this._valueMin())val=this._valueMin();if(val>this._valueMax())val=this._valueMax();return val;},_valueMin:function(){var valueMin=0;return valueMin;},_valueMax:function(){var valueMax=100;return valueMax;},_refreshValue:function(){var value=this.value();this.valueDiv[value==this._valueMax()?'addClass':'removeClass']("ui-corner-right");this.valueDiv.width(value+'%');this.element.attr("aria-valuenow",value);}});$.extend($.ui.progressbar,{version:"1.7.2",defaults:{value:0}});})(jQuery);;jQuery.effects||(function($){$.effects={version:"1.7.2",save:function(element,set){for(var i=0;i<set.length;i++){if(set[i]!==null)element.data("ec.storage."+set[i],element[0].style[set[i]]);}},restore:function(element,set){for(var i=0;i<set.length;i++){if(set[i]!==null)element.css(set[i],element.data("ec.storage."+set[i]));}},setMode:function(el,mode){if(mode=='toggle')mode=el.is(':hidden')?'show':'hide';return mode;},getBaseline:function(origin,original){var y,x;switch(origin[0]){case'top':y=0;break;case'middle':y=0.5;break;case'bottom':y=1;break;default:y=origin[0]/original.height;};switch(origin[1]){case'left':x=0;break;case'center':x=0.5;break;case'right':x=1;break;default:x=origin[1]/original.width;};return{x:x,y:y};},createWrapper:function(element){if(element.parent().is('.ui-effects-wrapper'))
return element.parent();var props={width:element.outerWidth(true),height:element.outerHeight(true),'float':element.css('float')};element.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var wrapper=element.parent();if(element.css('position')=='static'){wrapper.css({position:'relative'});element.css({position:'relative'});}else{var top=element.css('top');if(isNaN(parseInt(top,10)))top='auto';var left=element.css('left');if(isNaN(parseInt(left,10)))left='auto';wrapper.css({position:element.css('position'),top:top,left:left,zIndex:element.css('z-index')}).show();element.css({position:'relative',top:0,left:0});}
wrapper.css(props);return wrapper;},removeWrapper:function(element){if(element.parent().is('.ui-effects-wrapper'))
return element.parent().replaceWith(element);return element;},setTransition:function(element,list,factor,value){value=value||{};$.each(list,function(i,x){unit=element.cssUnit(x);if(unit[0]>0)value[x]=unit[0]*factor+unit[1];});return value;},animateClass:function(value,duration,easing,callback){var cb=(typeof easing=="function"?easing:(callback?callback:null));var ea=(typeof easing=="string"?easing:null);return this.each(function(){var offset={};var that=$(this);var oldStyleAttr=that.attr("style")||'';if(typeof oldStyleAttr=='object')oldStyleAttr=oldStyleAttr["cssText"];if(value.toggle){that.hasClass(value.toggle)?value.remove=value.toggle:value.add=value.toggle;}
var oldStyle=$.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(value.add)that.addClass(value.add);if(value.remove)that.removeClass(value.remove);var newStyle=$.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(value.add)that.removeClass(value.add);if(value.remove)that.addClass(value.remove);for(var n in newStyle){if(typeof newStyle[n]!="function"&&newStyle[n]&&n.indexOf("Moz")==-1&&n.indexOf("length")==-1&&newStyle[n]!=oldStyle[n]&&(n.match(/color/i)||(!n.match(/color/i)&&!isNaN(parseInt(newStyle[n],10))))&&(oldStyle.position!="static"||(oldStyle.position=="static"&&!n.match(/left|top|bottom|right/))))offset[n]=newStyle[n];}
that.animate(offset,duration,ea,function(){if(typeof $(this).attr("style")=='object'){$(this).attr("style")["cssText"]="";$(this).attr("style")["cssText"]=oldStyleAttr;}else $(this).attr("style",oldStyleAttr);if(value.add)$(this).addClass(value.add);if(value.remove)$(this).removeClass(value.remove);if(cb)cb.apply(this,arguments);});});}};function _normalizeArguments(a,m){var o=a[1]&&a[1].constructor==Object?a[1]:{};if(m)o.mode=m;var speed=a[1]&&a[1].constructor!=Object?a[1]:(o.duration?o.duration:a[2]);speed=$.fx.off?0:typeof speed==="number"?speed:$.fx.speeds[speed]||$.fx.speeds._default;var callback=o.callback||($.isFunction(a[1])&&a[1])||($.isFunction(a[2])&&a[2])||($.isFunction(a[3])&&a[3]);return[a[0],o,speed,callback];}
$.fn.extend({_show:$.fn.show,_hide:$.fn.hide,__toggle:$.fn.toggle,_addClass:$.fn.addClass,_removeClass:$.fn.removeClass,_toggleClass:$.fn.toggleClass,effect:function(fx,options,speed,callback){return $.effects[fx]?$.effects[fx].call(this,{method:fx,options:options||{},duration:speed,callback:callback}):null;},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0])))
return this._show.apply(this,arguments);else{return this.effect.apply(this,_normalizeArguments(arguments,'show'));}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0])))
return this._hide.apply(this,arguments);else{return this.effect.apply(this,_normalizeArguments(arguments,'hide'));}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||($.isFunction(arguments[0])||typeof arguments[0]=='boolean')){return this.__toggle.apply(this,arguments);}else{return this.effect.apply(this,_normalizeArguments(arguments,'toggle'));}},addClass:function(classNames,speed,easing,callback){return speed?$.effects.animateClass.apply(this,[{add:classNames},speed,easing,callback]):this._addClass(classNames);},removeClass:function(classNames,speed,easing,callback){return speed?$.effects.animateClass.apply(this,[{remove:classNames},speed,easing,callback]):this._removeClass(classNames);},toggleClass:function(classNames,speed,easing,callback){return((typeof speed!=="boolean")&&speed)?$.effects.animateClass.apply(this,[{toggle:classNames},speed,easing,callback]):this._toggleClass(classNames,speed);},morph:function(remove,add,speed,easing,callback){return $.effects.animateClass.apply(this,[{add:add,remove:remove},speed,easing,callback]);},switchClass:function(){return this.morph.apply(this,arguments);},cssUnit:function(key){var style=this.css(key),val=[];$.each(['em','px','%','pt'],function(i,unit){if(style.indexOf(unit)>0)
val=[parseFloat(style),unit];});return val;}});$.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,attr){$.fx.step[attr]=function(fx){if(fx.state==0){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end);}
fx.elem.style[attr]="rgb("+[Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0],10),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1],10),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2],10),255),0)].join(",")+")";};});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3)
return color;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
return[parseInt(result[1],10),parseInt(result[2],10),parseInt(result[3],10)];if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)];if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)];if(result=/rgba\(0, 0, 0, 0\)/.exec(color))
return colors['transparent'];return colors[$.trim(color).toLowerCase()];}
function getColor(elem,attr){var color;do{color=$.curCSS(elem,attr);if(color!=''&&color!='transparent'||$.nodeName(elem,"body"))
break;attr="backgroundColor";}while(elem=elem.parentNode);return getRGB(color);};var colors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};$.easing.jswing=$.easing.swing;$.extend($.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return $.easing[$.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-$.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return $.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return $.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});})(jQuery);(function($){$.effects.blind=function(o){return this.queue(function(){var el=$(this),props=['position','top','left'];var mode=$.effects.setMode(el,o.options.mode||'hide');var direction=o.options.direction||'vertical';$.effects.save(el,props);el.show();var wrapper=$.effects.createWrapper(el).css({overflow:'hidden'});var ref=(direction=='vertical')?'height':'width';var distance=(direction=='vertical')?wrapper.height():wrapper.width();if(mode=='show')wrapper.css(ref,0);var animation={};animation[ref]=mode=='show'?distance:0;wrapper.animate(animation,o.duration,o.options.easing,function(){if(mode=='hide')el.hide();$.effects.restore(el,props);$.effects.removeWrapper(el);if(o.callback)o.callback.apply(el[0],arguments);el.dequeue();});});};})(jQuery);(function($){$.effects.bounce=function(o){return this.queue(function(){var el=$(this),props=['position','top','left'];var mode=$.effects.setMode(el,o.options.mode||'effect');var direction=o.options.direction||'up';var distance=o.options.distance||20;var times=o.options.times||5;var speed=o.duration||250;if(/show|hide/.test(mode))props.push('opacity');$.effects.save(el,props);el.show();$.effects.createWrapper(el);var ref=(direction=='up'||direction=='down')?'top':'left';var motion=(direction=='up'||direction=='left')?'pos':'neg';var distance=o.options.distance||(ref=='top'?el.outerHeight({margin:true})/3:el.outerWidth({margin:true})/3);if(mode=='show')el.css('opacity',0).css(ref,motion=='pos'?-distance:distance);if(mode=='hide')distance=distance/(times*2);if(mode!='hide')times--;if(mode=='show'){var animation={opacity:1};animation[ref]=(motion=='pos'?'+=':'-=')+distance;el.animate(animation,speed/2,o.options.easing);distance=distance/2;times--;};for(var i=0;i<times;i++){var animation1={},animation2={};animation1[ref]=(motion=='pos'?'-=':'+=')+distance;animation2[ref]=(motion=='pos'?'+=':'-=')+distance;el.animate(animation1,speed/2,o.options.easing).animate(animation2,speed/2,o.options.easing);distance=(mode=='hide')?distance*2:distance/2;};if(mode=='hide'){var animation={opacity:0};animation[ref]=(motion=='pos'?'-=':'+=')+distance;el.animate(animation,speed/2,o.options.easing,function(){el.hide();$.effects.restore(el,props);$.effects.removeWrapper(el);if(o.callback)o.callback.apply(this,arguments);});}else{var animation1={},animation2={};animation1[ref]=(motion=='pos'?'-=':'+=')+distance;animation2[ref]=(motion=='pos'?'+=':'-=')+distance;el.animate(animation1,speed/2,o.options.easing).animate(animation2,speed/2,o.options.easing,function(){$.effects.restore(el,props);$.effects.removeWrapper(el);if(o.callback)o.callback.apply(this,arguments);});};el.queue('fx',function(){el.dequeue();});el.dequeue();});};})(jQuery);(function($){$.effects.clip=function(o){return this.queue(function(){var el=$(this),props=['position','top','left','height','width'];var mode=$.effects.setMode(el,o.options.mode||'hide');var direction=o.options.direction||'vertical';$.effects.save(el,props);el.show();var wrapper=$.effects.createWrapper(el).css({overflow:'hidden'});var animate=el[0].tagName=='IMG'?wrapper:el;var ref={size:(direction=='vertical')?'height':'width',position:(direction=='vertical')?'top':'left'};var distance=(direction=='vertical')?animate.height():animate.width();if(mode=='show'){animate.css(ref.size,0);animate.css(ref.position,distance/2);}
var animation={};animation[ref.size]=mode=='show'?distance:0;animation[ref.position]=mode=='show'?0:distance/2;animate.animate(animation,{queue:false,duration:o.duration,easing:o.options.easing,complete:function(){if(mode=='hide')el.hide();$.effects.restore(el,props);$.effects.removeWrapper(el);if(o.callback)o.callback.apply(el[0],arguments);el.dequeue();}});});};})(jQuery);(function($){$.effects.drop=function(o){return this.queue(function(){var el=$(this),props=['position','top','left','opacity'];var mode=$.effects.setMode(el,o.options.mode||'hide');var direction=o.options.direction||'left';$.effects.save(el,props);el.show();$.effects.createWrapper(el);var ref=(direction=='up'||direction=='down')?'top':'left';var motion=(direction=='up'||direction=='left')?'pos':'neg';var distance=o.options.distance||(ref=='top'?el.outerHeight({margin:true})/2:el.outerWidth({margin:true})/2);if(mode=='show')el.css('opacity',0).css(ref,motion=='pos'?-distance:distance);var animation={opacity:mode=='show'?1:0};animation[ref]=(mode=='show'?(motion=='pos'?'+=':'-='):(motion=='pos'?'-=':'+='))+distance;el.animate(animation,{queue:false,duration:o.duration,easing:o.options.easing,complete:function(){if(mode=='hide')el.hide();$.effects.restore(el,props);$.effects.removeWrapper(el);if(o.callback)o.callback.apply(this,arguments);el.dequeue();}});});};})(jQuery);(function($){$.effects.explode=function(o){return this.queue(function(){var rows=o.options.pieces?Math.round(Math.sqrt(o.options.pieces)):3;var cells=o.options.pieces?Math.round(Math.sqrt(o.options.pieces)):3;o.options.mode=o.options.mode=='toggle'?($(this).is(':visible')?'hide':'show'):o.options.mode;var el=$(this).show().css('visibility','hidden');var offset=el.offset();offset.top-=parseInt(el.css("marginTop"),10)||0;offset.left-=parseInt(el.css("marginLeft"),10)||0;var width=el.outerWidth(true);var height=el.outerHeight(true);for(var i=0;i<rows;i++){for(var j=0;j<cells;j++){el.clone().appendTo('body').wrap('<div></div>').css({position:'absolute',visibility:'visible',left:-j*(width/cells),top:-i*(height/rows)}).parent().addClass('ui-effects-explode').css({position:'absolute',overflow:'hidden',width:width/cells,height:height/rows,left:offset.left+j*(width/cells)+(o.options.mode=='show'?(j-Math.floor(cells/2))*(width/cells):0),top:offset.top+i*(height/rows)+(o.options.mode=='show'?(i-Math.floor(rows/2))*(height/rows):0),opacity:o.options.mode=='show'?0:1}).animate({left:offset.left+j*(width/cells)+(o.options.mode=='show'?0:(j-Math.floor(cells/2))*(width/cells)),top:offset.top+i*(height/rows)+(o.options.mode=='show'?0:(i-Math.floor(rows/2))*(height/rows)),opacity:o.options.mode=='show'?1:0},o.duration||500);}}
setTimeout(function(){o.options.mode=='show'?el.css({visibility:'visible'}):el.css({visibility:'visible'}).hide();if(o.callback)o.callback.apply(el[0]);el.dequeue();$('div.ui-effects-explode').remove();},o.duration||500);});};})(jQuery);(function($){$.effects.fold=function(o){return this.queue(function(){var el=$(this),props=['position','top','left'];var mode=$.effects.setMode(el,o.options.mode||'hide');var size=o.options.size||15;var horizFirst=!(!o.options.horizFirst);var duration=o.duration?o.duration/2:$.fx.speeds._default/2;$.effects.save(el,props);el.show();var wrapper=$.effects.createWrapper(el).css({overflow:'hidden'});var widthFirst=((mode=='show')!=horizFirst);var ref=widthFirst?['width','height']:['height','width'];var distance=widthFirst?[wrapper.width(),wrapper.height()]:[wrapper.height(),wrapper.width()];var percent=/([0-9]+)%/.exec(size);if(percent)size=parseInt(percent[1],10)/100*distance[mode=='hide'?0:1];if(mode=='show')wrapper.css(horizFirst?{height:0,width:size}:{height:size,width:0});var animation1={},animation2={};animation1[ref[0]]=mode=='show'?distance[0]:size;animation2[ref[1]]=mode=='show'?distance[1]:0;wrapper.animate(animation1,duration,o.options.easing).animate(animation2,duration,o.options.easing,function(){if(mode=='hide')el.hide();$.effects.restore(el,props);$.effects.removeWrapper(el);if(o.callback)o.callback.apply(el[0],arguments);el.dequeue();});});};})(jQuery);(function($){$.effects.highlight=function(o){return this.queue(function(){var el=$(this),props=['backgroundImage','backgroundColor','opacity'];var mode=$.effects.setMode(el,o.options.mode||'show');var color=o.options.color||"#ffff99";var oldColor=el.css("backgroundColor");$.effects.save(el,props);el.show();el.css({backgroundImage:'none',backgroundColor:color});var animation={backgroundColor:oldColor};if(mode=="hide")animation['opacity']=0;el.animate(animation,{queue:false,duration:o.duration,easing:o.options.easing,complete:function(){if(mode=="hide")el.hide();$.effects.restore(el,props);if(mode=="show"&&$.browser.msie)this.style.removeAttribute('filter');if(o.callback)o.callback.apply(this,arguments);el.dequeue();}});});};})(jQuery);(function($){$.effects.pulsate=function(o){return this.queue(function(){var el=$(this);var mode=$.effects.setMode(el,o.options.mode||'show');var times=o.options.times||5;var duration=o.duration?o.duration/2:$.fx.speeds._default/2;if(mode=='hide')times--;if(el.is(':hidden')){el.css('opacity',0);el.show();el.animate({opacity:1},duration,o.options.easing);times=times-2;}
for(var i=0;i<times;i++){el.animate({opacity:0},duration,o.options.easing).animate({opacity:1},duration,o.options.easing);};if(mode=='hide'){el.animate({opacity:0},duration,o.options.easing,function(){el.hide();if(o.callback)o.callback.apply(this,arguments);});}else{el.animate({opacity:0},duration,o.options.easing).animate({opacity:1},duration,o.options.easing,function(){if(o.callback)o.callback.apply(this,arguments);});};el.queue('fx',function(){el.dequeue();});el.dequeue();});};})(jQuery);(function($){$.effects.puff=function(o){return this.queue(function(){var el=$(this);var options=$.extend(true,{},o.options);var mode=$.effects.setMode(el,o.options.mode||'hide');var percent=parseInt(o.options.percent,10)||150;options.fade=true;var original={height:el.height(),width:el.width()};var factor=percent/100;el.from=(mode=='hide')?original:{height:original.height*factor,width:original.width*factor};options.from=el.from;options.percent=(mode=='hide')?percent:100;options.mode=mode;el.effect('scale',options,o.duration,o.callback);el.dequeue();});};$.effects.scale=function(o){return this.queue(function(){var el=$(this);var options=$.extend(true,{},o.options);var mode=$.effects.setMode(el,o.options.mode||'effect');var percent=parseInt(o.options.percent,10)||(parseInt(o.options.percent,10)==0?0:(mode=='hide'?0:100));var direction=o.options.direction||'both';var origin=o.options.origin;if(mode!='effect'){options.origin=origin||['middle','center'];options.restore=true;}
var original={height:el.height(),width:el.width()};el.from=o.options.from||(mode=='show'?{height:0,width:0}:original);var factor={y:direction!='horizontal'?(percent/100):1,x:direction!='vertical'?(percent/100):1};el.to={height:original.height*factor.y,width:original.width*factor.x};if(o.options.fade){if(mode=='show'){el.from.opacity=0;el.to.opacity=1;};if(mode=='hide'){el.from.opacity=1;el.to.opacity=0;};};options.from=el.from;options.to=el.to;options.mode=mode;el.effect('size',options,o.duration,o.callback);el.dequeue();});};$.effects.size=function(o){return this.queue(function(){var el=$(this),props=['position','top','left','width','height','overflow','opacity'];var props1=['position','top','left','overflow','opacity'];var props2=['width','height','overflow'];var cProps=['fontSize'];var vProps=['borderTopWidth','borderBottomWidth','paddingTop','paddingBottom'];var hProps=['borderLeftWidth','borderRightWidth','paddingLeft','paddingRight'];var mode=$.effects.setMode(el,o.options.mode||'effect');var restore=o.options.restore||false;var scale=o.options.scale||'both';var origin=o.options.origin;var original={height:el.height(),width:el.width()};el.from=o.options.from||original;el.to=o.options.to||original;if(origin){var baseline=$.effects.getBaseline(origin,original);el.from.top=(original.height-el.from.height)*baseline.y;el.from.left=(original.width-el.from.width)*baseline.x;el.to.top=(original.height-el.to.height)*baseline.y;el.to.left=(original.width-el.to.width)*baseline.x;};var factor={from:{y:el.from.height/original.height,x:el.from.width/original.width},to:{y:el.to.height/original.height,x:el.to.width/original.width}};if(scale=='box'||scale=='both'){if(factor.from.y!=factor.to.y){props=props.concat(vProps);el.from=$.effects.setTransition(el,vProps,factor.from.y,el.from);el.to=$.effects.setTransition(el,vProps,factor.to.y,el.to);};if(factor.from.x!=factor.to.x){props=props.concat(hProps);el.from=$.effects.setTransition(el,hProps,factor.from.x,el.from);el.to=$.effects.setTransition(el,hProps,factor.to.x,el.to);};};if(scale=='content'||scale=='both'){if(factor.from.y!=factor.to.y){props=props.concat(cProps);el.from=$.effects.setTransition(el,cProps,factor.from.y,el.from);el.to=$.effects.setTransition(el,cProps,factor.to.y,el.to);};};$.effects.save(el,restore?props:props1);el.show();$.effects.createWrapper(el);el.css('overflow','hidden').css(el.from);if(scale=='content'||scale=='both'){vProps=vProps.concat(['marginTop','marginBottom']).concat(cProps);hProps=hProps.concat(['marginLeft','marginRight']);props2=props.concat(vProps).concat(hProps);el.find("*[width]").each(function(){child=$(this);if(restore)$.effects.save(child,props2);var c_original={height:child.height(),width:child.width()};child.from={height:c_original.height*factor.from.y,width:c_original.width*factor.from.x};child.to={height:c_original.height*factor.to.y,width:c_original.width*factor.to.x};if(factor.from.y!=factor.to.y){child.from=$.effects.setTransition(child,vProps,factor.from.y,child.from);child.to=$.effects.setTransition(child,vProps,factor.to.y,child.to);};if(factor.from.x!=factor.to.x){child.from=$.effects.setTransition(child,hProps,factor.from.x,child.from);child.to=$.effects.setTransition(child,hProps,factor.to.x,child.to);};child.css(child.from);child.animate(child.to,o.duration,o.options.easing,function(){if(restore)$.effects.restore(child,props2);});});};el.animate(el.to,{queue:false,duration:o.duration,easing:o.options.easing,complete:function(){if(mode=='hide')el.hide();$.effects.restore(el,restore?props:props1);$.effects.removeWrapper(el);if(o.callback)o.callback.apply(this,arguments);el.dequeue();}});});};})(jQuery);(function($){$.effects.shake=function(o){return this.queue(function(){var el=$(this),props=['position','top','left'];var mode=$.effects.setMode(el,o.options.mode||'effect');var direction=o.options.direction||'left';var distance=o.options.distance||20;var times=o.options.times||3;var speed=o.duration||o.options.duration||140;$.effects.save(el,props);el.show();$.effects.createWrapper(el);var ref=(direction=='up'||direction=='down')?'top':'left';var motion=(direction=='up'||direction=='left')?'pos':'neg';var animation={},animation1={},animation2={};animation[ref]=(motion=='pos'?'-=':'+=')+distance;animation1[ref]=(motion=='pos'?'+=':'-=')+distance*2;animation2[ref]=(motion=='pos'?'-=':'+=')+distance*2;el.animate(animation,speed,o.options.easing);for(var i=1;i<times;i++){el.animate(animation1,speed,o.options.easing).animate(animation2,speed,o.options.easing);};el.animate(animation1,speed,o.options.easing).animate(animation,speed/2,o.options.easing,function(){$.effects.restore(el,props);$.effects.removeWrapper(el);if(o.callback)o.callback.apply(this,arguments);});el.queue('fx',function(){el.dequeue();});el.dequeue();});};})(jQuery);(function($){$.effects.slide=function(o){return this.queue(function(){var el=$(this),props=['position','top','left'];var mode=$.effects.setMode(el,o.options.mode||'show');var direction=o.options.direction||'left';$.effects.save(el,props);el.show();$.effects.createWrapper(el).css({overflow:'hidden'});var ref=(direction=='up'||direction=='down')?'top':'left';var motion=(direction=='up'||direction=='left')?'pos':'neg';var distance=o.options.distance||(ref=='top'?el.outerHeight({margin:true}):el.outerWidth({margin:true}));if(mode=='show')el.css(ref,motion=='pos'?-distance:distance);var animation={};animation[ref]=(mode=='show'?(motion=='pos'?'+=':'-='):(motion=='pos'?'-=':'+='))+distance;el.animate(animation,{queue:false,duration:o.duration,easing:o.options.easing,complete:function(){if(mode=='hide')el.hide();$.effects.restore(el,props);$.effects.removeWrapper(el);if(o.callback)o.callback.apply(this,arguments);el.dequeue();}});});};})(jQuery);(function($){$.effects.transfer=function(o){return this.queue(function(){var elem=$(this),target=$(o.options.to),endPosition=target.offset(),animation={top:endPosition.top,left:endPosition.left,height:target.innerHeight(),width:target.innerWidth()},startPosition=elem.offset(),transfer=$('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(o.options.className).css({top:startPosition.top,left:startPosition.left,height:elem.innerHeight(),width:elem.innerWidth(),position:'absolute'}).animate(animation,o.duration,o.options.easing,function(){transfer.remove();(o.callback&&o.callback.apply(elem[0],arguments));elem.dequeue();});});};})(jQuery);var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return}f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return}if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return}}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return}var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return}var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return}AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();(function($){$.dimensions={version:'@VERSION'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr);};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.is(':visible')?this[0]['offset'+name]:num(this,name.toLowerCase())
+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')
+num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0);};});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val;}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name];};});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}
return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static'))
offsetParent=offsetParent.offsetParent;return $(offsetParent);}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;};})(jQuery);(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+
(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)
this.insertBefore(document.createElement(html),this.firstChild);});}
return this;};})(jQuery);(function($){var Range=function(x1,y1,x2,y2){this.x1=x1;this.x2=x2;this.y1=y1;this.y2=y2;};Range.prototype.contains=function(range){return(this.x1<=range.x1&&range.x2<=this.x2)&&(this.y1<=range.y1&&range.y2<=this.y2);};Range.prototype.transform=function(x,y){return new Range(this.x1+x,this.y1+y,this.x2+x,this.y2+y);};$.fn.positionBy=function(args){var date1=new Date();if(this.length==0){return this;}
var args=$.extend({target:null,targetPos:null,elementPos:null,x:null,y:null,positions:null,addClass:false,force:false,container:window,hideAfterPosition:false},args);if(args.x!=null){var tLeft=args.x;var tTop=args.y;var tWidth=0;var tHeight=0;}else{var $target=$($(args.target)[0]);var tWidth=$target.outerWidth();var tHeight=$target.outerHeight();var tOffset=$target.offset();var tLeft=tOffset.left;var tTop=tOffset.top;}
var tRight=tLeft+tWidth;var tBottom=tTop+tHeight;return this.each(function(){var $element=$(this);if(!$element.is(':visible')){$element.css({left:-3000,top:-3000}).show();}
var eWidth=$element.outerWidth();var eHeight=$element.outerHeight();var position=[];var next=[];position[0]=new Range(tRight,tTop,tRight+eWidth,tTop+eHeight);next[0]=[1,7,4];position[1]=new Range(tRight,tBottom-eHeight,tRight+eWidth,tBottom);next[1]=[0,6,4];position[2]=new Range(tRight,tBottom,tRight+eWidth,tBottom+eHeight);next[2]=[1,3,10];position[3]=new Range(tRight-eWidth,tBottom,tRight,tBottom+eHeight);next[3]=[1,6,10];position[4]=new Range(tLeft,tBottom,tLeft+eWidth,tBottom+eHeight);next[4]=[1,6,9];position[5]=new Range(tLeft-eWidth,tBottom,tLeft,tBottom+eHeight);next[5]=[6,4,9];position[6]=new Range(tLeft-eWidth,tBottom-eHeight,tLeft,tBottom);next[6]=[7,1,4];position[7]=new Range(tLeft-eWidth,tTop,tLeft,tTop+eHeight);next[7]=[6,0,4];position[8]=new Range(tLeft-eWidth,tTop-eHeight,tLeft,tTop);next[8]=[7,9,4];position[9]=new Range(tLeft,tTop-eHeight,tLeft+eWidth,tTop);next[9]=[0,7,4];position[10]=new Range(tRight-eWidth,tTop-eHeight,tRight,tTop);next[10]=[0,7,3];position[11]=new Range(tRight,tTop-eHeight,tRight+eWidth,tTop);next[11]=[0,10,3];position[12]=new Range(tRight-eWidth,tTop,tRight,tTop+eHeight);next[12]=[13,7,10];position[13]=new Range(tRight-eWidth,tBottom-eHeight,tRight,tBottom);next[13]=[12,6,3];position[14]=new Range(tLeft,tBottom-eHeight,tLeft+eWidth,tBottom);next[14]=[15,1,4];position[15]=new Range(tLeft,tTop,tLeft+eWidth,tTop+eHeight);next[15]=[14,0,9];if(args.positions!==null){var pos=args.positions[0];}else if(args.targetPos!=null&&args.elementPos!=null){var pos=[];pos[0]=[];pos[0][0]=15;pos[0][1]=7;pos[0][2]=8;pos[0][3]=9;pos[1]=[];pos[1][0]=0;pos[1][1]=12;pos[1][2]=10;pos[1][3]=11;pos[2]=[];pos[2][0]=2;pos[2][1]=3;pos[2][2]=13;pos[2][3]=1;pos[3]=[];pos[3][0]=4;pos[3][1]=5;pos[3][2]=6;pos[3][3]=14;var pos=pos[args.targetPos][args.elementPos];}
var ePos=position[pos];var fPos=pos;if(!args.force){$window=$(window);var sx=$window.scrollLeft();var sy=$window.scrollTop();var container=new Range(sx,sy,sx+$window.width(),sy+$window.height());var stack;if(args.positions){stack=args.positions;}else{stack=[pos];}
var test=[];while(stack.length>0){var p=stack.shift();if(test[p]){continue;}
test[p]=true;if(!container.contains(position[p])){if(args.positions===null){stack=jQuery.merge(stack,next[p]);}}else{ePos=position[p];break;}}}
$element.parents().each(function(){var $this=$(this);if($this.css('position')!='static'){var abs=$this.offset();ePos=ePos.transform(-abs.left,-abs.top);return false;}});var css={left:ePos.x1,top:ePos.y1};if(args.hideAfterPosition){css['display']='none';}
$element.css(css);if(args.addClass){$element.removeClass('positionBy0 positionBy1 positionBy2 positionBy3 positionBy4 positionBy5 '
+'positionBy6 positionBy7 positionBy8 positionBy9 positionBy10 positionBy11 '
+'positionBy12 positionBy13 positionBy14 positionBy15').addClass('positionBy'+p);}});};})(jQuery);eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(9($){$.1v.C=9(o){z 4.1b(9(){3p r(4,o)})};8 q={Z:F,25:1,21:1,u:7,1c:3,15:7,1K:\'2X\',2c:\'2Q\',1q:0,B:7,1j:7,1G:7,2F:7,2B:7,2z:7,2x:7,2v:7,2s:7,2p:7,1S:\'<P></P>\',1Q:\'<P></P>\',2m:\'2l\',2k:\'2l\',1O:7,1L:7};$.C=9(e,o){4.5=$.16({},q,o||{});4.Q=F;4.D=7;4.H=7;4.t=7;4.U=7;4.R=7;4.N=!4.5.Z?\'1H\':\'26\';4.E=!4.5.Z?\'24\':\'23\';8 a=\'\',1e=e.K.1e(\' \');1r(8 i=0;i<1e.I;i++){6(1e[i].2y(\'C-2w\')!=-1){$(e).1E(1e[i]);8 a=1e[i];1p}}6(e.2t==\'3o\'||e.2t==\'3n\'){4.t=$(e);4.D=4.t.19();6(4.D.1o(\'C-H\')){6(!4.D.19().1o(\'C-D\'))4.D=4.D.B(\'<P></P>\');4.D=4.D.19()}10 6(!4.D.1o(\'C-D\'))4.D=4.t.B(\'<P></P>\').19()}10{4.D=$(e);4.t=$(e).3h(\'>2o,>2n,P>2o,P>2n\')}6(a!=\'\'&&4.D.19()[0].K.2y(\'C-2w\')==-1)4.D.B(\'<P 3g=" \'+a+\'"></P>\');4.H=4.t.19();6(!4.H.I||!4.H.1o(\'C-H\'))4.H=4.t.B(\'<P></P>\').19();4.R=$(\'.C-11\',4.D);6(4.R.u()==0&&4.5.1Q!=7)4.R=4.H.1z(4.5.1Q).11();4.R.V(4.K(\'C-11\'));4.U=$(\'.C-17\',4.D);6(4.U.u()==0&&4.5.1S!=7)4.U=4.H.1z(4.5.1S).11();4.U.V(4.K(\'C-17\'));4.H.V(4.K(\'C-H\'));4.t.V(4.K(\'C-t\'));4.D.V(4.K(\'C-D\'));8 b=4.5.15!=7?1k.1P(4.1m()/4.5.15):7;8 c=4.t.32(\'1F\');8 d=4;6(c.u()>0){8 f=0,i=4.5.21;c.1b(9(){d.1I(4,i++);f+=d.S(4,b)});4.t.y(4.N,f+\'T\');6(!o||o.u===J)4.5.u=c.u()}4.D.y(\'1y\',\'1A\');4.U.y(\'1y\',\'1A\');4.R.y(\'1y\',\'1A\');4.2G=9(){d.17()};4.2b=9(){d.11()};4.1U=9(){d.2q()};6(4.5.1j!=7)4.5.1j(4,\'2a\');6($.2A.28){4.1f(F,F);$(27).1u(\'2I\',9(){d.1t()})}10 4.1t()};8 r=$.C;r.1v=r.2H={C:\'0.2.3\'};r.1v.16=r.16=$.16;r.1v.16({1t:9(){4.A=7;4.G=7;4.X=7;4.13=7;4.14=F;4.1d=7;4.O=7;4.W=F;6(4.Q)z;4.t.y(4.E,4.1s(4.5.21)+\'T\');8 p=4.1s(4.5.25);4.X=4.13=7;4.1i(p,F);$(27).22(\'2E\',4.1U).1u(\'2E\',4.1U)},2D:9(){4.t.2C();4.t.y(4.E,\'3u\');4.t.y(4.N,\'3t\');6(4.5.1j!=7)4.5.1j(4,\'2D\');4.1t()},2q:9(){6(4.O!=7&&4.W)4.t.y(4.E,r.M(4.t.y(4.E))+4.O);4.O=7;4.W=F;6(4.5.1G!=7)4.5.1G(4);6(4.5.15!=7){8 a=4;8 b=1k.1P(4.1m()/4.5.15),N=0,E=0;$(\'1F\',4.t).1b(9(i){N+=a.S(4,b);6(i+1<a.A)E=N});4.t.y(4.N,N+\'T\');4.t.y(4.E,-E+\'T\')}4.1c(4.A,F)},3s:9(){4.Q=1h;4.1f()},3r:9(){4.Q=F;4.1f()},u:9(s){6(s!=J){4.5.u=s;6(!4.Q)4.1f()}z 4.5.u},3q:9(i,a){6(a==J||!a)a=i;6(4.5.u!==7&&a>4.5.u)a=4.5.u;1r(8 j=i;j<=a;j++){8 e=4.L(j);6(!e.I||e.1o(\'C-1a-1D\'))z F}z 1h},L:9(i){z $(\'.C-1a-\'+i,4.t)},2u:9(i,s){8 e=4.L(i),20=0,2u=0;6(e.I==0){8 c,e=4.1B(i),j=r.M(i);1n(c=4.L(--j)){6(j<=0||c.I){j<=0?4.t.2r(e):c.1X(e);1p}}}10 20=4.S(e);e.1E(4.K(\'C-1a-1D\'));1R s==\'3l\'?e.3k(s):e.2C().3j(s);8 a=4.5.15!=7?1k.1P(4.1m()/4.5.15):7;8 b=4.S(e,a)-20;6(i>0&&i<4.A)4.t.y(4.E,r.M(4.t.y(4.E))-b+\'T\');4.t.y(4.N,r.M(4.t.y(4.N))+b+\'T\');z e},1V:9(i){8 e=4.L(i);6(!e.I||(i>=4.A&&i<=4.G))z;8 d=4.S(e);6(i<4.A)4.t.y(4.E,r.M(4.t.y(4.E))+d+\'T\');e.1V();4.t.y(4.N,r.M(4.t.y(4.N))-d+\'T\')},17:9(){4.1C();6(4.O!=7&&!4.W)4.1T(F);10 4.1c(((4.5.B==\'1Z\'||4.5.B==\'G\')&&4.5.u!=7&&4.G==4.5.u)?1:4.A+4.5.1c)},11:9(){4.1C();6(4.O!=7&&4.W)4.1T(1h);10 4.1c(((4.5.B==\'1Z\'||4.5.B==\'A\')&&4.5.u!=7&&4.A==1)?4.5.u:4.A-4.5.1c)},1T:9(b){6(4.Q||4.14||!4.O)z;8 a=r.M(4.t.y(4.E));!b?a-=4.O:a+=4.O;4.W=!b;4.X=4.A;4.13=4.G;4.1i(a)},1c:9(i,a){6(4.Q||4.14)z;4.1i(4.1s(i),a)},1s:9(i){6(4.Q||4.14)z;6(4.5.B!=\'18\')i=i<1?1:(4.5.u&&i>4.5.u?4.5.u:i);8 a=4.A>i;8 b=r.M(4.t.y(4.E));8 f=4.5.B!=\'18\'&&4.A<=1?1:4.A;8 c=a?4.L(f):4.L(4.G);8 j=a?f:f-1;8 e=7,l=0,p=F,d=0;1n(a?--j>=i:++j<i){e=4.L(j);p=!e.I;6(e.I==0){e=4.1B(j).V(4.K(\'C-1a-1D\'));c[a?\'1z\':\'1X\'](e)}c=e;d=4.S(e);6(p)l+=d;6(4.A!=7&&(4.5.B==\'18\'||(j>=1&&(4.5.u==7||j<=4.5.u))))b=a?b+d:b-d}8 g=4.1m();8 h=[];8 k=0,j=i,v=0;8 c=4.L(i-1);1n(++k){e=4.L(j);p=!e.I;6(e.I==0){e=4.1B(j).V(4.K(\'C-1a-1D\'));c.I==0?4.t.2r(e):c[a?\'1z\':\'1X\'](e)}c=e;8 d=4.S(e);6(d==0){3f(\'3e: 3d 1H/26 3c 1r 3b. 3a 39 38 37 36 35. 34...\');z 0}6(4.5.B!=\'18\'&&4.5.u!==7&&j>4.5.u)h.33(e);10 6(p)l+=d;v+=d;6(v>=g)1p;j++}1r(8 x=0;x<h.I;x++)h[x].1V();6(l>0){4.t.y(4.N,4.S(4.t)+l+\'T\');6(a){b-=l;4.t.y(4.E,r.M(4.t.y(4.E))-l+\'T\')}}8 n=i+k-1;6(4.5.B!=\'18\'&&4.5.u&&n>4.5.u)n=4.5.u;6(j>n){k=0,j=n,v=0;1n(++k){8 e=4.L(j--);6(!e.I)1p;v+=4.S(e);6(v>=g)1p}}8 o=n-k+1;6(4.5.B!=\'18\'&&o<1)o=1;6(4.W&&a){b+=4.O;4.W=F}4.O=7;6(4.5.B!=\'18\'&&n==4.5.u&&(n-k+1)>=1){8 m=r.Y(4.L(n),!4.5.Z?\'1l\':\'1N\');6((v-m)>g)4.O=v-g-m}1n(i-->o)b+=4.S(4.L(i));4.X=4.A;4.13=4.G;4.A=o;4.G=n;z b},1i:9(p,a){6(4.Q||4.14)z;4.14=1h;8 b=4;8 c=9(){b.14=F;6(p==0)b.t.y(b.E,0);6(b.5.B==\'1Z\'||b.5.B==\'G\'||b.5.u==7||b.G<b.5.u)b.2j();b.1f();b.1M(\'2i\')};4.1M(\'31\');6(!4.5.1K||a==F){4.t.y(4.E,p+\'T\');c()}10{8 o=!4.5.Z?{\'24\':p}:{\'23\':p};4.t.1i(o,4.5.1K,4.5.2c,c)}},2j:9(s){6(s!=J)4.5.1q=s;6(4.5.1q==0)z 4.1C();6(4.1d!=7)z;8 a=4;4.1d=30(9(){a.17()},4.5.1q*2Z)},1C:9(){6(4.1d==7)z;2Y(4.1d);4.1d=7},1f:9(n,p){6(n==J||n==7){8 n=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!=\'A\')||4.5.u==7||4.G<4.5.u);6(!4.Q&&(!4.5.B||4.5.B==\'A\')&&4.5.u!=7&&4.G>=4.5.u)n=4.O!=7&&!4.W}6(p==J||p==7){8 p=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!=\'G\')||4.A>1);6(!4.Q&&(!4.5.B||4.5.B==\'G\')&&4.5.u!=7&&4.A==1)p=4.O!=7&&4.W}8 a=4;4.U[n?\'1u\':\'22\'](4.5.2m,4.2G)[n?\'1E\':\'V\'](4.K(\'C-17-1w\')).1J(\'1w\',n?F:1h);4.R[p?\'1u\':\'22\'](4.5.2k,4.2b)[p?\'1E\':\'V\'](4.K(\'C-11-1w\')).1J(\'1w\',p?F:1h);6(4.U.I>0&&(4.U[0].1g==J||4.U[0].1g!=n)&&4.5.1O!=7){4.U.1b(9(){a.5.1O(a,4,n)});4.U[0].1g=n}6(4.R.I>0&&(4.R[0].1g==J||4.R[0].1g!=p)&&4.5.1L!=7){4.R.1b(9(){a.5.1L(a,4,p)});4.R[0].1g=p}},1M:9(a){8 b=4.X==7?\'2a\':(4.X<4.A?\'17\':\'11\');4.12(\'2F\',a,b);6(4.X!==4.A){4.12(\'2B\',a,b,4.A);4.12(\'2z\',a,b,4.X)}6(4.13!==4.G){4.12(\'2x\',a,b,4.G);4.12(\'2v\',a,b,4.13)}4.12(\'2s\',a,b,4.A,4.G,4.X,4.13);4.12(\'2p\',a,b,4.X,4.13,4.A,4.G)},12:9(a,b,c,d,e,f,g){6(4.5[a]==J||(1R 4.5[a]!=\'2h\'&&b!=\'2i\'))z;8 h=1R 4.5[a]==\'2h\'?4.5[a][b]:4.5[a];6(!$.2W(h))z;8 j=4;6(d===J)h(j,c,b);10 6(e===J)4.L(d).1b(9(){h(j,4,d,c,b)});10{1r(8 i=d;i<=e;i++)6(i!==7&&!(i>=f&&i<=g))4.L(i).1b(9(){h(j,4,i,c,b)})}},1B:9(i){z 4.1I(\'<1F></1F>\',i)},1I:9(e,i){8 a=$(e).V(4.K(\'C-1a\')).V(4.K(\'C-1a-\'+i));a.1J(\'2V\',i);z a},K:9(c){z c+\' \'+c+(!4.5.Z?\'-2U\':\'-Z\')},S:9(e,d){8 a=e.2g!=J?e[0]:e;8 b=!4.5.Z?a.1x+r.Y(a,\'2f\')+r.Y(a,\'1l\'):a.2e+r.Y(a,\'2d\')+r.Y(a,\'1N\');6(d==J||b==d)z b;8 w=!4.5.Z?d-r.Y(a,\'2f\')-r.Y(a,\'1l\'):d-r.Y(a,\'2d\')-r.Y(a,\'1N\');$(a).y(4.N,w+\'T\');z 4.S(a)},1m:9(){z!4.5.Z?4.H[0].1x-r.M(4.H.y(\'2T\'))-r.M(4.H.y(\'2S\')):4.H[0].2e-r.M(4.H.y(\'2R\'))-r.M(4.H.y(\'3i\'))},2P:9(i,s){6(s==J)s=4.5.u;z 1k.2O((((i-1)/s)-1k.2N((i-1)/s))*s)+1}});r.16({3m:9(d){z $.16(q,d||{})},Y:9(e,p){6(!e)z 0;8 a=e.2g!=J?e[0]:e;6(p==\'1l\'&&$.2A.28){8 b={\'1y\':\'1A\',\'2M\':\'2L\',\'1H\':\'1q\'},1Y,1W;$.29(a,b,9(){1Y=a.1x});b[\'1l\']=0;$.29(a,b,9(){1W=a.1x});z 1W-1Y}z r.M($.y(a,p))},M:9(v){v=2K(v);z 2J(v)?0:v}})})(3v);',62,218,'||||this|options|if|null|var|function||||||||||||||||||||list|size||||css|return|first|wrap|jcarousel|container|lt|false|last|clip|length|undefined|className|get|intval|wh|tail|div|locked|buttonPrev|dimension|px|buttonNext|addClass|inTail|prevFirst|margin|vertical|else|prev|callback|prevLast|animating|visible|extend|next|circular|parent|item|each|scroll|timer|split|buttons|jcarouselstate|true|animate|initCallback|Math|marginRight|clipping|while|hasClass|break|auto|for|pos|setup|bind|fn|disabled|offsetWidth|display|before|block|create|stopAuto|placeholder|removeClass|li|reloadCallback|width|format|attr|animation|buttonPrevCallback|notify|marginBottom|buttonNextCallback|ceil|buttonPrevHTML|typeof|buttonNextHTML|scrollTail|funcResize|remove|oWidth2|after|oWidth|both|old|offset|unbind|top|left|start|height|window|safari|swap|init|funcPrev|easing|marginTop|offsetHeight|marginLeft|jquery|object|onAfterAnimation|startAuto|buttonPrevEvent|click|buttonNextEvent|ol|ul|itemVisibleOutCallback|reload|prepend|itemVisibleInCallback|nodeName|add|itemLastOutCallback|skin|itemLastInCallback|indexOf|itemFirstOutCallback|browser|itemFirstInCallback|empty|reset|resize|itemLoadCallback|funcNext|prototype|load|isNaN|parseInt|none|float|floor|round|index|swing|borderTopWidth|borderRightWidth|borderLeftWidth|horizontal|jcarouselindex|isFunction|normal|clearTimeout|1000|setTimeout|onBeforeAnimation|children|push|Aborting|loop|infinite|an|cause|will|This|items|set|No|jCarousel|alert|class|find|borderBottomWidth|append|html|string|defaults|OL|UL|new|has|unlock|lock|10px|0px|jQuery'.split('|'),0,{}));window.animateClassCache={};window.animateToClassPattern=/(design.css|animate_.*)/;(function($)
{$.fn.extend({animateToClass:function(to,duration,easing,callback)
{if(!to){return this;}
styles=selectStyle(to);if(!styles)return this;return this.animate(styles,duration,easing,callback);},animateToClassInFile:function(inFile,to,duration,easing,callback)
{if(inFile==undefined)inFile=window.animateToClassPattern;if(!to){return this;}
styles=selectStyle(to);if(!styles)return this;return this.animate(styles,duration,easing,callback);}});function selectStyle(sel,inFile)
{if(sel.substr(0,1)!="."){sel="."+sel;}
if(animateClassCache[sel]!=undefined){attrClass=animateClassCache[sel];}else{for(var cont=0;cont<document.styleSheets.length;cont++)
{v=document.styleSheets[cont];if(inFile==undefined||v.href.search(inFile)!=-1){attrClass=selectAttr(sel,v);animateClassCache[sel]=attrClass;}
if(attrClass!=false){break;}}}
if(!attrClass)attrClass=Array();objStyle={}
if(attrClass=="")return false;if(attrClass.match(";"))attrClass=attrClass.split(";");else attrClass=[attrClass];$(attrClass).each(function(i,v)
{if(v!="")
{v=v.split(":");v[0]=toCamelCase(v[0]);objStyle[v[0]]=$.trim(v[1]);}});return objStyle;}
function selectAttr(sel,v)
{attrClass=false;var importResult=false;if($.browser.msie)
{if(v.rules.length>0)
{$(v.rules).each(function(i2,v2){if(sel==v2.selectorText){attrClass=v2.style.cssText;}});}
else if(v.imports.length>0)
{$(v.imports).each(function(i2,v2){if(sel==v2.selectorText)
{attrClass=v2.style.cssText;}
else if(v2=="[object]"||v2=="[Object CSSStyleSheet]"||v2=="[object CSSImportRule]")
{if((importResult=selectAttr(sel,v2))){return importResult;}}});}}
else
{$(v.cssRules).each(function(i2,v2){if(sel==v2.selectorText)
{attrClass=v2.style.cssText;}
else if(v2=="[object CSSImportRule]")
{if((importResult=selectAttr(sel,v2.styleSheet))){return importResult;}}});}
return attrClass;}
function toCamelCase(str)
{str=$.trim(str);str=str.replace(/-/g," ");str=str.toLowerCase();strArr=str.split(" ");var nStr="";$(strArr).each(function(i,v){if(i==0){nStr+=v;}else{nStr+=v.substr(0,1).toUpperCase();nStr+=v.substr(1,v.length);}});return nStr;}})(jQuery);function ttalert(algo,filtrar){if(window.debugAnimateToClass||window.debugAnimateToClassFilter){if(window.debugAnimateToClassFilter){if(filtrar.search(window.debugAnimateToClassFilter)!=-1)
alert(algo);}else{alert(algo);}}}
$.fn.brmenu=function(options,par1,par2,par3){var gotoMenu=function($this,nuevo){var name="#"+$this.attr("id");if($this.attr("mnuCurrMenu")!=nuevo){$(name+" ul").slideUp($this.attr("mnuSpeed"));var $cMenu=$(name+" ul[menu='"+nuevo+"']");$cMenu.slideDown($this.attr("mnuSpeed"),function(){$this.scrollTo($("#"+$this.attr("mnuCurrValue")))});$(name+" h4").html($cMenu.attr("title"));$this.attr("mnuCurrMenu",$cMenu.attr("menu"));$this.trigger("changeMenu",[nuevo,$this]);}
else $this.scrollTo($("#"+$this.attr("mnuCurrValue")))}
var gotoItem=function($this,nuevo){var name="#"+$this.attr("id");if($this.attr("mnuCurrValue")!=nuevo){$(name+" li").removeClass(name.substr(1)+"-item-selected");$(name+" #"+par1).addClass(name.substr(1)+"-item-selected")
$this.attr("mnuCurrValue",nuevo);$this.trigger("changeItem",[nuevo,$this]);}
var nuevoMenu=$(name+" #"+par1).parent().attr("menu")
gotoMenu($this,nuevoMenu);}
if(options!=null&&typeof(options)=="string"){switch(options)
{case'goMenu':this.each(function(){gotoMenu($(this),par1);});break;case'goHome':this.each(function(){gotoMenu($(this),$("#"+$(this).attr("id")+" ul:first").attr("menu"));});break;case'goItem':this.each(function(){gotoItem($(this),par1);});break;default:alert("BRMENU>>Comando no reconocido");break;}}
else{return this.each(function(){var $this=$(this);var name="#"+$this.attr("id");var defaults={speed:500,currValue:'',currMenu:''};var $opts=$.extend(defaults,options);$(name+" ul").hide();if($opts.currValue==''){cMenu=$(name+" ul:first").show();$(name+" h4").html(cMenu.attr("title"));}
else{$(name+" #"+$opts.currValue).addClass(name.substr(1)+"-item-selected")
cMenu=$(name+" #"+$opts.currValue).parent()
$(name+" h4").html(cMenu.attr("title"));cMenu.slideDown($opts.speed,function(){$this.scrollTo($(name+" #"+$opts.currValue))});}
$this.attr("mnuSpeed",$opts.speed);$this.attr("mnuCurrMenu",cMenu.attr("menu"));$this.attr("mnuCurrValue",$opts.currValue);$(name+" li").click(function(ob){var nuevo=$(this).attr("id");if(nuevo!=''){$(name).attr("mnuCurrValue",nuevo);$(name+" li").removeClass(name.substr(1)+"-item-selected");$(name+" #"+nuevo).addClass(name.substr(1)+"-item-selected")
$(this).trigger("changeItem",[nuevo,$this]);}})});}};;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);$.fn.carrousel=function(options){return this.each(function(){var setTo=function(order,className){$($nameItems+"[order='"+order+"']").removeClass("item-hidden").addClass(className);}
var turnTo=function($nombre,className,classNameD,classNameI){$nombre.stop().animateToClass(className,$opts.speed,"swing",function(){$(this).removeAttr("style");}).attr("className",$name+"-item "+className);$("div.datos",$nombre).removeAttr("style").stop().animateToClass(classNameD,$opts.speed,"swing",function(){$(this).removeAttr("style");}).attr("className","datos "+classNameD);$("img.imagen",$nombre).removeAttr("style").stop().animateToClass(classNameI,$opts.speed,"swing",function(){$(this).removeAttr("style");}).attr("className","imagen "+classNameI);}
var refresh=function(){var total=parseInt($this.attr("carrTotal"));var curr=parseInt($this.attr("carrCurrent"));var $items=$("div."+$name+"-item",$this);var cssItem,cssDatos,offset,$it;for(var i=0;i<total;i++){if(i==curr){cssItem=$name+"-item-selected";cssDatos=$name+"-datos-selected";cssImagen=$name+"-imagen-selected";}
else if(i<curr&&i>=(curr-$opts.itemsShowPrev)){offset=curr-i;cssItem=$name+"-item-prev-"+offset;cssDatos=$name+"-datos-prev-"+offset;cssImagen=$name+"-imagen-prev-"+offset;}
else if(i>curr&&i<=(curr+$opts.itemsShowNext)){offset=i-curr;cssItem=$name+"-item-next-"+offset;cssDatos=$name+"-datos-next-"+offset;cssImagen=$name+"-imagen-next-"+offset;}
else{cssItem=$name+"-item-hidden";cssDatos=$name+"-datos-hidden";cssImagen=$name+"-imagen-hidden";}
$it=$($items[i]);if($it.attr("className").indexOf(cssItem)==-1){turnTo($it,cssItem,cssDatos,cssImagen);}}
$this.trigger("change",[curr,$items[curr]]);$(".show-curr-item",$this).html(curr+1);if(curr==0)$(".button-prev, .button-first",$this).hide("fast");else $(".button-prev, .button-first",$this).show("fast");if(curr==(total-1))$(".button-next, .button-last",$this).hide("fast");else $(".button-next, .button-last",$this).show("fast");}
var skipitem=function(cant,back){if(cant==null)cant=1;if(back)cant*=-1;var curr=parseInt($this.attr("carrCurrent"));var total=parseInt($this.attr("carrTotal"));curr+=parseInt(cant);if(curr<0){curr=0;$("#"+$name).trigger("bof",[curr,$($nameItems+"[order='"+curr+"']")]);}
if(curr>=total){curr=total-1;$("#"+$name).trigger("eof",[curr,$($nameItems+"[order='"+curr+"']")]);}
$this.attr("carrCurrent",curr);refresh();}
var gotoitem=function(nro){if(nro==null)nro=0;var curr=parseInt($this.attr("carrCurrent"));var total=parseInt($this.attr("carrTotal"));curr=parseInt(nro);if(curr<0){curr=0;$("#"+$name).trigger("bof",[curr,$($nameItems+"[order='"+curr+"']")]);}
if(curr>=total){curr=total-1;$("#"+$name).trigger("eof",[curr,$($nameItems+"[order='"+curr+"']")]);}
$this.attr("carrCurrent",curr);refresh();}
var gotofirst=function(){$this.attr("carrCurrent",0);refresh();}
var gotolast=function(){$this.attr("carrCurrent",parseInt($this.attr("carrTotal"))-1);refresh();}
var $this=$(this);var $name=$this.attr("id");var $nameItems="#"+$name+" ."+$name+"-item";var defaults={speed:500,itemStart:0,itemsShowPrev:3,itemsShowNext:2};var $opts=$.extend(defaults,options);var $items=$($nameItems);if($opts.itemStart=='last')$opts.itemStart=$items.length-1;$this.attr("carrTotal",$items.length)
$this.attr("carrCurrent",$opts.itemStart)
$this.attr("carrOptSpeed",$opts.speed)
$this.attr("carrOptItemStart",$opts.itemStart)
$this.attr("carrOptItemsShowPrev",$opts.itemsShowPrev)
$this.attr("carrOptItemsShowNext",$opts.itemsShowNext)
for(var i=0;i<$items.length;i++){$($items[i]).attr("order",i).addClass($name+"-item-hidden");$($items[i]).attr("order",i).find(".imagen").addClass($name+"-imagen-hidden");$($items[i]).attr("order",i).find(".datos").addClass($name+"-datos-hidden");}
if($items.length>0){$("#"+$name+" .show-no-data").hide("fast");refresh();$(".show-total-item",$this).html($items.length);if($this.attr("hooked")===undefined){$("#"+$name+" .button-prev").click(function(){skipitem($(this).attr("items"),true);return false;});$("#"+$name+" .button-next").click(function(event){skipitem($(this).attr("items"),false);return false;});$("#"+$name+" .button-goto").click(function(){gotoitem($(this).attr("item"));});$("#"+$name+" .button-first").click(function(){gotofirst();});$("#"+$name+" .button-last").click(function(){gotolast();});$this.attr("hooked","yes");for(var i=1;i<=$opts.itemsShowPrev;i++)$("."+$name+"-item-prev-"+i).live("click",function(){gotoitem($(this).attr("order"));});for(var i=1;i<=$opts.itemsShowNext;i++)$("."+$name+"-item-next-"+i).live("click",function(){gotoitem($(this).attr("order"));});}}
else{$("#"+$name+" .show-no-data").show("slow");$("#"+$name+" .button-prev").hide("fast");$("#"+$name+" .button-next").hide("fast");$("#"+$name+" .button-goto").hide("fast");$("#"+$name+" .button-first").hide("fast");$("#"+$name+" .button-last").hide("fast");$("#"+$name+" .show-pannel").hide("fast");$("#"+$name+" .show-curr-item").hide("fast");$("#"+$name+" .show-total-items").hide("fast");}});};$.fn.carrouselMoveTo=function(nro){return this.each(function(){var turnTo=function($nombre,className,classNameD,classNameI){$nombre.stop().animateToClass(className,$opts.speed,"swing",function(){$(this).removeAttr("style");}).attr("className",$name+"-item "+className);$("div.datos",$nombre).stop().animateToClass(classNameD,$opts.speed,"swing",function(){$(this).removeAttr("style");}).attr("className","datos "+classNameD);$("img.imagen",$nombre).stop().animateToClass(classNameI,$opts.speed,"swing",function(){$(this).removeAttr("style");}).attr("className","imagen "+classNameI);}
var refresh=function(){var total=parseInt($this.attr("carrTotal"));var curr=parseInt($this.attr("carrCurrent"));var $items=$("div."+$name+"-item",$this);var cssItem,cssDatos,offset,$it;for(var i=0;i<total;i++){if(i==curr){cssItem=$name+"-item-selected";cssDatos=$name+"-datos-selected";cssImagen=$name+"-imagen-selected";}
else if(i<curr&&i>=(curr-$opts.itemsShowPrev)){offset=curr-i;cssItem=$name+"-item-prev-"+offset;cssDatos=$name+"-datos-prev-"+offset;cssImagen=$name+"-imagen-prev-"+offset;}
else if(i>curr&&i<=(curr+$opts.itemsShowNext)){offset=i-curr;cssItem=$name+"-item-next-"+offset;cssDatos=$name+"-datos-next-"+offset;cssImagen=$name+"-imagen-next-"+offset;}
else{cssItem=$name+"-item-hidden";cssDatos=$name+"-datos-hidden";cssImagen=$name+"-imagen-hidden";}
$it=$($items[i]);if($it.attr("className").indexOf(cssItem)==-1){turnTo($it,cssItem,cssDatos,cssImagen);}}
$this.trigger("change",[curr,$items[curr]]);$(".show-curr-item",$this).html(curr+1);if(curr==0)$(".button-prev, .button-first",$this).hide("fast");else $(".button-prev, .button-first",$this).show("fast");if(curr==(total-1))$(".button-next, .button-last",$this).hide("fast");else $(".button-next, .button-last",$this).show("fast");}
var $this=$(this);var $name=$this.attr("id");var $nameItems="#"+$name+" ."+$name+"-item";var $opts={speed:parseInt($this.attr("carrOptSpeed")),itemStart:parseInt($this.attr("carrOptItemStart")),itemsShowPrev:parseInt($this.attr("carrOptItemsShowPrev")),itemsShowNext:parseInt($this.attr("carrOptItemsShowNext"))};if(nro==null)nro=0;var curr=parseInt($this.attr("carrCurrent"));var total=parseInt($this.attr("carrTotal"));curr=parseInt(nro);if(curr<0){curr=0;$("#"+$name).trigger("bof",[curr,$($nameItems+"[order='"+curr+"']")]);}
if(curr>=total){curr=total-1;$("#"+$name).trigger("eof",[curr,$($nameItems+"[order='"+curr+"']")]);}
$this.attr("carrCurrent",curr);refresh();});};$.fn.drawer=function(options)
{var turnTo=function($this,nuevo)
{$this.trigger("changeStart",[nuevo,$this]);$this.stop().animateToClass(((nuevo=="open")?$this.attr("dwOpenClass"):$this.attr("dwClosedClass")),parseInt($this.attr("dwSpeed")),"swing",function(){$(this).removeAttr("style");$(this).trigger("changeStop",[nuevo,$(this)]);});$this.removeClass(((nuevo=="open")?$this.attr("dwClosedClass"):$this.attr("dwOpenClass")));$this.addClass(((nuevo=="open")?$this.attr("dwOpenClass"):$this.attr("dwClosedClass")));$this.attr("dwStatus",nuevo);}
if(options!=null&&typeof(options)=="string")
{switch(options)
{case'close':this.each(function(){turnTo($(this),"closed");});break;case'open':this.each(function(){turnTo($(this),"open");});break;case'toggle':this.each(function(){turnTo($(this),($(this).attr("dwStatus")=="open")?"closed":"open");});break;default:alert("DRAWER>>Comando no reconocido");break;}}
else
{return this.each(function()
{var toggle=function()
{actual=$this.attr("dwStatus");nuevo=(actual=="open")?"closed":"open";$this.trigger("changeStart",[nuevo,$this]);$this.stop().animateToClass(((nuevo=="open")?$this.attr("dwOpenClass"):$this.attr("dwClosedClass")),parseInt($this.attr("dwSpeed")),"swing",function(){$(this).removeAttr("style");$(this).trigger("changeStop",[nuevo,$(this)]);});$this.removeClass(((nuevo=="open")?$this.attr("dwClosedClass"):$this.attr("dwOpenClass")));$this.addClass(((nuevo=="open")?$this.attr("dwOpenClass"):$this.attr("dwClosedClass")));$this.attr("dwStatus",nuevo);}
var $this=$(this);var $name=$this.attr("id").toLowerCase();var $content=$("."+$name+"-content");var $tag=$("."+$name+"-tag");var defaults={speed:500,openClass:$name+'-open',closedClass:$name+'-closed',initOpen:false};var $opts=$.extend(defaults,options);$this.attr("dwSpeed",$opts.speed);$this.attr("dwOpenClass",$opts.openClass);$this.attr("dwClosedClass",$opts.closedClass);$this.attr("dwStatus",($opts.initOpen)?"open":"closed");$this.addClass("drawer");$this.addClass(($opts.initOpen)?$opts.openClass:$opts.closedClass);$tag.live("click",function(){toggle();});});}};jQuery.fn.extend({ImageRotate:function(parameters)
{if(this.Wilq32&&this.Wilq32.PhotoEffect)return;return(new Wilq32.PhotoEffect(this.get(0),parameters))._temp;},rotate:function(parameters)
{if(this.length===0)return;if(typeof parameters=="undefined")return;if(typeof parameters=="number")parameters={angle:parameters};var returned=[];for(var i=0,i0=this.length;i<i0;i++)
{var element=this.get(i);if(typeof element.Wilq32=="undefined")
returned.push($($(element).ImageRotate(parameters)));else
{element.Wilq32.PhotoEffect._rotate(parameters.angle);}}
return returned;},rotateAnimation:function(parameters)
{if(this.length===0)return;if(typeof parameters=="undefined")return;if(typeof parameters=="number")parameters={angle:parameters};var returned=[];for(var i=0,i0=this.length;i<i0;i++)
{var element=this.get(i);if(typeof element.Wilq32=="undefined")
returned.push($($(element).ImageRotate(parameters)));else
{element.Wilq32.PhotoEffect._parameters.animateAngle=parameters.angle;element.Wilq32.PhotoEffect._parameters.callback=parameters.callback||function()
{};element.Wilq32.PhotoEffect._animateStart();}}
return returned;}});Wilq32={};Wilq32.PhotoEffect=function(img,parameters)
{this._IEfix=img;this._parameters=parameters;this._parameters.className=img.className;this._parameters.id=img.getAttribute('id');if(!parameters)this._parameters={};this._angle=0;if(!parameters.angle)this._parameters.angle=0;this._temp=document.createElement('span');this._temp.Wilq32={PhotoEffect:this};var image=img.src;img.parentNode.insertBefore(this._temp,img);this._img=new Image();this._img.src=image;this._img.setAttribute("height",$(img).attr("height"));this._img.setAttribute("width",$(img).attr("width"));this._img._ref=this;jQuery(this._img).bind("load",function()
{this._ref._Loader.call(this._ref);});if(jQuery.browser.msie)if(this._img.complete)this._Loader();}
Wilq32.PhotoEffect.prototype._Loader=(function()
{if(jQuery.browser.msie)
return function()
{var src=this._IEfix.src;this._IEfix.parentNode.removeChild(this._IEfix);this._temp.setAttribute('id',this._parameters.id);this._temp.className=this._parameters.className;var width=this._img.width;var height=this._img.height;this._img._widthMax=this._img._heightMax=Math.sqrt((height)*(height)+(width)*(width));this._img._heightMax=Math.sqrt((height)*(height)+(width)*(width));this._vimage=document.createElement('v:image');this._vimage._ref=this;this._vimage.style.height=height;this._vimage.style.width=width;this._vimage.style.position="relative";this._temp.style.display="inline-block";this._temp.style.width=this._temp.style.height=this._img._heightMax;this._vimage.src=src;this._vimage.rotate=0;this._temp.appendChild(this._vimage);var self=this;this._parameters.animateAngle=0;if(this._parameters.bind)
{for(var a in this._parameters.bind)if(this._parameters.bind.hasOwnProperty(a))
for(var b in this._parameters.bind[a])if(this._parameters.bind[a].hasOwnProperty(b))
jQuery(this._temp).bind(b,this._parameters.bind[a][b]);}
this._rotate(this._parameters.angle);}
else
return function()
{this._IEfix.parentNode.removeChild(this._IEfix);this._temp.setAttribute('id',this._parameters.id);this._temp.className=this._parameters.className;var width=this._img.width;var height=this._img.height;this._img._widthMax=this._img._heightMax=Math.sqrt((height)*(height)+(width)*(width));this._canvas=document.createElement('canvas');this._canvas._ref=this;this._canvas.height=height;this._canvas.width=width;this._canvas.setAttribute('width',width);this._temp.appendChild(this._canvas);var self=this;this._parameters.animateAngle=0;if(this._parameters.bind)
{for(var a in this._parameters.bind)if(this._parameters.bind.hasOwnProperty(a))
for(var b in this._parameters.bind[a])if(this._parameters.bind[a].hasOwnProperty(b))
jQuery(this._canvas).bind(b,this._parameters.bind[a][b]);}
this._cnv=this._canvas.getContext('2d');this._rotate(this._parameters.angle);}})();Wilq32.PhotoEffect.prototype._animateStart=function()
{if(this._timer)clearTimeout(this._timer);this._animate();}
Wilq32.PhotoEffect.prototype._animate=function()
{var temp=this._angle;if(typeof this._parameters.animateAngle!="undefined")this._angle-=(this._angle-this._parameters.animateAngle)*0.1;if(typeof this._parameters.minAngle!="undefined")if(this._angle<this._parameters.minAngle)this._angle=this._parameters.minAngle;if(typeof this._parameters.maxAngle!="undefined")if(this._angle>this._parameters.maxAngle)this._angle=this._parameters.maxAngle;if(Math.round(this._angle*100-temp*100)==0&&this._timer)
{clearTimeout(this._timer);if(this._parameters.callback)
this._parameters.callback();}
else
{this._rotate(this._angle);var self=this;this._timer=setTimeout(function()
{self._animate.call(self);},10);}}
Wilq32.PhotoEffect.prototype._rotate=(function()
{if(jQuery.browser.msie)
return function(angle)
{this._vimage.style.rotation=angle;var radians=angle*Math.PI/180;this._vimage.style.top=(this._img._heightMax-this._img.height)/2-(this._vimage.offsetHeight-this._img.height)/2+"px";this._vimage.style.left=(this._img._widthMax-this._img.width)/2-(this._vimage.offsetWidth-this._img.width)/2+"px";}
else
return function(angle)
{if(!this._img.width)return;if(typeof angle!="number")return;angle=(angle%360)*Math.PI/180;var width=this._img.width;var height=this._img.height;var widthAdd=this._img._widthMax-width;var heightAdd=this._img._heightMax-height;this._canvas.width=width+widthAdd;this._canvas.height=height+heightAdd;this._cnv.save();this._cnv.translate(widthAdd/2,heightAdd/2);this._cnv.translate(width/2,height/2);this._cnv.rotate(angle);this._cnv.translate(-width/2,-height/2);this._cnv.drawImage(this._img,0,0,width,height);this._cnv.restore();}})();$.fn.score=function(options)
{return this.each(function()
{var $this=$(this);var draw=function($name,newvalue)
{for(var a=0;a<parseInt($opts.points);a++){var it=$("#"+$name+"_p_"+a);it.removeClass("full").removeClass("empty").removeClass("half");it.addClass((a<=newvalue[0]-1)?"full":"empty");}
if(newvalue[1]!=0)$("#"+$name+"_p_"+(newvalue[0])).addClass("half");};var defaults={points:5};var $opts=$.extend(defaults,options);var $name=$this.attr("id");var $title=$this.attr("title");var $msg=$this.attr("msg");var $value=$this.attr("value").replace(",",".");var $points=$this.attr("points");var $href=$this.attr("href");if(typeof($points)!="undefined"&&$points!="")$opts.points=$points;if(parseInt($value)>parseInt($opts.points))$value=$opts.points;if($value<0)$value=0;$value=[Math.floor($value),$value%1];if($value[1]<0.25)$value[1]=0;if($value[1]>0.75){$value[0]++;$value[1]=0;}
var html="<div id='"+$name+"_title' class='title' style='display:none;'>"+$title+"</div><div class='score' id='"+$name+"_score'>";for(var a=0;a<$opts.points;a++)html+="<div id='"+$name+"_p_"+a+"' class='item'></div>";html+="</div><div id='"+$name+"_msg' class='msg' style='display:none;'>"+$msg+"</div><div id='"+$name+"_error' class='error' style='display:none;'></div>";$this.html(html);if(typeof($title)!="undefined"&&$title!="")$("#"+$name+"_title").show();if(typeof($msg)!="undefined"&&$msg!="")$("#"+$name+"_msg").show();draw($name,$value);if(typeof($href)!="undefined"&&$href!="")
{$("div[id^='"+$name+"_p_']").unbind("mouseover");$("div[id^='"+$name+"_p_']").unbind("mouseout");$("div[id^='"+$name+"_p_']").unbind("click");$("div[id^='"+$name+"_p_']").bind("mouseover",function(){var $newvalue=parseInt($(this).attr("id").split("_")[2])+1;for(var a=0;a<$newvalue;a++){$("#"+$name+"_p_"+a).addClass("selected");}});$("div[id^='"+$name+"_p_']").bind("mouseout",function(){for(var a=0;a<$opts.points;a++)$("#"+$name+"_p_"+a).removeClass("selected");});$("div[id^='"+$name+"_p_']").bind("click",function()
{var $id=$(this).attr("id").split("_");var $value=parseInt($id[2])+1;var $href=$(this).parent().parent().attr("href");for(var a=0;a<$value;a++)$("#"+$name+"_p_"+a).addClass("selected");$.get($href,{'value':$value,'id':$id[0],'tag':$(this).parent().parent().attr("tag")},function(data)
{for(var a=0;a<$opts.points;a++)$("#"+$name+"_p_"+a).removeClass("selected");var newvalue=$(data).find("score result").text();var $title=$(data).find("score title").text();var $msg=$(data).find("score msg").text();var $error=$(data).find("score error").text();if(newvalue!="")
{newvalue=[Math.floor(newvalue),newvalue%1];if(newvalue[1]<0.25)newvalue[1]=0;if(newvalue[1]>0.75){newvalue[0]++;newvalue[1]=0;}
draw(name,newvalue);}
if($title!="")$("#"+$name+"_title").html($title).show();if($msg!="")$("#"+$name+"_msg").html($msg).show();if($error!="")$("#"+$name+"_error").html($error).show();});});}});};(function($){$.widget("ui.player",{_init:function(){this.videoDiv=$('<div id="'+this.element.attr("id")+'_playerVideo" class="ui-player-video"></div>').appendTo(this.element);if(this.options.controlBar=="show"){this.controlDiv=$('<div id="'+this.element.attr("id")+'_controlBar" class="ui-player-controlbar"></div>').appendTo(this.element);this._drawControlBar();}
if(this.options.url){this.url(this.options.url);}},currentMedia:function(value){if(value===undefined){return this._currentMedia;}else{this._currentMedia=value;}},open:function(params){window.fwk.debugJson(params,"player::open");this.stop();this.close();this._disabledChangeSize();var url=this.options.openUrl;for(var param in params){url+="/"+param+"/"+eval("params."+param);}
url+='/quality/'+this.size().substring(0,1)+'?extensions='+this._getAvailableExtensions();url+="&layoutOff=true";var mthis=this;$.getJSON(url,function(data){window.fwk.debugJson(data,"player::result_open");mthis.currentMedia(new media(data,data.preview,mthis.options.ownerMode));window.fwk.debugJson(mthis._currentMedia,"player::currentMedia");if(mthis._currentMedia.isLoaded){mthis._refreshChangeSize(mthis._currentMedia.getMaterialProp("content_id"));var size=mthis._getSizeByQuality(mthis._currentMedia.getMaterialProp('quality_id'));mthis.size(size.name);var map=mthis._getMap(mthis._getExtension(mthis.currentMedia().url));if(map!=null){mthis._createPlayer(map);if(mthis._currentPlayer.isReady){mthis._currentPlayer.openUrl(mthis.currentMedia());if(mthis._currentPlayer.type=="flash"&&mthis.options.autoPlay){mthis.play();}}}}else{if(mthis._currentMedia.isWgChecked==false){mthis._refreshChangeSize(params.content_id);mthis._onError(mthis.options.messages.wgNotAllowed,"wgnotallowed");window.fwk.debugJson({},"player::wgnotallowed");}else{mthis._refreshChangeSize(params.content_id);mthis._onError(mthis.options.messages.fileNotFound,"filenotfound");window.fwk.debugJson({},"player::filenotfound");}}});this._currentOpenParams=params;},url:function(url){data={url:url};this.currentMedia(new media(data));var map=this._getMap(this._getExtension(url));window.fwk.debugJson(map,"player map");if(map!=null){this._createPlayer(map);if(this._currentPlayer.isReady){this._currentPlayer.openUrl(this.currentMedia());if(this._currentPlayer.type=="flash"&&this.options.autoPlay){this.play();}}}},changeMap:function(value){if(value!=undefined){for(var i=0;i<this.options.mapFormats.length;i++){if(this.options.mapFormats[i].ext.toLowerCase()==value.ext.toLowerCase()){this.options.mapFormats[i].player=value.player;break;}}}
return this;},getCurrentPlayer:function(){return this._currentPlayer;},mediaLength:function(){var ret=0;if(this._currentPlayer!=null&&this._currentPlayer.isReady){ret=this._currentPlayer.getMediaLength();}
return ret;},mediaPosition:function(value){if(this._currentPlayer!=null&&this._currentPlayer.isReady){if(value===undefined){return this._currentPlayer.getMediaPosition();}else{this._currentPlayer.setMediaPosition(value);}}},volume:function(value){if(this._currentPlayer!=null&&this._currentPlayer.isReady){if(value===undefined){return this._currentPlayer.getVolume();}else{this._currentPlayer.setVolume(value);this._currentVolume=value;if(this.volumeSlider!=null){this.volumeSlider.slider("value",value);}}}},mute:function(value){if(this._currentPlayer!=null&&this._currentPlayer.isReady){if(value===undefined){this._currentPlayer.setMute(!this._currentPlayer.getMute());}else{this._currentPlayer.setMute(value);}}
this._currentMute=this._currentPlayer.getMute();if(this._currentMute){this.muteDiv.addClass("ui-player-control-unmute");this.muteDiv.removeClass("ui-player-control-mute");}else{this.muteDiv.addClass("ui-player-control-mute");this.muteDiv.removeClass("ui-player-control-unmute");}
return this._currentMute;},size:function(name){if(name===undefined){return this.options.size;}else{var size=this._getSizeByName(name);if(size){this._changeSize(this._getSizeByName(this.options.size),size);this.options.size=size.name;this._destroyPlayer();}}},toggleFullScreen:function(){if(this._currentPlayer!=null&&this._currentPlayer.playState!=PLAY_STATE_COMPLETED){this._currentPlayer.toggleFullScreen();}},play:function(){if(this.currentMedia()!=null&&this._currentPlayer!=null&&this._currentPlayer.isReady){this._currentPlayer.play();}},stop:function(){if(this.currentMedia()!=null&&this._currentPlayer!=null&&this._currentPlayer.isReady){this._currentPlayer.stop();}},pause:function(){if(this.currentMedia()!=null&&this._currentPlayer!=null&&this._currentPlayer.isReady){if(this._currentPlayer.canPause()){this._currentPlayer.pause();}else{this._currentPlayer.stop();}}},status:function(text){if(this.statusDiv){this.statusDiv.text(text);}},close:function(){if(this.currentMedia()!=null&&this._currentPlayer!=null&&this._currentPlayer.isReady){this._currentPlayer.close();}},raiseError:function(err){this._showError(err);},destroyPlayer:function(){this._destroyPlayer();},enabledControlBar:function(value){if(value===undefined){return(this.controlDisabledDiv.css("display")=="none");}else{if(value){this.controlDisabledDiv.css("display","none");}else{this.controlDisabledDiv.css("display","block");}
return this;}},_currentPlayer:null,_hndPositionTimer:null,_currentVolume:50,_currentMute:false,_currentMedia:null,_changeStateByUserAction:false,_currentOpenParams:null,_drawControlBar:function(){var mthis=this;if(this.playPauseDiv===undefined){this.playPauseDiv=$('<div class="ui-player-control-pause"><span>Pausa</span></div>').appendTo(this.controlDiv);this.stopDiv=$('<div class="ui-player-control-stop"><span>Stop</span></div>').appendTo(this.controlDiv);this.muteDiv=$('<div class="ui-player-control-mute"><span>Mute</span></div>').appendTo(this.controlDiv);if(this.options.showPreviousNextButtons){this.previousDiv=$('<div class="ui-player-control-previous"><span>Previous</span></div>').appendTo(this.controlDiv);this.nextDiv=$('<div class="ui-player-control-next"><span>Next</span></div>').appendTo(this.controlDiv);}
this.sizeContainerDiv=$('<div class="ui-player-control-encodes"></div>').appendTo(this.videoDiv);this.sizeLowDiv=$('<div class="ui-player-size-low"></div>').appendTo(this.sizeContainerDiv);this.sizeNormalDiv=$('<div class="ui-player-size-medium"></div>').appendTo(this.sizeContainerDiv);this.sizeHighDiv=$('<div class="ui-player-size-high"></div>').appendTo(this.sizeContainerDiv);this.fullScreenDiv=$('<div class="ui-player-control-fullscreen"></div>').appendTo(this.sizeContainerDiv);this.fullScreenTooltipDiv=$('<div class="ui-player-control-fullscreen-tooltip" style="display:none;"><span>'+this.options.messages.fullScreen+'</span></div>').appendTo(this.sizeContainerDiv);if(this.options.showOpenPopup){this.openPopupDiv=$('<div class="ui-player-control-popup"><span>'+this.options.messages.openPopup+'</span></div>').appendTo(this.sizeContainerDiv);}
this.positionSlider=$('<div id="'+this.element.attr("id")+'_positionSlider"></div>').appendTo(this.controlDiv).slider({start:function(event,ui){mthis._clearPositionTimer();},slide:function(event,ui){if(mthis.positionDiv){mthis.positionDiv.text(new Date(1,0,1,0,0,(ui.value*mthis._currentPlayer.getMediaLength())/100).toTimeString().substring(1,8));}},stop:function(event,ui){mthis._currentPlayer.setMediaPosition((ui.value*mthis._currentPlayer.getMediaLength())/100);mthis._setIntervalPositionTimer();}});this.positionDiv=$('<div class="ui-player-control-position"></div>').appendTo(this.controlDiv);this.durationDiv=$('<div class="ui-player-control-duration"></div>').appendTo(this.controlDiv);$('<div class="ui-player-control-volume-text"><span>'+this.options.messages.volume+'</span></div>').appendTo(this.controlDiv);this.volumeSlider=$('<div id="'+this.element.attr("id")+'_volume"></div>').appendTo(this.controlDiv).slider({value:(mthis._currentPlayer!=null)?mthis._currentPlayer.getVolume():mthis._currentVolume,slide:function(event,ui){mthis.volume(ui.value);}});this.statusDiv=$('<div class="ui-player-statusbar"></div>').appendTo(this.controlDiv);this.controlDisabledDiv=$('<div class="ui-player-controlbar-disabled" style="display:none;"></div>').appendTo(this.element.parent());this.playPauseDiv.bind("click",this,function(e){e.data._changeStateByUserAction=true;if(e.data._currentPlayer!=null){if(e.data.playPauseDiv.hasClass("ui-player-control-pause")){e.data.pause();}else{e.data.play();}}});this.stopDiv=this.stopDiv.bind("click",this,function(e){e.data._changeStateByUserAction=true;if(e.data._currentPlayer!=null){e.data._currentPlayer.stop();}});if(this.options.showPreviousNextButtons){this.previousDiv.bind("click",this,function(e){mthis._trigger("onPrevious");});this.nextDiv.bind("click",this,function(e){mthis._trigger("onNext");});}
this.muteDiv=this.muteDiv.bind("click",this,function(e){var mute=e.data.mute();if(mute){$(this).addClass("ui-player-control-unmute");$(this).removeClass("ui-player-control-mute");}else{$(this).addClass("ui-player-control-mute");$(this).removeClass("ui-player-control-unmute");}});this.sizeContainerDiv.find("div:not(.ui-player-control-fullscreen, .ui-player-control-popup)").each(function(i){$(this).hover(function(){if(!$(this).hasClass("ui-player-size-disabled")){$(this).addClass("ui-player-size-hover");}},function(){if(!$(this).hasClass("ui-player-size-disabled")){$(this).removeClass("ui-player-size-hover");}});$(this).bind("click",mthis,function(e){if(!$(this).hasClass("ui-player-size-selected")&&!$(this).hasClass("ui-player-size-disabled")){$(this).removeClass("ui-player-size-hover");var className=$(this).attr("class");$(".ui-player-size-selected").removeClass("ui-player-size-selected");$(this).addClass("ui-player-size-selected");var sizeName=className.substr(className.lastIndexOf("-")+1);var sizeObject=e.data._getSizeByName(sizeName);e.data.size(sizeObject.name);e.data._trigger("onChangeSize",null,{size:sizeObject});e.data.open(e.data._currentOpenParams);}});});this.fullScreenDiv.bind("click",mthis,function(e){e.data.toggleFullScreen();});this.fullScreenDiv.hover(function(){mthis._fullScreenShowTooltip();},function(){mthis._fullScreenHideTooltip();});if(this.openPopupDiv){this.openPopupDiv.hover(function(){$(this).addClass("ui-player-control-popup-hover");},function(){$(this).removeClass("ui-player-control-popup-hover");});this.openPopupDiv.bind("click",mthis,function(e){e.data._trigger("onOpenPopup");});}
var size=this._getSizeByName(this.options.size);this._changeSize(size,size);}
if(this._currentPlayer){if(this._currentPlayer.playState==PLAY_STATE_IDLE&&(this._currentPlayer.openState==OPEN_STATE_OPENING||this._currentPlayer.openState==OPEN_STATE_OPENED)){this.playPauseDiv.removeClass("ui-player-control-pause");this.playPauseDiv.addClass("ui-player-control-play");}
if(!this._currentPlayer.settings.allowFullScreen){if(!this.fullScreenDiv.hasClass("ui-player-control-fullscreen-disabled")){this.fullScreenDiv.addClass("ui-player-control-fullscreen-disabled");}}else{if(this.fullScreenDiv.hasClass("ui-player-control-fullscreen-disabled")){this.fullScreenDiv.removeClass("ui-player-control-fullscreen-disabled");}}
switch(this._currentPlayer.playState){case PLAY_STATE_PLAYING:this.playPauseDiv.addClass("ui-player-control-pause");this.playPauseDiv.removeClass("ui-player-control-play");this.playPauseDiv.find("span").text("Pausa");this._setIntervalPositionTimer();break;case PLAY_STATE_PAUSED:this.playPauseDiv.addClass("ui-player-control-play");this.playPauseDiv.removeClass("ui-player-control-pause");this.playPauseDiv.find("span").text("Play");this._clearPositionTimer()
break;case PLAY_STATE_COMPLETED:if(!this.fullScreenDiv.hasClass("ui-player-control-fullscreen-disabled")){this.fullScreenDiv.addClass("ui-player-control-fullscreen-disabled");}
case PLAY_STATE_STOPED:this.playPauseDiv.addClass("ui-player-control-play");this.playPauseDiv.removeClass("ui-player-control-pause");this.playPauseDiv.find("span").text("Play");this._clearPositionTimer()
this.positionSlider.slider("value",0);this.positionDiv.text("0:00:00");break;}}else{this.positionDiv.text("0:00:00");this.durationDiv.text("0:00:00");}
this._hideError();this.element.find('#playerPluginError').hide();},_fullScreenShowTooltip:function(){if(this.fullScreenDiv!==undefined&&!this.fullScreenDiv.hasClass('ui-player-control-fullscreen-disabled')&&this._currentPlayer&&this._currentPlayer.type!="mediaplayer"){this.fullScreenTooltipDiv.stop().show();}},_fullScreenHideTooltip:function(){this.fullScreenTooltipDiv.stop().hide();},_attachEvents:function(){if(this._currentPlayer!=null){this._currentPlayer.attachPlayerReady(this._onPlayerReady);this._currentPlayer.attachMediaLoaded(this._onMediaLoaded);this._currentPlayer.attachStateChanged(this._onStateChanged);this._currentPlayer.attachBeforePlay(this._onBeforePlay);this._currentPlayer.attachError(this._onError);this._currentPlayer.attachStartLicenseAcquisition(this._onStartLicenseAcquisition);this._currentPlayer.attachEndLicenseAcquisition(this._onEndLicenseAcquisition);}},_deAttachEvents:function(){if(this._currentPlayer!=null){this._currentPlayer.deAttachAll();}},_createPlayer:function(map){if(map!=null&&((this._currentPlayer!=null&&this._currentPlayer.type!=map.player)||this._currentPlayer==null)){this._destroyPlayer();var params=this._makePlayerParams(map);window.fwk.debugJson(params,"Parametros CreatePlayer");var player=this._getPlayerObject(map,params);if(player!=null){this._currentPlayer=player;this._attachEvents();this._currentPlayer.setVolume(this._currentVolume);this._currentPlayer.setMute(this._currentMute);this._currentPlayer.drawPlayer();}}},_destroyPlayer:function(){if(this._currentPlayer!=null){this._clearPositionTimer()
this._currentPlayer.stop();this._currentPlayer.close();this._deAttachEvents();this._currentPlayer.destroy();delete this._currentPlayer;}},_getExtension:function(url){var data=url.split(".");if(data.length>=2){if(data[data.length-1].length<4){return data[data.length-1];}else{return"";}}else{return"";}},_getMap:function(extension){var ret=null;var checkPluginOk=false;for(var i=0;i<this.options.mapFormats.length;i++){if(ret==null&&this.options.mapFormats[i].ext==""){ret=this.options.mapFormats[i];if(this._checkPlugin(ret)){checkPluginOk=true;}}
if(this.options.mapFormats[i].ext.toLowerCase().indexOf(extension.toLowerCase())!=-1){ret=this.options.mapFormats[i];if(this._checkPlugin(ret)){checkPluginOk=true;break;}}}
if(!checkPluginOk){var urlDownload="";if(BrowserDetect){BrowserDetect.init();switch(BrowserDetect.OS.toLowerCase()){case"mac":urlDownload=this.options.mapFormats[0].urlDownloadPlugin.mac;break;default:urlDownload=this.options.mapFormats[0].urlDownloadPlugin.others;break;}}else{urlDownload=this.options.mapFormats[0].urlDownloadPlugin.others;}
this._onPluginDetectionError(urlDownload);ret=null;}
return ret;},_makePlayerParams:function(map){var ret={videoDivId:this.videoDiv.attr("id"),width:this._getSizeByName(this.size()).width,height:this._getSizeByName(this.size()).height,allowFullScreen:map.allowFullScreen,wMode:this.options.wMode,autoPlay:this.options.autoPlay,ownerMode:this.options.ownerMode,embed:map.embed,urlPreDelivery:map.urlPreDelivery,urlLicenser:(map.urlLicenser!==undefined?map.urlLicenser:null),version:map.version,linkTarget:"_blank"};if(map.defaultAction){ret.defaultAction=map.defaultAction;}else{switch(map.player){case"flash":case"silverlight":if(ret.allowFullScreen){ret.defaultAction="fullScreen";}else{ret.defaultAction="none";}
break;default:ret.defaultAction="play";break;}}
if(map.linkTarget){ret.linkTarget=map.linkTarget;}
if(map.player=="mediaplayer"){if(map.contextMenu!==undefined){ret.contextMenu=map.contextMenu;}else{ret.contextMenu=true;}}
return ret;},_getPlayerObject:function(map,params){var ret=null;switch(map.player){case"flash":ret=new flashPlayer(params,this);break;case"mediaplayer":ret=new mediaPlayer(params,this);break;case"silverlight":ret=new slPlayer(params,this);break;}
return ret;},_setIntervalPositionTimer:function(){if(this._hndPositionTimer==null){var mthis=this;this._hndPositionTimer=setInterval(function(){widgetPositionUpdate(mthis);},1000);}},_refreshPositionSlider:function(){if(this._currentPlayer!=null&&this._currentPlayer.isReady&&this.positionSlider){var curPos=this._currentPlayer.getMediaPosition();var curLen=this._currentPlayer.getMediaLength();if(curLen>0){this.positionSlider.slider("value",(curPos*100)/curLen);}
if(this.durationDiv.text()=="0:00:00"){this.durationDiv.text(new Date(1,0,1,0,0,this._currentPlayer.getMediaLength()).toTimeString().substring(1,8));}
this.positionDiv.text(new Date(1,0,1,0,0,curPos).toTimeString().substring(1,8));}},_clearPositionTimer:function(){clearInterval(this._hndPositionTimer);this._hndPositionTimer=null;},_debug:function(message){},_changeSize:function(oldSize,newSize){if(this.videoDiv){if(oldSize.name!=newSize.name){this.videoDiv.removeClass("ui-player-video-"+oldSize.name.toLowerCase());this.controlDiv.removeClass("ui-player-controlbar-"+oldSize.name.toLowerCase());}
this.videoDiv.addClass("ui-player-video-"+newSize.name.toLowerCase());if(this.controlDiv){this.controlDiv.addClass("ui-player-controlbar-"+newSize.name.toLowerCase());}
$(".ui-player-size-selected").removeClass("ui-player-size-selected");if(this.sizeContainerDiv){this.sizeContainerDiv.find(".ui-player-size-"+newSize.name.toLowerCase()).addClass("ui-player-size-selected");}}},_disabledChangeSize:function(){this.sizeContainerDiv.find("div:not(.ui-player-control-fullscreen)").addClass("ui-player-size-disabled");},_refreshChangeSize:function(contentId){var self=this;var selector="";$.getJSON(this.options.encodesUrl,{'content_id':contentId},function(result){for(var i=0;i<result.qualities.length;i++){var size=self._getSizeByQuality(result.qualities[i]);if(size){selector+='.ui-player-size-'+size.name.toLowerCase()+',';}}
if(selector!=''){selector=selector.substr(0,selector.length-1);$(selector).removeClass("ui-player-size-disabled");}});},_getSizeByEncode:function(encodeId){var ret=null;for(var i=0;i<this.options.sizes.length;i++){if(this.options.sizes[i].encode==encodeId){ret=this.options.sizes[i];break;}}
return ret;},_getSizeByQuality:function(quality){var ret=null;for(var i=0;i<this.options.sizes.length;i++){if(this.options.sizes[i].name.substring(0,1).toLowerCase()==quality.toLowerCase()){ret=this.options.sizes[i];break;}}
return ret;},_getSizeByName:function(name){var ret=null;for(var i=0;i<this.options.sizes.length;i++){if(this.options.sizes[i].name.toLowerCase()==name.toLowerCase()){ret=this.options.sizes[i];break;}}
return ret;},_showError:function(err,errclass){var size=this.size();this._hideError();$('<div class="ui-player-video-'+size.toLowerCase()+' ui-player-video-error '+(errclass?'ui-player-video-errorclass-'+errclass:'')+'"></div>').appendTo(this.element);},_hideError:function(){$(".ui-player-video-error").remove();},_checkPlugin:function(map){if(map.checkPlugin===undefined){return true;}else{var ret=false;switch(map.player){case"flash":ret=this._checkPluginFlash(map.version);break;case"silverlight":ret=this._checkPluginSilverlight(map.version);break;case"mediaplayer":ret=this._checkPluginMediaPlayer(map.embed);break;}
return ret;}},_checkNavigator:function(map){},_checkSO:function(map){},_checkPluginFlash:function(version){var ret=false;var aVersion=version.split('.');var clientVersion=swfobject.getFlashPlayerVersion();window.fwk.debugJson(clientVersion,"checkPluginFlash::Version");if(clientVersion.major!='0'){if(clientVersion.major>aVersion[0]){ret=true;}else if(clientVersion.major==aVersion[0]&&clientVersion.minor>aVersion[1]){ret=true;}else if(clientVersion.major==aVersion[0]&&clientVersion.minor==aVersion[1]&&clientVersion.release>=aVersion[2]){ret=true;}}
return ret;},_checkPluginSilverlight:function(version){var ret=false;if(typeof(Silverlight)!="undefined"){ret=Silverlight.isInstalled(version);}
return ret;},_checkPluginMediaPlayer:function(clsid){var ret=false;if($.browser.msie){try{var o=new ActiveXObject("WMPlayer.OCX");delete o;ret=true;}catch(e){}}else if($.browser.mozilla||$.browser.safari){}
return ret;},_saveTracking:function(){if(this.options.trackUrl){var params={group_id:this._currentMedia.getMaterialProp("group_id"),content_id:this._currentMedia.getMaterialProp("content_id"),material_id:this._currentMedia.getCommonProp("id")};if(document.location.href.indexOf("debugtracking")!=-1){alert('tracking= '+params.group_id+":"+params.content_id);}
$.get(this.options.trackUrl,params);}},_getAvailableExtensions:function(){var ret='';for(var i=0;i<this.options.mapFormats.length;i++){var extensions=this.options.mapFormats[i].ext;var aExtensions=extensions.split(',');for(var j=0;j<aExtensions.length;j++){if(ret.indexOf(aExtensions[j])==-1){if(ret!=''){ret+='|';}
ret+=aExtensions[j];}}}
return ret;},_onPlayerReady:function(){this.widget._trigger("onPlayerReady");if(this.widget.currentMedia()){this.openUrl(this.widget.currentMedia());if(this.widget.currentMedia()!=null&&this.widget._currentPlayer!=null&&this.widget.options.autoPlay&&this.widget._currentPlayer.isReady){this.play();}else{this.widget._drawControlBar();}}},_onMediaLoaded:function(){this.widget._drawControlBar();this.widget.durationDiv.text("0:00:00");this.widget._trigger("onMediaLoaded",null,null);if(this.type!="flash"){if(this.widget.currentMedia()!=null&&this.widget._currentPlayer!=null&&this.widget.options.autoPlay&&this.widget._currentPlayer.isReady){this.play();}}
this.widget._saveTracking();},_onBeforePlay:function(){var ret=true;return this.widget._trigger("onBeforePlay");return ret;},_onStateChanged:function(state){this.widget._drawControlBar(this.widget);if(state!=PLAY_STATE_COMPLETED){this.widget._trigger("onStateChanged",null,{state:state,isUserAction:this.widget._changeStateByUserAction});}else{this.widget._trigger("onCompleted");}
if(this.widget){this.widget._changeStateByUserAction=false;}},_onError:function(err,errClass){var mthis=(this.widget===undefined)?this:this.widget;mthis._showError(err,errClass);mthis._trigger("onError",null,{error:err,errorclass:errClass});},_onStartLicenseAcquisition:function(){this.widget._trigger("onStartLicenseAcquisition");},_onEndLicenseAcquisition:function(error){if(error){this.widget._onError(error);this.widget._trigger("onEndLicenseAcquisition",event,{message:error});}else{this.widget._trigger("onEndLicenseAcquisition");}},_onPluginDetectionError:function(url){if(this.element.find("#playerPluginError").length==0){$('<div id="playerPluginError" class="ui-player-plugin-error"></div>').appendTo(this.element);}else{this.element.find('#playerPluginError').show();}
this.element.find("#playerPluginError").unbind("click");this.element.find("#playerPluginError").bind("click",function(){document.location.href=url;});this._trigger("onPluginDetectionError");}});$.extend($.ui.player,{version:"@VERSION",getter:"getCurrentPlayer mediaLength mediaPosition volume mute currentMedia enabledControlBar",eventPrefix:"player",defaults:{mapFormats:[{ext:"",player:"flash",embed:"player.swf",allowFullScreen:false},{ext:"flv",player:"flash",embed:"player.swf",allowFullScreen:false},{ext:"wmv",player:"mediaplayer",embed:"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6",allowFullScreen:true}],sizes:[{name:"Low",width:450,height:360},{name:"Medium",width:450,height:360},{name:"High",width:450,height:360}],messages:{wgNotAllowed:"Content unavailable for your IP",fileNotFound:"File Not Found",openPopup:"Abrir en Popup",volume:"Volumen",fullScreen:"Para ver fullscreen haz click sobre el video"},size:"Medium",defaultEncode:350,controlBar:"show",allowFullScreen:true,autoPlay:false,ownerMode:false,wMode:"transparent",openUrl:null,trackUrl:null,encodesUrl:'/player/availablequalities',showPreviousNextButtons:false,showOpenPopup:false}});})(jQuery);Function.prototype.inheritsFrom=function(parentClassOrObject){if(parentClassOrObject.constructor==Function){for(var i in parentClassOrObject.prototype){this.prototype[i]=parentClassOrObject.prototype[i];}
this.prototype.constructor=this;this.prototype.parent=parentClassOrObject.prototype;this.prototype.parentConstructor=parentClassOrObject;}
return this;}
var PLAY_STATE_BUFFERING="buffering";var PLAY_STATE_PLAYING="playing";var PLAY_STATE_PAUSED="paused";var PLAY_STATE_STOPED="stoped";var PLAY_STATE_IDLE="idle";var PLAY_STATE_COMPLETED="completed";var OPEN_STATE_OPENING="opening";var OPEN_STATE_LICENSING="licensing";var OPEN_STATE_LICENSE_OK="license_ok";var OPEN_STATE_OPENED="opened";var OPEN_STATE_CLOSED="closed";var OPEN_STATE_ERROR="error";function getPlayerObject(id){var ret=null;if(("#"+id).length){try{ret=$("#"+id).parent().parent().player("getCurrentPlayer");}catch(e){}}
return ret;}
function widgetPositionUpdate(widget){widget._refreshPositionSlider();}
function media(data,preview,ownerModeEnabled){this.__data=data;this.isPlatformContent=false;this.isLoaded=false;this.isWgChecked=undefined;window.fwk.debugJson(data.entry,"media::__data");if(data.record_count===undefined&&data.url!==undefined){this.isPlatformContent=false;this.isLoaded=true;}else{this.isLoaded=(data.record_count);try{window.fwk.debugJson(data.materials.material[0].common.wgcheck,"media::__data.common.wgcheck");if(data.materials.material[0].common.wgcheck.result=="true"){this.isWgChecked=true;}else{this.isWgChecked=false;this.isLoaded=false;}}catch(e){window.fwk.debugJson({"message":e.message},"media::__data.common.wgcheck.RaiseException");this.isWgChecked=undefined;}
this.isPlatformContent=true;}
this.preview=(preview===undefined)?0:preview;if(this.isLoaded){if(this.isPlatformContent){if(preview!=undefined&&preview){this.url=data.materials.material[0].url_preview;}else{if(ownerModeEnabled){if(data.materials.material[0].url_original){this.url=data.materials.material[0].url_original;}else{this.url=data.materials.material[0].url;}}else{this.url=data.materials.material[0].url;}}}else{this.url=data.url;}}
this.getEntryProp=function(name){if(this.isPlatformContent){return this._getProp(this.__data.entry,name);}else{return"";}};this.getMaterialProp=function(name){if(this.isPlatformContent){return this._getProp(this.__data.materials.material[0],name);}else{return"";}};this.getCommonProp=function(name){if(this.isPlatformContent){return this._getProp(this.__data.materials.material[0].common,name);}else{return"";}}
this.getRankingProp=function(name){if(this.isPlatformContent){return this._getProp(this.__data.materials.material[0].common.ranking,name);}else{return"";}}
this.getVtcProp=function(name){if(this.isPlatformContent){return this._getProp(this.__data.materials.material[0].common.was_purchased,name);}else{return"";}}
this.getMediaProp=function(name){if(this.isPlatformContent){return this._getProp(this.__data.materials.material[0].media,name);}else{return"";}}
this._getProp=function(obj,name){var ret=null;for(var prop in obj){if(prop.toLowerCase()==name.toLowerCase()){ret=eval("obj."+prop);if(typeof ret=="string"){ret=ret.replace(/&quote;/g,'"').replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&aacute;/g,"á").replace(/&eacute;/g,"é").replace(/&iacute;/g,"í").replace(/&oacute;/g,"ó").replace(/&uacute;/g,"ú").replace(/&uuml;/g,"ü");}
break;}}
return ret;}}
function basePlayer(settings,widget){this.settings=settings;this.widget=widget;this.type="";this.player=null;this.isReady=false;this.openState=OPEN_STATE_CLOSED;this.playState=PLAY_STATE_IDLE;this._uniqId=null;this._mediaLength=0;this._mediaPosition=0;this._volume=50;this._mute=false;this.__onPlayerReady=null;this.__onMediaLoaded=null;this.__onStateChanged=null;this.__onBeforePlay=null;this.__onError=null;this.__onStartLicenseAcquisition=null;this.__onEndLicenseAcquisition=null;}
basePlayer.prototype.drawPlayer=function(){};basePlayer.prototype.play=function(){};basePlayer.prototype.pause=function(){};basePlayer.prototype.stop=function(){};basePlayer.prototype.close=function(){this.openState=OPEN_STATE_CLOSED;};basePlayer.prototype.getMediaLength=function(){return 0;};basePlayer.prototype.getMediaPosition=function(){return 0;};basePlayer.prototype.setMediaPosition=function(position){};basePlayer.prototype.toggleFullScreen=function(){};basePlayer.prototype.getFullScreen=function(){};basePlayer.prototype.storeLicense=function(){return false;};basePlayer.prototype.canPause=function(){return true;};basePlayer.prototype.getDefaultAction=function(action){return action;};basePlayer.prototype.dataLicense=function(media){var data={content_id:media.getMaterialProp("content_id"),material_id:media.getCommonProp("id"),encode_id:media.getMaterialProp("encode_id"),preview:media.preview};return data;};basePlayer.prototype.openUrl=function(media){this.openState=OPEN_STATE_OPENING;};basePlayer.prototype.getUniqId=function(){if(this._uniqId==null){do{this._uniqId=new Date().getTime()+""+parseInt(Math.random()*9);}while(document.getElementById("playerWidget"+this._uniqId)!=null);}
return this._uniqId;};basePlayer.prototype.getPlayerWidgetId=function(){return"playerWidget"+this.getUniqId();};basePlayer.prototype.attachPlayerReady=function(func){this.__onPlayerReady=func;};basePlayer.prototype.firePlayerReady=function(){if(this.__onPlayerReady){this.__onPlayerReady();}};basePlayer.prototype.attachMediaLoaded=function(func){this.__onMediaLoaded=func;};basePlayer.prototype.fireMediaLoaded=function(){this.openState=OPEN_STATE_OPENED;if(this.__onMediaLoaded){this.__onMediaLoaded();}};basePlayer.prototype.attachStateChanged=function(func){this.__onStateChanged=func;};basePlayer.prototype.fireStateChanged=function(state){this.playState=state;if(this.__onStateChanged){this.__onStateChanged(state);}};basePlayer.prototype.attachBeforePlay=function(func){this.__onBeforePlay=func;}
basePlayer.prototype.fireBeforePlay=function(){var ret=true;if(this.__onBeforePlay){ret=this.__onBeforePlay();}
return ret;}
basePlayer.prototype.attachError=function(func){this.__onError=func;}
basePlayer.prototype.fireError=function(err){if(this.__onError){this.__onError(err);}}
basePlayer.prototype.attachStartLicenseAcquisition=function(func){this.__onStartLicenseAcquisition=func;}
basePlayer.prototype.fireStartLicenseAcquisition=function(){if(this.__onStartLicenseAcquisition){this.__onStartLicenseAcquisition();}}
basePlayer.prototype.attachEndLicenseAcquisition=function(func){this.__onEndLicenseAcquisition=func;}
basePlayer.prototype.fireEndLicenseAcquisition=function(error){if(this.__onEndLicenseAcquisition){this.__onEndLicenseAcquisition(error);}}
basePlayer.prototype.deAttachAll=function(){this.__onPlayerReady=null;this.__onMediaLoaded=null;this.__onStateChanged=null;this.__onBeforePlay=null;this.__onError=null;this.__onStartLicenseAcquisition=null;this.__onEndLicenseAcquisition=null;};basePlayer.prototype.destroy=function(){this.deAttachAll();this.player=null;this.openState=OPEN_STATE_CLOSED;this.playState=PLAY_STATE_IDLE;this._mediaLength=0;this._mediaPosition=0;delete this.__onPlayerReady;delete this.__onMediaLoaded;delete this.__onStateChanged;delete this.__onBeforePlay;delete this.__onError;delete this.__onStartLicenseAcquisition;delete this.__onEndLicenseAcquisition;delete this.widget;delete this.settings;delete this.player;delete this.parent;delete this.parentConstructor;};basePlayer.prototype.getVolume=function(){return this._volume;};basePlayer.prototype.setVolume=function(value){this._volume=value;};basePlayer.prototype.getMute=function(){return this._mute;};basePlayer.prototype.setMute=function(value){this._mute=value;};basePlayer.prototype._getRnd=function(){return new Date().getTime()+""+parseInt(Math.random()*15);}
function flashPlayer(settings,widget){this.parentConstructor.call(this,settings,widget);this.type="flash";}
flashPlayer.inheritsFrom(basePlayer);flashPlayer.prototype.drawPlayer=function(){$('<div id="'+this.getPlayerWidgetId()+'"></div>').appendTo($("#"+this.settings.videoDivId));var flashvars={controlbar:"none",volume:this.getVolume(),mute:this.getMute(),displayclick:this.settings.defaultAction,linktarget:this.settings.linkTarget,provider:'http'};var fileExtension=this.widget._getExtension(this.widget.currentMedia().url).toLowerCase();if(fileExtension=='mp3'||fileExtension=='fla'){flashvars.plugins='revolt-1';}
if(this.widget)
var params={allowfullscreen:this.settings.allowFullScreen,allowscriptaccess:"always",wmode:this.settings.wMode};var attributes={id:this.getPlayerWidgetId(),name:this.getPlayerWidgetId()};var currTitle=document.title;swfobject.embedSWF(this.settings.embed+'?rnd='+this._getRnd(),this.getPlayerWidgetId(),this.settings.width,this.settings.height,this.settings.version,false,flashvars,params,attributes);document.title=currTitle;};flashPlayer.prototype.openUrl=function(media){this.parent.openUrl.call(this);if(this.player!=null){this.player.sendEvent("LOAD",media.url);}};flashPlayer.prototype.play=function(){if(this.player!=null){if(this.fireBeforePlay()){this.player.sendEvent("PLAY",true);}}};flashPlayer.prototype.pause=function(){if(this.player!=null){this.player.sendEvent("PLAY",false);}};flashPlayer.prototype.stop=function(){if(this.player!=null){this.player.sendEvent("STOP");}};flashPlayer.prototype.getMediaLength=function(){return this._mediaLength;}
flashPlayer.prototype.getMediaPosition=function(){return this._mediaPosition;}
flashPlayer.prototype.setMediaPosition=function(position){if(this.player!=null){this.player.sendEvent("SEEK",position);this._mediaPosition=position;}}
flashPlayer.prototype.getVolume=function(){var ret=0;if(this.player!=null){ret=this.player.getConfig().volume;}else{ret=this.parent.getVolume.call(this);}
return ret;}
flashPlayer.prototype.setVolume=function(value){if(this.player!=null){this.player.sendEvent("VOLUME",value);}
this.parent.setVolume.call(this,value);}
flashPlayer.prototype.getMute=function(){var ret=this.parent.getMute.call(this);if(this.player!=null){ret=this.player.getConfig().mute;}
return ret;}
flashPlayer.prototype.setMute=function(value){if(this.player!=null){this.player.sendEvent("MUTE",value);}
this.parent.setMute.call(this,value);}
flashPlayer.prototype.deAttachAll=function(){this.parent.deAttachAll.call(this);if(this.player){this.player.removeModelListener("LOADED","playerFlashMediaLoad");this.player.removeModelListener("STATE","playerFlashStateChanged");this.player.removeModelListener("TIME","playerFlashTime");this.player.removeModelListener("ERROR","playerFlashError");}}
flashPlayer.prototype.destroy=function(){this.parent.destroy.call(this);swfobject.removeSWF(this.getPlayerWidgetId());}
function playerReady(obj){var currentPlayer=getPlayerObject(obj["id"]);currentPlayer.player=document.getElementById(currentPlayer.getPlayerWidgetId());currentPlayer.player.addViewListener("LOAD","playerFlashMediaLoad");currentPlayer.player.addModelListener("STATE","playerFlashStateChanged");currentPlayer.player.addModelListener("TIME","playerFlashTime");currentPlayer.player.addModelListener("ERROR","playerFlashError");currentPlayer.isReady=true;currentPlayer.firePlayerReady();}
function playerFlashMediaLoad(params){var currentPlayer=getPlayerObject(params.id);if(currentPlayer!=null){currentPlayer.fireMediaLoaded();}}
function playerFlashStateChanged(params){var currentPlayer=getPlayerObject(params.id);if(params.newstate=="IDLE"){currentPlayer.fireStateChanged(PLAY_STATE_STOPED);}else{currentPlayer.fireStateChanged(params.newstate.toLowerCase());}};function playerFlashTime(params){var currentPlayer=getPlayerObject(params.id);currentPlayer._mediaLength=params.duration;currentPlayer._mediaPosition=params.position;}
function playerFlashError(params){var currentPlayer=getPlayerObject(params.id);currentPlayer.fireError(params.message);}
function mediaPlayer(settings,widget){this.parentConstructor.call(this,settings,widget);this.type="mediaplayer";}
mediaPlayer.inheritsFrom(basePlayer);mediaPlayer.prototype.dataLicense=function(media){var data=this.parent.dataLicense.call(this,media);var drm=document.getElementById("drm");if(drm){data.challenge=drm.GetSystemInfo();return data;}else{return false;}};mediaPlayer.prototype.storeLicense=function(license){var drm=document.getElementById("drm");if(drm){try{drm.StoreLicense(license);}catch(e){return e.message;}}}
mediaPlayer.prototype.fireMediaLoaded=function(){this.setMute(this.parent.getMute.call(this));this.parent.fireMediaLoaded.call(this);};mediaPlayer.prototype.drawPlayer=function(){var windowlessVideo="";if(this.settings.wMode=="transparent"){windowlessVideo="true";}
var size=this.widget._getSizeByName(this.widget.size());if($.browser.msie){var html='<OBJECT ID="'+this.getPlayerWidgetId()+'"width="'+size.width+'" height="'+size.height+'" CLASSID="'+this.settings.embed+'"'+'<PARAM name="autoStart" value="false">'+'<PARAM name="uiMode" value="none">'+'<PARAM name="showControls" value="false">'+'<PARAM name="windowlessVideo" value="'+windowlessVideo+'">'+'<PARAM name="volume" value="'+this.getVolume()+'">'+'<PARAM name="mute" value="'+this.getMute()+'">'+'<PARAM name="enableContextMenu" value="'+this.settings.contextMenu+'">'+'</OBJECT>';if(this.settings.urlPreDelivery){html+='<OBJECT classid="clsid:A9FC132B-096D-460B-B7D5-1DB0FAE0C062" height="0" id="drm" width="0"></object>';}}else{var html='<OBJECT type="application/x-ms-wmp" id="'+this.getPlayerWidgetId()+'"width="'+size.width+'" height="'+size.height+'">'+'<PARAM name="autoStart" value="false">'+'<PARAM name="uiMode" value="none">'+'<PARAM name="showControls" value="false">'+'<PARAM name="windowlessVideo" value="'+windowlessVideo+'">'+'<PARAM name="volume" value="'+this.getVolume()+'">'+'<PARAM name="mute" value="'+this.getMute()+'">'+'</OBJECT>';}
if($.browser.msie){document.getElementById(this.settings.videoDivId).insertAdjacentHTML("beforeEnd",html);}else{$("#"+this.settings.videoDivId).append(html);}
setTimeout("mediaPlayerReady('"+this.getPlayerWidgetId()+"');",1);}
mediaPlayer.prototype.openUrl=function(media){if(media.getEntryProp('licensed')&&this.settings.urlPreDelivery&&this.openState!=OPEN_STATE_LICENSE_OK){var mthis=this;var data=this.dataLicense(media);if(data){this.openState=OPEN_STATE_LICENSING;this.fireStartLicenseAcquisition();window.fwk.debugJson(data,"mediaPlayer->openUrl::LicenseParams");var urlPredelivery=this.settings.urlPreDelivery;if(urlPredelivery.indexOf(':region')!=-1){urlPredelivery=urlPredelivery.replace(':region',$(document.body).attr('nombreRegion'));}
$.post(urlPredelivery,data,function(result,textStatus){window.fwk.debugJson(result.entry,"mediaPlayer->openUrl::License (entry)");window.fwk.debugJson(result.license,"mediaPlayer->openUrl::License");var error=mthis.storeLicense(result.license.raw);if(error===undefined){mthis.openState=OPEN_STATE_LICENSE_OK;mthis.fireEndLicenseAcquisition();mthis.openUrl(media);}else{mthis.fireEndLicenseAcquisition(error);}},"json");}else{this.parent.openUrl.call(this,media);}}else{this.parent.openUrl.call(this,media);}
if(this.openState==OPEN_STATE_OPENING){if(this.player!=null){this.player.URL=media.url;}}}
mediaPlayer.prototype.play=function(){if(this.player!=null){if(this.fireBeforePlay()){this.player.controls.play();}}}
mediaPlayer.prototype.pause=function(){if(this.player!=null){this.player.controls.pause();}}
mediaPlayer.prototype.stop=function(){if(this.player!=null&&this.player.controls!=null){this.player.controls.stop();}}
mediaPlayer.prototype.close=function(){if(this.player!=null){this.player.close();}
this.parent.close.call(this);}
mediaPlayer.prototype.getMediaLength=function(){if(this.player.currentMedia){return this.player.currentMedia.duration;}}
mediaPlayer.prototype.getMediaPosition=function(){if(this.player!=null){this._mediaPosition=this.player.controls.currentPosition;}
return this._mediaPosition;}
mediaPlayer.prototype.setMediaPosition=function(position){if(this.player!=null){this.player.controls.currentPosition=position;this._mediaPosition=position;}}
mediaPlayer.prototype.getVolume=function(){var ret=0;if(this.player!=null){ret=this.player.settings.volume;}else{ret=this.parent.getVolume.call(this);}
return ret;}
mediaPlayer.prototype.setVolume=function(value){if(this.player!=null){this.player.settings.volume=value;}
this.parent.setVolume.call(this,value);}
mediaPlayer.prototype.getMute=function(){var ret=this.parent.getMute.call(this);if(this.player!=null){ret=this.player.settings.mute;}
return ret;}
mediaPlayer.prototype.setMute=function(value){if(this.player!=null){this.player.settings.mute=value;}
this.parent.setMute.call(this,value);}
mediaPlayer.prototype.deAttachAll=function(){this.parent.deAttachAll.call(this);var currentPlayer=getPlayerObject(this.getPlayerWidgetId());}
mediaPlayer.prototype.destroy=function(){this.parent.destroy.call(this);$("#"+this.getPlayerWidgetId()).remove();$("#drm").remove();}
mediaPlayer.prototype.getFullScreen=function(){if(this.player!=null){return this.player.fullScreen;}}
mediaPlayer.prototype.toggleFullScreen=function(){if(this.player!=null){try{this.player.fullScreen=!this.getFullScreen();}catch(e){}}}
mediaPlayer.prototype.canPause=function(){var ret=this.parent.canPause.call(this);if(this.player!=null){ret=this.player.controls.isAvailable("pause");}
return ret;}
function mediaPlayerReady(id){var currentPlayer=getPlayerObject(id);if(currentPlayer){currentPlayer.player=document.getElementById(currentPlayer.getPlayerWidgetId());currentPlayer.player.settings.autoStart=false;if($.browser.msie){currentPlayer.player.attachEvent("openStateChange",function(state){mpOpenStateChange(currentPlayer,state);});currentPlayer.player.attachEvent("playStateChange",function(state){mpPlayStateChange(currentPlayer,state);})
currentPlayer.player.attachEvent("error",function(){mpErrorEvent(currentPlayer);});currentPlayer.player.attachEvent("click",function(button,shiftState,x,y){mpClickEvent(currentPlayer,button,shiftState,x,y);});}
currentPlayer.isReady=true;currentPlayer.firePlayerReady();}}
function OnDSOpenStateChangeEvt(state){if(!$.browser.msie){mpOpenStateChange(window.fwk.controllers.currentPlayer.player("getCurrentPlayer"),state);}}
function OnDSPlayStateChangeEvt(state){if(!$.browser.msie){mpPlayStateChange(window.fwk.controllers.currentPlayer.player("getCurrentPlayer"),state);}}
function OnDSErrorEvt(){if(!$.browser.msie){mpErrorEvent(window.fwk.controllers.currentPlayer.player("getCurrentPlayer"));}}
function OnDSClickEvt(button,shiftState,x,y){if(!$.browser.msie){mpClickEvent(window.fwk.controllers.currentPlayer.player("getCurrentPlayer"),button,shiftState,x,y);}}
function mpOpenStateChange(currentPlayer,state){if(state==13&&currentPlayer.player.settings.autoStart){if(currentPlayer.openState==OPEN_STATE_OPENING){currentPlayer.fireMediaLoaded();}}}
function mpPlayStateChange(currentPlayer,state){var newState="";switch(state){case 1:if(currentPlayer.playState!=PLAY_STATE_COMPLETED){newState=PLAY_STATE_STOPED;}
break;case 2:if(currentPlayer.playState!=PLAY_STATE_COMPLETED){newState=PLAY_STATE_PAUSED;}
break;case 3:newState=PLAY_STATE_PLAYING;break;case 8:newState=PLAY_STATE_COMPLETED;break;case 10:if(!currentPlayer.player.settings.autoStart){if(currentPlayer.openState==OPEN_STATE_OPENING){currentPlayer.fireMediaLoaded();}}
break;}
if(newState!=""){currentPlayer.fireStateChanged(newState);}}
function mpErrorEvent(currentPlayer){var err="";for(var i=0;i<currentPlayer.player.error.errorCount;i++){err+="["+currentPlayer.player.error.item(i).errorCode+"] "+currentPlayer.player.error.item(i).errorDescription;}
currentPlayer.fireError(err);}
function mpClickEvent(currentPlayer,button,shiftState,x,y){if(button==1){switch(currentPlayer.settings.defaultAction){case"play":if(currentPlayer.player.playState==1||currentPlayer.player.playState==2){currentPlayer.play();}else{currentPlayer.pause();}
break;case"fullscreen":if(!currentPlayer.getFullScreen()){currentPlayer.toggleFullScreen();}
break;case"none":break;default:window.open(currentPlayer.settings.defaultAction,currentPlayer.settings.linkTarget);break;}}}
function slPlayer(settings,widget){this.parentConstructor.call(this,settings,widget);this.type="silverlight";}
slPlayer.inheritsFrom(basePlayer);slPlayer.prototype.drawPlayer=function(){var windowlessVideo="";var urlLicenser="";if(this.settings.wMode=="transparent"){windowlessVideo="true";}
if(this.settings.urlLicenser){urlLicenser=this.settings.urlLicenser;}
var size=this.widget._getSizeByName(this.widget.size());var html=$('<object id="'+this.getPlayerWidgetId()+'" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="'+size.width+'" height="'+size.height+'"><param name="source" value="'+this.settings.embed+'"/><param name="background" value="white"/><param name="minRuntimeVersion" value="2.0.31005.0"/><param name="autoUpgrade" value="true"/><param name="windowless" value="true"/><param name="initparams" value="autoStart=false,volume='+this.getVolume()+',mute='+this.getMute()+',allowFullScreen='+this.settings.allowFullScreen+',defaultAction='+this.settings.defaultAction+',linkTarget='+this.settings.linkTarget+',LicenseServerUri='+urlLicenser+'"/></object>').appendTo($("#"+this.settings.videoDivId));}
slPlayer.prototype.openUrl=function(media){this.parent.openUrl.call(this);if(this.player!=null){this.player.open(media.url);}}
slPlayer.prototype.fireBeforePlay=function(){if(this.playState==PLAY_STATE_COMPLETED){this.setMediaPosition(0);}
return this.parent.fireBeforePlay.call(this);}
slPlayer.prototype.play=function(){if(this.player!=null){if(this.fireBeforePlay()){this.player.play();}}}
slPlayer.prototype.pause=function(){if(this.player!=null){this.player.pause();}}
slPlayer.prototype.stop=function(){if(this.player!=null){this.player.stop();}}
slPlayer.prototype.close=function(){if(this.player!=null){this.player.close();}
this.parent.close.call(this);}
slPlayer.prototype.getMediaLength=function(){return this._mediaLength;}
slPlayer.prototype.getMediaPosition=function(){try{if(this.player!=null){this._mediaPosition=this.player.position;}}catch(e){}
return this._mediaPosition;}
slPlayer.prototype.setMediaPosition=function(position){if(this.player!=null){this.player.position=position;this._mediaPosition=position;}}
slPlayer.prototype.getVolume=function(){var ret=0;if(this.player!=null){ret=this.player.volume;}else{ret=this.parent.getVolume.call(this);}
return ret;}
slPlayer.prototype.setVolume=function(value){if(this.player!=null){this.player.volume=value;}
this.parent.setVolume.call(this,value);}
slPlayer.prototype.getMute=function(){var ret=this.parent.getMute.call(this);if(this.player!=null){ret=this.player.isMuted;}
return ret;}
slPlayer.prototype.setMute=function(value){if(this.player!=null){this.player.isMuted=value;}
this.parent.setMute.call(this,value);}
slPlayer.prototype.deAttachAll=function(){this.parent.deAttachAll.call(this);var currentPlayer=getPlayerObject(this.getPlayerWidgetId());}
slPlayer.prototype.destroy=function(){this.parent.destroy.call(this);$("#"+this.getPlayerWidgetId()).remove();}
slPlayer.prototype.getFullScreen=function(){if(this.player!=null){return this.player.isFullScreen;}}
slPlayer.prototype.canPause=function(){var ret=this.parent.canPause.call(this);if(this.player!=null){ret=this.player.canPause;}
return ret;}
function slPlayerReady(id){var currentPlayer=getPlayerObject(id);if(currentPlayer){currentPlayer.player=document.getElementById(currentPlayer.getPlayerWidgetId()).content.player;currentPlayer.player.onLoaded=function(sender,e){var currentPlayer=getPlayerObject(sender.playerId);if(currentPlayer){currentPlayer._mediaLength=currentPlayer.player.duration;currentPlayer.fireMediaLoaded();}};currentPlayer.player.onCompleted=function(sender,e){var currentPlayer=getPlayerObject(sender.playerId);if(currentPlayer){currentPlayer.fireStateChanged(PLAY_STATE_COMPLETED);}};currentPlayer.player.onError=function(sender,e){var currentPlayer=getPlayerObject(sender.playerId);if(currentPlayer){currentPlayer.fireError(e.message);}};currentPlayer.player.onStateChange=function(sender,e){var newState="";switch(e.newState){case 3:newState=PLAY_STATE_PLAYING;break;case 4:newState=PLAY_STATE_PAUSED;break;case 5:newState=PLAY_STATE_STOPED;break;}
if(newState!=""){var currentPlayer=getPlayerObject(sender.playerId);if(currentPlayer&&currentPlayer.fireStateChanged){currentPlayer.fireStateChanged(newState);}}};currentPlayer.isReady=true;currentPlayer.firePlayerReady();}}
(function($){$.widget("ui.playlist",{_preventRiseSelected:false,_current:null,_currentIndex:-1,_shuffle:false,_shuffleArray:null,_shuffleCurrentIndex:-1,_repeat:false,_commonElement:null,_currentEncode:null,_currentPlaylistId:null,_disabled:false,_init:function(){var mthis=this;var id="playlist"+this.options.type;this._ul=this.element.find("ul").sortable({axis:"y",distance:10,cancel:'.global-nodata',start:function(event,ui){mthis._preventRiseSelected=true;},stop:function(event,ui){if($(ui.item).find("div:first").hasClass("ui-playlist-item-sel")){mthis._currentIndex=mthis._ul.children().index(ui.item);}},update:function(event,ui){if(mthis.options.onSortChange){mthis.options.onSortChange();}}});this._ul.disableSelection();this.element.find("#selectAll").click(function(e){var selectAll=$(this);mthis._ul.find("input:checkbox").each(function(){$(this).attr("checked",selectAll.attr("checked"));});});this._prepareItems();if(this.options.autoPlay){this.next();}},disabled:function(value){if(value===undefined){return this._disabled;}else{this._disabled=value;}},clear:function(){if(this._ul){$(this._ul).find("li").each(function(){$(this).remove();});}},load:function(url,data,callback){var mthis=this;this.clear();$.ajax({type:"GET",url:url,data:(data===undefined?null:data),success:function(html){mthis._current=null;mthis._currentIndex=-1;mthis._shuffleArray=null;mthis._shuffleCurrentIndex=-1;mthis._currentEncode=null;mthis._currentPlaylistId=null;mthis._ul.html(html);if($(mthis._ul).find(".ui-playlist-item").length>0){mthis._prepareItems();if(callback){callback();}
if(mthis.options.autoPlay){if(data.content_id){var goTo=-1;mthis._ul.find("li[content_id='"+data.content_id+"']").each(function(){if(goTo==-1){goTo=$(this).parent().children().index(this);}})
if(goTo!=-1){mthis.goto(goTo);}else{mthis.next();}}else{mthis.next();}}}else{mthis._trigger("onNoDataFound");if(callback){callback();}}}});},deleteItems:function(){this._ul.find("input:checked").each(function(){$(this).parent().parent().remove();});},next:function(){if(!this._shuffle){var eq=-1;var bCont=true;eq=this._currentIndex+1;if(this._ul.children().length<=eq){if(this._repeat){eq=0;}else{bCont=false;this._trigger("onEof");}}
if(bCont){var next=this._ul.find("li:eq("+eq+") div:first");this._raiseSelected(this._attrToObject(next.parent()),next);}}else{if(this._shuffleCurrentIndex>=0){this._shuffleCurrentIndex++;if(this._shuffleCurrentIndex==this._shuffleArray.length){var index=this._shuffleIndex();this._shuffleArray.push(index);this._shuffleCurrentIndex=this._shuffleArray.length-1;}else{var index=this._shuffleArray[this._shuffleCurrentIndex];}}else{var index=this._shuffleIndex();this._shuffleArray.push(index);}
this.goto(index);}
if(this.options.onNext){this.options.onNext(this._current);}},previous:function(){if(!this._shuffle){var eq=this._currentIndex-1;var bCont=true;if(eq<0){if(this._repeat){eq=this._ul.children().length-1;}else{bCont=false;this._trigger("onBof");}}
if(bCont){var previous=this._ul.find("li:eq("+eq+") div:first");this._raiseSelected(this._attrToObject(previous.parent()),previous);}}else{if(this._shuffleCurrentIndex==-1){var position=this._shuffleArray.length-2;}else{var position=this._shuffleCurrentIndex-1;}
if(position>=0){var index=this._shuffleArray[position];this.goto(index);this._shuffleCurrentIndex=position;}}
if(this.options.onPrevious){this.options.onPrevious(this._current);}},goto:function(position){if(position>=0&&position<this._ul.children().length){var goTo=this._ul.find("li:eq("+position+") div:first");this._raiseSelected(this._attrToObject(goTo.parent()),goTo);}},gotoFromContentId:function(contentId){var self=this;this._ul.find("li[content_id='"+contentId+"']").each(function(){goTo=$(this).parent().children().index(this);self.goto(goTo);return false;});},shuffle:function(value){if(value===undefined){return this._shuffle;}else{this._shuffle=value;if(this._shuffle){this._shuffleArray=new Array();if(this._currentIndex>-1){this._shuffleArray.push(this._currentIndex);}}else{this._shuffleArray=null;this._shufflePrevious=-1;}}},repeat:function(value){if(value===undefined){return this._repeat;}else{this._repeat=value;}},currentElement:function(){return this._current;},selectedMaterialIds:function(){var ret="";this._ul.find("input:checked").each(function(){ret+=$(this).parent().parent().attr("material_id")+"|";});return ret;},allMaterialIds:function(){var ret="";this._ul.find("input:checkbox").each(function(){ret+=$(this).parent().parent().attr("material_id")+"|";});return ret;},selectedIds:function(returnEncode){var ret="";this._ul.find("input:checked").each(function(){var li=$(this).parent().parent();ret+=li.attr("group_id")+","+li.attr("content_id")+","+li.attr("encode_id")+"|";});ret=ret.substr(0,ret.length-1);return ret;},playlistId:function(value){if(value===undefined){return this._currentPlaylistId;}else{this._currentPlaylistId=value;}},moveUp:function(){if(this._current!=null&&this._currentIndex>0){var eq=this._currentIndex-1;this._ul.find("li:eq("+eq+")").before(this._current);this._currentIndex=eq;}},moveDn:function(){var eq=this._currentIndex+1;if(this._current!=null&&this._ul.children().length>eq){this._ul.find("li:eq("+eq+")").after(this._current);this._currentIndex=eq;}},length:function(){return this._ul.find(".ui-playlist-item").length;},currentIndex:function(){return this._currentIndex;},getItemData:function(position){return this._attrToObject(this._ul.find("li:eq("+position+")"));},_prepareItems:function(){var mthis=this;if(this._ul){$(this._ul).find(".ui-playlist-item").each(function(i){var li=$(this).parent();$(this).hover(function(){if(!$(this).hasClass("ui-playlist-item-over")){$(this).addClass("ui-playlist-item-over");}},function(){if($(this).hasClass("ui-playlist-item-over")){$(this).removeClass("ui-playlist-item-over");}});$(this).click(function(e){mthis._raiseSelected(mthis._attrToObject(li),this);if(mthis._shuffle){mthis._shuffleCurrentIndex=-1;mthis._shuffleArray.push(mthis._currentIndex);}});$(this).find(".ui-playlist-item-encodes").children().each(function(){$(this).hover(function(){var css="ui-playlist-item-encode-"+$(this).attr("encode_id")+"-over ui-playlist-item-type-"+$(this).attr("media_type")+"-over";$(this).addClass(css);},function(){var css="ui-playlist-item-encode-"+$(this).attr("encode_id")+"-over ui-playlist-item-type-"+$(this).attr("media_type")+"-over";$(this).removeClass(css);});$(this).click(function(e){e.stopPropagation();mthis._raiseSelected(mthis._attrToObject(li,$(this).attr("encode_id")),this);});});$(this).find(".ui-playlist-item-actions").children().each(function(){$(this).hover(function(){$(this).toggleClass("ui-playlist-item-action-over");},function(){$(this).toggleClass("ui-playlist-item-action-over");});$(this).click(function(e){e.stopPropagation();if(mthis.options.itemAction){mthis.options.itemAction(mthis._attrToObject(li),$(this).attr("action"),$(this));}});});});}},_attrToObject:function(element,enc_id){var ret={group_id:$(element).attr("group_id"),content_id:$(element).attr("content_id"),encode_id:(this.options.defaultEncode?this.options.defaultEncode:(enc_id?enc_id:$(element).attr("encode_id"))),material_id:$(element).attr("material_id")};return ret;},_raiseSelected:function(data,element){if(!this._preventRiseSelected){if(!this._disabled){var raise=true;var callParent=false;if($(element).hasClass("ui-playlist-item")){if($(element).hasClass("ui-playlist-item-sel")){raise=false;}}else{var cssSelEnc="ui-playlist-item-encode-"+$(element).attr("encode_id")+"-sel";var cssSelTyp="ui-playlist-item-type-"+$(element).attr("media_type")+"-sel";if($(element).hasClass(cssSelEnc)||$(element).hasClass(cssSelTyp)){raise=false;}else{if(this._currentEncode){var css="ui-playlist-item-encode-"+this._currentEncode.attr("encode_id")+"-sel ui-playlist-item-type-"+this._currentEncode.attr("media_type")+"-sel";this._currentEncode.removeClass(css);}
var css="ui-playlist-item-encode-"+$(element).attr("encode_id")+"-sel ui-playlist-item-type-"+$(element).attr("media_type")+"-sel";$(element).addClass(css);this._currentEncode=$(element);callParent=true;}}
if(raise){$(".ui-playlist-item-sel").removeClass("ui-playlist-item-sel");if(!callParent){$(element).addClass("ui-playlist-item-sel");if(this._currentEncode){var css="ui-playlist-item-encode-"+this._currentEncode.attr("encode_id")+"-sel ui-playlist-item-type-"+this._currentEncode.attr("media_type")+"-sel";this._currentEncode.removeClass(css);}
var css="ui-playlist-item-encode-"+$(element).parent().attr("encode_id")+"-sel ui-playlist-item-type-"+$(element).parent().attr("media_type")+"-sel";var selector=".ui-playlist-item-encode-"+$(element).parent().attr("encode_id");$(element).find(selector).addClass(css);this._currentEncode=$(element).find(selector);this._current=$(element).parent();}else{$(element).parent().parent().addClass("ui-playlist-item-sel");this._current=$(element).parent().parent().parent();}
this._currentIndex=this._ul.children().index(this._current);if(this.options.selected){this.options.selected(data,$(this.element).playlist());}}}}else{this._preventRiseSelected=false;}},_shuffleIndex:function(){var min=0;var max=this._ul.children().length-1;var num=max-min;var ret=0;do{ret=Math.random()*num;ret=Math.round(ret);ret=parseInt(min)+ret;}while(ret==this._currentIndex);return ret;}});$.extend($.ui.playlist,{version:"@VERSION",getter:"shuffle repeat selectedMaterialIds selectedIds playlistId allMaterialIds length currentIndex getItemData disabled",defaults:{type:"banda",selected:null,autoPlay:false,defaultEncode:null,itemAction:null,onNext:null,onPrevious:null,onRequestLogin:null,onSortChange:null,onNoDataFound:null}});})(jQuery);(function($){$.widget("ui.playlistContainer",{_tabs:null,_selectedPlaylist:null,_playerPlaylist:null,_commonElement:null,_selectedPlaylistIndex:-1,_commonHidden:false,_init:function(){var mthis=this;this._tabs=$(this.element).tabs({select:function(event,ui){mthis._closeAllDialogs();var playlist=mthis.options.playlists[ui.index];mthis._selectedPlaylist=playlist.obj;mthis._selectedPlaylistIndex=ui.index;mthis._updateToolbarState();if(!playlist.isFixed){if($(ui.panel).find("ul").children().length==0){mthis._showLoadPlaylist();}}}});this._initPlaylists();this._initToolbarButtons();this._initCommon();this._initLoadPlaylist();this._initAppendPlaylist();if(!this.options.selected){this.options.selected=0;}
this._selectedPlaylistIndex=this.options.selected;this._tabs.tabs("select","#"+this.options.playlists[this._selectedPlaylistIndex].name);this._selectedPlaylist=mthis.options.playlists[this._selectedPlaylistIndex].obj;this._updateToolbarState();},_initPlaylists:function(){var mthis=this;for(var index in this.options.playlists){var playlist=this.options.playlists[index];var autoPlay=false;switch(mthis.options.autoPlay){case"all":autoPlay=true;break;case"none":autoPlay=false;break;default:if(playlist.name==mthis.options.autoPlay){autoPlay=true;}
break;}
playlist.obj=this.element.find("#"+playlist.name).playlist({autoPlay:autoPlay,selected:function(data,playlist){mthis._playerPlaylist=playlist;if(mthis.options.onSelected){mthis._playerPlaylist.playlist('disabled',true);mthis.options.onSelected(data);}},itemAction:function(data,action,ui){if(mthis.options.onItemAction){mthis.options.onItemAction(data,action,ui);}},onRequestLogin:function(){if(mthis.options.onRequestLogin){mthis.options.onRequestLogin();}},onSortChange:function(){if(mthis.options.autoSave){mthis.save();}}});if(!this._playerPlaylist){this._playerPlaylist=playlist.obj;}
if(playlist.urls&&playlist.urls.get){playlist.obj.playlist("load",playlist.urls.get,null,function(){mthis._trigger('onPlaylistLoad',null,mthis._playerPlaylist);});}}},_initToolbarButtons:function(){var mthis=this;$(this.element).find(".ui-playlist-toolbar-button").each(function(){$(this).hover(function(){$(this).toggleClass("ui-playlist-toolbar-button-over");},function(){$(this).toggleClass("ui-playlist-toolbar-button-over");});$(this).click(function(e){if(!$(this).hasClass("ui-playlist-toolbar-button-dis")){mthis.action($(this).attr("action"));}});});this.element.find("#playlistCheckAll").change(function(e){var checked=$(this).attr("checked");mthis._ul.find("input:checkbox").each(function(){$(this).attr("checked",checked);});});},_initCommon:function(){this._commonElement=$(this.element).find(".ui-playlist-common");var self=this;this._commonElement.find('.ui-playlist-common-title').click(function(e){if(self._commonHidden){self.commonShow();}else{self.commonHide();}});if(this.options.commonHide){this.commonHide();}},_initLoadPlaylist:function(){var mthis=this;this.element.find("#playlistLoadOk").click(function(e){if(mthis.element.find("#playlistLoadCombo").val()){mthis._loadPlaylist(mthis.options.urls.userPlaylistLoad,mthis.element.find("#playlistLoadCombo option:selected").text(),mthis.element.find("#playlistLoadCombo").val(),mthis._selectedPlaylistIndex);mthis._hideLoadPlaylist();}});this.element.find("#playlistLoadClose").click(function(e){mthis._hideLoadPlaylist();});},_initAppendPlaylist:function(){var mthis=this;this.element.find("#playlistAppendNew").click(function(e){mthis.element.find("#playlistAppendCombo").attr("disabled","disabled");mthis.element.find("#playlistAppendNewName").removeAttr("disabled");});this.element.find("#playlistAppendExists").click(function(e){mthis.element.find("#playlistAppendNewName").attr("disabled","disabled");mthis.element.find("#playlistAppendCombo").removeAttr("disabled");});this.element.find("#playlistAppendOk").click(function(e){mthis._appendPlaylistUser();});this.element.find("#playlistAppendClose").click(function(e){mthis._hideAppendPlaylist();});},next:function(){if(this._playerPlaylist){this._playerPlaylist.playlist("next");}},previous:function(){if(this._playerPlaylist){this._playerPlaylist.playlist("previous");}},shuffle:function(value){if(value===undefined){return this._playerPlaylist.playlist("shuffle");}else{if(value){$(this.element).find(".ui-playlist-shuffle-button").addClass("ui-playlist-toolbar-button-sel");}else{$(this.element).find(".ui-playlist-shuffle-button").removeClass("ui-playlist-toolbar-button-sel");}
this._playerPlaylist.playlist("shuffle",value);}},gotoFromContentId:function(contentId){if(this._playerPlaylist){this._playerPlaylist.playlist('gotoFromContentId',contentId);}},repeat:function(value){if(value===undefined){return this._playerPlaylist.playlist("repeat");}else{if(value){$(this.element).find(".ui-playlist-repeat-button").addClass("ui-playlist-toolbar-button-sel");}else{$(this.element).find(".ui-playlist-repeat-button").removeClass("ui-playlist-toolbar-button-sel");}
this._playerPlaylist.playlist("repeat",value);}},action:function(action){switch(action){case"up":this._selectedPlaylist.playlist("moveUp");break;case"down":this._selectedPlaylist.playlist("moveDn");break;case"previous":this.previous();break;case"next":this.next();break;case"shuffle":this.shuffle(!this.shuffle());break;case"repeat":this.repeat(!this.repeat());break;case"load":if(!this.element.find(".ui-playlist-append").hasClass("ui-playlist-append-hidden")){this._hideAppendPlaylist();}
var playlistLoadDiv=this.element.find(".ui-playlist-load");if(playlistLoadDiv.hasClass("ui-playlist-load-hidden")){this._showLoadPlaylist();}else{this._hideLoadPlaylist();}
break;case"append":if(!this.element.find(".ui-playlist-load").hasClass("ui-playlist-load-hidden")){this._hideLoadPlaylist();}
var playlistAppendDiv=this.element.find(".ui-playlist-append");if(playlistAppendDiv.hasClass("ui-playlist-append-hidden")){this._showAppendPlaylist();}else{this._hideAppendPlaylist();}
break;case"delete":this.deleteItems();break;}},commonShow:function(){this._commonElement.show(300);this._commonHidden=false;},commonHide:function(){this._commonElement.hide(300);this._commonHidden=true;},toggleCommon:function(){if(this._commonHidden){this.commonShow();}else{this.commonHide();}},common:function(element){this._commonElement.find(".ui-playlist-common-html").html("");$(element).appendTo(this._commonElement.find(".ui-playlist-common-html"));},deleteItems:function(ids,playlist_id){var mthis=this;var data={playlist_id:(playlist_id===undefined)?this._selectedPlaylist.playlist("playlistId"):playlist_id};var url=this.options.playlists[this._selectedPlaylistIndex].urls.del;if(url&&this.options.autoSave){url=this._parseUrl(url,this._selectedPlaylist);$.post(url,data,function(data,textStatus){data=mthis._removeLB(data);if(data=="NOT_LOGGEDIN"){if(mthis.options.onRequestLogin){mthis.options.onRequestLogin();}}else{mthis._selectedPlaylist.playlist("deleteItems");}});}},save:function(){var playlist=this.options.playlists[this._selectedPlaylistIndex];var url=playlist.urls.save;if(url){var data={playlist_id:this._selectedPlaylist.playlist("playlistId"),ids:this._selectedPlaylist.playlist("allMaterialIds")};$.post(url,data,function(data,textStatus){data=mthis._removeLB(data);if(data=="NOT_LOGGEDIN"){if(mthis.options.onRequestLogin){mthis.options.onRequestLogin();}}});}},getItemData:function(position){var ret=null;if(this._playerPlaylist){ret=this._playerPlaylist.playlist('getItemData',position);}
return ret;},disablePlayerPlaylist:function(value){if(value===undefined){return this._playerPlaylist.playlist('disabled');}else{this._playerPlaylist.playlist('disabled',value);}},_updateToolbarState:function(){var playlist=this.options.playlists[this._selectedPlaylistIndex];if(playlist.urls.del){this.element.find(".ui-playlist-delete-button").removeClass("ui-playlist-toolbar-button-dis");}else{this.element.find(".ui-playlist-delete-button").addClass("ui-playlist-toolbar-button-dis");}
if(this.options.autoSave){this.element.find(".ui-playlist-save-button").hide();}else{if(playlist.isFixed){this.element.find(".ui-playlist-save-button").addClass("ui-playlist-toolbar-button-dis");}else{this.element.find(".ui-playlist-save-button").removeClass("ui-playlist-toolbar-button-dis");}}},_showLoadPlaylist:function(){var playlistLoadDiv=this.element.find(".ui-playlist-load");var mthis=this;$.get(this.options.urls.userPlaylists,function(data,textStatus){data=mthis._removeLB(data);if(data=="NOT_LOGGEDIN"){if(mthis.options.onRequestLogin){mthis.options.onRequestLogin();}}else{mthis.element.find("#playlistLoadCombo").html(data);playlistLoadDiv.removeClass("ui-playlist-load-hidden");}});},_hideLoadPlaylist:function(){this.element.find(".ui-playlist-load").addClass("ui-playlist-load-hidden");},_loadPlaylist:function(url,name,id,index){var mthis=this;var data={playlist_id:id};if(index===undefined){index=this._selectedPlaylistIndex;}
if(this.options.playlists[index].isFixed){index=this._getNotFixedPlaylistIndex();this._tabs.tabs("select","#"+this.options.playlists[index].name);}
this._selectedPlaylist.playlist("load",url,data,function(){mthis._selectedPlaylist.playlist("playlistId",id);});$(this.element).find("ul li:eq("+index+") a").text(name);},_showAppendPlaylist:function(){var playlistAppendDiv=this.element.find(".ui-playlist-append");var mthis=this;var ids=this._selectedPlaylist.playlist("selectedMaterialIds");var isSelection=(ids!="");this.element.find("#playlistAppendExists").attr("disabled",!isSelection);this.element.find("#playlistAppendNew").attr("disabled",!isSelection);this.element.find("#playlistAppendNewName").attr("disabled",!isSelection);this.element.find("#playlistAppendCombo").attr("disabled",!isSelection);this.element.find("#playlistAppendOk").attr("disabled",!isSelection);if(isSelection){this.element.find(".ui-playlist-append-error").html("");if(this._getNotFixedPlaylistIndex()>-1){var playlistId=this.options.playlists[this._getNotFixedPlaylistIndex()].obj.playlist("playlistId");}
this.element.find("#playlistAppendExists").click();this.element.find("#playlistAppendNewName").val("");$.get(this.options.urls.userPlaylists,function(data,textStatus){data=mthis._removeLB(data);if(data=="NOT_LOGGEDIN"){if(mthis.options.onRequestLogin){mthis.options.onRequestLogin();}}else{mthis.element.find("#playlistAppendCombo").html(data);if(playlistId){mthis.element.find("#playlistAppendCombo option[value="+playlistId+"]").attr("selected",true);}
playlistAppendDiv.removeClass("ui-playlist-append-hidden");}});}else{this.element.find(".ui-playlist-append-error").html(this.options.errors.noSelection);playlistAppendDiv.removeClass("ui-playlist-append-hidden");}},_hideAppendPlaylist:function(){this.element.find(".ui-playlist-append").addClass("ui-playlist-append-hidden");},_appendPlaylistUser:function(){var mthis=this;var url;var data={name:this.element.find("#playlistAppendNewName").val(),ids:""};if(this.element.find("#playlistAppendExists").attr("checked")){url=this.options.urls.userPlaylistAppend;data.playlist_id=this.element.find("#playlistAppendCombo").val();}else{url=this.options.urls.userPlaylistNew;}
data.ids=this._selectedPlaylist.playlist("selectedMaterialIds");if(url){$.post(url,data,function(data,textStatus){if(data.result){mthis._hideAppendPlaylist();}else{if(data.error=="NOT_LOGGEDIN"){if(mthis.options.onRequestLogin){mthis.options.onRequestLogin();}}}},"json");}},_parseUrl:function(url,use){var ret=unescape(url);var arr=ret.split("{@");for(var index in arr){var pos=arr[index].indexOf("}");if(pos!=-1){var func=arr[index].substr(0,pos);var result=use.playlist(func);ret=ret.replace("{@"+func+"}",result);}}
return ret;},_closeAllDialogs:function(){this._hideLoadPlaylist();this._hideAppendPlaylist();},_removeLB:function(text){return text.replace(/\n/g,'');},_getNotFixedPlaylistIndex:function(){var ret=-1;for(var index in this.options.playlists){if(!this.options.playlists[index].isFixed){ret=index;break;}}
return ret;}});$.extend($.ui.playlistContainer,{version:"@VERSION",getter:"shuffle getItemData",defaults:{readOnly:true,commonHide:false,autoSave:true,autoPlay:"none",playlists:[{title:"Playlist",name:"playlist",tooltip:"",isFixed:true}],urls:{userPlaylists:"",userPlaylistLoad:"",userPlaylistAppend:"",userPlaylistNew:""},errors:{noSelection:""},onSelected:null,onItemAction:null,onRequestLogin:null,onPlaylistLoad:null}});})(jQuery);(function($){$.widget("ui.nowplaying",{_init:function(){var mthis=this;this.element.find(".ui-nowplaying-buttons div").each(function(){$(this).hover(function(){$(this).addClass("ui-nowplaying-button-over");},function(){$(this).addClass("ui-nowplaying-button");});$(this).click(function(){mthis._buttonAction($(this).attr("action"));});});if(this.options.player){$(this.options.player).bind("playeronStateChanged",function(ui,e){mthis.refreshClassFromPlayState(ui,e);});$(this.options.player).bind("playeronMediaLoaded",function(){mthis.refreshClassFromPlayState(undefined,undefined,"loaded");mthis.refresh();});$(this.options.player).bind("playeronError",function(){mthis.refreshClassFromPlayState(undefined,undefined,"error");mthis.refresh();});$(this.options.player).bind("playeronCompleted",function(){mthis.refresh(true);})}
this.element.find("#nowPlayingPlaylists").change(function(){if($(this).val()==-1){mthis.element.find(".ui-nowplaying-new-playlist").show();}else{mthis.element.find(".ui-nowplaying-new-playlist").hide();}});this.element.find("#nowPlayingAppend").click(function(){var url="";var mediaParams=mthis._getMediaParams();var data={};if(mthis.element.find("#nowPlayingPlaylists").val()==-1){url=mthis.options.urls.userPlaylistNew;data.name=mthis.element.find("#nowPlayingPlaylistName").val();}else{url=mthis.options.urls.userPlaylistAppend;data.playlist_id=mthis.element.find("#nowPlayingPlaylists").val();}
data.ids=mediaParams.material_id;$.get(url,data,function(data,textStatus){if(data.result){mthis.element.find(".ui-nowplaying-playlist").addClass("ui-nowplaying-playlist-hidden");}else{if(data.error=="NOT_LOGGEDIN"){mthis._trigger("onRequestLogin");}}});});this.element.find(".ui-nowplaying-new-playlist").hide();},refreshClassFromPlayState:function(ui,e,mode){if(e){switch(e.state){case PLAY_STATE_PLAYING:this.element.addClass("ui-nowplaying-playstate-playing");this.element.removeClass("ui-nowplaying-playstate-paused");this.element.removeClass("ui-nowplaying-playstate-stoped");this.element.removeClass("ui-nowplaying-playstate-loaded");this.element.removeClass("ui-nowplaying-playstate-error");break;case PLAY_STATE_PAUSED:break;case PLAY_STATE_STOPED:this.element.addClass("ui-nowplaying-playstate-stoped");this.element.removeClass("ui-nowplaying-playstate-playing");this.element.removeClass("ui-nowplaying-playstate-paused");this.element.removeClass("ui-nowplaying-playstate-loaded");this.element.removeClass("ui-nowplaying-playstate-error");break;}}
if(ui==undefined&&e==undefined){switch(mode){case"loaded":this.element.addClass("ui-nowplaying-playstate-loaded");this.element.removeClass("ui-nowplaying-playstate-paused");this.element.removeClass("ui-nowplaying-playstate-stoped");this.element.removeClass("ui-nowplaying-playstate-playing");this.element.removeClass("ui-nowplaying-playstate-error");break;case"error":this.element.addClass("ui-nowplaying-playstate-error");this.element.removeClass("ui-nowplaying-playstate-paused");this.element.removeClass("ui-nowplaying-playstate-stoped");this.element.removeClass("ui-nowplaying-playstate-playing");this.element.removeClass("ui-nowplaying-playstate-loaded");break;}}},refresh:function(isFinished){if(isFinished===undefined){isFinished=false;}
if(this.options.player){this._trigger("onRefresh",null,{element:this.element,media:this.options.player.player("currentMedia"),player:this.options.player,finished:isFinished});}},destroy:function(){$(this.options.player).unbind("playeronMediaLoaded");},_buttonAction:function(action){switch(action){case"add":this._addItem();break;case"playlist":this._playlist();break;case"play":this._playItem();break;}},_playItem:function(){if(window.fwk.controllers.currentPlayer){window.fwk.controllers.currentPlayer.player("play");}},_addItem:function(){var mthis=this;if(this.options.urls.userItemAdd){$.get(this.options.urls.userItemAdd,this._getMediaParams(),function(data,textStatus){if(!data.result){if(data.error=="NOT_LOGGEDIN"){mthis._trigger("onRequestLogin");}}},"json");}},_playlist:function(){var mthis=this;if(this.element.find(".ui-nowplaying-playlist").hasClass("ui-nowplaying-playlist-hidden")){$.get(this.options.urls.userPlaylists,function(data,textStatus){data=data.replace(/\n/g,'');if(data=="NOT_LOGGEDIN"){mthis._trigger("onRequestLogin");}else{data+='<option value="-1">'+mthis.options.newPlaylistText+'</option>';mthis.element.find("#nowPlayingPlaylists").html(data);}});this.element.find(".ui-nowplaying-playlist").removeClass("ui-nowplaying-playlist-hidden");}else{this.element.find(".ui-nowplaying-playlist").addClass("ui-nowplaying-playlist-hidden");}},_getMediaParams:function(){var ret={group_id:null,content_id:null,encode_id:null,material_id:null};var curMedia=this.options.player.player("currentMedia");if(this.options.player){ret.group_id=curMedia.getMaterialProp("group_id");ret.content_id=curMedia.getMaterialProp("content_id");ret.encode_id=curMedia.getMaterialProp("encode_id");ret.material_id=curMedia.getCommonProp("id");}
return ret;}});$.extend($.ui.nowplaying,{version:"@VERSION",getter:"",onRequestLogin:null,newPlaylistText:"[Nueva Playlist]",defaults:{player:null},urls:{userItemAdd:null,userPlaylists:null,userPlaylistAppend:null,userPlaylistNew:null}});})(jQuery);(function($){$.widget("ui.navpath",{_pathItems:[],_init:function(){if(this.options.parser){this.options.parser.widget=this;}
this._setPathItems();},_setPathItems:function(){var mthis=this;this.element.find(".ui-path-item").each(function(){mthis._pathItems.push(new pathItem($(this).find(":first-child").text(),$(this).find("a:first-child").attr("href"),$(this).attr("codenode"),$(this).attr("idnode")));});},_parserFinished:function(data,callback){var mthis=this;this.clear(function(){mthis.element.html(data);mthis._setPathItems();if(callback){callback();}});},chooseParser:function(url){url=unescape(url);if(window.fwk.controllers.player){var controllerName=window.fwk.controllers.player.getParamFromUrl(url,"fromController");var actionName=window.fwk.controllers.player.getParamFromUrl(url,"fromAction");switch(controllerName){case"tapa":if(url.indexOf("getfeatured")!=-1){this.options.parser=new pathParserNodes(this,{url:url,type:"getfeatured"});}else if(url.indexOf("getmostviewed")!=-1){this.options.parser=new pathParserNodes(this,{url:url,type:"getmostviewed"});}else{this.options.parser=new pathParserNodes(this,{url:url});}
break;case"relacionados":switch(actionName){case"getrelacionados":this.options.parser=new pathParserRelated(this,{url:url});break;default:this.options.parser=new pathParserNodes(this,{url:url});break;}
break;case"buscador":case"browser":switch(actionName){case"resultadopage":case"getitems":var type=window.fwk.controllers.player.getParamFromUrl(url,"ranking");switch(type){case"getfeatured":case"getmostviewed":this.options.parser=new pathParserNodes(this,{url:url,type:type});break;default:this.options.parser=new pathParserSearch(this,{words:window.fwk.controllers.player.getParamFromUrl(url,"words"),url:url});break;}
break;default:this.options.parser=new pathParserNodes(this,{url:url});break;}
break;default:this.options.parser=new pathParserNodes(this,{url:url});break;}}},parserName:function(){if(this.options.parser){return this.options.parser.name;}else{return"";}},refresh:function(params,callback){if(this.options.parser){this.options.parser.parse(params,callback);}},clear:function(callback){this.element.html('');this._pathItems=new Array();if(callback!==undefined){callback();}},getItemByText:function(text){var ret=null;for(var index in this._pathItems){if(this._pathItems[index].text==text){ret=pathItem;break;}}
return ret;},pathToString:function(format){if(format===undefined){format="text";}
var ret="";for(var index in this._pathItems){if(ret!=""){ret+="/";}
ret+=eval("this._pathItems["+index+"]."+format);}
return ret;},currentNodeCode:function(){if(this.options.parser!=null){return this.options.parser.currentNodeCode();}else{return null;}},addItem:function(params){if($.trim(this.element.html())){$('<span class="ui-path-separator">'+this.options.separator+'</span>').appendTo(this.element);}
$('<span class="ui-path-item" '+(params.code?'codenode="'+params.code+'"':'')+(params.id?'idnode="'+params.id+'"':'')+'><span>'+params.text+'</span></span>').appendTo(this.element);this._setPathItems();},currentParser:function(){return this.options.parser;}});$.extend($.ui.navpath,{version:"@VERSION",getter:"getItemByText pathToString currentNodeCode parserName currentParser",defaults:{separator:'/',region:'',urls:{fullPath:'/navpath/fullpath',searchPath:'navpath/searchpath'},parser:null}});})(jQuery);function pathItem(text,url,code,id){this.text=text;this.url=url;this.code=code;this.id=id;this.navigate=function(){if(this.url!==undefined){document.location.href=this.url;}}}
function pathParserAbstract(widget,data){this.__data=data;this.widget=widget;this.name="";}
pathParserAbstract.prototype.parse=function(params,callback){var mthis=this;mthis.widget._parserFinished(null,callback);}
pathParserAbstract.prototype.currentNodeCode=function(){var ret='home';if(this.__data!==undefined&&this.__data.url!==undefined&&this.__data.url!=null){var urlAux=this.__data.url;urlAux=urlAux.replace(/^\/\/*/,'/');urlAux=urlAux.replace('/fe/sitesplus','');urlAux=urlAux.replace('/apis','');urlAux=urlAux.replace(/^\/\/*/,'');var aUrl=urlAux.split('/');var verifyRegion=true;for(var i in aUrl){if(verifyRegion){if(this.widget!==undefined&&this.widget!=null&&this.widget.options.region==aUrl[i]){verifyRegion=false;}else if($(document.body).attr("nombreRegion")==aUrl[i]){verifyRegion=false;}else{ret=aUrl[i];break;}}else{ret=aUrl[i];break;}}}
return ret;}
function pathParserNodes(widget,data){this.parentConstructor.call(this,widget,data);this.name="pathParserNodes";}
pathParserNodes.inheritsFrom(pathParserAbstract);pathParserNodes.prototype.parse=function(params,callback){var ret=[];if(this.__data!==undefined&&this.__data.type){if(params!==undefined){params.type=this.__data.type;}else{params=this.__data;}}
var mthis=this;$.get(this.widget.options.urls.fullPath,params,function(result){mthis.widget._parserFinished(result,callback);});}
function pathParserSearch(widget,data){this.parentConstructor.call(this,widget,data);this.name="pathParserSearch";}
pathParserSearch.inheritsFrom(pathParserAbstract);pathParserSearch.prototype.parse=function(params,callback){var ret=[];var mthis=this;if(params!==undefined){params.words=this.__data!==undefined?this.__data.words:"";params.url_node=this.__data!==undefined?this.__data.url:"";}else{params={words:this.__data!==undefined?this.__data.words:"",url_node:this.__data!==undefined?this.__data.url:""};}
$.get(this.widget.options.urls.searchPath,params,function(result){mthis.widget._parserFinished(result,callback);})}
function pathParserRelated(widget,data){this.parentConstructor.call(this,widget,data);this.name="pathParserRelated";}
pathParserRelated.inheritsFrom(pathParserAbstract);pathParserRelated.prototype.parse=function(params,callback){var ret=[];var mthis=this;$.get(this.widget.options.urls.relatedPath,function(result){mthis.widget._parserFinished(result,callback);});};(function($){$.widget("ui.tops",{_items:[],_lastZIndex:0,_init:function(){var mthis=this;this._items=this.element.find(this.options.searchPattern);var lastOffsetTop=null;this._items.each(function(index){if(lastOffsetTop==null){lastOffsetTop=this.offsetTop;}
if(index==0||this.offsetTop!=lastOffsetTop){$(this).attr("top-type","first");if(this.offsetTop!=lastOffsetTop){$(mthis._items[index-1]).attr("top-type","last");}}else if(index>0&&index<mthis._items.length-1){$(this).attr("top-type","middle");}else{$(this).attr("top-type","last");}
$(this).hover(function(){var classSufix="-"+$(this).attr("top-type")+"-hover";$(this).css("z-index",++mthis._lastZIndex);$(this).find("[class]").each(function(i){var className=mthis._getFirstClassName($(this));if(className){$(this).stop().animateToClassInFile(undefined,className+classSufix,mthis.options.duration,function(){$(this).attr("baseclass",className);$(this).addClass(className+classSufix);$(this).removeAttr("style","");});}})},function(){var classSufix="-"+$(this).attr("top-type")+"-hover";$(this).find("[class]").each(function(){var className=$(this).attr("baseclass");if(className){$(this).stop().animateToClassInFile(undefined,className,mthis.options.duration,function(){$(this).removeClass(className+classSufix);$(this).removeAttr("style","");});}});});if(mthis.options.clickPattern==""){$(this).click(function(){params={group_id:$(this).attr("group_id"),content_id:$(this).attr("content_id"),encode_id:$(this).attr("encode_id")}
mthis._trigger("click",null,params);});}else{$(this).find(mthis.options.clickPattern).click(function(){params={group_id:$(this).attr("group_id"),content_id:$(this).attr("content_id"),encode_id:$(this).attr("encode_id")}
mthis._trigger("click",null,params);});}
lastOffsetTop=this.offsetTop;});},_getFirstClassName:function(element){var ret=element.attr("class");if(ret!==undefined){var aClass=ret.split(" ");if(aClass.length>1){ret=aClass[0];}}
return ret;}});$.extend($.ui.tops,{version:"@VERSION",getter:"",defaults:{searchPattern:"ul li",clickPattern:"",duration:"normal",click:null}});})(jQuery);window.fwk={'nsName':'fwk','nsFullName':'fwk','nsParent':window};window.fwk.common={'nsName':'common','nsFullName':'fwk.common','nsParent':window.fwk};window.fwk.core={'nsName':'core','nsFullName':'fwk.core','nsParent':window.fwk};window.fwk.controls={'nsName':'controls','nsFullName':'fwk.controls','nsParent':window.fwk};window.fwk.controllers={'nsName':'controllers','nsFullName':'fwk.controllers','nsParent':window.fwk};window.fwk.require=function(namespaceRequired,returnBoolean){var alreadyExists=true;var objectPivot=undefined;if(namespaceRequired){var arrParts=namespaceRequired.split(".");objectPivot=window;for(var i=0;i<arrParts.length;i++){var key=arrParts[i];if(objectPivot[key]!=undefined){objectPivot=objectPivot[key];}else{alreadyExists=false;break;}}}
if(returnBoolean==true){return alreadyExists;}else{return objectPivot;}};window.fwk.cleanUrl=function(url){return url.replace(/([^:A])\/\/+/,"$1/");};window.fwk.getBaseUrl=function(relative){var ret=$("body").attr("siteBaseUrl");if(relative){ret+=relative;}
return window.fwk.cleanUrl(ret);};window.fwk.getBaseUrlWithRegion=function(relative){var codeNodo=$(document.body).attr('codeNodo');if(codeNodo)codeNodo=codeNodo+"/";var nombreRegion=$(document.body).attr('nombreRegion');if(nombreRegion)nombreRegion=nombreRegion+"/";var ret=window.fwk.getBaseUrl()+""+nombreRegion;if(relative){ret+=relative;}
return window.fwk.cleanUrl(ret);};window.fwk.getBaseUrlWithRegionAndNode=function(relative){var codeNodo=$(document.body).attr('codeNodo');if(codeNodo)codeNodo=codeNodo+"/";var nombreRegion=$(document.body).attr('nombreRegion');if(nombreRegion)nombreRegion=nombreRegion+"/";var ret=window.fwk.getBaseUrl()+""+nombreRegion+codeNodo;if(relative){ret+=relative;}
return window.fwk.cleanUrl(ret);};window.fwk.commonGetMyBaseUrl=function(relative){var codeNodo=$(document.body).attr('codeNodo');if(codeNodo)codeNodo=codeNodo+"/";var nombreRegion=$(document.body).attr('nombreRegion');if(nombreRegion)nombreRegion=nombreRegion+"/";var ret=window.fwk.getBaseUrl()+""+nombreRegion+codeNodo;if(relative){ret+=relative;}
return window.fwk.cleanUrl(ret);};window.fwk.commonGetMyBaseSeoUrlOnlyRegion=function(relative){var ret=$(document.body).attr('prefijo_default_onlyregion');if(relative){ret+=relative;}
return window.fwk.cleanUrl(ret);};window.fwk.commonGetMyBaseSeoUrl=function(relative){var ret=$(document.body).attr('prefijo_default_full');if(relative){ret+=relative;}
return window.fwk.cleanUrl(ret);};window.fwk.getPrefijoDefault=function(){return $(document.body).attr('prefijo_default_full');};window.fwk.isLayoutPlayer=false;window.fwk.commonView=function(jsonParams){window.fwk.debugJson(jsonParams,"commonView");if(jsonParams.media_type=="video"||jsonParams.media_type=="audio"||jsonParams.media_type=="audiovideo"){window.fwk.commonPlay(jsonParams);}else if(jsonParams.media_type=="note"){var codeNodo=$(document.body).attr('codeNodo');if(codeNodo)codeNodo=codeNodo+"/";window.location=window.fwk.getPrefijoDefault()+"/"+jsonParams.group_id+".php?viewnote";}else if(jsonParams.media_type=="gallery"){window.location=window.fwk.getPrefijoDefault()+"/"+jsonParams.group_id+".php?viewgallery";}else{alert("Click sobre algo");}
return false;};window.fwk.commonPlay=function(jsonParams){var refrescar=false;var apiNode;var apiNodeSkin;var currentNode;var currentNodeSkin;if(jsonParams.url_order==undefined){jsonParams.url_order=-1;}
if(window.fwk.isLayoutPlayerEmbed){$("#seccionMasVistos").hide();$("#seccionPlayer").removeClass("player-masvistos");}
if(jsonParams.url_api&&!window.fwk.isLayoutPlayerEmbed&&window.fwk.common.nav){apiNode=new pathParserAbstract(null,{url:jsonParams.url_api}).currentNodeCode();currentNode=$(document.body).attr("codeNodo");currentNodeSkin=$(document.body).attr("skin");apiNodeSkin=window.fwk.common.nav.getAttr(apiNode,'skin');apiNodeMenuType=window.fwk.common.nav.getAttr(apiNode,'menuType');if(apiNodeMenuType){switch(apiNodeMenuType.toLowerCase()){case'canales':apiNodeMenuType='channel';break;case'radios':apiNodeMenuType='radio';break;default:apiNodeMenuType='category';break;}}
if(document.location.href.indexOf("debugplayerskin")!=-1){alert("apiNode:"+apiNode+"\n"+"currentNode:"+currentNode+"\n"+"currentNodeSkin:"+currentNodeSkin+"\n"+"apiNodeSkin:"+apiNodeSkin+"\n"+"urlApi:"+jsonParams.url_api+"\n");}
if(apiNodeSkin&&currentNodeSkin!=apiNodeSkin){window.fwk.isLayoutPlayer=false;refrescar=true;}
if(!refrescar){if(apiNodeMenuType=='channel'){window.fwk.controllers.player.is_channel=true;}else if(apiNodeMenuType=='category'){window.fwk.controllers.player.is_channel=false;}}}
jsonParams.stopvideo="regionHide";if(!window.fwk.isLayoutPlayer){var urlParams="";var accion="playgroup";var id="";if(jsonParams.group_id!==undefined){accion="playgroup";urlParams+="group_id="+jsonParams.group_id+"&";id=jsonParams.group_id;}
if(jsonParams.content_id!==undefined&&jsonParams.content_id){accion="playcontent";id=jsonParams.content_id;urlParams+="content_id="+jsonParams.content_id+"&";}
if(jsonParams.encode_id!==undefined){urlParams+="encode_id="+jsonParams.encode_id+"&";}
if(jsonParams.preview!==undefined){urlParams+="preview="+jsonParams.preview+"&";}
if(jsonParams.url_api!==undefined){urlParams+="url_api="+escape(jsonParams.url_api)+"&";}
if(jsonParams.url_order!==undefined){urlParams+="url_order="+jsonParams.url_order+"&";}
var codeNodo=$(document.body).attr('codeNodo');var nombreRegion=$(document.body).attr('nombreRegion');var agregarUrl=nombreRegion+"/";if(codeNodo)agregarUrl=agregarUrl+codeNodo+"/";if(refrescar){document.location=window.fwk.commonGetMyBaseSeoUrlOnlyRegion("/"+apiNode+"/"+id+".php?"+accion+"&"+urlParams);}else{document.location=window.fwk.commonGetMyBaseSeoUrl("/"+id+".php?"+accion+"&"+urlParams);}}else{if(window.videoBanner!==undefined){try{window.videoBanner._destroy();}catch(e){}
window.videoBanner=null;}
var anchorname="player";if(jsonParams.content_id){anchorname=window.fwk.controllers.player.is_channel?"player_canal":"player";}else if(jsonParams.group_id){anchorname=window.fwk.controllers.player.is_channel?"playergrupo_canal":"playergrupo";}
if(!window.fwk.isLayoutPlayerEmbed){anchorChange(window.fwk.core.anchorManager(anchorname,jsonParams),'player');}
window.fwk.core.layerManager.closeAllLayer();window.fwk.controllers.player.closeAllDrawers();window.fwk.controllers.player.updatePlaylist(jsonParams);window.fwk.debugJson(jsonParams,"commonPlay");window.fwk.controllers.currentPlaylist.playlist("load",window.fwk.controllers.playlist.url_miniplaylist,jsonParams);window.fwk.controllers.player.addHistory(jsonParams);window.fwk.common.metricas.hit("player_loaded");}
return false;};window.fwk.commonMoreInfo=function(jsonParams){window.fwk.myalert('more info :',jsonParams);if(jsonParams.media_type=="video"||jsonParams.media_type=="audio"||jsonParams.media_type=="audiovideo"){var codeNodo=$(document.body).attr('codeNodo');if(codeNodo)codeNodo=codeNodo+"/";var urlParams="";if(jsonParams.group_id!==undefined){urlParams+="group_id="+jsonParams.group_id+"&";}
if(jsonParams.content_id!==undefined){urlParams+="content_id="+jsonParams.content_id+"&";}
if(jsonParams.url_api!==undefined){urlParams+="url_api="+escape(jsonParams.url_api)+"&";}
if(jsonParams.url_order!==undefined){urlParams+="url_order="+jsonParams.url_order+"&";}
var url=window.fwk.getBaseUrlWithRegionAndNode()+"/card/video?layout=aplicacion&"+urlParams;anchorChange(window.fwk.core.anchorManager('ficha',jsonParams),'ficha');window.fwk.core.layerManager.newLayer("ficha",window.fwk.commonModalLayout(url));return false;}else if(jsonParams.media_type=="note"){return window.fwk.commonView(jsonParams);}else if(jsonParams.media_type=="gallery"){return window.fwk.commonView(jsonParams);}
return window.fwk.commonView(jsonParams);};window.fwk.commonSyntonize=function(jsonParams){if($(document.body).attr("layoutName").toString().search(/^radio/)!=-1){anchorChange(window.fwk.core.anchorManager("radios",jsonParams),'radios');window.fwk.controllers.radio.changeRadio(jsonParams.name);}else{document.location=window.fwk.commonGetMyBaseSeoUrlOnlyRegion("/"+jsonParams.name+".php?syntonize");}
return false;};window.fwk.commonSearch=function(jsonParams){if(jsonParams){var nombrehash="buscador";if(jsonParams.keyword){nombrehash+="keyword";}else{jsonParams.keyword="";nombrehash+="todos";}
if(jsonParams.idNode){nombrehash+="_connodo";}else{nombrehash+="_sinnodo";}
if(jsonParams.ownurl){window.fwk.myalert("OwnUrl:"+jsonParams.ownurl+"&layoutOff=true",jsonParams);anchorChange(window.fwk.core.anchorManager(nombrehash,jsonParams),'buscador');}else{jsonParams.ownurl=window.fwk.commonGetMyBaseUrl("/buscador/resultado?layout=aplicacion");jsonParams.ownurl+="&words="+escape(jsonParams.keyword)+(jsonParams.codeNode?"&idnode="+jsonParams.codeNode:'');anchorChange(window.fwk.core.anchorManager(nombrehash,jsonParams),'buscador');window.fwk.myalert("UrlCreated :"+jsonParams.ownurl+"&layoutOff=true",jsonParams);}
window.fwk.core.layerManager.newLayer("buscador",jsonParams.ownurl+"&layoutOff=true");}};window.fwk.commonLogin=function(jsonParams){if(!jsonParams.ownurl){jsonParams.ownurl=window.fwk.commonGetMyBaseUrl("/usuario/login?layout=aplicacion");}
anchorChange(window.fwk.core.anchorManager('login',jsonParams),'loginregister');window.fwk.core.layerManager.newLayer("loginregister",window.fwk.commonModalLayout(jsonParams.ownurl));};window.fwk.commonActivateUser=function(jsonParams){if(!jsonParams.ownurl){jsonParams.ownurl=window.fwk.commonGetMyBaseUrl("/mipase/validmail?layout=aplicacion&username="+jsonParams.username+"&hash="+jsonParams.hash);}
window.fwk.core.layerManager.newLayer("loginregistermp",window.fwk.commonModalLayout(jsonParams.ownurl));};window.fwk.commonActivateOkUser=function(jsonParams){var ownurl=window.fwk.commonGetMyBaseUrl("/mipase/validmailok?layout=aplicacion");window.fwk.core.layerManager.newLayer("loginregistermp",window.fwk.commonModalLayout(ownurl));};window.fwk.commonSignupUser=function(jsonParams){if(!jsonParams.ownurl){jsonParams.ownurl=window.fwk.commonGetMyBaseUrl("/mipase/adduser?layout=aplicacion");}
anchorChange(window.fwk.core.anchorManager('registro',jsonParams),'loginregister');window.fwk.core.layerManager.newLayer("loginregistermp",window.fwk.commonModalLayout(jsonParams.ownurl));};window.fwk.commonSigninstUser=function(jsonParams){if(!jsonParams.ownurl){jsonParams.ownurl=window.fwk.commonGetMyBaseUrl("/mipase/adduserinst?layout=aplicacion");}
anchorChange(window.fwk.core.anchorManager('registro',jsonParams),'loginregister');window.fwk.core.layerManager.newLayer("loginregistermp",window.fwk.commonModalLayout(jsonParams.ownurl));};window.fwk.commonModifyUser=function(jsonParams){if(!jsonParams.ownurl){jsonParams.ownurl=window.fwk.commonGetMyBaseUrl("/mipase/modifyuser?layout=aplicacion");}
anchorChange(window.fwk.core.anchorManager('registro',jsonParams),'loginregister');window.fwk.core.layerManager.newLayer("loginregistermp",window.fwk.commonModalLayout(jsonParams.ownurl));};window.fwk.commonModifyinstUser=function(jsonParams){if(!jsonParams.ownurl){jsonParams.ownurl=window.fwk.commonGetMyBaseUrl("/mipase/modifyuserinst?layout=aplicacion");}
anchorChange(window.fwk.core.anchorManager('registro',jsonParams),'loginregister');window.fwk.core.layerManager.newLayer("loginregistermp",window.fwk.commonModalLayout(jsonParams.ownurl));};window.fwk.commonDeleteUser=function(jsonParams){window.fwk.core.layerManager.newLayer("loginregister",window.fwk.commonModalLayout('/fe/sitesplus/mipase/deleteuser?layoutOff=true'));};window.fwk.commonDeleteUserClose=function(){window.fwk.core.layerManager.closeLayer("loginregister");};window.fwk.commonLogout=function(jsonParams){document.location="/";};window.fwk.commonLoginOk=function(jsonParams){if(jsonParams.ownurl.search("#")!=-1){var anchorInterno=jsonParams.ownurl.match(/#.*$/);if(anchorInterno.length){anchorExecute(window.fwk.commonGetMyBaseSeoUrl(),undefined,undefined,undefined,anchorInterno[0]);}}else{document.location=jsonParams.ownurl;}};window.fwk.commonRemind=function(jsonParams){if(!jsonParams.ownurl){jsonParams.ownurl=window.fwk.commonGetMyBaseUrl("/usuario/remind?layout=aplicacion");}
anchorChange(window.fwk.core.anchorManager('olvide',jsonParams),'loginregister');window.fwk.core.layerManager.newLayer("loginregister",window.fwk.commonModalLayout(jsonParams.ownurl));};window.fwk.commonRemindClose=function(jsonParams){window.fwk.core.layerManager.closeLayer("loginregister");window.fwk.common.user.goToLogin();};window.fwk.commonChangeNode=function(jsonParams){if(jsonParams.node){window.location.replace(window.fwk.commonGetMyBaseSeoUrlOnlyRegion("/"+jsonParams.node));}};window.fwk.commonSocialNavCategories=function(jsonParams){anchorChange(window.fwk.core.anchorManager('recomendarsocial',jsonParams),'socialnavcategories');window.fwk.core.layerManager.newLayer("socialnavcategories",window.fwk.commonModalLayout(window.fwk.getBaseUrlWithRegionAndNode('/social/socialcategorias?layoutOff=true&red='+jsonParams.red)));};window.fwk.commonSocialNavRecommendCategories=function(jsonParams){var url=window.fwk.getBaseUrlWithRegion()+'social/recomendarcategorias?layoutOff=true';anchorChange(window.fwk.core.anchorManager('recomendarnav',jsonParams),'socialnavrecommendcategories');window.fwk.core.layerManager.newLayer("socialnavrecommendcategories",window.fwk.commonModalLayout(url));};window.fwk.commonSocialNavCategoriesCerrar=function(){window.fwk.core.layerManager.closeLayer("socialnavcategories");};window.fwk.commonModalLayout=function(originalUrl){if(originalUrl.search(/layout=/)!=-1){originalUrl=originalUrl.replace(/layout=[^&]+/,"layout=modal");}
if(originalUrl.search(/layout\//)!=-1){originalUrl=originalUrl.replace(/layout\/[^\/\?]+/,"layout/modal");}
if(originalUrl.search(/\?/)!=-1){originalUrl+='&modal=true';}else{originalUrl+='?modal=true';}
originalUrl=originalUrl.replace(/([^:A])\/\/+/,"$1/");return originalUrl;};window.fwk.commonGetCurrent=function(){return{content_id:3449};};window.fwk.commonGetCurrentNode=function(){var lastNode;$("#PathMenu li").each(function(){lastNode={id:$(this).attr("node_id"),text:$(this).attr("node_text"),code:$(this).attr("node_code"),parentNode:lastNode};});return lastNode;};window.fwk.getCurrentFullPath=function(){var path='/';$(".nav-item-current-parent").each(function(){path+=$(this).attr('node_code')+'/';});path+=$(".nav-item-current").attr('node_code');return path;};window.fwk.debugJson=function(json,message){if(document.location.href.indexOf("debugjson")!=-1){if(message===undefined){message="";}
var a="Debug Json "+message+"\n";for(var p in json){a+=p+" = "+eval("json."+p)+"\n";}
alert(a);}};window.fwk.myalert=function(str,jsonObject){var addInfo="";if(jsonObject){addInfo+="\n";for(var i in jsonObject){addInfo+=i+":"+jsonObject[i]+"\n";}}
if(window.fwk.debug){alert(str+"\njsonParamsObject:"+addInfo);}};function clickShare(idContenido,url){if(window.document.getElementById('BaseApp')){idContenido=window.document.getElementById('BaseApp').content.App.CurrentMaterialItem.ContentId;}else if(window.goCMaterial){idContenido=goCMaterial.id_contenido;}else if(window.fwk.controllers){idContenido=window.fwk.controllers.currentPlayer.player("currentMedia").getMaterialProp("content_id");}
if(idContenido){url='http://www.mixplay.tv/videosonline/'+idContenido+'.php?playcontent&sharemeta=true';window.open('http://www.facebook.com/sharer.php?u='+escape(url),'sharer','toolbar=0,status=0,width=626,height=436');}else if(url){window.open('http://www.facebook.com/sharer.php?u='+escape(url),'sharer','toolbar=0,status=0,width=626,height=436');}
var nuevaImagen=new Image();nuevaImagen.src="http://ds.clickexperts.net/iserver/site=CL_MIXPLAY/camp_id=100/aamsz=PIX/acc_random?"+(new Date()).getTime();return void('');};window.fwk.playerNode=function(nodeName,rankingType,defaultGroup){if(rankingType==undefined)rankingType="getfeatured";if(nodeName==undefined)nodeName="home";var urlApi="/apis/"+$(document.body).attr('nombreRegion')+"/"+nodeName+"/ranking/"+rankingType+"?format=json&quantity=1";var urlPlayer="/apis/"+$(document.body).attr('nombreRegion')+"/"+nodeName+"/ranking/"+rankingType;window.fwk.debugJson("UrlApi: "+urlApi);$.getJSON(urlApi,function(data){if(data&&data.groups&&data.groups.group.length>=1&&data.groups.group[0].common.id){window.fwk.debugJson("Api groupId: "+data.groups.group[0].common.id);window.fwk.commonPlay({group_id:data.groups.group[0].common.id,url_api:urlPlayer});}else{window.fwk.debugJson("Default GroupId: "+defaultGroup);window.fwk.commonPlay({group_id:defaultGroup,url_api:urlPlayer});}});};window.encodeURIComponent=window.escape;$top=window;try{var pruebaLocation=window.top.location.toString();$top=window.top;}catch(e){try{var pruebaLocation=window.parent.location.toString();$top=window.parent;}catch(e){$top=window;}}
var _anchorSeparador=".";var _skinSeparador=":";var _nodoSeparador=":";var _tokenActivacionLogicaNueva="plus";var _defaultModalName="BaseApp";var _hashHistory=new Array();var _hashHistoryModalNames=new Array();var _lastLayerName="";var _layerName;function anchorExecute(prefijo,invoke,invokeHash,invokePrevHash,invokeForcedHash){top.pageNum=undefined;var info;var url="";var infoModulo=new Array();var sSearch="";var sSkin="";var logicaNueva=false;var urlEntryMode="";var urlEntryInitParams="";var urlCloseChildLayers=true;var jsonCommonParams={};var jsonCommonFunction=undefined;if(!prefijo){prefijo="";}
if(invokeForcedHash){info=invokeForcedHash.split(_anchorSeparador);}else if(top.location.hash){info=top.location.hash.split(_anchorSeparador);}
if(invoke){if(invokeHash){info=invokeHash.split(_anchorSeparador);}}
if(info){if(info[info.length-1]){if(info[info.length-1].search(_skinSeparador)!=-1){infoModulo=info[info.length-1].split(_skinSeparador);if(infoModulo.length&&infoModulo[infoModulo.length-1]==_tokenActivacionLogicaNueva){logicaNueva=1;}
info[info.length-1]=infoModulo[0];if(!logicaNueva){if(infoModulo[1]){sSkin="&skin=sk_"+infoModulo[1];}}}}
if(!logicaNueva){switch(info[0]){case"#buscar-videos-en":sSearch="search";if(info[3]){info[3]=info[3].replace("-"," ");info[3]=escape(info[3]);}else{info[3]="all";sSearch="searchall";}
url=prefijo+"/"+info[1]+"/"+info[3]+".php?"+sSearch+"&id_nodo="+info[2];jsonCommonFunction=window.fwk.commonSearch;jsonCommonParams.codeNode=info[1];jsonCommonParams.idNode=info[2];jsonCommonParams.keyword=info[3];break;case"#buscador":case"#buscar-videos":sSearch="search";if(info[1]){info[1]=info[1].replace("-"," ");info[1]=escape(info[1]);}else{info[1]="all";sSearch="searchall";}
url=prefijo+"/"+info[1]+".php?"+sSearch;jsonCommonFunction=window.fwk.commonSearch;jsonCommonParams.keyword=info[1];break;case"#playergrupo":url=prefijo+"/"+info[1]+".php?playgroup";break;case"#player":case"#ver-video":url=prefijo+"/"+info[1]+"/"+info[2]+".php?playcontent";break;case"#nota":if(info[2]){url=prefijo+"/"+info[1]+"/"+info[2]+".php?viewnote";}else{url=prefijo+"/"+info[1]+".php?viewnote";}
break;case"#ficha":case"#video":url=prefijo+"/"+info[1]+"/"+info[2]+".php?viewcard";jsonCommonFunction=window.fwk.commonMoreInfo;jsonCommonParams.group_id=info[2];jsonCommonParams.title=info[1];jsonCommonParams.media_type='video';break;case"#tapa":case"#videos-de":info[1]=info[1].replace('+',"/");url=prefijo+"/"+info[1]+"?";break;case"#ver-mensaje":switch(info[1]){case"instalacionActiveX":break;}
break;}
if(invoke!=undefined){malert(urlEntryMode);if(urlEntryMode){anchorInvoke(jsonCommonFunction,jsonCommonParams);}else{anchorInvokeEmpty();}}else{if(url){top.location.replace(url.replace("//","/")+sSkin);}}}else{prefijoOriginal=prefijo;if(infoModulo.length>2){prefijo=window.fwk.commonGetMyBaseSeoUrlOnlyRegion()+"/"+infoModulo[infoModulo.length-2];}
switch(info[0]){case"#buscar-videos-en":sSearch="search";if(info[3]){info[3]=info[3].replace("-"," ");info[3]=escape(info[3]);}else{info[3]="all";sSearch="searchall";}
urlEntryMode="search";urlEntryInitParams="words="+(info[3]=="all"?"":info[3])+"&node="+infoModulo[infoModulo.length-2].toLowerCase()+"&id_nodo="+info[2]+"&code_node="+info[1].toLowerCase();url=prefijo+"/"+info[3]+".php?"+sSearch+"&id_nodo="+info[2]+"&code_nodo="+info[1].toLowerCase();jsonCommonFunction=window.fwk.commonSearch;jsonCommonParams.codeNode=info[1].toLowerCase();jsonCommonParams.idNode=info[2];jsonCommonParams.keyword=info[3]!='all'?info[3]:'';jsonCommonParams.currentCodeNode=infoModulo[infoModulo.length-2];break;case"#buscar-videos":sSearch="search";if(info[1]){info[1]=info[1].replace("-"," ");info[1]=escape(info[1]);}else{info[1]="all";sSearch="searchall";}
url=prefijo+"/"+info[1]+".php?"+sSearch;urlEntryMode="search";urlEntryInitParams="words="+(info[1]=="all"?"":info[1])+"&node="+infoModulo[infoModulo.length-2].toLowerCase();jsonCommonFunction=window.fwk.commonSearch;jsonCommonParams.keyword=info[1]!='all'?info[1]:'';jsonCommonParams.currentCodeNode=infoModulo[infoModulo.length-2];break;case"#ver-grupo-video":case"#ver-grupo-videos":case"#ver-videos":case"#ver-video":var stopVideo="";var currentStopVideo="";var currentUri="";var currentIndex=undefined;switch(infoModulo.length){case 6:case 5:if(infoModulo[3]!=""){currentIndex=infoModulo[3];}
case 4:if(infoModulo[2]!=""){currentUri=infoModulo[2];}
case 3:if(infoModulo[1].search("stopvideo")!=-1){var currentStopVideo=infoModulo[1].replace("stopvideo","");switch(currentStopVideo){case"regionUL":currentStopVideo="history";break;case"regionUR":currentStopVideo="browser";break;case"regionU":currentStopVideo="history,browser";break;case"regionBL":currentStopVideo="related";break;case"regionBR":currentStopVideo="recommend";break;case"regionB":currentStopVideo="related,recommend";break;case"regionL":currentStopVideo="history,related";break;case"regionR":currentStopVideo="browser,recommend";break;case"regionHide":currentStopVideo="";case"region":currentStopVideo="history,recommend,related,browser";break;}}}
var gparam="content_id";var gaction="playcontent";if(info[0]=="#ver-grupo-video"||info[0]=="#ver-grupo-videos"){gparam="group_id";gaction="playgroup";}
if(info[0]=="#ver-videos"){urlEntryMode="channel";url=prefijo+"/?"+gparam+"="+info[2]+"&title="+info[1];}else{urlEntryMode="play";url=prefijo+"/"+info[1]+"/"+info[2]+".php?"+gaction;}
urlEntryInitParams=gparam+"="+info[2]+"&node="+infoModulo[infoModulo.length-2];if(currentStopVideo){url+="&stopvideo="+currentStopVideo;urlEntryInitParams+="&stopvideo="+currentStopVideo;}
if(currentUri){url+="&url_api="+escape(currentUri);urlEntryInitParams+="&url_api="+escape(currentUri);}
if(currentIndex!=undefined){url+="&url_order="+currentIndex;urlEntryInitParams+="&url_order="+currentIndex;}
jsonCommonFunction=window.fwk.commonView;jsonCommonParams[gparam]=info[2];jsonCommonParams.title=info[1];jsonCommonParams.media_type='video';if(currentUri)
jsonCommonParams.url_api=currentUri;if(currentIndex!=undefined)
jsonCommonParams.url_order=currentIndex;if(currentStopVideo)
jsonCommonParams.stopvideo=currentStopVideo;jsonCommonParams.currentCodeNode=infoModulo[infoModulo.length-2];break;case"#nota":if(info[2]){url=prefijo+"/"+info[1]+"/"+info[2]+".php?viewnote";}else{url=prefijo+"/"+info[1]+".php?viewnote";}
jsonCommonFunction=window.fwk.commonView;if(info[2]){jsonCommonParams.group_id=info[2];jsonCommonParams.title=info[1];}else{jsonCommonParams.group_id=info[1];}
jsonCommonParams.media_type='note';break;case"#video":if(infoModulo.length==4){malert("invokePrevHashCalcPrev:"+invokePrevHash);invokePrevHash=infoModulo[infoModulo.length-2];malert("invokePrevHashCalcDesp:"+invokePrevHash);invokePrevHash=anchorPrevHash(invokePrevHash);malert("invokePrevHashCalcDesp2:"+invokePrevHash);infoModulo[infoModulo.length-2]=infoModulo[infoModulo.length-1];infoModulo.length=infoModulo.length-1;}
malert("invokePrevHash:"+infoModulo.length+invokePrevHash);if(invokePrevHash!=undefined&&invokePrevHash.search(/buscar-videos\.?/)!=-1){anchorExecute("",true,invokePrevHash);GETBACK_SEMAPHORE=false;urlCloseChildLayers=false;}
url=prefijo+"/"+info[1]+"/"+info[2]+".php?viewcard";urlEntryMode="viewcard";urlEntryInitParams="group_id="+info[2]+"&node="+infoModulo[infoModulo.length-2];jsonCommonFunction=window.fwk.commonMoreInfo;jsonCommonParams.group_id=info[2];jsonCommonParams.title=info[1];jsonCommonParams.media_type='video';jsonCommonParams.currentCodeNode=infoModulo[infoModulo.length-2];break;case"#videos-de":if(info[2]){url=prefijo+"/"+info[1]+"/"+info[2]+"";}else{url=prefijo+"/"+info[1]+"";}
urlEntryMode="node";urlEntryInitParams="node="+info[1];jsonCommonFunction=window.fwk.commonChangeNode;if(info[2]){jsonCommonParams.node=info[2];}else{jsonCommonParams.node=info[1];}
jsonCommonParams.currentCodeNode=jsonCommonParams.node;break;case"#sintonizar":if(info[2]){url=prefijo+"/"+info[1]+"/"+info[2]+".php?syntonize";}else{url=prefijo+"/"+info[1]+".php?syntonize";}
urlEntryMode="syntonize";urlEntryInitParams="station="+info[1];jsonCommonFunction=window.fwk.commonSyntonize;if(info[2]){jsonCommonParams.name=info[2];}else{jsonCommonParams.name=info[1];}
break;case"#ingresar":url=prefijo+"/"+info[1]+"/login.php?login";urlEntryMode="login";urlEntryInitParams="node="+info[1];jsonCommonFunction=window.fwk.commonLogin;break;case"#registro":url=prefijo+"/"+info[1]+"/signup.php?signup";urlEntryMode="register";urlEntryInitParams="node="+info[1];jsonCommonFunction=window.fwk.commonSignupUser;break;case"#recomendar":url=prefijo+"/recomendar.php?suggest";urlEntryMode="suggest";urlEntryInitParams="";jsonCommonFunction=window.fwk.commonSocialNavRecommendCategories;break;case"#recomendarRed":url=prefijo+"/recomendar.php?suggestsocial&socialnetworkselected="+info[1];urlEntryMode="suggestsocial";urlEntryInitParams="socialnetworkselected="+info[1];jsonCommonFunction=window.fwk.commonSocialNavCategories;jsonCommonParams.red=info[1];break;}
var codeNodo=$(document.body).attr('codeNodo');if(!codeNodo)codeNodo="home";if(invoke==undefined&&!invokeForcedHash){if(jsonCommonParams.currentCodeNode){if(jsonCommonParams.currentCodeNode==codeNodo){invoke=true;}}else{invoke=true;}}
if(invoke!=undefined){if(urlEntryMode){malert("urlEntryMode="+urlEntryMode+"\nurlEntryInitParams="+urlEntryInitParams);anchorInvoke(jsonCommonFunction,jsonCommonParams,urlCloseChildLayers);}else{anchorInvokeEmpty();}}else{if(url){malert("locationReplace:"+url.replace("//","/"));top.location.replace(url.replace("//","/"));}}}}}
function anchorInvoke(jsonCommonFunction,jsonCommonParams){window.fwk.myalert("anchorInvoke\n"+jsonCommonFunction,jsonCommonParams);if(jsonCommonFunction)
jsonCommonFunction(jsonCommonParams);}
function anchorInvokeEmpty(){window.fwk.myalert("anchorInvokeEmpty : closeAllLayer");window.fwk.core.layerManager.closeAllLayer(true);}
AnchorObject={};AnchorObject.AnchorInherits=function(mthis,parent){if(typeof(parent)=="function"){if(arguments.length>1){parent.apply(mthis,Array.prototype.slice.call(arguments,1));}else{parent.call(mthis);}}else{}};Function.prototype.AnchorInherits=function(parent){this.prototype=new parent();this.prototype.constructor=this;};function AnchorCustomEvent(onlyOnceMode){this.anchorClassName="AnchorCustomEvent";this.onlyOnceMode=onlyOnceMode;this.onlyOnceFired=false;this.onlyOnceArguments=null;this.suscribers=[];};AnchorCustomEvent.prototype.addListener=function(eventHandler){this.suscribers[this.suscribers.length]=eventHandler;if(this.onlyOnceMode&&this.onlyOnceFired){if(eventHandler){eventHandler.apply(eventHandler,this.onlyOnceArguments);}}};AnchorCustomEvent.prototype.removeListener=function(eventHandler){for(var i=0;i<this.suscribers.length;i++){if(this.suscribers[i]==eventHandler){this.suscribers[i]=false;}}};AnchorCustomEvent.prototype.fireEvent=function(){this.onlyOnceFired=true;this.onlyOnceArguments=arguments;for(var i=0;i<this.suscribers.length;i++){var eventHandler=this.suscribers[i]
if(eventHandler){eventHandler.apply(eventHandler,arguments);}}};AnchorCustomEvent.prototype.clear=function(){this.suscribers=[];};AnchorCustomEvent.prototype.detachEvent=AnchorCustomEvent.prototype.removeListener;AnchorCustomEvent.prototype.removeEventListener=AnchorCustomEvent.prototype.removeListener;AnchorCustomEvent.prototype.attachEvent=AnchorCustomEvent.prototype.addListener;AnchorCustomEvent.prototype.addEventListener=AnchorCustomEvent.prototype.addListener;AnchorCustomEvent.prototype.clearEvent=AnchorCustomEvent.prototype.clear;AnchorCustomEvent.prototype.clearEventListener=AnchorCustomEvent.prototype.clear;function AnchorCustomEventManager(){this.anchorClassName="AnchorCustomEventManager";};AnchorCustomEventManager.prototype.addListener=function(eventName,eventHandler){if(this[eventName]!=undefined)
this[eventName].addListener(eventHandler);return this;};AnchorCustomEventManager.prototype.removeListener=function(eventName,eventHandler){if(this[eventName]!=undefined&&this[eventName]instanceof AnchorCustomEvent)
this[eventName].removeListener(eventHandler);return this;};AnchorCustomEventManager.prototype.fireEvent=function(eventName){if(this[eventName]!=undefined&&this[eventName]instanceof AnchorCustomEvent)
this[eventName].fireEvent.apply(this[eventName],[this].concat(Array.prototype.slice.call(arguments,1)));return this;};AnchorCustomEventManager.prototype.clear=function(eventName){if(this[eventName]!=undefined&&this[eventName]instanceof AnchorCustomEvent)
this[eventName].clear();return this;};AnchorCustomEventManager.prototype.attachEvent=AnchorCustomEventManager.prototype.addListener;AnchorCustomEventManager.prototype.addEventListener=AnchorCustomEventManager.prototype.addListener;AnchorCustomEventManager.prototype.detachEvent=AnchorCustomEventManager.prototype.removeListener;AnchorCustomEventManager.prototype.removeEventListener=AnchorCustomEventManager.prototype.removeListener;AnchorCustomEventManager.prototype.clearEvent=AnchorCustomEventManager.prototype.clear;AnchorCustomEventManager.prototype.clearEventListener=AnchorCustomEventManager.prototype.clear;function AnchorProperty(source,defValue,customSetter,customGetter){AnchorObject.AnchorInherits(this,AnchorCustomEventManager);this.anchorClassName="AnchorProperty";this.source=source;this._value=defValue;this._checkType=undefined;if(customSetter&&customGetter){this._customSet=customSetter;this._customGet=customGetter;}
this.onPropertyChange=new AnchorCustomEvent();};AnchorProperty.AnchorInherits(AnchorCustomEventManager);AnchorProperty.prototype.toString=function(){return this.get();};AnchorProperty.prototype.readOnlyMode=function(){this.set=function(newValue){throw"AnchorProperty.readOnlyMode :: you are trying to set a readOnly property ["+newValue+"]";};return this;};AnchorProperty.prototype.readWriteMode=function(){this.set=AnchorProperty.prototype.set;return this;};AnchorProperty.prototype.checkTypeEnabled=function(typeClass){this._checkType=typeClass;return this;};AnchorProperty.prototype.checkTypeDisabled=function(){this._checkType=undefined;return this;};AnchorProperty.prototype.set=function(newValue){if(this._checkType!=undefined&&newValue!=null){if(typeof(this._checkType)=="string"){if(typeof(newValue)!=this._checkType){throw"AnchorProperty.set :: you are trying to set a newValue of type ("+typeof(newValue)+") when a value of type ["+this._checkType+"] was expected";}}else{if(!(newValue instanceof this._checkType)){throw"AnchorProperty.set :: you are trying to set a newValue of type "+newValue+") when a value of type "+this._checkType+" was expected";}}}
if(this._customSet!=undefined){this._customSet.call(this.source?this.source:this,newValue);}else{var prevValue=this._value;this._value=newValue;if(newValue!=prevValue){this.onPropertyChange.fireEvent(this.source?this.source:this,prevValue,newValue);}}
return this.source?this.source:this;};AnchorProperty.prototype.get=function(){if(this._customGet){return this._customGet.call(this.source?this.source:this);}else{return this._value;}};function AnchorTimer(interval,timerMode,timerId){AnchorObject.AnchorInherits(this,AnchorCustomEventManager);this.isEnabled=new AnchorProperty(this,false);if(!timerMode){timerMode="interval";}
this.timerMode=new AnchorProperty(this,timerMode);this.interval=new AnchorProperty(this,new Number(interval)).checkTypeEnabled(Number).addEventListener("onPropertyChange",function(sender,prevValue,newValue){if(sender.isEnabled.get()){sender.stop();sender.start();}});if(!timerId){timerId="AnchorTimer_"+(new Date().getTime());}
this._timerId=timerId;this._timerObjectId=undefined;if(window.AnchorTimers==undefined)window.AnchorTimers=[];window.AnchorTimers[this._timerId]=this;this.onTick=new AnchorCustomEvent();};AnchorTimer.AnchorInherits(AnchorCustomEventManager);AnchorTimer.prototype.changeInterval=function(seconds){this.interval.set(new Number(seconds));};AnchorTimer.prototype.start=function(){if(!this.interval.get()){throw"AnchorTimer.start :: interval required";}
switch(this.timerMode.get()){case"timeout":this._timerObjectId=window.setTimeout("window.AnchorTimers['"+this._timerId+"']._tick('"+this._timerId+"');",this.interval.get()*1000);break;case"interval":default:this._timerObjectId=window.setInterval("window.AnchorTimers['"+this._timerId+"']._tick('"+this._timerId+"');",this.interval.get()*1000);break;}
this.isEnabled.set(true);};AnchorTimer.prototype.stop=function(){switch(this.timerMode.get()){case"timeout":window.clearTimeout(this._timerObjectId);break;case"interval":default:window.clearInterval(this._timerObjectId);break;}
this.isEnabled.set(false);};AnchorTimer.prototype._tick=function(timerId){window.AnchorTimers[timerId].onTick.fireEvent(window.AnchorTimers[timerId]);};function AnchorHistoryManager(windowObject,anchorDiv,anchorInput,anchorIFrame,anchorTimerSeconds){AnchorObject.AnchorInherits(this,AnchorCustomEventManager);var me=this;this.onHistoryStateChange=new AnchorCustomEvent();this.onAnchorChange=new AnchorCustomEvent();this.onHistoryTimerTick=new AnchorCustomEvent();this.requireIFrame=new AnchorProperty(this,this._requireIFrame());this.anchor=new AnchorProperty(this,"").addEventListener("onPropertyChange",function(sender,prevValue,newValue){sender._changeState(newValue);sender.onAnchorChange.fireEvent(sender,prevValue,newValue);});this._windowObject=windowObject!=undefined?windowObject:window;this._timerSemaphore=true;this._changeSemaphore=true;this._lastState=undefined;if(anchorDiv!=undefined){if(typeof(anchorDiv)=="string"){this._htmlDivName=anchorDiv;this._htmlDivObject=document.getElementById(this._htmlDivName);}else if(anchorDiv.tagName.toLowerCase()=="div"){this._htmlDivName=anchorDiv.getAttribute("id");this._htmlDivObject=anchorDiv;}}else{this._htmlDivName="anchorHistoryDiv";}
if(this.requireIFrame.get()){if(anchorInput!=undefined){if(typeof(anchorInput)=="string"){this._htmlInputName=anchorInput;this._htmlInputObject=document.getElementById(this._htmlInputName);}else if(anchorInput.tagName.toLowerCase()=="div"){this._htmlInputName=anchorInput.getAttribute("id");this._htmlInputObject=anchorInput;}}else{this._htmlInputName="anchorHistoryInput";}
if(anchorIFrame!=undefined){if(typeof(anchorIFrame)=="string"){this._htmlIFrameName=anchorIFrame;this._htmlIFrameObject=document.getElementById(this._htmlIFrameName);}else if(anchorIFrame.tagName.toLowerCase()=="div"){this._htmlIFrameName=anchorIFrame.getAttribute("id");this._htmlIFrameObject=anchorIFrame;}}else{this._htmlIFrameName="anchorHistoryIFrame";}}
if(this._requireIE8Event()){if(this._windowObject.attachEvent){this._windowObject.attachEvent("onhashchange",function(){me._checkState();});}}else{this._anchorTimerSeconds=anchorTimerSeconds?anchorTimerSeconds:0.05;this._anchorTimer=new AnchorTimer(this._anchorTimerSeconds,"interval").addEventListener("onTick",function(){me._checkState();me.onHistoryTimerTick.fireEvent(me);});this._anchorTimer.start();}
this._hookHtmlElements();};AnchorHistoryManager.AnchorInherits(AnchorCustomEventManager);AnchorHistoryManager.prototype._hookHtmlElements=function(){if(!this._htmlDivObject){this._htmlDivObject=this._windowObject.document.createElement('DIV');this._htmlDivObject.id=this._htmlDivName;this._htmlDivObject.name=this._htmlDivName;this._htmlDivObject.style.display="none";this._windowObject.document.body.appendChild(this._htmlDivObject);}
if(!this._htmlIFrameObject&&this._htmlIFrameName){this._htmlDivObject.innerHTML="<iframe src='/blank.html' id='"+this._htmlIFrameName+"' style='display: none;'></iframe>";this._htmlIFrameObject=document.getElementById(this._htmlIFrameName);}
if(!this._htmlInputObject&&this._htmlInputName){this._htmlInputObject=this._windowObject.document.createElement('INPUT');this._htmlInputObject.id=this._htmlInputName;this._htmlInputObject.type="text";this._htmlDivObject.appendChild(this._htmlInputObject);}};AnchorHistoryManager.prototype._requireIFrame=function(){if(navigator.userAgent.search('MSIE')!=-1){if(typeof document.documentMode==="undefined"||document.documentMode<8){return true;}}};AnchorHistoryManager.prototype._requireIE8Event=function(){if(navigator.userAgent.search('MSIE')!=-1){if(document.documentMode==8){return true;}}};AnchorHistoryManager.prototype._checkState=function(){consoledebug("_checkState:: timerSempahore:"+this._timerSemaphore);if(!this._timerSemaphore)return;var state=undefined;var initial=false;if(this.requireIFrame.get()){var doc=this._htmlIFrameObject.contentWindow.document;if(doc.getElementById("state")){state=doc.getElementById("state").innerHTML;}else{if(!this._htmlInputObject.value){state=this._windowObject.location.hash;if(!state)state="undefined";this._htmlInputObject.value=state;initial=true;}else{state=this._htmlInputObject.value;}}}else{if(this._windowObject.location.hash.length)
state=this._windowObject.location.hash;}
if(state=="undefined")state="";consoledebug("_checkState:: lastState:"+this._lastState+", state:"+state);if(this._lastState!=state&&unescape(this._lastState)!=state&&this._lastState!=state.replace(/&amp;/g,"&")&&(state||!state&&this._lastState)){var prevState=this._lastState;this._lastState=state;this._changeSemaphore=false;this.anchor.set(state);this._changeSemaphore=true;if(!this._requireIE8Event()&&this._requireIFrame()){this._windowObject.location.hash=state;}
this.onHistoryStateChange.fireEvent(this,prevState,state,initial);}};AnchorHistoryManager.prototype._changeState=function(newState,withoutOpen){if(!this._changeSemaphore)return;this._timerSemaphore=false;if(this.requireIFrame.get()){var doc=this._htmlIFrameObject.contentWindow.document;doc.open();doc.write("<html><body><div id='state'>"+newState+"</div></body></html>");doc.close();}
this._lastState=newState;this._windowObject.location.hash=newState;this._timerSemaphore=true;};AnchorHistoryManager.prototype.changeSilently=function(newState){this._changeSemaphore=false;this._timerSemaphore=false;this._lastState=newSate;this.anchor.set(newState);this._windowObject.location.hash=newState;this._timerSemaphore=true;this._changeSemaphore=true;};AnchorHistoryManager.instance=undefined;AnchorHistoryManager.getInstance=function(windowObject,anchorDiv,anchorInput,anchorIFrame,anchorTimerSeconds){if(!AnchorHistoryManager.instance){AnchorHistoryManager.instance=new AnchorHistoryManager(windowObject,anchorDiv,anchorInput,anchorIFrame,anchorTimerSeconds);}
return AnchorHistoryManager.instance;};function consoledebug(str){};window.fwk.core.anchorData={buscadorkeyword_sinnodo:"#buscar-videos.{@keyword}:{@currentNode}:plus",buscadorkeyword_connodo:"#buscar-videos-en.{@codeNode}.{@idNode}.{@keyword}:{@currentNode}:plus",buscadortodos_sinnodo:"#buscar-videos:{@currentNode}:plus",buscadortodos_connodo:"#buscar-videos-en.{@codeNode}.{@idNode}:{@currentNode}:plus",ficha:"#video.{@title}.{@group_id}:{@currentNode}:{@prevHash}:plus",registro:"#registro:plus",login:"#ingresar:plus",olvide:"#recordar:plus",recomendarnav:"#recomendar:plus",recomendarsocial:"#recomendarRed.{@red}:plus",radios:"#sintonizar.{@name}:plus",playergrupo:"#ver-grupo-video.{@title}.{@group_id}:{@stopvideo}:{@url_api}:{@url_order}:{@currentNode}:plus",playergrupo_canal:"#ver-grupo-videos.{@title}.{@group_id}:{@stopvideo}:{@url_api}:{@url_order}:{@currentNode}:plus",player:"#ver-video.{@title}.{@content_id}:{@stopvideo}:{@url_api}:{@url_order}:{@currentNode}:plus",player_canal:"#ver-videos.{@title}.{@content_id}:{@stopvideo}:{@url_api}:{@url_order}:{@currentNode}:plus",nada:"#nada"};window.fwk.core.anchorManager=function(name,params){var str=window.fwk.core.anchorData[name];if(str&&params){var strToken=str.replace(/^#([^\.]+)\..*/,"$1");var prevToken=window.location.hash.replace(/^#([^\.]+)\..*/,"$1");malert("token: "+strToken+"\nprevToken: "+prevToken);for(var i in params){if(params[i]!=undefined){var paramsIClean=params[i].toString();paramsIClean=paramsIClean.replace(/API_REMOTE_ADDR=[0-9\.]+/,"");paramsIClean=paramsIClean.replace(/\./g,'');str=str.replace("{@"+i+"}",paramsIClean);}else{str=str.replace("{@"+i+"}",'');}}
var codeNodo=$(document.body).attr('codeNodo');if(!codeNodo)codeNodo="home";var nombreRegion=$(document.body).attr('nombreRegion');if(!nombreRegion)nombreRegion="";str=str.replace("{@currentNode}",codeNodo);str=str.replace("{@currentRegion}",nombreRegion);if(prevToken!=strToken&&prevToken.search(/[a-zA-Z]/)!=-1){str=str.replace("{@prevHash}",anchorPrevHash());}else{str=str.replace(":{@prevHash}","");}}
return str;};window.anchorChangeStack=[];function anchorChange(newAnchor){window.anchorChangeStack.push(newAnchor);window.anchorHistoryManager.anchor.set(newAnchor);}
function anchorPrevHash(value){if(value){value="#"+value.replace(new RegExp(escape(":"),"g"),":");value=value.replace(new RegExp(escape(","),"g"),".");return value;}else{var windowHash=window.location.hash;windowHash=windowHash.replace(/:/g,escape(":"));windowHash=windowHash.replace(/\./g,escape(","));return windowHash.replace("#","");}}
function anchorStopSeoInitialize(){if(window.location.hash.length){if(window.location.hash.search(/[^#0-9]/)!=-1){return true;}}}
function anchorClear(){if(anchorChangeStack.length>=2){window.anchorChangeStack.pop();window.anchorHistoryManager.anchor.set(anchorChangeStack[anchorChangeStack.length-1]);}else{window.anchorChangeStack.pop();window.anchorHistoryManager.anchor.set("#"+(new Date()).getTime());}}
function malert(cadena){if(window.location.toString().search(/debugbf=true/)!=-1){alert(cadena);}}
$(document).ready(function(){window.anchorHistoryManager=AnchorHistoryManager.getInstance(window,"anchorHistoryDiv","anchorHistoryInput","anchorHistoryIFrame");anchorHistoryManager.addEventListener('onHistoryStateChange',function(sender,prevValue,newValue,initial){malert("onHistoryStateChange :: prevValue="+prevValue+", newValue="+newValue+", initial="+initial);anchorExecute(window.fwk.commonGetMyBaseSeoUrl(),(initial)?undefined:true,newValue,undefined);})});window.fwk.core.layerManager=function(){};window.fwk.core.layerManager.lastLayer=null;window.fwk.core.layerManager.allLayers=new Array();window.fwk.core.layerManager.AdManager=null;window.fwk.core.layerManager.newLayer=function(layerName,url,postParams,dialogSettings,dialogClass){var dialogDivContainerId="dialogs";var dialogDivSelectorId="dialog_"+layerName;var dialogDivContainer="#"+dialogDivContainerId;var dialogDivSelector="#"+dialogDivSelectorId;var $div;window.fwk.core.layerManager.myalert("layerManager.newLayer :: Call");if(!$(dialogDivContainer).length){window.fwk.core.layerManager.myalert("layerManager.newLayer :: Creando div container");$div=$("<div>").html("");$div.attr('id',dialogDivContainerId);$("body").append($div);}
if(!$(dialogDivSelector).length){window.fwk.core.layerManager.myalert("layerManager.newLayer :: Creando div "+$(dialogDivContainer).length);$div=$("<div>").html("");$div.attr('id',dialogDivSelectorId);$(dialogDivContainer).append($div);}
window.fwk.core.layerManager.myalert('layerManager.newLayer :: Url a cargar: '+url);$(dialogDivSelector).load(url,postParams,function(){window.fwk.core.layerManager.myalert("layerManager.newLayer :: Pagina ya cargada, Mostrando el dialog ");var currentStackOrder=$(dialogDivSelector).attr('stackOrder');if(currentStackOrder==undefined||parseInt(currentStackOrder)==-1){currentStackOrder=window.fwk.core.layerManager.allLayers.length;window.fwk.core.layerManager.myalert("layerManager.newLayer :: Agrega a la pila "+currentStackOrder);window.fwk.core.layerManager.allLayers.push(layerName);$(dialogDivSelector).attr('stackOrder',parseInt(currentStackOrder));}else{window.fwk.core.layerManager.myalert("layerManager.newLayer :: Reutilizo, previa limpieza "+currentStackOrder);window.fwk.core.layerManager.closeChildsLayer(parseInt(currentStackOrder),true);}
if(dialogSettings){dialogSettings.autoOpen=true;dialogSettings.close=function(event,ui){window.fwk.core.layerManager.closeLayer(layerName);};}else{dialogSettings={autoOpen:true,show:'slide',modal:true,closeOnEscape:false,close:function(event,ui){window.fwk.core.layerManager.closeLayer(layerName);}};}
if(dialogClass){dialogSettings.dialogClass=dialogClass;}else{dialogSettings.dialogClass="dialog-"+layerName;}
$(dialogDivSelector).dialog(dialogSettings);if(AdManager){try{if($('#ad-wrapper-modal').length==0){$('body').append('<div id="ad-wrapper-modal"></div>');}
if(!window.fwk.core.layerManager.AdManager){window.fwk.core.layerManager.AdManager=new AdManager('generalmodal','ad-wrapper-modal').addLayer('BannersModal').addPosition('FlyAd','BANNERFLYAD',undefined,150).showAdLayer('BannersModal');}}catch(e){}
window.fwk.core.layerManager.AdManager.getPosition("BannersModal","FlyAd").adRefresh(new AdRequest($('body').attr('codenodo')));if(window.fwk.isLayoutPlayer){window.fwk.controllers.player.AdRefreshLayerPlayer(false);}else{if(window.adManager){var posBottomLeft=window.adManager.getPosition('BannersTapas','BottomLeft');var posFull=window.adManager.getPosition('BannersTapas','Full');var posSky=window.adManager.getPosition('BannersTapas','Sky');if(posBottomLeft){posBottomLeft.adRefresh(new AdRequest($(document.body).attr("codeNodo")),'BannersTapas');}
if(posFull){posFull.adRefresh(new AdRequest($(document.body).attr("codeNodo")),'BannersTapas');}
if(posSky){posSky.adRefresh(new AdRequest($(document.body).attr("codeNodo")),'BannersTapas');}}}}});}
window.fwk.core.layerManager.closeChildsLayer=function(stackOrder,dontAnchorClear){window.fwk.core.layerManager.myalert("layerManager.closeChildsLayer  :: Call destruyo desde: "+(stackOrder+1)+" , "+window.fwk.core.layerManager.allLayers.length);for(var i=stackOrder+1;i<window.fwk.core.layerManager.allLayers.length;i++){window.fwk.core.layerManager.closeLayer(window.fwk.core.layerManager.allLayers[i],true,dontAnchorClear);}
window.fwk.core.layerManager.allLayers=window.fwk.core.layerManager.allLayers.slice(0,stackOrder+1);};window.fwk.core.layerManager.closeAllLayer=function(dontAnchorClear){if(window.fwk.core.layerManager.allLayers.length){window.fwk.core.layerManager.closeLayer(window.fwk.core.layerManager.allLayers[0],false,dontAnchorClear);}};window.fwk.core.layerManager.closeLayer=function(layer,dontCloseChilds,dontAnchorClear){window.fwk.core.layerManager.myalert('layerManager.closeLayer :: Call');if(!dontAnchorClear){anchorClear(layer);}
var dialogDivSelectorId="dialog_"+layer;var dialogDivSelector="#"+dialogDivSelectorId;if(typeof(layer)=="string"){var stackOrder=$(dialogDivSelector).attr('stackOrder');if(!dontCloseChilds){window.fwk.core.layerManager.closeChildsLayer(parseInt(stackOrder),dontAnchorClear);}
window.fwk.core.layerManager.allLayers=window.fwk.core.layerManager.allLayers.slice(0,stackOrder);$(dialogDivSelector).html("");$(dialogDivSelector).dialog("destroy");$(dialogDivSelector).attr('stackOrder',-1);}else{}};window.fwk.core.layerManager.myalert=function(str,jsonObject){var addInfo="";if(jsonObject){addInfo+="\n";for(var i in jsonObject){addInfo+=i+":"+jsonObject[i]+"\n";}}
if(window.fwk.debug||window.location.toString().search("debuglayer")!=-1){alert(str+addInfo);}};window.fwk.controllers.nav={'nsName':'nav','nsFullName':'fwk.controllers.nav','nsParent':window.fwk.controllers};window.fwk.controllers.nav.startUp=function(){};window.fwk.controllers.navpath={};window.fwk.controllers.navpath.instance=null;window.fwk.common.fieldCheck={check:function(ob){tipo=$(ob).attr("control");switch(tipo){case"TEXTAREA":return(this.checkText(ob));break;case"TEXT":return(this.checkText(ob));break;case"PASSWORD":return(this.checkPassword(ob));break;case"DATE":return(this.checkDate(ob));break;case"RADIO":return(this.checkRadio(ob));break;case"SELECT":return(this.checkSelect(ob));break;default:return(true);}
return(true);},checkText:function(ob){$this=$(ob);var id=$this.attr("id");obligatorio=$this.attr("obligatorio");max=parseInt($this.attr("maxlength"));val=$this.val();$this_obligatorio=$("#"+id+"_error_obligatorio").hide();$this_max=$("#"+id+"_error_max").hide();ok=true;if(obligatorio=='yes')if(val.length==0){$this_obligatorio.show();ok=false;}
if(max>0){if(val.length>max){$this_max.show();ok=false;}else{$this_max.hide();}}
return(ok);},checkPassword:function(ob){$this=$(ob);id=$this.attr("id");obligatorio=$this.attr("obligatorio");max=parseInt($this.attr("maxlength"));val=$this.val();segundo=(id.substr(-1)=='2');$this_concordancia=$("#"+id+"_error_concordancia").hide();$this_obligatorio=$("#"+id+"_error_obligatorio").hide();$this_max=$("#"+id+"_error_max").hide();ok=true;if(obligatorio=='yes')if(val.length==0){$this_obligatorio.show();ok=false;}
if(max>0)if(val.length>max){$this_max.show();ok=false;}
if(ok&&segundo)
{$primero=$("#"+id.substr(0,id.length-1));if(val!=$primero.val()){$this_concordancia.show();ok=false;}}
return(ok);},checkDate:function(ob){$this=$(ob);id=$this.attr("id");obligatorio=$this.attr("obligatorio");val=$this.val();$this_obligatorio=$("#"+id+"_error_obligatorio").hide();ok=true;if(obligatorio=='yes')
{datos=val.split("-");if(datos[0]==""||datos[1]==""||datos[2]==""){$this_obligatorio.show();ok=false;}}
return(ok);},checkRadio:function(ob){return(true);},checkSelect:function(ob){$this=$(ob);id=$this.attr("id");obligatorio=$this.attr("obligatorio");val=$this.val();$this_obligatorio=$("#"+id+"_error_obligatorio").hide();ok=true;if(obligatorio=='yes')if(val==""){$this_obligatorio.show();ok=false;}
return(ok);}}
window.fwk.controllers.mipase={};window.fwk.controllers.mipase.url={};$(document).ready(function(){window.fwk.controllers.mipase.url.feSingupUserInst=window.fwk.getBaseUrlWithRegionAndNode("/mipase/adduserinst?layout=aplicacion");window.fwk.controllers.mipase.url.feSingupUser=window.fwk.getBaseUrlWithRegionAndNode("/mipase/adduser?layout=aplicacion");window.fwk.controllers.mipase.url.feModifyUser=window.fwk.getBaseUrlWithRegionAndNode("/mipase/modifyuser?layout=aplicacion");});window.fwk.controllers.mipase.scrAddUser=function(pNombre,oneStepAdd){this.nombre=pNombre;this.apiChkAvailable=window.fwk.getBaseUrlWithRegionAndNode("/mipase/available");this.apiGetProv=window.fwk.getBaseUrlWithRegionAndNode("/mipase/getprovincias");this.apisave1=window.fwk.getBaseUrlWithRegionAndNode("/mipase/savefase1");this.apiEnding="&showxml=true&layoutOff=true";this.scrInst=window.fwk.getBaseUrlWithRegionAndNode("/mipase/adduserinst?layoutOff=true");this.scrMail=window.fwk.getBaseUrlWithRegionAndNode("/mipase/scrmailsent?layoutOff=true");this.saveandgo=null;this.oneStepAdd=oneStepAdd;this.initialize=function(){this.inicializarControles();}
this.inicializarControles=function(){this.intializeAvailable();this.initializeDate();this.initializeSelects();this.initializeButtons();this.initializeTerminos();$("#adduser_form input, #adduser_form select").blur(function(){window.fwk.common.fieldCheck.check(this);});if($("#USERPHOTO").length>0){$("#USERPHOTO").fileupload({filetypes:Array('jpg','png','gif'),uploadMaxSize:'500K'});}}
this.intializeAvailable=function()
{$("#username").blur(this.getCallback("checkAvailable"));}
this.checkAvailable=function(ob)
{valor=$(ob).val();if(valor.length>1)
{params="?&username="+$(ob).val();url=this.apiChkAvailable+params+this.apiEnding;$.get(url,this.getCallback("checkAvailableRespuesta","data"));}}
this.checkAvailableRespuesta=function(data)
{if($(data).find("error").text()!='')this.showErrorMsg("#username",$(data).find("error").text());if($(data).find("existe_username").text()==1)$("#username_error_duplicado").show();else $("#username_error_duplicado").hide();window.fwk.common.fieldCheck.check($("#username"));}
this.initializeDate=function()
{fechas=$("#mipase [control='DATE']");for(i=0;i<fechas.length;i++)
{$this=$(fechas[i]);fecha=$this.val().split("/");if(fecha.length==3)
{$("#"+$this.attr("id")+"_d").val(parseInt(fecha[0]));$("#"+$this.attr("id")+"_m").val(parseInt(fecha[1]));$("#"+$this.attr("id")+"_y").val(parseInt(fecha[2]));}
$("#"+$this.attr("id")+"_d").change(this.getCallback("changeDateDia"));$("#"+$this.attr("id")+"_m").change(this.getCallback("changeDateMes"));$("#"+$this.attr("id")+"_y").change(this.getCallback("changeDateAno"));this.changeDateSetear($(this).attr("id"));}}
this.changeDateDia=function(ob)
{id=$(ob).attr("id");id=id.substr(0,id.length-2);fecha=this.changeDateSetear(id);if((fecha[0]>30)&&(fecha[1]==2||fecha[1]==4||fecha[1]==6||fecha[1]==9||fecha[1]==11)){$(this).val(30);window.fwk.controllers.MIPASE.changeDateSetear(id);}}
this.changeDateMes=function(ob)
{id=$(ob).attr("id")
id=id.substr(0,id.length-2);this.changeDateSetear(id);}
this.changeDateAno=function(ob)
{id=$(ob).attr("id")
id=id.substr(0,id.length-2);this.changeDateSetear(id);}
this.changeDateSetear=function(id)
{dia=$("#"+id+"_d").val();mes=$("#"+id+"_m").val();ano=$("#"+id+"_y").val();if(dia>30&&(mes==2||mes==4||mes==6||mes==9||mes==11))dia=30;if(mes==2&&dia>29)dia=29;if(dia==29&&mes==2&&(!(!(ano%4)||!(ano%100))))dia=28;$("#"+id+"_d").val(dia);$("#"+id+"_m").val(mes);$("#"+id+"_y").val(ano);$("#"+id).val(dia+"/"+mes+"/"+ano);return([dia,mes,ano]);}
this.initializeSelects=function()
{selects=$("select[padre*='ATRIB']")
for(i=0;i<selects.length;i++)
{$this=$(selects[i]);padre=$("#"+$this.attr("padre"));padre.attr("hijo",$this.attr("id"));padre.change(this.getCallback("changeSelect"));};},this.changeSelect=function(ob)
{param="?&idalfanumerico="+$(ob).attr("id")+"&valorposible="+$(ob).val();url=this.apiGetProv+param+this.apiEnding;$.get(url,this.getCallback("changeSelectRespuesta","data"));}
this.changeSelectRespuesta=function(data)
{padre=$("#"+$(data).find("parametros idalfanumerico").text());opciones=$(data).find($(padre).attr("hijo")+" option");opts="";for(i=0;i<opciones.length;i++)
{texto=$(opciones[i]).find("valor").text();valor=$(opciones[i]).find("valor_posible").text();opts+="<option value='"+valor+"'>"+texto+"</option>";}
$("#"+$(padre).attr("hijo")).html(opts);}
this.initializeTerminos=function()
{$("#addUser_terminos").click(this.getCallback("chkTerminos"));}
this.chkTerminos=function(ob)
{if($(ob).attr("checked"))
{$("#error-terminos").hide();}
else
{$("#error-terminos").show();}}
this.initializeButtons=function()
{$("#addUser_btnSendAndStop").click(this.getCallback("btnSendAndStop"));}
this.btnCancel=function(ob)
{}
this.btnSendAndStop=function(ob){if(this.checkAllForm()&&$("#addUser_terminos").attr("checked")){$("#adduser_form *[name*='error']").hide();this.saveandgo=false;url=this.apisave1+"?"+this.apiEnding;$("#cargandoRegistracion").fadeIn(500);$.post(url,$("#adduser_form").serializeArray(),this.getCallback("btnSendRespuesta","data"));}else if(!$("#addUser_terminos").attr("checked")){$("#error-terminos").show();}};this.btnSendRespuesta=function(data){$("#cargandoRegistracion").fadeOut(500);errores=$(data).find("errores error");if($(data).find("captcharesultado").text()=="FAIL"){$("#captcha_input_error_incorrecto").show();}else if(errores.length>0){for(i=0;i<errores.length;i++){$err=$(errores[i]);mensaje=$err.find("mensaje").text();nombrecampo=$err.find("campo").text();campo=$("#adduser_form *[name='"+nombrecampo+"']");if(mensaje=="El Nombre de usuario ya existe")$("#"+campo.attr("id")+"_error_duplicado").show();else if(mensaje=="Este campo es obligatorio")$("#"+campo.attr("id")+"_error_obligatorio").show();else if(mensaje=="La cantidad de caracteres es incorrecta")$("#"+campo.attr("id")+"_error_min").show();else if(mensaje=="Fecha inválida")$("#"+campo.attr("id")+"_error_min").show();else $("#"+campo.attr("id")+"_error").html(mensaje).show();}
return(false);}
else{if(this.oneStepAdd==null||this.oneStepAdd==false||this.oneStepAdd=='false'){$("#mipase").load(this.scrInst+"&urlReturn="+escape($("#adduser_form [name=urlReturn]").val()));}
else{$("#mipase").load(this.scrMail+"&urlReturn="+escape($("#adduser_form [name=urlReturn]").val()));}}};this.checkAllForm=function()
{var OK=true;campos=$("#adduser_form input, #adduser_form select");for(i=0;i<campos.length;i++){OK=window.fwk.common.fieldCheck.check(campos[i])&&OK;}
return(OK);}
this.showErrorMsg=function(ob,msg)
{$(ob+"_error").html(msg).show();}
this.getCallback=function(destino,parametro)
{if(parametro)eval("var callback= function ("+parametro+") { "+this.nombre+"."+destino+"("+parametro+"); }");else eval("var callback= function () { "+this.nombre+"."+destino+"(this); }");return(callback);}}
window.fwk.controllers.mipase.scrAddUserInst=function(pNombre){this.nombre=pNombre;this.apisave2=window.fwk.getBaseUrlWithRegionAndNode("/mipase/savefase2");this.apiEnding="&showxml=true&layoutOff=true";this.scrFinal=window.fwk.getBaseUrlWithRegionAndNode("/mipase/confirm?layoutOff=true");this.initialize=function()
{this.inicializarControles();}
this.inicializarControles=function()
{this.initializeDate();this.initializeSelects();this.initializeButtons();$("#adduserinst_form input, #adduserinst_form select, #adduserinst_form textarea").blur(function(){window.fwk.common.fieldCheck.check(this);});}
this.initializeSelects=function()
{selects=$("select[padre*='ATRIB']")
for(i=0;i<selects.length;i++)
{$this=$(selects[i]);padre=$("#"+$this.attr("padre"));padre.attr("hijo",$this.attr("id"));padre.change(this.getCallback("changeSelect"));};},this.changeSelect=function(ob)
{param="?&idalfanumerico="+$(ob).attr("id")+"&valorposible="+$(ob).val();url=this.apiGetProv+param+this.apiEnding;$.get(url,this.getCallback("changeSelectRespuesta","data"));}
this.changeSelectRespuesta=function(data)
{opciones=$(data).find("option");opts="";for(i=0;i<opciones.length;i++)
{texto=$(opciones[i]).find("valor").text();valor=$(opciones[i]).find("valor_posible").text();opts+="<option value='"+valor+"'>"+texto+"</option>";}
padre=$("#"+$(data).find("parametros idalfanumerico").text());$("#"+$(padre).attr("hijo")).html(opts);}
this.initializeDate=function()
{fechas=$("#mipase [control='DATE']");for(i=0;i<fechas.length;i++)
{$this=$(fechas[i]);fecha=$this.val().split("/");if(fecha.length==3)
{$("#"+$this.attr("id")+"_d").val(parseInt(fecha[0]));$("#"+$this.attr("id")+"_m").val(parseInt(fecha[1]));$("#"+$this.attr("id")+"_y").val(parseInt(fecha[2]));}
$("#"+$this.attr("id")+"_d").change(this.getCallback("changeDateDia"));$("#"+$this.attr("id")+"_m").change(this.getCallback("changeDateMes"));$("#"+$this.attr("id")+"_y").change(this.getCallback("changeDateAno"));this.changeDateSetear($(this).attr("id"));}}
this.changeDateDia=function(ob)
{id=$(ob).attr("id");id=id.substr(0,id.length-2);fecha=this.changeDateSetear(id);if((fecha[0]>30)&&(fecha[1]==2||fecha[1]==4||fecha[1]==6||fecha[1]==9||fecha[1]==11)){$(this).val(30);window.fwk.controllers.MIPASE.changeDateSetear(id);}}
this.changeDateMes=function(ob)
{id=$(ob).attr("id")
id=id.substr(0,id.length-2);this.changeDateSetear(id);}
this.changeDateAno=function(ob)
{id=$(ob).attr("id")
id=id.substr(0,id.length-2);this.changeDateSetear(id);}
this.changeDateSetear=function(id)
{dia=$("#"+id+"_d").val();mes=$("#"+id+"_m").val();ano=$("#"+id+"_y").val();if(dia>30&&(mes==2||mes==4||mes==6||mes==9||mes==11))dia=30;if(mes==2&&dia>29)dia=29;if(dia==29&&mes==2&&(!(!(ano%4)||!(ano%100))))dia=28;$("#"+id+"_d").val(dia);$("#"+id+"_m").val(mes);$("#"+id+"_y").val(ano);$("#"+id).val(dia+"/"+mes+"/"+ano);return([dia,mes,ano]);}
this.initializeButtons=function()
{$("#addUserInst_btnSendAndStop").click(this.getCallback("btnSendAndStop"));}
this.btnSendAndStop=function(ob){if(this.checkAllForm()){url=this.apisave2+"?"+this.apiEnding;$("#cargandoRegistracion").fadeIn(500);$.post(url,$("#adduserinst_form").serializeArray(),this.getCallback("btnSendRespuesta","data"));}}
this.btnSendRespuesta=function(data)
{$("#cargandoRegistracion").fadeOut(500);errores=$(data).find("errores error");if(errores.length>0){for(i=0;i<errores.length;i++){$err=$(errores[i]);mensaje=$err.find("mensaje").text();nombrecampo=$err.find("campo").text();campo=$("#adduserinst_form *[name='"+nombrecampo+"']");if(mensaje=="Este campo es obligatorio")$("#"+campo.attr("id")+"_error_obligatorio").show();if(mensaje=="La cantidad de caracteres es incorrecta")$("#"+campo.attr("id")+"_error_min").show();if(mensaje=="Fecha inválida")$("#"+campo.attr("id")+"_error_min").show();}
return(false);}
else{$("#mipase").load(this.scrFinal+"&urlReturn="+escape($("#adduserinst_form [name=urlReturn]").val())+"&step=add");}}
this.checkAllForm=function()
{var OK=true;campos=$("#adduserinst_form input, #adduserinst_form select");for(i=0;i<campos.length;i++){OK=window.fwk.common.fieldCheck.check(campos[i])&&OK;}
return(OK);}
this.showErrorMsg=function(ob,msg)
{$(ob+"_error").html(msg).show();}
this.getCallback=function(destino,parametro)
{if(parametro)eval("var callback= function ("+parametro+") { "+this.nombre+"."+destino+"("+parametro+"); }");else eval("var callback= function () { "+this.nombre+"."+destino+"(this); }");return(callback);}}
window.fwk.controllers.mipase.scrModifyUser=function(pNombre){this.nombre=pNombre;this.apiChkAvailable=window.fwk.getBaseUrlWithRegionAndNode("/mipase/available");this.apiGetProv=window.fwk.getBaseUrlWithRegionAndNode("/mipase/getprovincias");this.apisave1=window.fwk.getBaseUrlWithRegionAndNode("/mipase/updatefase1");this.apiEnding="&showxml=true&layoutOff=true";this.scrInst=window.fwk.getBaseUrlWithRegionAndNode("/mipase/modifyuserinst?layoutOff=true");this.scrFinal=window.fwk.getBaseUrlWithRegionAndNode("/mipase/confirm?layoutOff=true");this.saveandgo=null;this.initialize=function()
{this.inicializarControles();}
this.inicializarControles=function()
{this.intializeAvailable();this.initializeDate();this.initializeSelects();this.initializeButtons();$("#modifyuser_form input, #modifyuser_form select, #modifyuser_form textarea").blur(function(){window.fwk.common.fieldCheck.check(this);});if($("#USERPHOTO").length>0){$("#USERPHOTO").fileupload({filetypes:Array('jpg','png','gif'),uploadMaxSize:'500K'});$("#USERPHOTO_clear").click(function(){$("#USERPHOTO_img").hide("slow");});}}
this.intializeAvailable=function()
{$("#username").attr("name","username_show");$("<input type='hidden' id='username_real' name='USERNAME'/>").appendTo($("#username").parent());$("#username_real").val($("#username").val());$("#username").attr("disabled","disabled");}
this.initializeDate=function()
{fechas=$("#mipase [control='DATE']");for(i=0;i<fechas.length;i++)
{$this=$(fechas[i]);fecha=$this.val().split("/");if(fecha.length==3)
{$("#"+$this.attr("id")+"_d").val(parseInt(fecha[0]));$("#"+$this.attr("id")+"_m").val(parseInt(fecha[1]));$("#"+$this.attr("id")+"_y").val(parseInt(fecha[2]));}
$("#"+$this.attr("id")+"_d").change(this.getCallback("changeDateDia"));$("#"+$this.attr("id")+"_m").change(this.getCallback("changeDateMes"));$("#"+$this.attr("id")+"_y").change(this.getCallback("changeDateAno"));this.changeDateSetear($(this).attr("id"));}}
this.changeDateDia=function(ob)
{id=$(ob).attr("id");id=id.substr(0,id.length-2);fecha=this.changeDateSetear(id);if((fecha[0]>30)&&(fecha[1]==2||fecha[1]==4||fecha[1]==6||fecha[1]==9||fecha[1]==11)){$(this).val(30);window.fwk.controllers.MIPASE.changeDateSetear(id);}}
this.changeDateMes=function(ob)
{id=$(ob).attr("id")
id=id.substr(0,id.length-2);this.changeDateSetear(id);}
this.changeDateAno=function(ob)
{id=$(ob).attr("id")
id=id.substr(0,id.length-2);this.changeDateSetear(id);}
this.changeDateSetear=function(id)
{dia=$("#"+id+"_d").val();mes=$("#"+id+"_m").val();ano=$("#"+id+"_y").val();if(dia>30&&(mes==2||mes==4||mes==6||mes==9||mes==11))dia=30;if(mes==2&&dia>29)dia=29;if(dia==29&&mes==2&&(!(!(ano%4)||!(ano%100))))dia=28;$("#"+id+"_d").val(dia);$("#"+id+"_m").val(mes);$("#"+id+"_y").val(ano);$("#"+id).val(dia+"/"+mes+"/"+ano);return([dia,mes,ano]);}
this.initializeSelects=function(){selects=$("select[padre*='ATRIB']")
for(i=0;i<selects.length;i++)
{$this=$(selects[i]);padre=$("#"+$this.attr("padre"));padre.attr("hijo",$this.attr("id"));padre.change(this.getCallback("changeSelect"));padre.trigger("change");};},this.changeSelect=function(ob){param="?&idalfanumerico="+$(ob).attr("id")+"&valorposible="+$(ob).val();url=this.apiGetProv+param+this.apiEnding;$.get(url,this.getCallback("changeSelectRespuesta","data"));}
this.changeSelectRespuesta=function(data){padre=$("#"+$(data).find("parametros idalfanumerico").text());$hijo=$("#"+$(padre).attr("hijo"));opciones=$(data).find($(padre).attr("hijo")+" option");opts="";hijo_valor=$hijo.val();for(i=0;i<opciones.length;i++){texto=$(opciones[i]).find("valor").text();valor=$(opciones[i]).find("valor_posible").text();opts+="<option value='"+valor+"' "+((valor==hijo_valor)?"selected":"")+">"+texto+"</option>";}
$hijo.html(opts);}
this.initializeButtons=function()
{$("#modifyUser_btnCancel").click(this.getCallback("btnCancel"));$("#modifyUser_btnSendAndStop").click(this.getCallback("btnSendAndStop"));$("#modifyUser_btnSendAndGo").click(this.getCallback("btnSendAndGo"));}
this.btnCancel=function(ob)
{}
this.btnSendAndStop=function(ob)
{if(this.checkAllForm())
{this.saveandgo=false;url=this.apisave1+"?"+this.apiEnding;$("#cargandoRegistracion").fadeIn(500);$.post(url,$("#modifyuser_form").serializeArray(),this.getCallback("btnSendRespuesta","data"));}}
this.btnSendRespuesta=function(data)
{$("#cargandoRegistracion").fadeOut(500);errores=$(data).find("errores error");if(errores.length>0)
{for(i=0;i<errores.length;i++)
{$err=$(errores[i]);mensaje=$err.find("mensaje").text();nombrecampo=$err.find("campo").text();campo=$("#modifyuser_form *[name='"+nombrecampo+"']");if(mensaje=="El Nombre de usuario ya existe")$("#"+campo.attr("id")+"_error_duplicado").show();else if(mensaje=="Este campo es obligatorio")$("#"+campo.attr("id")+"_error_obligatorio").show();else if(mensaje=="La cantidad de caracteres es incorrecta")$("#"+campo.attr("id")+"_error_min").show();else if(mensaje=="Fecha inválida")$("#"+campo.attr("id")+"_error_min").show();else $("#"+campo.attr("id")+"_error").html(mensaje).show();}
return(false);}else{$("#mipase").html('cargando...').load(this.scrInst+"&urlReturn="+escape($("#modifyuser_form [name=urlReturn]").val()));}}
this.checkAllForm=function()
{var OK=true;campos=$("#modifyuser_form input, #modifyuser_form select, #modifyuser_form textarea");for(i=0;i<campos.length;i++){OK=window.fwk.common.fieldCheck.check(campos[i])&&OK;}
return(OK);}
this.showErrorMsg=function(ob,msg)
{$(ob+"_error").html(msg).show();}
this.getCallback=function(destino,parametro)
{if(parametro)eval("var callback= function ("+parametro+") { "+this.nombre+"."+destino+"("+parametro+"); }");else eval("var callback= function () { "+this.nombre+"."+destino+"(this); }");return(callback);}}
window.fwk.controllers.mipase.scrModifyUserInst=function(pNombre){this.nombre=pNombre;this.apisave2=window.fwk.getBaseUrlWithRegionAndNode("mipase/updatefase2");this.apiEnding="&showxml=true&layoutOff=true";this.scrFinal=window.fwk.getBaseUrlWithRegionAndNode("mipase/confirm?layoutOff=true");this.initialize=function()
{this.inicializarControles();}
this.inicializarControles=function()
{this.initializeDate();this.initializeSelects();this.initializeButtons();$("#modifyuserinst_form input, #modifyuserinst_form select, #modifyuserinst_form textarea").blur(function(){window.fwk.common.fieldCheck.check(this);});}
this.initializeSelects=function()
{selects=$("select[padre*='ATRIB']")
for(i=0;i<selects.length;i++)
{$this=$(selects[i]);padre=$("#"+$this.attr("padre"));padre.attr("hijo",$this.attr("id"));padre.change(this.getCallback("changeSelect"));};},this.changeSelect=function(ob)
{param="?&idalfanumerico="+$(ob).attr("id")+"&valorposible="+$(ob).val();url=this.apiGetProv+param+this.apiEnding;$.get(url,this.getCallback("changeSelectRespuesta","data"));}
this.changeSelectRespuesta=function(data)
{opciones=$(data).find("option");opts="";for(i=0;i<opciones.length;i++)
{texto=$(opciones[i]).find("valor").text();valor=$(opciones[i]).find("valor_posible").text();opts+="<option value='"+valor+"'>"+texto+"</option>";}
padre=$("#"+$(data).find("parametros idalfanumerico").text());$("#"+$(padre).attr("hijo")).html(opts);}
this.initializeDate=function()
{fechas=$("#mipase [control='DATE']");for(i=0;i<fechas.length;i++)
{$this=$(fechas[i]);fecha=$this.val().split("/");if(fecha.length==3)
{$("#"+$this.attr("id")+"_d").val(parseInt(fecha[0]));$("#"+$this.attr("id")+"_m").val(parseInt(fecha[1]));$("#"+$this.attr("id")+"_y").val(parseInt(fecha[2]));}
$("#"+$this.attr("id")+"_d").change(this.getCallback("changeDateDia"));$("#"+$this.attr("id")+"_m").change(this.getCallback("changeDateMes"));$("#"+$this.attr("id")+"_y").change(this.getCallback("changeDateAno"));this.changeDateSetear($(this).attr("id"));}}
this.changeDateDia=function(ob)
{id=$(ob).attr("id");id=id.substr(0,id.length-2);fecha=this.changeDateSetear(id);if((fecha[0]>30)&&(fecha[1]==2||fecha[1]==4||fecha[1]==6||fecha[1]==9||fecha[1]==11)){$(this).val(30);window.fwk.controllers.MIPASE.changeDateSetear(id);}}
this.changeDateMes=function(ob)
{id=$(ob).attr("id")
id=id.substr(0,id.length-2);this.changeDateSetear(id);}
this.changeDateAno=function(ob)
{id=$(ob).attr("id")
id=id.substr(0,id.length-2);this.changeDateSetear(id);}
this.changeDateSetear=function(id)
{dia=$("#"+id+"_d").val();mes=$("#"+id+"_m").val();ano=$("#"+id+"_y").val();if(dia>30&&(mes==2||mes==4||mes==6||mes==9||mes==11))dia=30;if(mes==2&&dia>29)dia=29;if(dia==29&&mes==2&&(!(!(ano%4)||!(ano%100))))dia=28;$("#"+id+"_d").val(dia);$("#"+id+"_m").val(mes);$("#"+id+"_y").val(ano);$("#"+id).val(dia+"/"+mes+"/"+ano);return([dia,mes,ano]);}
this.initializeButtons=function()
{$("#modifyUserInst_btnCancel").click(this.getCallback("btnCancel"));$("#modifyUserInst_btnSendAndStop").click(this.getCallback("btnSendAndStop"));}
this.btnCancel=function(ob)
{}
this.btnSendAndStop=function(ob)
{if(this.checkAllForm())
{this.saveandgo=false;url=this.apisave2+"?"+this.apiEnding;$("#cargandoRegistracion").fadeIn(500);$.post(url,$("#modifyuserinst_form").serializeArray(),this.getCallback("btnSendRespuesta","data"));}}
this.btnSendRespuesta=function(data)
{$("#cargandoRegistracion").fadeOut(500);errores=$(data).find("errores error");if(errores.length>0)
{for(i=0;i<errores.length;i++)
{$err=$(errores[i]);mensaje=$err.find("mensaje").text();nombrecampo=$err.find("campo").text();campo=$("#modifyuserinst_form *[name='"+nombrecampo+"']");if(mensaje=="Este campo es obligatorio")$("#"+campo.attr("id")+"_error_obligatorio").show();if(mensaje=="La cantidad de caracteres es incorrecta")$("#"+campo.attr("id")+"_error_min").show();if(mensaje=="Fecha inválida")$("#"+campo.attr("id")+"_error_min").show();}
return(false);}
else{$('#mipase').load(this.scrFinal+"&urlReturn="+escape($("#modifyuserinst_form [name=urlReturn]").val())+"&step=edit");}}
this.checkAllForm=function()
{var OK=true;campos=$("#modifyuserinst_form input, #modifyuserinst_form select, modifyuser_form textarea");for(i=0;i<campos.length;i++){OK=window.fwk.common.fieldCheck.check(campos[i])&&OK;}
return(OK);}
this.showErrorMsg=function(ob,msg)
{$(ob+"_error").html(msg).show();}
this.getCallback=function(destino,parametro)
{if(parametro)eval("var callback= function ("+parametro+") { "+this.nombre+"."+destino+"("+parametro+"); }");else eval("var callback= function () { "+this.nombre+"."+destino+"(this); }");return(callback);}}
window.fwk.controllers.mipase.scrDelUser=function(pNombre){this.nombre=pNombre;this.apiDelUser=window.fwk.getBaseUrlWithRegionAndNode("/mipase/deleteusersave");this.apiEnding="&layoutOff=true";this.initialize=function(){$("#bajaUsuarioSend").click(this.getCallback("bajaSend"));}
this.bajaSend=function(ob)
{params="?&message="+escape($("#bajaMotivo").val());url=this.apiDelUser+params+this.apiEnding;$("#bajaDeUsuario").load(url);}
this.getCallback=function(destino,parametro)
{if(parametro)eval("var callback= function ("+parametro+") { "+this.nombre+"."+destino+"("+parametro+"); }");else eval("var callback= function () { "+this.nombre+"."+destino+"(this); }");return(callback);}}
window.fwk.controllers.buscador={};window.fwk.controllers.buscador.scrFormContextual=function(pNombre){this.nombre=pNombre;this.url=window.fwk.getBaseUrlWithRegionAndNode("/buscador/resultado?layout=aplicacion");this.initialize=function(){$("#btnSearchContextual").click(this.getCallback("buscar"));$("#buscadorFormContextual").submit(this.getCallback("buscar"));}
this.buscar=function(){var words=$("#buscadorWordsContextual").val();var nodo="";var idnodo="";if(window.fwk.isLayoutPlayer){if(window.fwk.controllers.navpath.instance){if(window.fwk.controllers.navpath.instance.navpath("parserName")=="pathParserNodes"){nodo=window.fwk.controllers.navpath.instance.navpath("currentNodeCode");}else if(window.fwk.controllers.navpath.instance.navpath("parserName")=="pathParserSearch"){if(window.fwk.controllers.navpath.instance.navpath("currentNodeCode")&&window.fwk.controllers.navpath.instance.navpath("currentNodeCode")!="home"){nodo=window.fwk.controllers.navpath.instance.navpath("currentNodeCode");}}}
idnodo=nodo;}else{if($(document.body).attr("entryMode")=="category"||$(document.body).attr("entryMode")=="channel"){nodo=$(document.body).attr("codeNodo");idnodo=$(document.body).attr("idNodo");}}
url=this.url+"&words="+escape(words)+"&idnode="+nodo;window.fwk.commonSearch({'keyword':escape(words),'codeNode':nodo,'idNode':idnodo,'ownurl':url});return(false);}
this.getCallback=function(destino,parametro){if(parametro)eval("var callback= function ("+parametro+") { "+this.nombre+"."+destino+"("+parametro+"); }");else eval("var callback= function () { return("+this.nombre+"."+destino+"(this)); }");return(callback);}};window.fwk.controllers.buscador.scrForm=function(pNombre){this.nombre=pNombre;this.url=window.fwk.getBaseUrlWithRegionAndNode("/buscador/resultado?layout=aplicacion");this.initialize=function(){$("#btnSearch").click(this.getCallback("buscar"));$("#buscadorForm").submit(this.getCallback("buscar"));}
this.buscar=function(){words=$("#buscadorWords").val();nodo=$("#buscadorNodo").attr("value");var idnodo=$("#buscadorNodo").attr('node_id');url=this.url+"&words="+escape(words)+"&idnode="+nodo;window.fwk.commonSearch({'keyword':escape(words),'codeNode':nodo,'idNode':idnodo,'ownurl':url});return(false);}
this.getCallback=function(destino,parametro){if(parametro)eval("var callback= function ("+parametro+") { "+this.nombre+"."+destino+"("+parametro+"); }");else eval("var callback= function () { return("+this.nombre+"."+destino+"(this)); }");return(callback);}
window.fwk.controllers.buscador.load=function(){$("#comboboxBuscadorObject").click(function(){$("#comboboxselector").attr("selectedValue",$(this).val());$("#comboboxselector a").html($("option[value="+$(this).val()+"]",this).html());$("#buscadorNodo").attr("value",$("option[value="+$(this).val()+"]",this).attr("value"));$("#buscadorNodo").attr("node_id",$("option[value="+$(this).val()+"]",this).attr("node_id"));$('#comboboxvaluesPanel').toggle(200);lastObject=$(this);});var optDefault=$("#comboboxBuscadorObject option[selected]");if(optDefault.val()!=undefined){$("#comboboxselector").attr("selectedValue",optDefault.val());$("#buscadorNodo").attr("value",optDefault.val());$("#buscadorNodo").attr("node_id",optDefault.attr("node_id"));$("#comboboxselector a").html(optDefault.html());lastObject=optDefault;}else{$("#comboboxselector").attr("selectedValue",$("#comboboxBuscadorObject option:first").val());$("#comboboxselector a").html($("#comboboxBuscadorObject option:first").html());$("#buscadorNodo").attr("value",$("#comboboxBuscadorObject option:first").val());$("#buscadorNodo").attr("node_id",$("#comboboxBuscadorObject option:first").attr("node_id"));lastObject=$("#comboboxBuscadorObject option:first");}
$('#comboboxselector a').click(function(e){e.preventDefault();$('#comboboxvaluesPanel').toggle(200);lastObject.focus();});}}
$(document).ready(function(){if(window.fwk.controllers.buscador.load){window.fwk.controllers.buscador.load();}});window.fwk.controllers.buscador.scrResultado=function(pNombre)
{this.nombre=pNombre;this.param={};this.url=window.fwk.getBaseUrlWithRegionAndNode("/buscador/resultadopage?layoutOff=true");this.initialize=function(pPars){this.param=pPars;$("#searchPaginador LI").live("click",this.getCallback("jumpTo"));this.buscar(1);}
this.buscar=function(pag){url=this.url+"&words="+escape(this.param.words)+"&idnode="+this.param.node+"&page="+pag;$("#buscadorPagina").html("<div id='cargando'></div>").load(url);window.scrollTo(0);}
this.jumpTo=function(ob){this.buscar($(ob).attr("jumpto"));}
this.getCallback=function(destino,parametro){if(parametro)eval("var callback= function ("+parametro+") { "+this.nombre+"."+destino+"("+parametro+"); }");else eval("var callback= function () { "+this.nombre+"."+destino+"(this); }");return(callback);}}
window.fwk.controllers.classNotas=function(){var mthis=this;this.apiLogin=window.fwk.getBaseUrlWithRegionAndNode("/usuario/login");this.feLogin=window.fwk.getBaseUrlWithRegionAndNode("/usuario/login?layout=aplicacion");this.feLogout=window.fwk.getBaseUrlWithRegionAndNode()+"";this.apiLogout=window.fwk.getBaseUrlWithRegionAndNode("/usuario/logout?showxml=true");this.urlRedir="";this.debug=false;this.setVerbose=function(v){if(this.debug==true)alert(v);},this.load=function(){$("[id^=imageNotaCaroucel]").jcarousel({scroll:1,initCallback:mthis.callbackCarousel});$("[id^=imageNotaZoom]").click(function(){mthis.getPic(this.id);});$("[id^=imageNotaZoomParrafo] img").click(function(){});$("[id^=swfNotaNormal]").each(function(i){mthis.getFlash(this.id);});};this.callbackCarousel=function(){};this.getFlashZoom=function(id){mthis.showHtmlObj(id);if($("#"+id+"Panel").length==0){$("#"+id).html("<div class=\""+$("#"+id).attr("class")+"-close\"  onclick=\"fwk.controllers.notas.hideHtmlObj('"+id+"');\" ><span>X</span></div>");$("#"+id).html($("#"+id).html()+"<div id=\""+id+"Panel\" class=\""+$("#"+id).attr("class")+"-panel\"></div>");mthis.setVerbose("id"+id+" jquery object "+$("#"+id));$("#"+id).attr("panel",($("#"+id).attr("Panel")+"Panel"));mthis.getFlash(id);}};this.showHtmlObj=function(id){$("#"+id).fadeIn(500);};this.hideHtmlObj=function(id){$("#"+id).fadeOut(500);};this.getPic=function(obj){var Contenedor=$("#"+obj).attr("panel");mthis.showHtmlObj(Contenedor);var image;var alt;var close;if($("#"+Contenedor+"Panel").length==0){close="<div class=\""+$("#"+obj).attr("class")+"-close-content\"  onclick=\"fwk.controllers.notas.hideHtmlObj('"+$("#"+obj).attr("panel")+"');\" ><span>X</span></div>";image="<div class=\""+$("#"+Contenedor).attr("class")+"-image\"><img id=\""+Contenedor+"Image\" src=\""+$("#"+obj).attr("image_large")+"\"/></div>";alt="<div class=\""+$("#"+Contenedor).attr("class")+"-alt\" id=\""+Contenedor+"Alt\">"+$("#"+obj).attr("alt")+"</div>";$("#"+Contenedor).html(close+"<div id=\""+Contenedor+"Panel\" class=\""+$("#"+Contenedor).attr("class")+"-panel\">"+image+alt+"</div>");mthis.setVerbose("id"+obj+" contenendor "+$("#"+Contenedor));}else{$("#"+Contenedor+"Image").attr("src",$("#"+obj).attr("image_large"));$("#"+Contenedor+"Alt").attr("src",$("#"+obj).attr("alt"));}};this.getFlash=function(id){obj=$("#"+id);var urlMovie=(obj.attr("loader_object")+"?id="+obj.attr("video"));mthis.setVerbose("object"+obj+"url "+urlMovie+" Panel "+obj.attr("Panel")+" ancho "+obj.attr("swfwidth")+" alto "+obj.attr("swfheight"));urlMovie=urlMovie.replace(".flv","");var flashvars={url:urlMovie};var params={menu:"false",wmode:"transparent"};var attributes={};swfobject.embedSWF(urlMovie,obj.attr("panel"),obj.attr("swfwidth"),obj.attr("swfheight"),"7","",flashvars,params,attributes);}}
$(document).ready(function(){window.fwk.controllers.notas=new window.fwk.controllers.classNotas();window.fwk.controllers.notas.load();});window.fwk.common.classDestacadoItem=function(){var mthis=this;this.nextPosition=false;this.destacadoState="run";this.debug=false;this.showDebug=function(){$("#debugDestacadoFrame").show();};this.lastPositionNumber=1;this.lastDivId="destacadosContentControl";this.setVerbose=function(v){if(mthis.debug==true){var i=0;var hr="";if(this.debugDiv==false){$("body").append("<div id='debugDestacadoFrame' style='width: 100%; height: 100px;position:fixed;right:0px;bottom: 0px;background-color:blue; text-align:right;'><input type='button' value='Clear' onclick='$(\"#debugDestacadoClass\").val(\"\");'/><input type='button' value='X' onclick='$(\"#debugDestacadoFrame\").hide();'/><p><textarea id='debugDestacadoClass' style='width: 100%;height: 100px;'  rows=10  wrap='off'>"+v+"\n"+hr+"</textarea></p></div>");this.debugDiv=true;}else{$("#debugDestacadoClass").val($("#debugDestacadoClass").val()+v+"\n"+hr);}}};this.getDestacadosContentControlName=function(num){return"destacadosContentControl"+(num==1?"":num);};this.load=function(id){$("#"+id).each(function(i){mthis.goTo(this.id,1,true);if($(this).attr("cantidad_pagina")=="1"){$("#comandos"+this.id+" .comandos-num").hide();}});for(var i=1;i<=$(".destacados-content-control-item a").length;i++){this.replaceHtmlTitle(mthis.getDestacadosContentControlName(i));}
$(".destacados-content-control-item a").live("click",function(){mthis.destacadoState="stop";mthis.getPosition(this);});$("#"+id).css("display","block");};this.nextItem=function(id){var item=($("#"+id).attr("item_actual")*1);var cantidad=($("#"+id).attr("cantidad_pagina")*1);var next=(item>=cantidad?1:(item+1));return next;};this.prevItem=function(id){var item=($("#"+id).attr("item_actual")*1);var cantidad=($("#"+id).attr("cantidad_pagina")*1);var next=(item==1?cantidad:(item-1));return next;};this.showItem=function(id){$("#comandos"+id+" .comandos-num .selectedcommand").removeClass("selectedcommand");$("#comandos"+id+" .comandos-num .comando-pos"+$("#"+id).attr("item_actual")).addClass("selectedcommand");if($("#"+id).attr("slice")=="vertical"){var mTop=$("#"+id+" .item-pos-"+$("#"+id).attr("item_actual")).css("marginTop");var h=$("#"+id).css("height");mTop=mTop.replace("px","");h=h.replace("px","");if($("#"+id).attr("item_actual")==$("#"+id).attr("cantidad_pagina")){var a
for(a=1;a<=$("#"+id).attr("cantidad_pagina");a++){$("#"+id+" .item-pos-"+a).css("marginTop",mTop+"px");}}else{$("#"+id+" .item-pos-"+$("#"+id).attr("item_actual")).animate({marginTop:"-="+(h-mTop)+"px"},1000);}}else{if($("#"+id).attr("cantidad_pagina")!="1"){var a;for(a=1;a<=$("#"+id).attr("cantidad_pagina");a++){if($("#"+id+" .item-pos-"+a).css("display","none")){}}
var c;for(c=1;c<=$("#"+id).attr("cantidad_pagina");c++){if(c==$("#"+id).attr("item_actual")){$("#"+id+" .item-pos-"+c).fadeIn(500);$("#"+id+" .item-pos-"+c).css("display","block")}}}}};this.getNextPositionNumber=function(){if(($(".destacados-content-control-item a").length)==this.lastPositionNumber){this.lastPositionNumber=1;}else{this.lastPositionNumber=this.lastPositionNumber+1;}
return this.lastPositionNumber;};this.setDestacado=function(id,jump){mthis.setVerbose($("#"+id).attr("estado"));if($("#"+id).attr("estado")!="stop"){mthis.showItem(id);if(jump==true){var next=mthis.nextItem(id);var estado_posicion=($("#"+id).attr("estado_posicion")==undefined?"":$("#"+id).attr("estado_posicion"));if(estado_posicion=="ready"){var o="#"+mthis.getDestacadosContentControlName(mthis.getNextPositionNumber(id))+" a";mthis.getPosition($(o));}
if(next==1&&mthis.destacadoState!="stop"&&estado_posicion!="done"){$("#"+id).attr("estado_posicion","ready");}
$("#"+id).attr("item_actual",next);setTimeout(function(){mthis.setDestacado(id,jump);},$("#"+id).attr("speed"));}}};this.stopRun=function(id){$("#"+id).attr("estado","stop");$("#comandos"+id+" .selectedcommand").removeClass("selectedcommand");$("#comandos"+id+" .stop").addClass("selectedcommand");};this.stop=function(id){this.stopRun(id)
mthis.goTo(id,($("#"+id).attr("item_actual")-1),false);};this.play=function(id){$("#comandos"+id+" .selectedcommand").removeClass("selectedcommand");$("#comandos"+id+" .play").addClass("selectedcommand");$("#"+id).attr("estado","play");if($("#"+id).attr("item_actual")>=$("#"+id).attr("cantidad_pagina")){$("#"+id).attr("item_actual",1);}else{var newItemActual=(($("#"+id).attr("item_actual")*1)+1);$("#"+id).attr("item_actual",newItemActual);}
mthis.setDestacado(id,true);};this.moveFirst=function(id){$("#comandos"+id+" .selectedcommand").removeClass("selectedcommand");$("#comandos"+id+" .first").addClass("selectedcommand");mthis.moveTo(id,1);};this.moveLast=function(id){$("#comandos"+id+" .selectedcommand").removeClass("selectedcommand");$("#comandos"+id+" .last").addClass("selectedcommand");$("#"+id).attr("cantidad_pagina",$("#"+id).attr("cantidad_pagina"));mthis.stopRun(id);mthis.moveTo(id,$("#"+id).attr("cantidad_pagina"));};this.moveNext=function(id){$("#comandos"+id+" .selectedcommand").removeClass("selectedcommand");$("#comandos"+id+" .next").addClass("selectedcommand");if($("#"+id).attr("estado")=="stop"){mthis.stopRun(id);}else{this.stop(id);}
mthis.moveTo(id,mthis.nextItem(id));};this.movePrev=function(id){$("#comandos"+id+" .selectedcommand").removeClass("selectedcommand");$("#comandos"+id+" .prev").addClass("selectedcommand");if($("#"+id).attr("estado")=="stop"){mthis.stopRun(id);}else{this.stop(id);}
mthis.moveTo(id,mthis.prevItem(id));};this.goTo=function(id,itemNum,jump){$("#comandos"+id+" .comandos-num .selectedcommand").removeClass("selectedcommand");$("#comandos"+id+" .comandos-num .comando-pos"+itemNum).addClass("selectedcommand");$("#"+id).attr("item_actual",itemNum);mthis.setDestacado(id,jump);mthis.setVerbose("#comandos"+id+" .comandos-num .comando-pos"+itemNum);};this.moveTo=function(id,itemNum){$("#"+id).attr("estado","play");mthis.stopRun(id);$("#"+id).attr("item_actual",itemNum);mthis.showItem(id);};this.replaceHtmlTitle=function(id){if($("#"+id).length>0){$("#"+id+" a").css("display","block");var html=$("#"+id).html();html=html.replace(/&lt;/g,"<");$("#"+id).html(html.replace(/&gt;/g,">"));}};this.getPosition=function(obj){var url=window.fwk.getPrefijoDefault()+"/tapa/destacado?position="+$(obj).attr("item")+"&layoutOff=true";this.showLoading();$("#destacadosCintaPaginadorPanel").load(url);$("#"+mthis.lastDivId).removeClass("destacados-content-control-item-selected");$(obj).parent().addClass("destacados-content-control-item-selected");mthis.lastDivId=$(obj).parent().attr("id");};this.showLoading=function(){$("#destacadosCintaPaginadorPanel").html("<div class=\"destacado-cinta-paginador-cargando\"><span>cargando...</span></div>");}}
window.fwk.common.classMultipleDestacado=function(){var mthis=this;this.lastDivId="destacadosContentControl";this.destacado={};this.debug=false;this.setVerbose=function(v){if(this.debug==true)alert(v);};this.load=function(id){this.setVerbose("instancial el objto"+id);mthis.destacado=new fwk.common.classDestacadoItem();mthis.destacado.load(id);};}
$(document).ready(function(){window.fwk.common.multipleDestacado=new window.fwk.common.classMultipleDestacado();window.fwk.common.multipleDestacado.load("destacadoscintapaginador");});window.fwk.common.classSocial=function(){var mthis=this;this.feRecomendarWidget=window.fwk.getBaseUrlWithRegionAndNode("/social/recomendarwidget?layoutOff=1");this.feSocialWidget=window.fwk.getBaseUrlWithRegionAndNode("/social/social?layoutOff=1");this.feSocialNavRecomendarWidget=window.fwk.getBaseUrlWithRegionAndNode("/social/recomendarcategorias?layoutOff=1");this.feRecomendarPage=window.fwk.getBaseUrlWithRegionAndNode("/social/recomendar?layout=aplicacion");this.urlDomainWidget="http://"+window.location.host;this.url="";this.titulo="";this.id_contenido="";this.id_nodo="";this.objeto_recomendar="";this.lastNavNodoSelected="";this.debug=false;this.initFlat=false;this.setVerbose=function(v){if(this.debug==true)alert(v);},this.load=function(){if($("#social").length>0){$("#social").drawer({initOpen:false});}
$("#social").bind("changeStop",function(e,estado,puntero){if(estado=="open"){window.fwk.controllers.player.closePlaylist();window.fwk.controllers.playlist.closeMiniPlaylist();if(mthis.initFlat==false){mthis.init();mthis.initFlat=true;}}});if($("#modSocialnavWidget").length>0){$("#modSocialnavWidget .socialnav-redes").each(function(){$(this).click(function(){window.fwk.commonSocialNavCategories({'red':$(this).attr("name")});});});$("#recomendarNodoSocialNav").click(function(){window.fwk.commonSocialNavRecommendCategories();});}};this.init=function(){this.getSocial();};this.getSocial=function(){var url=this.getUrlSocialWidget();mthis.setVerbose(url);$("#socialContent").load(url,function(){$("#socialContent").fadeIn(500,mthis.setFormSocialNav());});};this.getRecomendar=function(){var url=this.getUrlRecomendarWidget();mthis.setVerbose(url);$("#socialContent").load(url,function(){$("#socialContent").fadeIn(500,mthis.setFormRecomendar());});};this.getUrlRecomendarWidget=function(){return mthis.feRecomendarWidget+"&url_recomendar="+escape(this.url)+"&url_titulo="+escape(this.titulo)+"&objeto_recomendar="+this.objeto_recomendar;};this.getUrlSocialWidget=function(){return mthis.feSocialWidget+"&url_recomendar="+escape(this.url)+"&url_titulo="+escape(this.titulo)+"&objeto_recomendar="+this.objeto_recomendar;};this.procesarParams=function(params){var id_grupo="";var id_contenido="";if(params.id_grupo!=undefined){id_grupo=params.id_grupo;}else{params.id_grupo='';}
if(params.id_contenido!=undefined){id_contenido=params.id_contenido;}else{params.id_contenido='';}
if(params.url!=undefined){this.url=params.url;}
if(params.titulo!=undefined){this.titulo=params.titulo;}
if(params.id_nodo!=undefined){this.id_nodo=params.id_nodo;}
this.id_contenido=params.id_contenido;var objeto_recomendar="";if(id_grupo!=""){this.objeto_recomendar="material";}
if(id_contenido!=""){this.objeto_recomendar="capitulo";}
if(params.objeto_recomendar!=undefined&&id_contenido!=""&&id_grupo!=""){this.objeto_recomendar=params.objeto_recomendar;}};this.recomendarPlayer=function(params){mthis.setVerbose("url:"+params.url+"\ntitulo:"+params.titulo+"\nid_contenido: "+params.id_contenido+"\nid_grupo: "+params.id_grupo);this.params=mthis.procesarParams(params);this.setFormRecomendar();this.setFormSocialNav();};this.setFormRecomendar=function(){if($("#recomendarForm").length>0){$('#recomendarForm [name=url_recomendar]').attr('value',this.url);$('#recomendarForm [name=url_titulo]').attr('value',this.titulo);$('#recomendarForm [name=objeto_recomendar]').attr('value',this.objeto_recomendar);}
$("#volverRecomendarSocialNav").click(function(){mthis.getSocial();});};this.setFormSocialNav=function(){if($("#formSocialNavRecomendar").length>0){$('#formSocialNavRecomendar [name=url_recomendar]').attr('value',this.url);$('#formSocialNavRecomendar [name=url_titulo]').attr('value',this.titulo);$('#formSocialNavRecomendar [name=objeto_recomendar]').attr('value',this.objeto_recomendar);$("#sendSocialNavRecomendar").click(function(){mthis.getRecomendar();});$("#socialNavUrlEmbed").attr('value','<iframe src="'+mthis.urlDomainWidget+'/videosonline/'+mthis.id_contenido+'.php?extplay&FWK[id_nodo]='+mthis.id_nodo+'&FWK[skin]='+$(document.body).attr("skin")+'" allowTransparency="yes" width="477" height="500" frameborder="none"></iframe>');$("#formSocialNavRecomendar .socialnav-redes-sociales").each(function(){$(this).click(function(){var sk=$(document.body).attr("skin");var red=$(this).attr("red");window.open('/scripts/socialnetworks/'+red+'/add.php/id_contenido/'+mthis.id_contenido+'/template/'+sk+'/red/'+red,'socialwindow');});});}};this.getUrlFromParam=function(url,param){for(var p in param){eval('url=url.replace(/{'+p+'}/gi,param[p]);');}
return url;}
this.getRecomendarWidget=function(){var url=this.getUrlRecomendarWidget();mthis.setVerbose(url);$("#recomendarPanel").parent().fadeOut(500);$("#recomendarPanel").parent().load(url,function(){mthis.setFormRecomendar();$("#recomendarPanel").parent().fadeIn(500);});};this.enviarRecomendacion=function(form){this.enviar(form,this.feRecomendarWidget);};this.enviarSocialNavRecomendacion=function(form){this.enviar(form,this.feSocialNavRecomendarWidget);};this.enviar=function(form,urlnav){var url=urlnav+"&"+$("#recomendarForm").serialize();mthis.setVerbose(url);$.ajax({type:"POST",url:urlnav,data:$("#recomendarForm").serialize(),error:function(objeto,quepaso,otroobj){mthis.setVerbose(objeto+" "+quepaso+" "+otroobj);},dataType:"text",success:function(data){mthis.setVerbose("enviar recomendacion success!!"+data);$("#socialMensajePanel").html(data);$("#socialMensajePanel").fadeIn(500);}});return false;};this.closeEnviarRecomendacion=function(){mthis.setVerbose("close");this.getRecomendarWidget();$('#socialMensajePanel').css("display","none");};this.setRecomendarEncuesta=function(){$("#encuestaRecomendar").live("click",function(ev){var url=mthis.feRecomendarPage+"&url_recomendar="+escape($top.window.location)+"&url_titulo="+escape(($("#encuestaRecomendar span").length>0?$("#encuestaRecomendar span").html():$("#encuestaRecomendar").html()));mthis.setVerbose(url);window.location=url});};this.loadSocialNav=function(){$("#socialNavCategorias .categorias-nav-social-menumostrar").each(function(){var control=$(this).attr("control");$(this).click(function(e){e.preventDefault();mthis.toggleSocialNav(this,control);});});$("#socialNavCategorias .button-socialnav").each(function(){$(this).click(function(e){e.preventDefault();$("#formSocialNav [name=nodosocialnav]").attr("value",$(this).attr("nodo"));mthis.resetExpandirSocialNav($(this).attr("menuParent"));mthis.lastNavNodoSelected=$(this).attr("menuParent");mthis.fillRecomendarFromNodo($("#socialNavName"+$(this).attr("nodo")));mthis.setVerbose("socialNav click:["+$(this).attr("nodo")+" "+$(this).attr("menuParent")+"]");mthis.expandOpendNode($(this).attr("menuParent"));});});if($("#sendSocialNav").length>0){$("#sendSocialNav").click(function(e){e.preventDefault();mthis.sendSocialNav();});var nodo=mthis.openNode();$("#socialNavPanelCategoriaTxt").html(nodo.attr("titulo"));mthis.setVerbose("socialNav nodo:["+nodo.attr("nodo")+"]");$("#formSocialNav [name=nodosocialnav]").attr("value",nodo.attr("nodo"));}
if($("#recomendarForm").length>0){var nodoNav=this.openNode();this.fillRecomendarFromNodo(nodoNav);}
if($("#socialNavVolverContent").length>0){$("#socialNavVolverContent").click(function(){window.fwk.commonSocialNavCategoriesCerrar();window.fwk.commonSocialNavRecommendCategories();});}};this.fillRecomendarFromNodo=function(node){var nodourl=node.attr("url");$("#socialNavPanelCategoriaTxt").html(node.attr("titulo"));if(nodourl.indexOf(window.location.hostname)==-1){node.attr("url","http://"+window.location.hostname+nodourl);}
if($("#recomendarForm").length>0){$("#recomendarForm [name=url_recomendar]").attr("value",node.attr("url"));$("#recomendarForm [name=objeto_recomendar]").attr("value","categoria");$("#recomendarForm [name=url_titulo]").attr("value",node.attr("titulo"));}};this.resetExpandirSocialNav=function(mParent){var path=mthis.lastNavNodoSelected;var vpath=path.split('/');var lastObj="home";var debugOpen="";var obj;var id
for(var i=1;i<vpath.length;i++){obj=$("#controlsocialNavName"+vpath[i]);id="socialNavName"+vpath[i];if($("#"+id).is('ul')==true){$("#"+id).css("display","none");$("span",obj).html("+");$(obj).parent().removeClass("socialnav-node-selected");}else{$("#"+id).removeClass("nav-node-selected");}
debugOpen=debugOpen+" - socialNavName"+vpath[i]+"\n";}
mthis.setVerbose("socialNav resetopenNode:["+debugOpen+"]");};this.sendSocialNav=function(){$("#errorRedSocialNav").fadeOut(500);$("#errorNodoSocialNav").fadeOut(500);var node=$("#formSocialNav [name=nodosocialnav]").attr("value");if(node==""){$("#errorNodoSocialNav").fadeIn(500);}
var red=$("#formSocialNav [name=redsocialnav]:checked").val();if(red==undefined||red==""){$("#errorRedSocialNav").fadeIn(500);}
var sk=$(document.body).attr("skin");window.open('/scripts/socialnetworks/'+red+'/add.php/nodo/'+node+'/template/'+sk+'/red/'+red,'socialwindow');$("#panelSocialNav").fadeOut(500);$("#panelSocialNavMsgOk").fadeIn(500);return false;}
this.expandirSocialNav=function(obj,id){this.setVerbose("socialNav expandirSocialNav:["+id+" "+$("#"+id).css("display")+"- is ul"+($("#"+id).is('ul')?"true":"false")+"]");if($("#"+id).is('ul')==true){$("#"+id).css("display","block");$("span",obj).html("-");$(obj).parent().addClass("socialnav-node-selected");}else{$("#"+id).addClass("nav-node-selected");}};this.openNode=function(){var nodo=$(document.body).attr('codeNodo');var menuName="socialNavName"+nodo;var path=$("#"+menuName).attr("menuParent");mthis.lastNavNodoSelected=path;mthis.setVerbose("socialNav openNode:"+nodo+"-"+menuName+"-"+path);var lastObj=mthis.expandOpendNode(path);var node=$("#"+lastObj);if(!node.attr("url")){node=$("#socialNavNamehome");}
mthis.setVerbose("socialNav openNode :#"+lastObj+" - "+node+" "+node.attr("url"));return node;};this.expandOpendNode=function(path){var vpath=path.split('/');var lastObj="home";var debugOpen="";for(var i=1;i<vpath.length;i++){if($("#controlsocialNavName"+vpath[i]).length>0){mthis.expandirSocialNav($("#controlsocialNavName"+vpath[i]),"socialNavName"+vpath[i]);debugOpen=debugOpen+" - socialNavName"+vpath[i];}
lastObj="socialNavName"+vpath[i];}
mthis.setVerbose("socialNav lastnode ("+lastObj+") openNode:["+debugOpen+"]");$("#socialNavCategorias").scrollTo((vpath.length==1?$("#"+lastObj):$("#"+lastObj).parent()),800,{axis:'y',onAfter:function(){}});return lastObj;};this.toggleSocialNav=function(obj,id){this.setVerbose("socialNav toggleSocialNav:["+id+" "+$("#"+id).css("display")+"- is ul"+($("#"+id).is('ul')?"true":"false")+"]");if($("#"+id).is('ul')==true){if($("#"+id).css("display")=="none"){$("#"+id).css("display","block");$("span",obj).html("-");$(obj).parent().addClass("socialnav-node-selected");}else{$("#"+id).css("display","none");$("span",obj).html("+");$(obj).parent().removeClass("socialnav-node-selected");}}else{$("#"+id).addClass("nav-node-selected");}};}
$(document).ready(function(){window.fwk.common.social=new window.fwk.common.classSocial();window.fwk.common.social.load();});window.fwk.common.classMiniencuestas=function(){var mthis=this;this.feMiniencuestaWidget=window.fwk.getBaseUrlWithRegionAndNode("/miniencuestas/widget?layoutOff=1");this.feMiniencuestaPage=window.fwk.getBaseUrlWithRegionAndNode("miniencuestas/index?layout=aplicacion");this.debug=false;this.setVerbose=function(v){if(this.debug==true)alert(v);},this.load=function(){$("#encuestaRecomendar").live("click",function(ev){var url=window.fwk.getBaseUrlWithRegionAndNode("social/recomendar?layout=aplicacion&url_recomendar="+escape(top.window.location)+"&url_titulo="+escape(($("#encuestaRecomendar span").length>0?$("#encuestaRecomendar span").html():$("#encuestaRecomendar").html())));mthis.setVerbose(url);window.location=url});};this.responder=function(tipoEncuesta,form,errorDiv){$("#"+errorDiv).fadeOut(500);$("#"+errorDiv+"Login").fadeOut(500);mthis.setVerbose("estado usuario [login :"+$("#"+form.name).attr("login")+" - user id"+$("#"+form.name).attr("user_id")+"]");if($("#"+form.name).attr("login")!=""&&($("#"+form.name).attr("user_id")==""||$("#"+form.name).attr("user_id")=="0")){$("#"+errorDiv+"Login").fadeIn(500);}else{mthis.setVerbose('tipo encuesta['+tipoEncuesta+']\n form['+form+']\n error Div['+errorDiv+'] ');var opcion_id='';if(form.opcion_id!=undefined&&form.opcion_id.length>0){for(i=0;i<form.opcion_id.length;i++)
if(form.opcion_id[i].checked)opcion_id=form.opcion_id[i].value;}
if(opcion_id!=""){var url=this.feMiniencuestaWidget+"&encuesta_id="+$("#"+form.name).attr("encuesta_id")+"&opcion_id="+opcion_id+"&encuesta="+$("#"+form.name).attr("encuesta")+"&responder_encuesta="+form.responder_encuesta.value;mthis.setVerbose(url);$("#"+form.name+"Panel").parent().load(url);}else{$("#"+errorDiv).fadeIn(500);}}};this.responderPage=function(form){var opcion_id='';if(form.opcion_id!=undefined&&form.opcion_id.length>0){for(i=0;i<form.opcion_id.length;i++)
if(form.opcion_id[i].checked)opcion_id=form.opcion_id[i].value;}
var url=this.feMiniencuestaPage+"&encuesta_id="+$("#"+form.name).attr("encuesta_id")+"&opcion_id="+opcion_id+"&encuesta="+$("#"+form.name).attr("encuesta")+"&responder_encuesta="+form.responder_encuesta.value;mthis.setVerbose(url);if($("#"+form.name).attr("login")!=""&&($("#"+form.name).attr("user_id")==""||$("#"+form.name).attr("user_id")=="0")){mthis.setVerbose("redireciona a Logion y luego [login "+$("#"+form.name).attr("login")+" - user id "+$("#"+form.name).attr("user_id")+" ] "+url);fwk.common.user.goToLogin({"urlReturn":url});}else{mthis.setVerbose("redireciona a  [login "+$("#"+form.name).attr("login")+" - user id "+$("#"+form.name).attr("user_id")+" ] "+url);top.window.location=url;}};}
$(document).ready(function(){window.fwk.common.miniencuestas=new window.fwk.common.classMiniencuestas();window.fwk.common.miniencuestas.load();});window.fwk.common.classUser=function(){var mthis=this;this.apiLogin=window.fwk.getBaseUrlWithRegionAndNode("usuario/login");this.feLogin=window.fwk.getBaseUrlWithRegionAndNode("/usuario/login?layout=aplicacion");this.feRemind=window.fwk.getBaseUrlWithRegionAndNode("/usuario/remind?layout=aplicacion");this.feKeepLogin=window.fwk.getBaseUrlWithRegionAndNode("/usuario/keeplogin?showxml=true");this.feLogout=window.fwk.getBaseUrlWithRegionAndNode();this.apiLogout=window.fwk.getBaseUrlWithRegionAndNode("/usuario/logout?showxml=true");this.urlRedir="";this.USUARIO_NO_EXISTE="NE";this.USUARIO_NO_HABILITADO="NH";this.USUARIO_PENAC="PENAC";this.isWaiting=false;this.alreadyUserFocus=false;this.alreadyPassFocus=false;this.debug=false;this.setVerbose=function(v){if(this.debug==true)alert(v);};this.load=function(){$("#userInfoLogout").live("click",function(event){event.preventDefault();mthis.logout();});$("#userInfoModify").live("click",function(event){event.preventDefault();mthis.goToModifyUser();});$("#userInfoOptionModify").live("click",function(event){event.preventDefault();mthis.goToModifyUser();});$("#userInfoSingIn").live("click",function(event){event.preventDefault();mthis.goToSingupUser()});$("#linkSignup").live("click",function(event){event.preventDefault();mthis.goToSingupUser()});$("#linkRemind").live("click",function(event){event.preventDefault();mthis.goToRemind()});$("#userInfoLogin").live("click",function(ev){ev.preventDefault();mthis.goToLogin();});var userInfoLoginPanel=$("#userInfoLoginPanel");if(userInfoLoginPanel.length>0){$("#loginusername",userInfoLoginPanel).focus(function(){if(mthis.alreadyUserFocus==false){mthis.alreadyUserFocus=true;$("#loginusername",userInfoLoginPanel).val("");userInfoLoginPanel.removeClass('userinfo-desc-campos');}});$("#loginpassword",userInfoLoginPanel).focus(function(){if(mthis.alreadyPassFocus==false){mthis.alreadyPassFocus=true;$("#loginpassword",userInfoLoginPanel).val("");userInfoLoginPanel.removeClass('userinfo-desc-campos');}});}};this.validate=function(form,urlRedir){mthis.setVerbose("isWaiting "+mthis.isWaiting);if(mthis.isWaiting==true){return false;}
mthis.isWaiting=true;$("#cargandoLogin").fadeIn(500);$("#userRespLogin").fadeOut(2000);this.urlRedir=urlRedir;var location=((this.urlRedir!=undefined&&this.urlRedir!="")?this.urlRedir:"/");mthis.setVerbose("username="+form.username.value+"\npassword="+form.password.value+"\nlocation="+location);if(form.username.value==""||form.password.value==""){$("#userRespLogin").fadeIn(2000);$("#cargandoLogin").fadeOut(500);mthis.isWaiting=false;}else{var keeplogin="";if(form.keeplogin!=undefined){if(form.keeplogin.checked==true){keeplogin="&keeplogin=true";}}
var dataAjax="showxml=true&ispost=true&usuario="+form.username.value+"&clave="+form.password.value+keeplogin;mthis.setVerbose("ajax :"+this.apiLogin+"?"+dataAjax);$.ajax({type:"POST",url:this.apiLogin,data:dataAjax,error:function(objeto,quepaso,otroobj){mthis.setVerbose(objeto+" "+quepaso+" "+otroobj);$("#cargandoLogin").fadeOut(500);mthis.isWaiting=false;},dataType:"xml",success:function(xml){$("#cargandoLogin").fadeOut(500);var Valido="";$(xml).find('user_get').each(function(){Valido=$(xml).find('valido').text();});mthis.setVerbose("ajax success User Valido :"+Valido)
if(Valido=="N")
{window.fwk.common.metricas.hit("login_error");$("#userRespLogin").fadeIn(2000);}else{window.fwk.common.metricas.hit("login_ok");mthis.setVerbose(mthis.USUARIO_NO_HABILITADO+"=="+$(xml).find("resultado").find("activo").text());if(mthis.USUARIO_NO_HABILITADO==$(xml).find("resultado").find("activo").text())
{var url=window.fwk.controllers.mipase.url.feSingupUserInst+"&urlReturn="+escape(location);window.fwk.commonSigninstUser({ownurl:url});}
else
{window.fwk.commonLoginOk({ownurl:location});}}
mthis.isWaiting=false;}});}
return false;};this.goToSingupUser=function(option){var url;var urlReturn;if(option!=undefined){if(option.urlReturn!=undefined){urlReturn=escape(option.urlReturn);url=window.fwk.controllers.mipase.url.feSingupUser+"&urlReturn="+escape(option.urlReturn);}}else{urlReturn=escape($top.window.location);url=window.fwk.controllers.mipase.url.feSingupUser+"&urlReturn="+escape($top.window.location);}
window.fwk.commonSignupUser({ownurl:url,urlReturn:urlReturn});};this.goToModifyUser=function(option){var url;var urlReturn;if(option!=undefined){if(option.urlReturn!=undefined){urlReturn=escape(option.urlReturn);url=window.fwk.controllers.mipase.url.feModifyUser+"&urlReturn="+escape(option.urlReturn);}}else{urlReturn=escape($top.window.location);url=window.fwk.controllers.mipase.url.feModifyUser+"&urlReturn="+escape($top.window.location);}
window.fwk.commonModifyUser({ownurl:url,urlReturn:urlReturn});};this.goToLogin=function(option){var url;var urlReturn;if(option!=undefined){if(option.urlReturn!=undefined){urlReturn=option.urlReturn;url=this.feLogin+"&urlReturn="+escape(option.urlReturn);}}else{urlReturn=$top.window.location.pathname+""+$top.window.location.search;url=this.feLogin+"&urlReturn="+escape($top.window.location.pathname+""+$top.window.location.search);}
window.fwk.commonLogin({ownurl:url,urlReturn:urlReturn});};this.goToRemind=function(option){var url;var urlReturn;if(option!=undefined){if(option.urlReturn!=undefined){urlReturn=option.urlReturn;url=this.feRemind+"&urlReturn="+escape(option.urlReturn);}}else{urlReturn=$top.window.location;url=this.feRemind+"&urlReturn="+escape($top.window.location);}
mthis.setVerbose("url"+url);window.fwk.commonRemind({ownurl:url,urlReturn:urlReturn});};this.remindMe=function(option){var url;var urlReturn;if(option!=undefined){if(option.urlReturn!=undefined&&option.urlReturn!=''){urlReturn=option.urlReturn;url=this.feRemind+"&"+$("#remindFormEmail").serialize()+"&urlReturn="+escape(option.urlReturn);}}else{urlReturn=$top.window.location;url=this.feRemind+"&"+$("#remindFormEmail").serialize()+"&urlReturn="+escape($top.window.location);}
mthis.setVerbose("url"+url);window.fwk.commonRemind({ownurl:url,urlReturn:urlReturn});};this.catchLogin=function(){};this.logout=function(location){var vlocation="";if(location==undefined){vlocation=this.feLogout;}else{vlocation=location;}
mthis.setVerbose("to redir a "+vlocation+"\n al api: "+this.apiLogout);$.ajax({type:"POST",url:this.apiLogout,data:"",dataType:"xml",success:function(xml){var resultado="";$(xml).find('logout_get').each(function(){resultado=$(xml).find('resultado').text();});mthis.setVerbose("ajax logout resultado :"+resultado);if(resultado=="OK")
{window.fwk.commonLogout({ownurl:vlocation});}
else
{window.fwk.commonLogout({ownurl:mthis.feLogout});}}});}}
$(document).ready(function(){window.fwk.common.user=new window.fwk.common.classUser();window.fwk.common.user.load();});window.fwk.common.classMetricas=function(){var mthis=this;this.hitCodes={player_loaded:(window.fwk.isLayoutPlayerEmbed)?'/{@nombreSite}/'+window.fwk.isLayoutPlayerEmbedMetrics:'/{@nombreSite}/player',player_fadein:(window.fwk.isLayoutPlayerEmbed)?'/{@nombreSite}/'+window.fwk.isLayoutPlayerEmbedMetrics:'/{@nombreSite}/player',player_inicio:(window.fwk.isLayoutPlayerEmbed)?'/{@nombreSite}/{@path}/'+window.fwk.isLayoutPlayerEmbedMetrics+'/inicio/{@title}/{@content_id}/{@encode_id}':'/{@nombreSite}/{@path}/player/inicio/{@title}/{@content_id}/{@encode_id}',player_stopvideo:(window.fwk.isLayoutPlayerEmbed)?'/{@nombreSite}/{@path}/'+window.fwk.isLayoutPlayerEmbedMetrics+'/stop_videos/{@title}/{@content_id}/{@encode_id}':'/{@nombreSite}/{@path}/player/stop_videos/{@title}/{@content_id}/{@encode_id}',video_ver_inicio:(window.fwk.isLayoutPlayerEmbed)?'/{@nombreSite}_tracking_videos/{@path}/'+window.fwk.isLayoutPlayerEmbedMetrics+'/ver/{@title}/{@content_id}/{@encode_id}/0':'/{@nombreSite}_tracking_videos/{@path}/player/ver/{@title}/{@content_id}/{@encode_id}/0',video_ver:(window.fwk.isLayoutPlayerEmbed)?'/{@nombreSite}_tracking_videos/{@path}/'+window.fwk.isLayoutPlayerEmbedMetrics+'/ver/{@title}/{@content_id}/{@encode_id}/{@player_position}':'/{@nombreSite}_tracking_videos/{@path}/player/ver/{@title}/{@content_id}/{@encode_id}/{@player_position}',video_ver_finalizado:(window.fwk.isLayoutPlayerEmbed)?'/{@nombreSite}_tracking_videos/{@path}/'+window.fwk.isLayoutPlayerEmbedMetrics+'/finalizado/{@title}/{@content_id}/{@encode_id}/{@player_position}':'/{@nombreSite}_tracking_videos/{@path}/player/finalizado/{@title}/{@content_id}/{@encode_id}/{@player_position}',tapas_loaded:'/{@nombreSite}/{@path_nodo}/tapas',login_loaded:'/{@nombreSite}/login/logueo',login_error:'/{@nombreSite}/login/error_login',login_ok:'/{@nombreSite}/login/ok_login',remind_error:'/{@nombreSite}/login/error_remind',remind_loaded:'/{@nombreSite}/login/remind',remind_ok:'/{@nombreSite}/login/ok_remind',buscador_resultado:'/{@nombreSite}/buscador/resultado/{@nodo}/{@palabras}',ficha_loaded:'/{@nombreSite}/ficha/{@titulo}/{@id}',recomendado_amigo_form:'/{@nombreSite}/compartir/recomendar_amigo/{@titulo}/{@id}',recomendado_amigo_ok:'/{@nombreSite}/compartir/ok_recomendar_amigo/{@titulo}/{@id}',recomendado_amigo_error:'/{@nombreSite}/compartir/error_recomendar_amigo/{@titulo}/{@id}',recomendado_amigo_loaded:'/{@nombreSite}/compartir/inicio/{@titulo}/{@id}',signup_alta_paso1:'/{@nombreSite}/registro/alta_paso1',signup_alta_paso2:'/{@nombreSite}/registro/alta_paso2',signup_alta_paso3:'/{@nombreSite}/registro/alta_paso3',signup_modificacion_paso1:'/{@nombreSite}/registro/modificacion_paso1',signup_modificacion_paso2:'/{@nombreSite}/registro/modificacion_paso2',signup_modificacion_paso3:'/{@nombreSite}/registro/modificacion_paso3',deleteuser:'/{@nombreSite}/registro/deleteuser',galeria:'/{@nombreSite}/galeria/{@nombre_galeria}/{@id_grupo}',nota_loaded:'/{@nombreSite}/nota/{@title}/{@id_grupo}',disclaimer:'/{@nombreSite}/disclaimer',radio_sintonizo:'/{@nombreSite}/radio/{@nombreradio}',radio_escuchando:'/{@nombreSite}/radio/{@nombreradio}/listening',social_alta_banda:'/{@nombreSite}/{@user}/alta_banda',social_home:'/{@nombreSite}/{@tipo}/{@name}/{@id}/home',social_appcontroller:'/{@nombreSite}/{@tipo}/{@name}/{@controller}',social_ranking:'/{@nombreSite}/ranking/{@tab}',social_recomendados:'/{@nombreSite}/recomendados',promomail_index:'/{@nombreSite}/mailpromo/{@promo}/index',promomail_sendit:'/{@nombreSite}/mailpromo/{@promo}/sendit'};this.metricasRegion="";this.metricasNodo="";this.metricasSite="";this.metricasUrchinAccount="";this.debug=false;this.debugDiv=false;this.setVerbose=function(v){if(mthis.debug==true){if(this.debugDiv==false){$("body").append("<div id='debugMetricasClass' style='display:block;position:absolute;right:0px;top: 0px;background-color:yellow;'>"+v+"<br/></div>");this.debugDiv=true;}else{$("#debugMetricasClass").html(v+"<br/>"+$("#debugMetricasClass").html());}}};this.load=function(){this.getParamBody();};this.metricasGet=function(label,datos)
{var hit=this.hitCodes[label];if(datos)for(var i in datos){eval("regi=/\\{@"+i+"\\}/g");hit=hit.replace(regi,datos[i]);}
return this.metricasFormat(hit);};this.metricasFormat=function(codigo)
{codigo=codigo.toLowerCase();codigo=codigo.replace(/[ ]/g,"-");codigo=codigo.replace(/[áàä]/g,"a");codigo=codigo.replace(/[éèë]/g,"e");codigo=codigo.replace(/[íìï]/g,"i");codigo=codigo.replace(/[óòö]/g,"o");codigo=codigo.replace(/[úùü]/g,"u");codigo=codigo.replace(/[ñ]/g,"n");codigo=codigo.replace(/([0-9][0-9]):([0-9][0-9]):([0-9][0-9])/g,"$1-$2-$3");codigo=codigo.replace(/[^a-z0-9-/_]/g,"");codigo=codigo.replace(/[\/]+/g,"/");return codigo;};this.hit=function(label,datos)
{if(datos==undefined)datos={};datos['nombreSite']=this.metricasSite;datos['region']=this.metricasRegion;datos['path_nodo']=this.metricasNodo;datos['skin']=$("body").attr("skin");this.metricasSite=$("body").attr("metricasSite");var hit=this.metricasGet(label,datos);this.metricasHitTiming(hit,label);};this.metricasHitTiming=function(url,label){_ubd=$top.document;_udl=_ubd.location;_uacct=this.metricasUrchinAccount;this.setVerbose("Google Analytics Timing ["+label+"] siteUrl("+_uacct+"): "+url.toLowerCase());if($top.location.toString().search("debugga=true")!=-1){alert(url);}
urchinTracker(url.toLowerCase());};this.getParamBody=function(){this.metricasRegion=($("body").attr("metricasRegion")!=undefined?$("body").attr("metricasRegion"):"");this.metricasNodo=($("body").attr("metricasNodo")!=undefined?$("body").attr("metricasNodo"):"");this.metricasSite=($("body").attr("metricasSite")!=undefined?$("body").attr("metricasSite"):"");this.metricasUrchinAccount=($("body").attr("metricasUrchinAccount")!=undefined?$("body").attr("metricasUrchinAccount"):"");};this.setParamBody=function(urchinAccount,Region,Nodo,Site){this.metricasRegion=Region;this.metricasNodo=Nodo;this.metricasSite=Site;this.metricasUrchinAccount=urchinAccount;}}
$(document).ready(function(){window.fwk.common.metricas=new window.fwk.common.classMetricas();window.fwk.common.metricas.load();});window.fwk.controllers.tapa={'nsName':'tapa','nsFullName':'fwk.controllers.tapa','nsParent':window.fwk.controllers};$(document).ready(function(){if($("#listadorPaginador").length>0){$("#listadorPaginador li").live("click",function(){var url=unescape($("#listadorPaginador form input[name=url]").val());url=url.replace("{@page}",$(this).attr("jumpTo"));$(".listador").load(url);window.scroll(0,0);});}});window.fwk.common.classSubscription=function(){var mthis=this;this.debug=false;this.setVerbose=function(v){if(this.debug==true)alert(v);},this.load=function(){$("#paises").change(function(){$("#cargador").load(window.fwk.getBaseUrlWithRegionAndNode("subscription/subscription?ajax=1&country_id="+$("#paises").val()+"&layoutOff=1"));});}}
$(document).ready(function(){window.fwk.common.subscription=new window.fwk.common.classSubscription();window.fwk.common.subscription.load();});window.fwk.controllers.player={};window.fwk.controllers.player.url_playlist=null;window.fwk.controllers.player.url_player=null;window.fwk.controllers.player.url_add_history=null;window.fwk.controllers.player.url_get_history=null;window.fwk.controllers.player.url_api=null;window.fwk.controllers.player.url_api_default=null;window.fwk.controllers.playerprefijo_default=null;window.fwk.controllers.player.is_channel=false;window.fwk.controllers.player.adsInstance=null;window.fwk.controllers.player.playlist_showNext=null;window.fwk.controllers.player.playlist_showPrev=null;window.fwk.controllers.currentPlayer=null;window.fwk.controllers.player.uiElementToJson=function(element){var ret={group_id:element.attr("group_id"),content_id:element.attr("content_id"),encode_id:element.attr("encode_id"),url_api:element.attr("url_api"),url_order:element.attr("url_order"),title:element.attr("title_uri")};return ret;}
window.fwk.controllers.player.playlistNext=function(){var total=parseInt($("#carroplaylist").attr("carrTotal"));var current=parseInt($("#carroplaylist").attr("carrCurrent"));if(current+1<total){$("#carroplaylist").carrouselMoveTo(current+1);$(".carroplaylist-item-selected").click();}}
window.fwk.controllers.player.playlistPrevious=function(){var current=parseInt($("#carroplaylist").attr("carrCurrent"));if(current-1>=0){$("#carroplaylist").carrouselMoveTo(current-1);$(".carroplaylist-item-selected").click();}}
window.fwk.controllers.player.updatePlaylist=function(params){window.fwk.debugJson(params,"updatePlaylist");window.fwk.controllers.player.url_api=params.url_api;$.get(window.fwk.controllers.player.url_playlist,params,function(html,textStatus){$("#carroplaylist #pagina").html(html);if(params.url_order==-1||$("#carroplaylist #pagina > div").length<params.url_order){params.url_order=-1;$("#carroplaylist #pagina div[group_id='"+params.group_id+"']").each(function(){if(params.url_order==-1){params.url_order=$(this).parent().children().index(this);}});}
if(params.url_order==-1){params.url_order=0;}
$(".carroplaylist-item .item-score").score();var carroParams={itemStart:params.url_order};if(window.fwk.controllers.player.playlist_showNext){carroParams.itemsShowNext=window.fwk.controllers.player.playlist_showNext;}
if(window.fwk.controllers.player.playlist_showPrev){carroParams.itemsShowPrev=window.fwk.controllers.player.playlist_showPrev;}
$("#carroplaylist").carrousel(carroParams);var total=$("#carroplaylist").attr("carrTotal");var current=parseInt(params.url_order);if(current-1>=0){var url_img=$(".carroplaylist-item:eq("+(current-1)+")").attr("url_img");$(".ui-playlist-previous img").attr("src",url_img);$(".ui-playlist-previous").css("visibility","").show();}else{$(".ui-playlist-previous").hide();}
if(current+1<total){var url_img=$(".carroplaylist-item:eq("+(current+1)+")").attr("url_img");$(".ui-playlist-next img").attr("src",url_img);$(".ui-playlist-next").css("visibility","").show();}else{$(".ui-playlist-next").hide();}
window.fwk.controllers.player.managePlaylist();});}
window.fwk.controllers.player.initPlaylist=function(){$(".ui-playlist-previous, .ui-playlist-next").hover(function(){$(this).addClass("ui-playlist-prev-next-hover");},function(){$(this).removeClass("ui-playlist-prev-next-hover");}).click(function(event){var current=parseInt($("#carroplaylist").attr("carrCurrent"));$("#carroplaylist .button-close").attr("moveToOnClose",current);if($(this).hasClass("ui-playlist-next")){current++;}else{current--;}
$("#carroplaylist").carrouselMoveTo(current);$("#dwrPlaylist").drawer("open");$(".ui-playlist-previous, .ui-playlist-next").css("visibility","hidden");});$("#carroplaylist .button-close").click(function(){$("#dwrPlaylist").drawer("close");$("#carroplaylist").carrouselMoveTo($(this).attr("moveToOnClose"));$(".ui-playlist-previous, .ui-playlist-next").css("visibility","");});$("#dwrPlaylist").drawer();$("#dwrPlaylist").bind("changeStart",function(e,estado,puntero){if(estado=="open"){window.fwk.controllers.player.stopVideoCloseAll();window.fwk.controllers.playlist.closeMiniPlaylist();}});}
window.fwk.controllers.player.managePlaylist=function(){$(".carroplaylist-item-selected").live("click",function(){var total=$("#carroplaylist").attr("carrTotal");var current=parseInt($("#carroplaylist").attr("carrCurrent"));if(current-1>=0){var url_img=$(".carroplaylist-item:eq("+(current-1)+")").attr("url_img");$(".ui-playlist-previous img").attr("src",url_img);$(".ui-playlist-previous").css("visibility","").show();}else{$(".ui-playlist-previous").hide();}
if(current+1<total){var url_img=$(".carroplaylist-item:eq("+(current+1)+")").attr("url_img");$(".ui-playlist-next img").attr("src",url_img);$(".ui-playlist-next").css("visibility","").show();}else{$(".ui-playlist-next").hide();}});}
window.fwk.controllers.player.closePlaylist=function(){$("#carroplaylist .button-close").click();}
window.fwk.controllers.player.addHistory=function(params){$.get(window.fwk.controllers.player.url_add_history,params,function(data,textStatus){});}
window.fwk.controllers.player.stopVideoOpenAll=function(){$("#dwrHistory,#relacionados,#social,#browser").drawer("open");if(window.fwk.common.nav!=undefined)
{window.fwk.common.nav.cerrarMenu();}
window.fwk.controllers.player.AdRefreshLayerPlayer();window.fwk.common.metricas.hit("player_stopvideo",window.fwk.controllers.player.getParamsMetricas("player_stopvideo"));}
window.fwk.controllers.player.AdRefreshLayerPlayer=function(refreshFlyAd){if(refreshFlyAd===undefined){refreshFlyAd=true;}
if(window.fwk.controllers.player.adsInstance&&window.adManager){var currMedia=window.fwk.controllers.currentPlayer.player("currentMedia");if(currMedia){var keywords=currMedia.getMaterialProp("keywords");}else{var keywords='';}
var posSky=window.adManager.getPosition("BannersPlayer","Sky");var posFull=window.adManager.getPosition("BannersPlayer","Full");var posFlyAd=window.adManager.getPosition("BannersPlayer","FlyAd");if(posSky){posSky.adRefresh(new AdRequest(window.fwk.controllers.player.adsInstance.getAdArea(),keywords));}
if(posFull){posFull.adRefresh(new AdRequest(window.fwk.controllers.player.adsInstance.getAdArea(),keywords));}
if(refreshFlyAd&&posFlyAd){posFlyAd.adRefresh(new AdRequest(window.fwk.controllers.player.adsInstance.getAdArea(),keywords));}}}
window.fwk.controllers.player.stopVideoCloseAll=function(){$("#dwrHistory,#relacionados,#social,#browser").drawer("close");}
window.fwk.controllers.player.closeAllDrawers=function(){$(".drawer").drawer("close");}
window.fwk.controllers.player.getParamsMetricas=function(label){var currMedia=window.fwk.controllers.currentPlayer.player("currentMedia");if(currMedia){var ret={path:window.fwk.controllers.player.getPathMetricas(window.fwk.controllers.player.url_api),title:currMedia.getCommonProp("title"),content_id:currMedia.getMaterialProp("content_id"),encode_id:currMedia.getMaterialProp("encode_id")}
switch(label){case"video_ver":var auxDate=new Date(1,0,1,0,0,window.fwk.controllers.currentPlayer.player("mediaPosition")).toTimeString();var pos=auxDate.indexOf('UTC');if(pos!=-1){auxDate=$.trim(auxDate.substring(0,pos-1));}
ret.player_position=auxDate.replace(/:/g,"-");break;case"video_ver_finalizado":var auxDate=new Date(1,0,1,0,0,window.fwk.controllers.currentPlayer.player("mediaLength")).toTimeString();var pos=auxDate.indexOf('UTC');if(pos!=-1){auxDate=$.trim(auxDate.substring(0,pos-1));}
ret.player_position=auxDate.replace(/:/g,"-");break;}}
return ret;}
window.fwk.controllers.player.getPathMetricas=function(url){var fromController=window.fwk.controllers.player.getParamFromUrl(url,"fromController");var fromAction=window.fwk.controllers.player.getParamFromUrl(url,"fromAction");var ret="";switch(fromController){case"tapa":switch(fromAction){case"destacado":ret=window.fwk.controllers.navpath.instance.navpath('pathToString');ret=ret.replace(/lo mas nuevo/gi,'');ret=ret.replace(/lo mas visto/gi,'');ret+="/destacado";break;}
break;case"relacionados":switch(fromAction){case"getrelacionados":ret="contenidos relacionados";break;}
break;case"buscador":case"browser":switch(fromAction){case"resultadopage":case"getitems":var type=window.fwk.controllers.player.getParamFromUrl(url,"ranking");switch(type){case"getfeatured":ret=window.fwk.controllers.navpath.instance.navpath('pathToString');break;case"getmostviewed":ret=window.fwk.controllers.navpath.instance.navpath('pathToString');break;default:var nombreSite=window.fwk.common.metricas.metricasSite;var words=window.fwk.controllers.player.getParamFromUrl(url,"words");ret="resultados de busqueda de "+nombreSite+" "+words;break;}
break;}
break;}
return ret.toLowerCase();}
window.fwk.controllers.player.getParamFromUrl=function(url,param){var urlAux=url;var pos=urlAux.indexOf("?");if(pos>-1){urlAux=urlAux.substr(0,pos);}
var aUrl=urlAux.split('/');var ret=null;for(var i=0;i<aUrl.length;i++){if(aUrl[i].toLowerCase()==param.toLowerCase()){ret=aUrl[i+1];break;}}
if(ret==null){urlAux=url.substr(pos+1);aUrl=urlAux.split('&');for(var i=0;i<aUrl.length;i++){var par=aUrl[i].split('=');if(par[0].toLowerCase()==param.toLowerCase()){ret=par[1];break;}}}
return ret;}
window.fwk.controllers.player.adMarkManager=function(node,urlConfig,player,interval){this.currentNode=node;this.configNode=node;this.urlConfig=urlConfig;if(player===undefined){this.currentPlayer=window.fwk.controllers.currentPlayer;}else{this.currentPlayer=player;}
if(interval===undefined){this.interval=300;}else{this.interval=interval;}
this.fixed={area:null,keywords:null,position:null};this.layer="BannersPlayerTanda";this.maxFixedTime=0;this.intervalTime=0;this.intervalPosition='';this.config=null;this.hndlInterval=null;this.lastTimeProc=-1;this.onTick=null;var mthis=this;$.ajax({type:"GET",url:this.urlConfig,cache:false,dataType:($.browser.msie)?"text":"xml",async:false,success:function(data){if(typeof data=="string"){mthis.config=new ActiveXObject("Microsoft.XMLDOM");mthis.config.async=false;mthis.config.loadXML(data);}else{mthis.config=data;}
var selector="node[name='"+mthis.configNode+"']"
if($(mthis.config).find(selector).length==0){mthis.configNode='default';}
selector="node[name='"+mthis.configNode+"'] mark";$(mthis.config).find(selector).each(function(){if($(this).find("type").text()=="Fixed"){var time=$(this).find("time").text();if(time&&parseInt(time)>parseInt(mthis.maxFixedTime)){mthis.maxFixedTime=parseInt(time);}}else{mthis.intervalTime=$(this).find("time").text();mthis.intervalPosition=$(this).find("position").text();}});}});this.start=function(){var mthis=this;if(window.adManager){if(!this.hndlInterval){this.hndlInterval=window.setInterval(function(){mthis.tick();},this.interval);}}};this.stop=function(){if(this.hndlInterval){window.clearInterval(this.hndlInterval);this.hndlInterval=null;}};this.tick=function(){if(this.currentPlayer&&this.config){var curPos=Math.floor(this.currentPlayer.player("mediaPosition"));var mthis=this;if(mthis.lastTimeProc==curPos)return;$(this.config).find("node[name='"+this.configNode+"'] mark").each(function(){var ret=true;if($(this).find("type").text()=="Fixed"){if($(this).find("time").text()==curPos&&mthis.lastTimeProc!=curPos){mthis.lastTimeProc=curPos;if(window.adManager){var currentMedia=mthis.currentPlayer.player("currentMedia");var useArea=(mthis.fixed.area)?mthis.fixed.area:mthis.getAdArea();var useKeywords=(mthis.fixed.keywords)?mthis.fixed.keywords:currentMedia.getMaterialProp("keywords");var usePosition=(mthis.fixed.position)?mthis.fixed.position:$(this).find("position").text();$top.pageNum=undefined;window.adManager.adRefresh(new AdRequest(useArea,useKeywords,usePosition),mthis.layer);if(mthis.onTick){mthis.onTick(mthis);}}
ret=false;}}else{if(curPos>0&&(curPos-mthis.maxFixedTime)>0&&(curPos-mthis.maxFixedTime)%mthis.intervalTime==0){mthis.lastTimeProc=curPos;if(window.adManager){var currentMedia=mthis.currentPlayer.player("currentMedia");var useArea=(mthis.fixed.area)?mthis.fixed.area:mthis.getAdArea();var useKeywords=(mthis.fixed.keywords)?mthis.fixed.keywords:currentMedia.getMaterialProp("keywords");var usePosition=(mthis.fixed.position)?mthis.fixed.position:$(this).find("position").text();$top.pageNum=undefined;window.adManager.adRefresh(new AdRequest(useArea,useKeywords,usePosition),mthis.layer);if(mthis.onTick){mthis.onTick(mthis);}}
ret=false;}else{mthis.lastTimeProc=-1;}}
return ret;});}}
this.getAdArea=function(){var adArea="player";if(window.fwk.isLayoutPlayerEmbed&&window.fwk.isLayoutPlayerEmbedAdArea){adArea=window.fwk.isLayoutPlayerEmbedAdArea;}
if(window.fwk.controllers.navpath.instance){if(window.fwk.controllers.navpath.instance.navpath("parserName")=="pathParserNodes"){adArea=this.currentNode+".player";if(window.fwk.isLayoutPlayerEmbed&&window.fwk.isLayoutPlayerEmbedAdArea){adArea=this.currentNode+"."+window.fwk.isLayoutPlayerEmbedAdArea;}}}
if(document.location.href.indexOf("debugad=1")!=-1||document.location.href.indexOf("debugad=true")!=-1){alert("player adArea: "+adArea);}
return adArea;}}
window.adShow=false;window.adShowPreroll=false;window.fwk.controllers.player.adPrerollShow=function(){window.adManager.hideAdLayer("BannersPlayerTanda");window.adShow=true;window.adShowPreroll=true;if(window.fwk.controllers.currentPlayer){window.fwk.controllers.currentPlayer.player("enabledControlBar",false);}}
window.fwk.controllers.player.adPrerollFinished=function(event){if(window.adShowPreroll||event=='onEmpty'){if(window.fwk.controllers.currentPlayer){window.fwk.controllers.currentPlayer.player("enabledControlBar",true);window.fwk.controllers.currentPlayer.player("play");}
window.adShowPreroll=false;}else{if(window.fwk.controllers.player.is_channel){if(window.fwk.controllers.currentPlayer){window.fwk.controllers.currentPlayer.player("enabledControlBar",true);window.fwk.controllers.currentPlayer.player("play");}}}};window.fwk.controllers.playlist={};window.fwk.controllers.playlist.url_miniplaylist=null;window.fwk.controllers.playlist.url_firstTrackAlbum=null;window.fwk.controllers.currentPlaylist=null;window.fwk.controllers.playlist.onMediaCompleted=function(){if(window.fwk.controllers.currentPlaylist){window.fwk.controllers.currentPlaylist.playlist("next");}}
window.fwk.controllers.playlist.closeMiniPlaylist=function(){$("#dwrMiniPlaylist").drawer("close");}
window.fwk.controllers.playlist.makeUrl=function(url,data,layoutOff){var ret=url;if(layoutOff===undefined){layoutOff="true";}
ret+="?"
for(var prop in data){ret+=prop+"="+eval("data."+prop)+"&";}
ret+="layoutOff="+layoutOff;return ret;}
window.fwk.controllers.playlist.removeLB=function(text){return text.replace(/\n/g,'');}
window.fwk.controllers.playlist.moveToFirstTrackAlbum=function(groupId){$.getJSON(window.fwk.controllers.playlist.url_firstTrackAlbum,{group_id:groupId},function(json){fwk.controllers.playlist.csContainer.playlistContainer('gotoFromContentId',json.contentId);});}
window.fwk.controllers.relacionados={};window.fwk.controllers.relacionados.scrCajonera=function(){this.data={group_id:null,content_id:null};this.url={relacionados:window.fwk.getBaseUrlWithRegionAndNode("/relacionados/getrelacionados?layoutOff=true&view=simple")};this.initialize=function(){$("#btnRelacionados").live("click",this.recallRelacionados);};this.recallRelacionados=function(){this.getRelacionados(this.data.group_id,this.data.content_id);};this.setRelacionados=function(group_id,content_id){this.getRelacionados(group_id,content_id);};this.getRelacionados=function(group_id,content_id){this.data.group_id=group_id;this.data.content_id=content_id;url=this.url.relacionados;if(group_id!=null)url+="&group_id="+group_id;if(content_id!=null)url+="&content_id="+content_id;$("#relapagina").load(url,this.getRelacionadosRespuesta);$("#relacionadosLoading").css("display","block");};this.getRelacionadosRespuesta=function(){$("#relapagina .item-score").score();$("#relacionadosLoading").css("display","none");}}
window.fwk.controllers.browser={};window.fwk.controllers.browser.scrCajonera=function(pNombre,pOptions){this.nombre=pNombre;this.url={datos:window.fwk.getBaseUrlWithRegionAndNode("browser/getitems?layoutOff=true")};this.carrouselParams=pOptions;this.currTipoListado="nuevos";this.currNode="";this.currSeekText="";this.currPage=1;this.initialize=function(){$("#browser").drawer({initOpen:false});$("#browser").bind("changeStart",function(e,estado,item){if(estado=="open"){window.fwk.controllers.player.closePlaylist();window.fwk.controllers.playlist.closeMiniPlaylist();}});$("#brmenu").brmenu();$("#brmenu").bind("changeItem",this.getCallback("clickMenu","e,nuevo,item"));$("#brmenu h4").live("click",this.getCallback("clickTitulo"));this.clickMenu(null,$("#brmenu ul:first").attr("mnuid"),$("#brmenu ul:first"));$("#btnNuevo").live("click",this.getCallback("setNuevos"));$("#btnVisto").live("click",this.getCallback("setVistos"));$("#btnBuscar").live("click",this.getCallback("seekText"));$("#seektext").keypress(function(e){if(e.which==13){window.fwk.controllers.browser.cajonera.seekText();return(false);}});$("#browserPaginador li").live("click",this.getCallback("getPagina"));}
this.setRelacionados=function(group_id,content_id){this.getTags(group_id,content_id);this.getRelacionados(group_id,content_id);}
this.setNuevos=function(){$("#btnNuevo").removeClass("nuevo-off").addClass("nuevo-on");$("#btnVisto").removeClass("visto-on").addClass("visto-off")
if(this.currTipoListado!="nuevos"){this.currTipoListado="nuevos";this.currPage=1;this.getDatos();}}
this.setVistos=function(){$("#btnNuevo").removeClass("nuevo-on").addClass("nuevo-off");$("#btnVisto").removeClass("visto-off").addClass("visto-on");if(this.currTipoListado!="vistos"){this.currTipoListado="vistos";this.currPage=1;this.getDatos();}}
this.seekText=function(){$("#btnNuevo").removeClass("nuevo-on").addClass("nuevo-off");$("#btnVisto").removeClass("visto-on").addClass("visto-off");this.currTipoListado="seek";this.currSeekText=$("#seektext").val();this.currPage=1;this.getDatos();return(false);}
this.getPagina=function(ob){this.currPage=$(ob).attr("jumpto");this.getDatos();}
this.clickTitulo=function(){if(this.currTipoListado=="seek")this.setNuevos();else this.getDatos();}
this.clickMenu=function(e,nuevo,item){this.currNode=nuevo.substr(5);if(this.currTipoListado=="seek")this.setNuevos();else this.getDatos();}
this.getDatos=function(){var url=this.url.datos+"&id_nodo="+this.currNode+"&page="+this.currPage;if(this.currTipoListado=="seek")url+="&tipo=seek&seek_text="+escape(this.currSeekText);else url+="&tipo="+this.currTipoListado;$("#browsercliente").load(url,this.getCallback("getDatosRespuesta","data"));$("#browserClienteLoading").css("display","block");}
this.getDatosRespuesta=function(data){$("#carrobrow .item-score").score();$("#carrobrow").carrousel(this.carrouselParams);$("#browserClienteLoading").css("display","none");}
this.hitBof=function(e,item,objeto){}
this.hitEof=function(e,item,objeto){}
this.getRelByKeyword=function(ob){url=this.url.relkeyword+"&group_id="+$(ob).attr("group_id")+"&keyword_id="+$(ob).attr("keyword_id");$("#carrorel #pagina").load(url,this.getCallback("getRelacionadosRespuesta","data"));}
this.getCallback=function(destino,parametro){if(parametro)eval("var callback= function ("+parametro+") { "+this.nombre+"."+destino+"("+parametro+"); }");else eval("var callback= function () { return("+this.nombre+"."+destino+"(this)); }");return(callback);}}
window.fwk.controllers.browser.scrCajoneraTwoTabs=function(pNombre,pOptions){this.nombre=pNombre;this.url={datos:window.fwk.getBaseUrlWithRegionAndNode("browser/getitems?layoutOff=true")};this.carrouselParams=pOptions;this.currTipoListado="nuevos";this.currNode="";this.currSeekText="";this.currPage=1;this.currMenu="brmenu";this.initialize=function(){$("#browser").drawer({initOpen:false});$("#browser").bind("changeStart",function(e,estado,item){if(estado=="open"){window.fwk.controllers.player.closePlaylist();window.fwk.controllers.playlist.closeMiniPlaylist();}});$("#canmenu").brmenu();$("#canmenu").bind("changeItem",this.getCallback("clickMenu","e,nuevo,item"));$("#canmenu h4").live("click",this.getCallback("clickTitulo"));$("#brmenu").brmenu();$("#brmenu").bind("changeItem",this.getCallback("clickMenu","e,nuevo,item"));$("#brmenu h4").live("click",this.getCallback("clickTitulo"));var nnodo=$('body').attr('codenodo');this.currNode=nnodo;if($('body').attr('entrymode')=='category'){$("#canmenu").attr("mnuCurrValue",$("#canmenu ul:first").find("li:first").attr("id"));this.btnBrowCategorias();$("#brmenu").brmenu("goItem",'Nodo-'+nnodo);if($("#brmenu ul[menu='"+nnodo+"']").length>0){$("#brmenu").attr("mnuCurrMenu","x-x-x");$("#brmenu").brmenu("goMenu",nnodo);}}
else{$("#brmenu").attr("mnuCurrValue",$("#brmenu ul:first").attr("mnuid"))
this.btnBrowCanales();$("#canmenu").brmenu("goItem",'Nodo-'+nnodo);$("#canmenu").brmenu("goMenu",'home');}
$("#btnNuevo").live("click",this.getCallback("setNuevos"));$("#btnVisto").live("click",this.getCallback("setVistos"));$("#btnBuscar").live("click",this.getCallback("seekText"));$("#seektext").keypress(function(e){if(e.which==13){window.fwk.controllers.browser.cajonera.seekText();return(false);}});$("#btnBrowCategorias").live("click",this.getCallback("btnBrowCategorias"));$("#btnBrowCanales").live("click",this.getCallback("btnBrowCanales"));$("#browserPaginador li").live("click",this.getCallback("getPagina"));}
this.btnBrowCategorias=function(){$("#brmenu").slideDown("normal");$("#canmenu").slideUp("normal");$("#btnBrowCategorias").addClass("btnBrowSelected");$("#btnBrowCanales").removeClass("btnBrowSelected");this.clickMenu(null,$("#brmenu").attr("mnuCurrValue"),null);this.currMenu="brmenu";}
this.btnBrowCanales=function(){$("#canmenu").slideDown("fast");$("#brmenu").slideUp("normal");$("#btnBrowCategorias").removeClass("btnBrowSelected");$("#btnBrowCanales").addClass("btnBrowSelected");this.clickMenu(null,$("#canmenu").attr("mnuCurrValue"),null);this.currMenu="canmenu";}
this.setRelacionados=function(group_id,content_id){this.getTags(group_id,content_id);this.getRelacionados(group_id,content_id);}
this.setNuevos=function(){$("#btnNuevo").removeClass("nuevo-off").addClass("nuevo-on");$("#btnVisto").removeClass("visto-on").addClass("visto-off")
if(this.currTipoListado!="nuevos"){this.currTipoListado="nuevos";this.currPage=1;this.getDatos();}}
this.setVistos=function(){$("#btnNuevo").removeClass("nuevo-on").addClass("nuevo-off");$("#btnVisto").removeClass("visto-off").addClass("visto-on");if(this.currTipoListado!="vistos"){this.currTipoListado="vistos";this.currPage=1;this.getDatos();}}
this.seekText=function(){$("#btnNuevo").removeClass("nuevo-on").addClass("nuevo-off");$("#btnVisto").removeClass("visto-on").addClass("visto-off");this.currTipoListado="seek";this.currSeekText=$("#seektext").val();this.currPage=1;this.getDatos();return(false);}
this.getPagina=function(ob){this.currPage=$(ob).attr("jumpto");this.getDatos();}
this.clickTitulo=function(){if(this.currTipoListado=="seek")this.setNuevos();else this.getDatos();}
this.clickMenu=function(e,nuevo,item){this.currNode=nuevo.substr(5);if(this.currTipoListado=="seek")this.setNuevos();else this.getDatos();}
this.getDatos=function(){var url=this.url.datos+"&id_nodo="+this.currNode+"&page="+this.currPage;if(this.currTipoListado=="seek")url+="&tipo=seek&seek_text="+escape(this.currSeekText);else url+="&tipo="+this.currTipoListado;if(this.currNode!=''){$("#browsercliente").load(url,this.getCallback("getDatosRespuesta","data"));$("#browserClienteLoading").css("display","block");}}
this.getDatosRespuesta=function(data){$("#carrobrow .item-score").score();$("#carrobrow").carrousel(this.carrouselParams);$("#browserClienteLoading").css("display","none");}
this.hitBof=function(e,item,objeto){}
this.hitEof=function(e,item,objeto){}
this.getRelByKeyword=function(ob){url=this.url.relkeyword+"&group_id="+$(ob).attr("group_id")+"&keyword_id="+$(ob).attr("keyword_id");$("#carrorel #pagina").load(url,this.getCallback("getRelacionadosRespuesta","data"));}
this.getCallback=function(destino,parametro){if(parametro)eval("var callback= function ("+parametro+") { "+this.nombre+"."+destino+"("+parametro+"); }");else eval("var callback= function () { return("+this.nombre+"."+destino+"(this)); }");return(callback);}}
window.fwk.controllers.galeria={};window.fwk.controllers.galeria.csGaleriaController=function(){var mthis=this;this._dbg=false;this.refreshGalleryPictures=function(){if(window.adManager!=undefined){window.adManager.adRefresh(new AdRequest($(document.body).attr("codeNodo")),"BannersTapas");}
$("#loadingimagenes").show();var id_grupo=$("#carrouselgalerias .carrouselgalerias-item-selected").attr("id_item");var titulo_galeria=$("#carrouselgalerias .carrouselgalerias-item-selected").find(".item-title").html();var url="/fe/sitesplus/galeria/getgallerypictures?group_id="+id_grupo+"&layoutOff=true";if(window.fwk.controllers.galeria.onclick){window.fwk.controllers.galeria.onclick(id_grupo);}else{$("#carrouselimagenes .galerias-titulo-3").html(titulo_galeria);if(mthis._dbg)alert(url);$("#carrouselimagenes .pagina").load(url,null,function(responseText,textStatus,XMLHttpRequest){$("#loadingimagenes").hide();});}};this.load=function(){$("#dialog .dialog_img").live("click",function(){$(this).parent().dialog('close');});$("#carrouselgalerias .carrouselgalerias-item-selected").live("click",function(){mthis.refreshGalleryPictures();});$("#linkGaleriaAgregar").live("click",function(){window.fwk.commonCRUDGalleries();});$("#carrouselimagenes .carrouselimagenes-item-selected").live("click",function(){if(window.adManager!=undefined){window.adManager.adRefresh(new AdRequest($(document.body).attr("codeNodo")),"BannersTapas");}
var img=$("#carrouselimagenes .carrouselimagenes-item-selected").find(".item-hidden.url-img-grande").html();var titulo=$("#carrouselimagenes .carrouselimagenes-item-selected").find(".item-title").html();var id=$("#carrouselimagenes .carrouselimagenes-item-selected").attr("id_item");$("#dialog").dialog({autoOpen:false,show:'slide',bgiframe:true,modal:true,width:'auto',position:[200,110],close:function(event,ui){$("#dialog .dialog_img").attr("src",$("#dialog").attr("img_url"));}});$("#dialog .dialog_img").attr("src",$("#dialog").attr("img_url"));$("#dialog").dialog('option','title',$("#carrouselimagenes .carrouselimagenes-item-selected").find(".item-title").html());var tmpImage=new Image();tmpImage.onload=function(){$("#dialog .dialog_img").attr("src",img);}
tmpImage.src=img;$("#dialog").dialog('open');window.fwk.common.metricas.hit("galeria",{nombre_galeria:titulo,id_grupo:id});});if($("#carrouselgaleriaspaginado").length>0){$("#carrouselgaleriaspaginado li").live("click",function(ev){url=window.fwk.getBaseUrlWithRegionAndNode("/galeria/index?layoutOff=true&page="+$(this).attr("jumpTo")+"&"+$("#carrouselgaleriaspaginado form").serialize());$("#loadinggalerias").show();if(mthis._dbg)alert(url);$("#galeriascontenedor").parent().load(url,null,function(responseText,textStatus,XMLHttpRequest){$("#loadinggalerias").hide();});});}};};window.fwk.controllers.galeria.onclick=undefined;$(document).ready(function(){galeriaController=new window.fwk.controllers.galeria.csGaleriaController();galeriaController.load();});window.fwk.controllers.radio={};window.fwk.controllers.radio.urls={openRadio:'',getRadio:'',popupRadio:''}
window.fwk.controllers.radio.currentRadioName='';window.fwk.controllers.radio.currentRadioTitle='';window.fwk.controllers.radio.plugin=null;window.fwk.controllers.radio.refreshNowPlaying=function(data){var params={name:window.fwk.controllers.radio.currentRadioName};$.get(window.fwk.controllers.radio.urls.getRadio,params,function(result){$(".ui-nowplaying-radio-img > img").attr("src",result.radios.radio[0].imagen_principal);data.element.find(".ui-nowplaying-radio-name").text(result.radios.radio[0].titulo);data.element.find(".ui-nowplaying-radio-description > span").text(result.radios.radio[0].descripcion);},"json")}
window.fwk.controllers.radio.changeRadio=function(name){var params={name:name};if(window.fwk.controllers.radio.currentRadioName!=name){$.get(window.fwk.controllers.radio.urls.getRadio,params,function(result){window.fwk.controllers.radio.currentRadioName=name;window.fwk.controllers.radio.currentRadioTitle=result.radios.radio[0].titulo;$("#spanRadioName").text(window.fwk.controllers.radio.currentRadioTitle);window.fwk.controllers.radio.plugin.player("close");window.fwk.controllers.radio.plugin.player("url",result.radios.radio[0].montaje);$("#dwrPlaylistRadio").drawer("close");if(window.fwk.controllers.navpath.instance){window.fwk.controllers.navpath.instance.navpath("clear");window.fwk.controllers.navpath.instance.navpath("addItem",{text:window.fwk.controllers.radio.currentRadioTitle});}},"json");}}
window.fwk.controllers.radio.fullScreen=function(){window.fwk.controllers.radio.plugin.player("stop");window.open(window.fwk.controllers.radio.urls.openRadio+"&name="+window.fwk.controllers.radio.currentRadioName);}
window.fwk.controllers.newsletter={};window.fwk.controllers.newsletter.scrForm=function(pNombre,timeouts){this.nombre=pNombre;this.timeouts=timeouts;this.urls={'formsave':window.fwk.getBaseUrlWithRegionAndNode("/newsletter/formsave"),'ending':'&showxml=true&layoutOff=true'};this.initialize=function(){this.setFormulario();$("#btnNewsLOk").live("click",this.getCallback("buttonsSave"));$("#btnNewsLBack").live("click",this.getCallback("buttonsBack"));$("#newsletterEmail").live("keypress",this.getCallback("keyPressed","e"));}
this.setInicial=function(){$("#newsletterFormEnviando").fadeOut();$("#newsletterFormClient").fadeOut();$("#newsletterFormRespuesta").fadeOut();$("#newsletterButtonClient").fadeIn();$("#newsletterFormError").hide("fast");}
this.setApagado=function(){$("#newsletterFormEnviando").fadeOut();$("#newsletterFormRespuesta").fadeOut();$("#newsletterFormClient").fadeOut();$("#newsletterFormError").hide("fast");}
this.setFormulario=function(){$("#newsletterEmail").val($("#newsletterEmail").attr("orig"));$("#newsletterFormEnviando").fadeOut();$("#newsletterFormRespuesta").fadeOut();$("#newsletterFormError").hide("fast");$("#newsletterFormClient").fadeIn();$("#newsletterEmail").focus();$("#newsletterEmail").select();}
this.setEnviando=function(){$("#newsletterFormClient").hide("fast");$("#newsletterFormRespuesta").hide("fast");$("#newsletterFormError").hide("fast");$("#newsletterFormEnviando").fadeIn("fast");}
this.setError=function(){$("#newsletterFormClient").hide("fast");$("#newsletterFormRespuesta").hide("fast");$("#newsletterFormEnviando").hide("fast");$("#newsletterFormError").fadeIn("fast");}
this.setRespuesta=function(resultado){$("#newsletterFormEnviando").hide("fast");$("#newsletterFormClient").hide("fast");$("#newsletterFormError").hide("fast");$("#newsletterFormRespuesta").fadeIn("fast");if(resultado=="OK"){$("#newsletterFormRespuestaFail").hide();$("#newsletterFormRespuestaOk").show();}else{$("#newsletterFormRespuestaFail").show();$("#newsletterFormRespuestaOk").hide();}}
this.keyPressed=function(e){if(e.keyCode==13||e.charCode==13){this.buttonsSave();return(false);}
return(true);}
this.buttonsCancel=function(){this.setInicial();};this.buttonsBack=function(){this.setFormulario();};this.buttonsSave=function(){$ob=$("#newsletterEmail");mail=$ob.val();if(mail!=""&&(mail.indexOf(".")>2)&&(mail.indexOf("@")>0)){this.setEnviando();var urlApi=(window.fwk.controllers.player.url_api!="")?window.fwk.controllers.player.url_api:window.fwk.controllers.player.url_api_default,title=window.fwk.controllers.currentPlayer.player("currentMedia").getCommonProp("title"),pathNav=window.fwk.controllers.navpath.instance.navpath("pathToString");var datos={'email':$ob.val(),'urlApi':urlApi,'title':title,'pathNav':pathNav};$.post(this.urls.formsave+"?"+this.urls.ending,datos,this.getCallback("buttonsSaveRespuesta","data"));}else{this.setError();}}
this.buttonsSaveRespuesta=function(data){if($(data).find("result").text()=="OK"){this.setRespuesta("OK");setTimeout(this.nombre+".setApagado()",this.timeouts.ok);}else{this.setRespuesta("FAIL");setTimeout(this.nombre+".setFormulario()",this.timeouts.fail);}}
this.getCallback=function(destino,parametro){if(parametro)eval("var callback= function ("+parametro+") { return("+this.nombre+"."+destino+"("+parametro+")); }");else eval("var callback= function () { return("+this.nombre+"."+destino+"(this)); }");return(callback);}
this.shareSocialNetwork=function(redsocial){var id_contenido="";id_contenido=window.fwk.controllers.currentPlayer.player("currentMedia").getMaterialProp("content_id");if(id_contenido==undefined||id_contenido==null)id_contenido="";if(id_contenido){url='http://'+window.location.host+'/videosonline/'+id_contenido+'.php?playcontent&sharemeta=true';window.open('http://www.facebook.com/sharer.php?u='+escape(url),'sharer','toolbar=0,status=0,width=626,height=436');};}}
window.fwk.common.accordionNav=function(){var mthis=this;this.menus={};this.speed=1000;this.speedfade=500;this.menusByPosition={};this.menuName;this.lastNavNodoSelected="";this.debug=false;this.setVerbose=function(v){if(this.debug==true)alert("nav:"+v);};this.load=function(){$("#menuNavCategorias .categorias-nav-menumostrar").each(function(){var control=$(this).attr("control");$(this).click(function(e){e.preventDefault();mthis.toggleNav(this,control);});});$("#menuNavCategorias .button-menunav").each(function(){$(this).click(function(e){e.preventDefault();mthis.setVerbose("menuNav click:["+$(this).attr("nodo")+" "+$(this).attr("menuParent")+"]");if($("#menuName"+$(this).attr("nodo")).attr("hijos")=="S"){if($("#menuName"+$(this).attr("nodo")).css("display")=="none"){mthis.resetExpandirNav($(this).attr("menuParent"));mthis.lastNavNodoSelected=$(this).attr("menuParent");mthis.expandOpendNode($(this).attr("menuParent"));}else{mthis.resetExpandirNav($(this).attr("menuParent"));mthis.lastNavNodoSelected=$(this).attr("menuParent");}}else{$top.window.location=$(this).attr("href");if($("#menuName"+$(this).attr("nodo")).attr("hijos")=="N"){$("#menuName"+$(this).attr("nodo")).addClass("nav-node-selected-nochild");}}});});this.openNode();};this.getAttr=function(name,attr){return($("#menuName"+name+"").attr('id_nodo')==undefined?$("#menuName"+name+"").parent().attr(attr):$("#menuName"+name+"").attr(attr));};this.cerrarMenu=function(){};this.resetExpandirNav=function(mParent){var path=mthis.lastNavNodoSelected;var vpath=path.split('/');var lastObj="home";var debugOpen="";var obj;var id;for(var i=1;i<vpath.length;i++){obj=$("#controlmenuName"+vpath[i]);id="menuName"+vpath[i];if($("#"+id).is('ul')==true){$("#"+id).css("display","none");$("span",obj).html("+");$(obj).parent().removeClass("menunav-node-selected");}else{$("#"+id).removeClass("nav-node-selected");$("#"+id).removeClass("nav-node-selected-nochild");}
debugOpen=debugOpen+" - menuName"+vpath[i]+"\n";}
mthis.setVerbose("menuNav resetopenNode:["+debugOpen+"]");};this.expandirNav=function(obj,id){this.setVerbose("menuNav expandirNav:["+id+" "+$("#"+id).css("display")+"- is ul"+($("#"+id).is('ul')?"true":"false")+"]");if($("#"+id).is('ul')==true){$("#"+id).css("display","block");$("span",obj).html("-");$(obj).parent().addClass("menunav-node-selected");}else{$("#"+id).addClass("nav-node-selected");}};this.openNode=function(){var nodo=$(document.body).attr('codeNodo');var menuName="menuName"+nodo;var path;if($("#"+menuName).length==0){path="home";}else{path=$("#"+menuName).attr("menuParent");}
mthis.lastNavNodoSelected=path;mthis.setVerbose("accordionNav openNode:"+nodo+"-"+menuName+"-"+path);var lastObj=mthis.expandOpendNode(path);var node=$("#"+lastObj);if(!node.attr("url")){node=$("#menuNamehome");}
mthis.setVerbose("accordionNav openNode :#"+lastObj+" - "+node+" "+node.attr("url"));return node;};this.expandOpendNode=function(path){if(path==undefined){path="home";}
var vpath=path.split('/');var lastObj="home";var debugOpen="";for(var i=1;i<vpath.length;i++){if($("#controlmenuName"+vpath[i]).length>0){mthis.expandirNav($("#controlmenuName"+vpath[i]),"menuName"+vpath[i]);debugOpen=debugOpen+" - menuName"+vpath[i];}
lastObj="menuName"+vpath[i];}
mthis.setVerbose("accordionNav lastnode ("+lastObj+") openNode:["+debugOpen+"]");$("#menuNavCategorias").scrollTo((vpath.length==1?$("#"+lastObj):$("#"+lastObj).parent()),800,{axis:'y',onAfter:function(){}});return lastObj;};this.toggleNav=function(obj,id){this.setVerbose("accordionNav toggleNav:["+id+" "+$("#"+id).css("display")+"- is ul"+($("#"+id).is('ul')?"true":"false")+"]");if($("#"+id).is('ul')==true){if($("#"+id).css("display")=="none"){$("#"+id).css("display","block");$("span",obj).html("-");$(obj).parent().addClass("menunav-node-selected");}else{$("#"+id).css("display","none");$("span",obj).html("+");$(obj).parent().removeClass("menunav-node-selected");}}else{$("#"+id).addClass("nav-node-selected");}};}
$(document).ready(function(){window.fwk.common.accordionNav=new window.fwk.common.accordionNav();window.fwk.common.accordionNav.load();fwk.common.nav=window.fwk.common.accordionNav;});
/**
 * $.showLoading() Jquery Plugin
 *
 * Se implementa este plugin que permite mostrar un Div con cargando en cualquier otro Div.
 * Dicho div funciona como un shadow y bloqueo la funcionalidad tapada.
 * Se genera con el siguiente formato "<div class='loading-message loading-message-default'><div class='loading-message-content'><div class='loading-message-ico'><span>ico</span></div><span class='loading-message-label'>cargando</span></div></div>"
 *
 * @param {Json}     options        Opciones de configuracion [labelName, textLabel, className]
 * @return {this}
 * @author rcelestino <rcelestino@claxson.com>
 * @see window.fwk.common.labels.getLabel
 */ 
$.fn.showLoading= function(options) {
    var defaults = {
        labelName: 'loadingText',
        textLabel: 'Loading ...',
        className: 'loading-message-default'
    };
    defaults = $.extend(defaults,options);
    return this.each(function() {
        //Antes de agregarlo me fijo que exista
        var $loadingMessage=$(this).find('.loading-message');
        if ($loadingMessage.length == 0) {
            var textLabel=defaults.textLabel;
            if(defaults.labelName){
            	textLabel=window.fwk.common.labels.getLabel(defaults.labelName);
            }
            var htmlCode='<div class="loading-message '+defaults.className+'"><div class="loading-message-content"><div class="loading-message-ico"><span>ico</span></div><span class="loading-message-label">'+textLabel+'</span></div></div>';
            if($("#loadingTemplate").length){
            	htmlCode=$("#loadingTemplate").html();
            }
            $(this).append(htmlCode);
            var height = 0;
            var width= 0;
            var position = {};
            var positionCss ="";            
            var isVisible=true;
            height = $(this).outerHeight();
            width = $(this).outerWidth();
            isVisible=$(this).css("display")=="none"?false:true;
            if(isVisible){
            	position = $(this).position();
            }
            positionCss =$(this).css("position");
            if (height) {
                height += "px";
            } else {
                height = "100%";
            }
            $loadingMessage=$(this).find('.loading-message');
            if(positionCss=="absolute"){
            	$loadingMessage.css("position","absolute").css("top",position.top).css("left",position.left);
            }else{
            	$(this).css("position","relative");
            	$loadingMessage.css("position","absolute").css("top",0).css("left",0);
            }
            try{
            	$(this).find(".loading-message-content").center();
            }catch(e){
            
            }
            $loadingMessage.css("height",height).css("width",width).click(function(e) {
                e.preventDefault();
                e.stopPropagation();
            });
            if($(this).attr("loading_messageId")){
            	$loadingMessage.attr("id",$(this).attr("loading_messageId"));
            }            
        }
        $loadingMessage.stop();
        $loadingMessage.show("normal");
    });
};

/**
 * $.hideLoading() Jquery Plugin
 *
 * Se implementa este plugin para ocultar y destruir los Divs generados por showLoading
 *
 * @param {Json}     options        Opciones de configuracion []
 * @return {this}
 * @author rcelestino <rcelestino@claxson.com> 
 */ 
$.fn.hideLoading= function(options) {
    return this.each(function() {
    	var $loadingMessage=$(this).find('.loading-message');
    	if ($loadingMessage.length != 0) {
    		$loadingMessage.stop();
    		$loadingMessage.hide("normal",function (){
    			$loadingMessage.remove();
    		});
    	}
    });
};

/**
 * $.center() Jquery Plugin
 *
 * Se implementa este plugin para centrar vertical y horizontalmente un elemento
 *
 * @param {Json}     params        Opciones de configuracion [vertical, horizontal]
 * @return {this}
 * @author rcelestino <rcelestino@claxson.com> 
 */
$.fn.center = function(params) {

		var options = {

			vertical: true,
			horizontal: true

		}
		op = jQuery.extend(options, params);

   return this.each(function(){

		//initializing variables
		var $self = jQuery(this);
		//get the dimensions using dimensions plugin
		var width = $self.width();
		var height = $self.height();
		//get the paddings
		var paddingTop = parseInt($self.css("padding-top"));
		var paddingBottom = parseInt($self.css("padding-bottom"));
		if(isNaN(paddingTop)) paddingTop=0;
		if(isNaN(paddingBottom)) paddingBottom=0;
		//get the borders
		var borderTop = parseInt($self.css("border-top-width"));
		var borderBottom = parseInt($self.css("border-bottom-width"));
		if(isNaN(borderTop)) borderTop=0;
		if(isNaN(borderBottom)) borderBottom=0;
		//get the media of padding and borders
		var mediaBorder = (borderTop+borderBottom)/2;
		var mediaPadding = (paddingTop+paddingBottom)/2;
		if(isNaN(mediaBorder)) mediaBorder=0;
		if(isNaN(mediaPadding)) mediaPadding=0;
		//get the type of positioning
		var positionType = $self.parent().css("position");
		// get the half minus of width and height
		var halfWidth = (width/2)*(-1);
		var halfHeight = ((height/2)*(-1))-mediaPadding-mediaBorder;
		// initializing the css properties
		var cssProp = {
			position: 'absolute'
		};

		if(op.vertical) {
			cssProp.height = height;
			cssProp.top = '50%';
			cssProp.marginTop = halfHeight;
		}
		if(op.horizontal) {
			cssProp.width = width;
			cssProp.left = '50%';
			cssProp.marginLeft = halfWidth;
		}
		//check the current position
		if(positionType == 'static') {
			$self.parent().css("position","relative");
		}
		//aplying the css
		$self.css(cssProp);


   });

};

$(document).ready(function (){
	$(document.body).append("<div style='display:none;' id='preloadLoading'></div>");
	$("#preloadLoading").showLoading();
});
