(function(window,undefined){var document=window.document;(function(){var initializing=false,fnTest=/xyz/.test(function(){xyz;})?/\b_super\b/:/.*/;this.JRClass=function(){};JRClass.extend=function(prop){var _super=this.prototype;initializing=true;var prototype=new this();initializing=false;for(var name in prop){prototype[name]=typeof prop[name]=="function"&&typeof _super[name]=="function"&&fnTest.test(prop[name])?(function(name,fn){return function(){var tmp=this._super;this._super=_super[name];var ret=fn.apply(this,arguments);this._super=tmp;return ret;};})(name,prop[name]):prop[name];}function JRClass(){if(!initializing&&this.init)this.init.apply(this,arguments);}JRClass.prototype=prototype;JRClass.constructor=JRClass;JRClass.extend=arguments.callee;return JRClass;};})();var VideoJS=JRClass.extend({init:function(element,setOptions){if(typeof element=='string'){this.video=document.getElementById(element);}else{this.video=element;}
this.video.player=this;this.values={};this.elements={};this.options={autoplay:false,preload:true,useBuiltInControls:false,controlsBelow:false,controlsAtStart:false,controlsHiding:true,defaultVolume:0.85,playerFallbackOrder:["html5","flash","links"],flashPlayer:"htmlObject",flashPlayerVersion:false};if(typeof VideoJS.options=="object"){_V_.merge(this.options,VideoJS.options);}
if(typeof setOptions=="object"){_V_.merge(this.options,setOptions);}
if(this.getPreloadAttribute()!==undefined){this.options.preload=this.getPreloadAttribute();}
if(this.getAutoplayAttribute()!==undefined){this.options.autoplay=this.getAutoplayAttribute();}
this.box=this.video.parentNode;this.linksFallback=this.getLinksFallback();this.hideLinksFallback();this.each(this.options.playerFallbackOrder,function(playerType){if(this[playerType+"Supported"]()){this[playerType+"Init"]();return true;}});this.activateElement(this,"player");this.activateElement(this.box,"box");},behaviors:{},newBehavior:function(name,activate,functions){this.behaviors[name]=activate;this.extend(functions);},activateElement:function(element,behavior){if(typeof element=="string"){element=document.getElementById(element);}
this.behaviors[behavior].call(this,element);},errors:[],warnings:[],warning:function(warning){this.warnings.push(warning);this.log(warning);},history:[],log:function(event){if(!event){return;}
if(typeof event=="string"){event={type:event};}
if(event.type){this.history.push(event.type);}
if(this.history.length>=50){this.history.shift();}
try{console.log(event.type);}catch(e){try{opera.postError(event.type);}catch(e){}}},setLocalStorage:function(key,value){if(!localStorage){return;}
try{localStorage[key]=value;}catch(e){if(e.code==22||e.code==1014){this.warning(VideoJS.warnings.localStorageFull);}}},getPreloadAttribute:function(){if(typeof this.video.hasAttribute=="function"&&this.video.hasAttribute("preload")){var preload=this.video.getAttribute("preload");if(preload===""||preload==="true"){return"auto";}
if(preload==="false"){return"none";}
return preload;}},getAutoplayAttribute:function(){if(typeof this.video.hasAttribute=="function"&&this.video.hasAttribute("autoplay")){var autoplay=this.video.getAttribute("autoplay");if(autoplay==="false"){return false;}
return true;}},bufferedPercent:function(){return(this.duration())?this.buffered()[1]/this.duration():0;},each:function(arr,fn){if(!arr||arr.length===0){return;}
for(var i=0,j=arr.length;i<j;i++){if(fn.call(this,arr[i],i)){break;}}},extend:function(obj){for(var attrname in obj){if(obj.hasOwnProperty(attrname)){this[attrname]=obj[attrname];}}}});VideoJS.player=VideoJS.prototype;VideoJS.player.extend({flashSupported:function(){if(!this.flashElement){this.flashElement=this.getFlashElement();}
if(this.flashElement&&this.flashPlayerVersionSupported()){return true;}else{return false;}},flashInit:function(){this.replaceWithFlash();this.element=this.flashElement;this.video.src="";var flashPlayerType=VideoJS.flashPlayers[this.options.flashPlayer];this.extend(VideoJS.flashPlayers[this.options.flashPlayer].api);(flashPlayerType.init.context(this))();},getFlashElement:function(){var children=this.video.children;for(var i=0,j=children.length;i<j;i++){if(children[i].className=="vjs-flash-fallback"){return children[i];}}},replaceWithFlash:function(){if(this.flashElement){this.box.insertBefore(this.flashElement,this.video);this.video.style.display="none";}},flashPlayerVersionSupported:function(){var playerVersion=(this.options.flashPlayerVersion)?this.options.flashPlayerVersion:VideoJS.flashPlayers[this.options.flashPlayer].flashPlayerVersion;return VideoJS.getFlashVersion()>=playerVersion;}});VideoJS.flashPlayers={};VideoJS.flashPlayers.htmlObject={flashPlayerVersion:9,init:function(){return true;},api:{width:function(width){if(width!==undefined){this.element.width=width;this.box.style.width=width+"px";this.triggerResizeListeners();return this;}
return this.element.width;},height:function(height){if(height!==undefined){this.element.height=height;this.box.style.height=height+"px";this.triggerResizeListeners();return this;}
return this.element.height;}}};VideoJS.player.extend({linksSupported:function(){return true;},linksInit:function(){this.showLinksFallback();this.element=this.video;},getLinksFallback:function(){return this.box.getElementsByTagName("P")[0];},hideLinksFallback:function(){if(this.linksFallback){this.linksFallback.style.display="none";}},showLinksFallback:function(){if(this.linksFallback){this.linksFallback.style.display="block";}}});VideoJS.merge=function(obj1,obj2,safe){for(var attrname in obj2){if(obj2.hasOwnProperty(attrname)&&(!safe||!obj1.hasOwnProperty(attrname))){obj1[attrname]=obj2[attrname];}}
return obj1;};VideoJS.extend=function(obj){this.merge(this,obj,true);};VideoJS.extend({setupAllWhenReady:function(options){VideoJS.options=options;VideoJS.DOMReady(VideoJS.setup);},DOMReady:function(fn){VideoJS.addToDOMReady(fn);},setup:function(videos,options){var returnSingular=false,playerList=[],videoElement;if(!videos||videos=="All"){videos=VideoJS.getVideoJSTags();}else if(typeof videos!='object'||videos.nodeType==1){videos=[videos];returnSingular=true;}
for(var i=0;i<videos.length;i++){if(typeof videos[i]=='string'){videoElement=document.getElementById(videos[i]);}else{videoElement=videos[i];}
playerList.push(new VideoJS(videoElement,options));}
return(returnSingular)?playerList[0]:playerList;},getVideoJSTags:function(){var videoTags=document.getElementsByTagName("video"),videoJSTags=[],videoTag;for(var i=0,j=videoTags.length;i<j;i++){videoTag=videoTags[i];if(videoTag.className.indexOf("video-js")!=-1){videoJSTags.push(videoTag);}}
return videoJSTags;},browserSupportsVideo:function(){if(typeof VideoJS.videoSupport!="undefined"){return VideoJS.videoSupport;}
VideoJS.videoSupport=!!document.createElement('video').canPlayType;return VideoJS.videoSupport;},getFlashVersion:function(){if(typeof VideoJS.flashVersion!="undefined"){return VideoJS.flashVersion;}
var version=0,desc;if(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]=="object"){desc=navigator.plugins["Shockwave Flash"].description;if(desc&&!(typeof navigator.mimeTypes!="undefined"&&navigator.mimeTypes["application/x-shockwave-flash"]&&!navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)){version=parseInt(desc.match(/^.*\s+([^\s]+)\.[^\s]+\s+[^\s]+$/)[1],10);}}else if(typeof window.ActiveXObject!="undefined"){try{var testObject=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(testObject){version=parseInt(testObject.GetVariable("$version").match(/^[^\s]+\s(\d+)/)[1],10);}}
catch(e){}}
VideoJS.flashVersion=version;return VideoJS.flashVersion;},isIE:function(){return!+"\v1";},isIPad:function(){return navigator.userAgent.match(/iPad/i)!==null;},isIPhone:function(){return navigator.userAgent.match(/iPhone/i)!==null;},isIOS:function(){return VideoJS.isIPhone()||VideoJS.isIPad();},iOSVersion:function(){var match=navigator.userAgent.match(/OS (\d+)_/i);if(match&&match[1]){return match[1];}},isAndroid:function(){return navigator.userAgent.match(/Android/i)!==null;},androidVersion:function(){var match=navigator.userAgent.match(/Android (\d+)\./i);if(match&&match[1]){return match[1];}},warnings:{videoNotReady:"Video is not ready yet (try playing the video first).",localStorageFull:"Local Storage is Full"}});if(VideoJS.isIE()){document.createElement("video");}
window.VideoJS=window._V_=VideoJS;VideoJS.player.extend({html5Supported:function(){if(VideoJS.browserSupportsVideo()&&this.canPlaySource()){return true;}else{return false;}},html5Init:function(){this.element=this.video;this.fixPreloading();this.supportProgressEvents();this.volume((localStorage&&localStorage.volume)||this.options.defaultVolume);if(VideoJS.isIOS()){this.options.useBuiltInControls=true;this.iOSInterface();}else if(VideoJS.isAndroid()){this.options.useBuiltInControls=true;this.androidInterface();}
if(!this.options.useBuiltInControls){this.video.controls=false;if(this.options.controlsBelow){_V_.addClass(this.box,"vjs-controls-below");}
this.activateElement(this.video,"playToggle");this.buildStylesCheckDiv();this.buildAndActivatePoster();this.buildBigPlayButton();this.buildAndActivateSpinner();this.buildAndActivateControlBar();this.loadInterface();this.getSubtitles();}},canPlaySource:function(){if(this.canPlaySourceResult){return this.canPlaySourceResult;}
var children=this.video.children;for(var i=0,j=children.length;i<j;i++){if(children[i].tagName.toUpperCase()=="SOURCE"){var canPlay=this.video.canPlayType(children[i].type)||this.canPlayExt(children[i].src);if(canPlay=="probably"||canPlay=="maybe"){this.firstPlayableSource=children[i];this.canPlaySourceResult=true;return true;}}}
this.canPlaySourceResult=false;return false;},canPlayExt:function(src){if(!src){return"";}
var match=src.match(/\.([^\.]+)$/);if(match&&match[1]){var ext=match[1].toLowerCase();if(VideoJS.isAndroid()){if(ext=="mp4"||ext=="m4v"){return"maybe";}}else if(VideoJS.isIOS()){if(ext=="m3u8"){return"maybe";}}}
return"";},forceTheSource:function(){this.video.src=this.firstPlayableSource.src;this.video.load();},fixPreloading:function(){if(typeof this.video.hasAttribute=="function"&&this.video.hasAttribute("preload")&&this.video.preload!="none"){this.video.autobuffer=true;}else{this.video.autobuffer=false;this.video.preload="none";}},supportProgressEvents:function(e){_V_.addListener(this.video,'progress',this.playerOnVideoProgress.context(this));},playerOnVideoProgress:function(event){this.setBufferedFromProgress(event);},setBufferedFromProgress:function(event){if(event.total>0){var newBufferEnd=(event.loaded/event.total)*this.duration();if(newBufferEnd>this.values.bufferEnd){this.values.bufferEnd=newBufferEnd;}}},iOSInterface:function(){if(VideoJS.iOSVersion()<4){this.forceTheSource();}
if(VideoJS.isIPad()){this.buildAndActivateSpinner();}},androidInterface:function(){this.forceTheSource();_V_.addListener(this.video,"click",function(){this.play();});this.buildBigPlayButton();_V_.addListener(this.bigPlayButton,"click",function(){this.play();}.context(this));this.positionBox();this.showBigPlayButtons();},loadInterface:function(){if(!this.stylesHaveLoaded()){if(!this.positionRetries){this.positionRetries=1;}
if(this.positionRetries++<100){setTimeout(this.loadInterface.context(this),10);return;}}
this.hideStylesCheckDiv();this.showPoster();if(this.video.paused!==false){this.showBigPlayButtons();}
if(this.options.controlsAtStart){this.showControlBars();}
this.positionAll();},buildAndActivateControlBar:function(){this.controls=_V_.createElement("div",{className:"vjs-controls"});this.box.appendChild(this.controls);this.activateElement(this.controls,"controlBar");this.activateElement(this.controls,"mouseOverVideoReporter");this.playControl=_V_.createElement("div",{className:"vjs-play-control",innerHTML:"<span></span>"});this.controls.appendChild(this.playControl);this.activateElement(this.playControl,"playToggle");this.progressControl=_V_.createElement("div",{className:"vjs-progress-control"});this.controls.appendChild(this.progressControl);this.progressHolder=_V_.createElement("div",{className:"vjs-progress-holder"});this.progressControl.appendChild(this.progressHolder);this.activateElement(this.progressHolder,"currentTimeScrubber");this.loadProgressBar=_V_.createElement("div",{className:"vjs-load-progress"});this.progressHolder.appendChild(this.loadProgressBar);this.activateElement(this.loadProgressBar,"loadProgressBar");this.playProgressBar=_V_.createElement("div",{className:"vjs-play-progress"});this.progressHolder.appendChild(this.playProgressBar);this.activateElement(this.playProgressBar,"playProgressBar");this.timeControl=_V_.createElement("div",{className:"vjs-time-control"});this.controls.appendChild(this.timeControl);this.currentTimeDisplay=_V_.createElement("span",{className:"vjs-current-time-display",innerHTML:"00:00"});this.timeControl.appendChild(this.currentTimeDisplay);this.activateElement(this.currentTimeDisplay,"currentTimeDisplay");this.timeSeparator=_V_.createElement("span",{innerHTML:" / "});this.timeControl.appendChild(this.timeSeparator);this.durationDisplay=_V_.createElement("span",{className:"vjs-duration-display",innerHTML:"00:00"});this.timeControl.appendChild(this.durationDisplay);this.activateElement(this.durationDisplay,"durationDisplay");this.volumeControl=_V_.createElement("div",{className:"vjs-volume-control",innerHTML:"<div><span></span><span></span><span></span><span></span><span></span><span></span></div>"});this.controls.appendChild(this.volumeControl);this.activateElement(this.volumeControl,"volumeScrubber");this.volumeDisplay=this.volumeControl.children[0];this.activateElement(this.volumeDisplay,"volumeDisplay");this.fullscreenControl=_V_.createElement("div",{className:"vjs-fullscreen-control",innerHTML:"<div><span></span><span></span><span></span><span></span></div>"});this.controls.appendChild(this.fullscreenControl);this.activateElement(this.fullscreenControl,"fullscreenToggle");},buildAndActivatePoster:function(){this.updatePosterSource();if(this.video.poster){this.poster=document.createElement("img");this.box.appendChild(this.poster);this.poster.src=this.video.poster;this.poster.className="vjs-poster";this.activateElement(this.poster,"poster");}else{this.poster=false;}},buildBigPlayButton:function(){this.bigPlayButton=_V_.createElement("div",{className:"vjs-big-play-button",innerHTML:"<span></span>"});this.box.appendChild(this.bigPlayButton);this.activateElement(this.bigPlayButton,"bigPlayButton");},buildAndActivateSpinner:function(){this.spinner=_V_.createElement("div",{className:"vjs-spinner",innerHTML:"<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>"});this.box.appendChild(this.spinner);this.activateElement(this.spinner,"spinner");},buildStylesCheckDiv:function(){this.stylesCheckDiv=_V_.createElement("div",{className:"vjs-styles-check"});this.stylesCheckDiv.style.position="absolute";this.box.appendChild(this.stylesCheckDiv);},hideStylesCheckDiv:function(){this.stylesCheckDiv.style.display="none";},stylesHaveLoaded:function(){if(this.stylesCheckDiv.offsetHeight!=5){return false;}else{return true;}},positionAll:function(){this.positionBox();this.positionControlBars();this.positionPoster();},positionBox:function(){if(this.videoIsFullScreen){this.box.style.width="";this.element.style.height="";if(this.options.controlsBelow){this.box.style.height="";this.element.style.height=(this.box.offsetHeight-this.controls.offsetHeight)+"px";}}else{this.box.style.width=this.width()+"px";this.element.style.height=this.height()+"px";if(this.options.controlsBelow){this.element.style.height="";}}},getSubtitles:function(){var tracks=this.video.getElementsByTagName("TRACK");for(var i=0,j=tracks.length;i<j;i++){if(tracks[i].getAttribute("kind")=="subtitles"&&tracks[i].getAttribute("src")){this.subtitlesSource=tracks[i].getAttribute("src");this.loadSubtitles();this.buildSubtitles();}}},loadSubtitles:function(){_V_.get(this.subtitlesSource,this.parseSubtitles.context(this));},parseSubtitles:function(subText){var lines=subText.split("\n"),line="",subtitle,time,text;this.subtitles=[];this.currentSubtitle=false;this.lastSubtitleIndex=0;for(var i=0;i<lines.length;i++){line=_V_.trim(lines[i]);if(line){subtitle={id:line,index:this.subtitles.length};line=_V_.trim(lines[++i]);time=line.split(" --> ");subtitle.start=this.parseSubtitleTime(time[0]);subtitle.end=this.parseSubtitleTime(time[1]);text=[];for(var j=i;j<lines.length;j++){line=_V_.trim(lines[++i]);if(!line){break;}
text.push(line);}
subtitle.text=text.join('<br/>');this.subtitles.push(subtitle);}}},parseSubtitleTime:function(timeText){var parts=timeText.split(':'),time=0;time+=parseFloat(parts[0])*60*60;time+=parseFloat(parts[1])*60;var seconds=parts[2].split(/\.|,/);time+=parseFloat(seconds[0]);ms=parseFloat(seconds[1]);if(ms){time+=ms/1000;}
return time;},buildSubtitles:function(){this.subtitlesDisplay=_V_.createElement("div",{className:'vjs-subtitles'});this.box.appendChild(this.subtitlesDisplay);this.activateElement(this.subtitlesDisplay,"subtitlesDisplay");},addVideoListener:function(type,fn){_V_.addListener(this.video,type,fn.rEvtContext(this));},play:function(){this.video.play();return this;},onPlay:function(fn){this.addVideoListener("play",fn);return this;},pause:function(){this.video.pause();return this;},onPause:function(fn){this.addVideoListener("pause",fn);return this;},paused:function(){return this.video.paused;},currentTime:function(seconds){if(seconds!==undefined){try{this.video.currentTime=seconds;}
catch(e){this.warning(VideoJS.warnings.videoNotReady);}
this.values.currentTime=seconds;return this;}
return this.video.currentTime;},onCurrentTimeUpdate:function(fn){this.currentTimeListeners.push(fn);},duration:function(){return this.video.duration;},buffered:function(){if(this.values.bufferStart===undefined){this.values.bufferStart=0;this.values.bufferEnd=0;}
if(this.video.buffered&&this.video.buffered.length>0){var newEnd=this.video.buffered.end(0);if(newEnd>this.values.bufferEnd){this.values.bufferEnd=newEnd;}}
return[this.values.bufferStart,this.values.bufferEnd];},volume:function(percentAsDecimal){if(percentAsDecimal!==undefined){this.values.volume=Math.max(0,Math.min(1,parseFloat(percentAsDecimal)));this.video.volume=this.values.volume;this.setLocalStorage("volume",this.values.volume);return this;}
if(this.values.volume){return this.values.volume;}
return this.video.volume;},onVolumeChange:function(fn){_V_.addListener(this.video,'volumechange',fn.rEvtContext(this));},width:function(width){if(width!==undefined){this.video.width=width;this.box.style.width=width+"px";this.triggerResizeListeners();return this;}
return this.video.offsetWidth;},height:function(height){if(height!==undefined){this.video.height=height;this.box.style.height=height+"px";this.triggerResizeListeners();return this;}
return this.video.offsetHeight;},supportsFullScreen:function(){if(typeof this.video.webkitEnterFullScreen=='function'){if(!navigator.userAgent.match("Chrome")&&!navigator.userAgent.match("Mac OS X 10.5")){return true;}}
return false;},html5EnterNativeFullScreen:function(){try{this.video.webkitEnterFullScreen();}catch(e){if(e.code==11){this.warning(VideoJS.warnings.videoNotReady);}}
return this;},enterFullScreen:function(){if(this.supportsFullScreen()){this.html5EnterNativeFullScreen();}else{this.enterFullWindow();}},exitFullScreen:function(){if(this.supportsFullScreen()){}else{this.exitFullWindow();}},enterFullWindow:function(){this.videoIsFullScreen=true;this.docOrigOverflow=document.documentElement.style.overflow;_V_.addListener(document,"keydown",this.fullscreenOnEscKey.rEvtContext(this));_V_.addListener(window,"resize",this.fullscreenOnWindowResize.rEvtContext(this));document.documentElement.style.overflow='hidden';_V_.addClass(this.box,"vjs-fullscreen");this.positionAll();},exitFullWindow:function(){this.videoIsFullScreen=false;document.removeEventListener("keydown",this.fullscreenOnEscKey,false);window.removeEventListener("resize",this.fullscreenOnWindowResize,false);document.documentElement.style.overflow=this.docOrigOverflow;_V_.removeClass(this.box,"vjs-fullscreen");this.positionAll();},onError:function(fn){this.addVideoListener("error",fn);return this;},onEnded:function(fn){this.addVideoListener("ended",fn);return this;}});VideoJS.player.newBehavior("player",function(player){this.onError(this.playerOnVideoError);this.onPlay(this.playerOnVideoPlay);this.onPlay(this.trackCurrentTime);this.onPause(this.playerOnVideoPause);this.onPause(this.stopTrackingCurrentTime);this.onEnded(this.playerOnVideoEnded);this.trackBuffered();this.onBufferedUpdate(this.isBufferFull);},{playerOnVideoError:function(event){this.log(event);this.log(this.video.error);},playerOnVideoPlay:function(event){this.hasPlayed=true;},playerOnVideoPause:function(event){},playerOnVideoEnded:function(event){this.currentTime(0);this.pause();},trackBuffered:function(){this.bufferedInterval=setInterval(this.triggerBufferedListeners.context(this),500);},stopTrackingBuffered:function(){clearInterval(this.bufferedInterval);},bufferedListeners:[],onBufferedUpdate:function(fn){this.bufferedListeners.push(fn);},triggerBufferedListeners:function(){this.isBufferFull();this.each(this.bufferedListeners,function(listener){(listener.context(this))();});},isBufferFull:function(){if(this.bufferedPercent()==1){this.stopTrackingBuffered();}},trackCurrentTime:function(){if(this.currentTimeInterval){clearInterval(this.currentTimeInterval);}
this.currentTimeInterval=setInterval(this.triggerCurrentTimeListeners.context(this),100);this.trackingCurrentTime=true;},stopTrackingCurrentTime:function(){clearInterval(this.currentTimeInterval);this.trackingCurrentTime=false;},currentTimeListeners:[],triggerCurrentTimeListeners:function(late,newTime){this.each(this.currentTimeListeners,function(listener){(listener.context(this))(newTime||this.currentTime());});},resizeListeners:[],onResize:function(fn){this.resizeListeners.push(fn);},triggerResizeListeners:function(){this.each(this.resizeListeners,function(listener){(listener.context(this))();});}});VideoJS.player.newBehavior("mouseOverVideoReporter",function(element){_V_.addListener(element,"mousemove",this.mouseOverVideoReporterOnMouseMove.context(this));_V_.addListener(element,"mouseout",this.mouseOverVideoReporterOnMouseOut.context(this));},{mouseOverVideoReporterOnMouseMove:function(){this.showControlBars();clearInterval(this.mouseMoveTimeout);this.mouseMoveTimeout=setTimeout(this.hideControlBars.context(this),4000);},mouseOverVideoReporterOnMouseOut:function(event){var parent=event.relatedTarget;while(parent&&parent!==this.box){parent=parent.parentNode;}
if(parent!==this.box){this.hideControlBars();}}});VideoJS.player.newBehavior("box",function(element){this.positionBox();_V_.addClass(element,"vjs-paused");this.activateElement(element,"mouseOverVideoReporter");this.onPlay(this.boxOnVideoPlay);this.onPause(this.boxOnVideoPause);},{boxOnVideoPlay:function(){_V_.removeClass(this.box,"vjs-paused");_V_.addClass(this.box,"vjs-playing");},boxOnVideoPause:function(){_V_.removeClass(this.box,"vjs-playing");_V_.addClass(this.box,"vjs-paused");}});VideoJS.player.newBehavior("poster",function(element){this.activateElement(element,"mouseOverVideoReporter");this.activateElement(element,"playButton");this.onPlay(this.hidePoster);this.onEnded(this.showPoster);this.onResize(this.positionPoster);},{showPoster:function(){if(!this.poster){return;}
this.poster.style.display="block";this.positionPoster();},positionPoster:function(){if(!this.poster||this.poster.style.display=='none'){return;}
this.poster.style.height=this.height()+"px";this.poster.style.width=this.width()+"px";},hidePoster:function(){if(!this.poster){return;}
this.poster.style.display="none";},updatePosterSource:function(){if(!this.video.poster){var images=this.video.getElementsByTagName("img");if(images.length>0){this.video.poster=images[0].src;}}}});VideoJS.player.newBehavior("controlBar",function(element){if(!this.controlBars){this.controlBars=[];this.onResize(this.positionControlBars);}
this.controlBars.push(element);_V_.addListener(element,"mousemove",this.onControlBarsMouseMove.context(this));_V_.addListener(element,"mouseout",this.onControlBarsMouseOut.context(this));},{showControlBars:function(){if(!this.options.controlsAtStart&&!this.hasPlayed){return;}
this.each(this.controlBars,function(bar){bar.style.display="block";});},positionControlBars:function(){this.updatePlayProgressBars();this.updateLoadProgressBars();},hideControlBars:function(){if(this.options.controlsHiding&&!this.mouseIsOverControls){this.each(this.controlBars,function(bar){bar.style.display="none";});}},onControlBarsMouseMove:function(){this.mouseIsOverControls=true;},onControlBarsMouseOut:function(event){this.mouseIsOverControls=false;}});VideoJS.player.newBehavior("playToggle",function(element){if(!this.elements.playToggles){this.elements.playToggles=[];this.onPlay(this.playTogglesOnPlay);this.onPause(this.playTogglesOnPause);}
this.elements.playToggles.push(element);_V_.addListener(element,"click",this.onPlayToggleClick.context(this));},{onPlayToggleClick:function(event){if(this.paused()){this.play();}else{this.pause();}},playTogglesOnPlay:function(event){this.each(this.elements.playToggles,function(toggle){_V_.removeClass(toggle,"vjs-paused");_V_.addClass(toggle,"vjs-playing");});},playTogglesOnPause:function(event){this.each(this.elements.playToggles,function(toggle){_V_.removeClass(toggle,"vjs-playing");_V_.addClass(toggle,"vjs-paused");});}});VideoJS.player.newBehavior("playButton",function(element){_V_.addListener(element,"click",this.onPlayButtonClick.context(this));},{onPlayButtonClick:function(event){this.play();}});VideoJS.player.newBehavior("pauseButton",function(element){_V_.addListener(element,"click",this.onPauseButtonClick.context(this));},{onPauseButtonClick:function(event){this.pause();}});VideoJS.player.newBehavior("playProgressBar",function(element){if(!this.playProgressBars){this.playProgressBars=[];this.onCurrentTimeUpdate(this.updatePlayProgressBars);}
this.playProgressBars.push(element);},{updatePlayProgressBars:function(newTime){var progress=(newTime!==undefined)?newTime/this.duration():this.currentTime()/this.duration();if(isNaN(progress)){progress=0;}
this.each(this.playProgressBars,function(bar){if(bar.style){bar.style.width=_V_.round(progress*100,2)+"%";}});}});VideoJS.player.newBehavior("loadProgressBar",function(element){if(!this.loadProgressBars){this.loadProgressBars=[];}
this.loadProgressBars.push(element);this.onBufferedUpdate(this.updateLoadProgressBars);},{updateLoadProgressBars:function(){this.each(this.loadProgressBars,function(bar){if(bar.style){bar.style.width=_V_.round(this.bufferedPercent()*100,2)+"%";}});}});VideoJS.player.newBehavior("currentTimeDisplay",function(element){if(!this.currentTimeDisplays){this.currentTimeDisplays=[];this.onCurrentTimeUpdate(this.updateCurrentTimeDisplays);}
this.currentTimeDisplays.push(element);},{updateCurrentTimeDisplays:function(newTime){if(!this.currentTimeDisplays){return;}
var time=(newTime)?newTime:this.currentTime();this.each(this.currentTimeDisplays,function(dis){dis.innerHTML=_V_.formatTime(time);});}});VideoJS.player.newBehavior("durationDisplay",function(element){if(!this.durationDisplays){this.durationDisplays=[];this.onCurrentTimeUpdate(this.updateDurationDisplays);}
this.durationDisplays.push(element);},{updateDurationDisplays:function(){if(!this.durationDisplays){return;}
this.each(this.durationDisplays,function(dis){if(this.duration()){dis.innerHTML=_V_.formatTime(this.duration());}});}});VideoJS.player.newBehavior("currentTimeScrubber",function(element){_V_.addListener(element,"mousedown",this.onCurrentTimeScrubberMouseDown.rEvtContext(this));},{onCurrentTimeScrubberMouseDown:function(event,scrubber){event.preventDefault();this.currentScrubber=scrubber;this.stopTrackingCurrentTime();this.videoWasPlaying=!this.paused();this.pause();_V_.blockTextSelection();this.setCurrentTimeWithScrubber(event);_V_.addListener(document,"mousemove",this.onCurrentTimeScrubberMouseMove.rEvtContext(this));_V_.addListener(document,"mouseup",this.onCurrentTimeScrubberMouseUp.rEvtContext(this));},onCurrentTimeScrubberMouseMove:function(event){this.setCurrentTimeWithScrubber(event);},onCurrentTimeScrubberMouseUp:function(event){_V_.unblockTextSelection();document.removeEventListener("mousemove",this.onCurrentTimeScrubberMouseMove,false);document.removeEventListener("mouseup",this.onCurrentTimeScrubberMouseUp,false);if(this.videoWasPlaying){this.play();this.trackCurrentTime();}},setCurrentTimeWithScrubber:function(event){var newProgress=_V_.getRelativePosition(event.pageX,this.currentScrubber);var newTime=newProgress*this.duration();this.triggerCurrentTimeListeners(0,newTime);if(newTime==this.duration()){newTime=newTime-0.1;}
this.currentTime(newTime);}});VideoJS.player.newBehavior("volumeDisplay",function(element){if(!this.volumeDisplays){this.volumeDisplays=[];this.onVolumeChange(this.updateVolumeDisplays);}
this.volumeDisplays.push(element);this.updateVolumeDisplay(element);},{updateVolumeDisplays:function(){if(!this.volumeDisplays){return;}
this.each(this.volumeDisplays,function(dis){this.updateVolumeDisplay(dis);});},updateVolumeDisplay:function(display){var volNum=Math.ceil(this.volume()*6);this.each(display.children,function(child,num){if(num<volNum){_V_.addClass(child,"vjs-volume-level-on");}else{_V_.removeClass(child,"vjs-volume-level-on");}});}});VideoJS.player.newBehavior("volumeScrubber",function(element){_V_.addListener(element,"mousedown",this.onVolumeScrubberMouseDown.rEvtContext(this));},{onVolumeScrubberMouseDown:function(event,scrubber){_V_.blockTextSelection();this.currentScrubber=scrubber;this.setVolumeWithScrubber(event);_V_.addListener(document,"mousemove",this.onVolumeScrubberMouseMove.rEvtContext(this));_V_.addListener(document,"mouseup",this.onVolumeScrubberMouseUp.rEvtContext(this));},onVolumeScrubberMouseMove:function(event){this.setVolumeWithScrubber(event);},onVolumeScrubberMouseUp:function(event){this.setVolumeWithScrubber(event);_V_.unblockTextSelection();document.removeEventListener("mousemove",this.onVolumeScrubberMouseMove,false);document.removeEventListener("mouseup",this.onVolumeScrubberMouseUp,false);},setVolumeWithScrubber:function(event){var newVol=_V_.getRelativePosition(event.pageX,this.currentScrubber);this.volume(newVol);}});VideoJS.player.newBehavior("fullscreenToggle",function(element){_V_.addListener(element,"click",this.onFullscreenToggleClick.context(this));},{onFullscreenToggleClick:function(event){if(!this.videoIsFullScreen){this.enterFullScreen();}else{this.exitFullScreen();}},fullscreenOnWindowResize:function(event){this.positionControlBars();},fullscreenOnEscKey:function(event){if(event.keyCode==27){this.exitFullScreen();}}});VideoJS.player.newBehavior("bigPlayButton",function(element){if(!this.elements.bigPlayButtons){this.elements.bigPlayButtons=[];this.onPlay(this.bigPlayButtonsOnPlay);this.onEnded(this.bigPlayButtonsOnEnded);}
this.elements.bigPlayButtons.push(element);this.activateElement(element,"playButton");},{bigPlayButtonsOnPlay:function(event){this.hideBigPlayButtons();},bigPlayButtonsOnEnded:function(event){this.showBigPlayButtons();},showBigPlayButtons:function(){this.each(this.elements.bigPlayButtons,function(element){element.style.display="block";});},hideBigPlayButtons:function(){this.each(this.elements.bigPlayButtons,function(element){element.style.display="none";});}});VideoJS.player.newBehavior("spinner",function(element){if(!this.spinners){this.spinners=[];_V_.addListener(this.video,"loadeddata",this.spinnersOnVideoLoadedData.context(this));_V_.addListener(this.video,"loadstart",this.spinnersOnVideoLoadStart.context(this));_V_.addListener(this.video,"seeking",this.spinnersOnVideoSeeking.context(this));_V_.addListener(this.video,"seeked",this.spinnersOnVideoSeeked.context(this));_V_.addListener(this.video,"canplay",this.spinnersOnVideoCanPlay.context(this));_V_.addListener(this.video,"canplaythrough",this.spinnersOnVideoCanPlayThrough.context(this));_V_.addListener(this.video,"waiting",this.spinnersOnVideoWaiting.context(this));_V_.addListener(this.video,"stalled",this.spinnersOnVideoStalled.context(this));_V_.addListener(this.video,"suspend",this.spinnersOnVideoSuspend.context(this));_V_.addListener(this.video,"playing",this.spinnersOnVideoPlaying.context(this));_V_.addListener(this.video,"timeupdate",this.spinnersOnVideoTimeUpdate.context(this));}
this.spinners.push(element);},{showSpinners:function(){this.each(this.spinners,function(spinner){spinner.style.display="block";});clearInterval(this.spinnerInterval);this.spinnerInterval=setInterval(this.rotateSpinners.context(this),100);},hideSpinners:function(){this.each(this.spinners,function(spinner){spinner.style.display="none";});clearInterval(this.spinnerInterval);},spinnersRotated:0,rotateSpinners:function(){this.each(this.spinners,function(spinner){spinner.style.WebkitTransform='scale(0.5) rotate('+this.spinnersRotated+'deg)';spinner.style.MozTransform='scale(0.5) rotate('+this.spinnersRotated+'deg)';});if(this.spinnersRotated==360){this.spinnersRotated=0;}
this.spinnersRotated+=45;},spinnersOnVideoLoadedData:function(event){this.hideSpinners();},spinnersOnVideoLoadStart:function(event){this.showSpinners();},spinnersOnVideoSeeking:function(event){},spinnersOnVideoSeeked:function(event){},spinnersOnVideoCanPlay:function(event){},spinnersOnVideoCanPlayThrough:function(event){this.hideSpinners();},spinnersOnVideoWaiting:function(event){this.showSpinners();},spinnersOnVideoStalled:function(event){},spinnersOnVideoSuspend:function(event){},spinnersOnVideoPlaying:function(event){this.hideSpinners();},spinnersOnVideoTimeUpdate:function(event){if(this.spinner.style.display=="block"){this.hideSpinners();}}});VideoJS.player.newBehavior("subtitlesDisplay",function(element){if(!this.subtitleDisplays){this.subtitleDisplays=[];this.onCurrentTimeUpdate(this.subtitleDisplaysOnVideoTimeUpdate);this.onEnded(function(){this.lastSubtitleIndex=0;}.context(this));}
this.subtitleDisplays.push(element);},{subtitleDisplaysOnVideoTimeUpdate:function(time){if(this.subtitles){if(!this.currentSubtitle||this.currentSubtitle.start>=time||this.currentSubtitle.end<time){var newSubIndex=false,reverse=(this.subtitles[this.lastSubtitleIndex].start>time),i=this.lastSubtitleIndex-(reverse)?1:0;while(true){if(reverse){if(i<0||this.subtitles[i].end<time){break;}
if(this.subtitles[i].start<time){newSubIndex=i;break;}
i--;}else{if(i>=this.subtitles.length||this.subtitles[i].start>time){break;}
if(this.subtitles[i].end>time){newSubIndex=i;break;}
i++;}}
if(newSubIndex!==false){this.currentSubtitle=this.subtitles[newSubIndex];this.lastSubtitleIndex=newSubIndex;this.updateSubtitleDisplays(this.currentSubtitle.text);}else if(this.currentSubtitle){this.currentSubtitle=false;this.updateSubtitleDisplays("");}}}},updateSubtitleDisplays:function(val){this.each(this.subtitleDisplays,function(disp){disp.innerHTML=val;});}});VideoJS.extend({addClass:function(element,classToAdd){if((" "+element.className+" ").indexOf(" "+classToAdd+" ")==-1){element.className=element.className===""?classToAdd:element.className+" "+classToAdd;}},removeClass:function(element,classToRemove){if(element.className.indexOf(classToRemove)==-1){return;}
var classNames=element.className.split(/\s+/);classNames.splice(classNames.lastIndexOf(classToRemove),1);element.className=classNames.join(" ");},createElement:function(tagName,attributes){return this.merge(document.createElement(tagName),attributes);},blockTextSelection:function(){document.body.focus();document.onselectstart=function(){return false;};},unblockTextSelection:function(){document.onselectstart=function(){return true;};},formatTime:function(secs){var seconds=Math.round(secs);var minutes=Math.floor(seconds/60);minutes=(minutes>=10)?minutes:"0"+minutes;seconds=Math.floor(seconds%60);seconds=(seconds>=10)?seconds:"0"+seconds;return minutes+":"+seconds;},getRelativePosition:function(x,relativeElement){return Math.max(0,Math.min(1,(x-this.findPosX(relativeElement))/relativeElement.offsetWidth));},findPosX:function(obj){var curleft=obj.offsetLeft;while(obj=obj.offsetParent){curleft+=obj.offsetLeft;}
return curleft;},getComputedStyleValue:function(element,style){return window.getComputedStyle(element,null).getPropertyValue(style);},round:function(num,dec){if(!dec){dec=0;}
return Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);},addListener:function(element,type,handler){if(element.addEventListener){element.addEventListener(type,handler,false);}else if(element.attachEvent){element.attachEvent("on"+type,handler);}},removeListener:function(element,type,handler){if(element.removeEventListener){element.removeEventListener(type,handler,false);}else if(element.attachEvent){element.detachEvent("on"+type,handler);}},get:function(url,onSuccess){if(typeof XMLHttpRequest=="undefined"){XMLHttpRequest=function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0");}catch(e){}
try{return new ActiveXObject("Msxml2.XMLHTTP.3.0");}catch(f){}
try{return new ActiveXObject("Msxml2.XMLHTTP");}catch(g){}
throw new Error("This browser does not support XMLHttpRequest.");};}
var request=new XMLHttpRequest();request.open("GET",url);request.onreadystatechange=function(){if(request.readyState==4&&request.status==200){onSuccess(request.responseText);}}.context(this);request.send();},trim:function(string){return string.toString().replace(/^\s+/,"").replace(/\s+$/,"");},bindDOMReady:function(){if(document.readyState==="complete"){return VideoJS.onDOMReady();}
if(document.addEventListener){document.addEventListener("DOMContentLoaded",VideoJS.DOMContentLoaded,false);window.addEventListener("load",VideoJS.onDOMReady,false);}else if(document.attachEvent){document.attachEvent("onreadystatechange",VideoJS.DOMContentLoaded);window.attachEvent("onload",VideoJS.onDOMReady);}},DOMContentLoaded:function(){if(document.addEventListener){document.removeEventListener("DOMContentLoaded",VideoJS.DOMContentLoaded,false);VideoJS.onDOMReady();}else if(document.attachEvent){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",VideoJS.DOMContentLoaded);VideoJS.onDOMReady();}}},DOMReadyList:[],addToDOMReady:function(fn){if(VideoJS.DOMIsReady){fn.call(document);}else{VideoJS.DOMReadyList.push(fn);}},DOMIsReady:false,onDOMReady:function(){if(VideoJS.DOMIsReady){return;}
if(!document.body){return setTimeout(VideoJS.onDOMReady,13);}
VideoJS.DOMIsReady=true;if(VideoJS.DOMReadyList){for(var i=0;i<VideoJS.DOMReadyList.length;i++){VideoJS.DOMReadyList[i].call(document);}
VideoJS.DOMReadyList=null;}}});VideoJS.bindDOMReady();Function.prototype.context=function(obj){var method=this,temp=function(){return method.apply(obj,arguments);};return temp;};Function.prototype.evtContext=function(obj){var method=this,temp=function(){var origContext=this;return method.call(obj,arguments[0],origContext);};return temp;};Function.prototype.rEvtContext=function(obj,funcParent){if(this.hasContext===true){return this;}
if(!funcParent){funcParent=obj;}
for(var attrname in funcParent){if(funcParent[attrname]==this){funcParent[attrname]=this.evtContext(obj);funcParent[attrname].hasContext=true;return funcParent[attrname];}}
return this.evtContext(obj);};if(window.jQuery){(function($){$.fn.VideoJS=function(options){this.each(function(){VideoJS.setup(this,options);});return this;};$.fn.player=function(){return this[0].player;};})(jQuery);}
window.VideoJS=window._V_=VideoJS;})(window);
;(function($){$.alerts={verticalOffset:-75,horizontalOffset:0,repositionOnResize:true,overlayOpacity:.5,overlayColor:'#FFF',draggable:true,okButton:'&nbsp;OK&nbsp;',cancelButton:'&nbsp;Cancel&nbsp;',dialogClass:null,alert:function(message,title,callback){if(title==null)title='Alert';$.alerts._show(title,message,null,'alert',function(result){if(callback)callback(result);});},notify:function(message,title,time){if(title==null)title='Information';if(time==null)time=1500;$.alerts._show(title,message,time,'notify');},confirm:function(message,title,callback){if(title==null)title='Confirm';$.alerts._show(title,message,null,'confirm',function(result){if(callback)callback(result);});},prompt:function(message,value,title,callback){if(title==null)title='Prompt';$.alerts._show(title,message,value,'prompt',function(result){if(callback)callback(result);});},_show:function(title,msg,value,type,callback){$.alerts._hide();$.alerts._overlay('show');$("BODY").append('<div id="popup_container">'+'<h1 id="popup_title"></h1>'+'<div id="popup_content">'+'<div id="popup_message"></div>'+'</div>'+'</div>');if($.alerts.dialogClass)$("#popup_container").addClass($.alerts.dialogClass);var pos=($.browser.msie&&parseInt($.browser.version)<=6)?'absolute':'fixed';$("#popup_container").css({position:pos,zIndex:99999,padding:0,margin:0});$("#popup_title").text(title);$("#popup_content").addClass(type);$("#popup_message").text(msg);$("#popup_message").html($("#popup_message").text().replace(/\n/g,'<br />'));$("#popup_container").css({minWidth:$("#popup_container").outerWidth(),maxWidth:$("#popup_container").outerWidth()});$.alerts._reposition();$.alerts._maintainPosition(true);switch(type){case'alert':$("#popup_message").after('<div id="popup_panel"><input type="button" value="'+$.alerts.okButton+'" id="popup_ok" /></div>');$("#popup_ok").click(function(){$.alerts._hide();callback(true);});$("#popup_ok").focus().keypress(function(e){if(e.keyCode==13||e.keyCode==27)$("#popup_ok").trigger('click');});break;case'notify':setTimeout('$.alerts._hide()',value);break;case'confirm':$("#popup_message").after('<div id="popup_panel"><input type="button" value="'+$.alerts.okButton+'" id="popup_ok" /> <input type="button" value="'+$.alerts.cancelButton+'" id="popup_cancel" /></div>');$("#popup_ok").click(function(){$.alerts._hide();if(callback)callback(true);});$("#popup_cancel").click(function(){$.alerts._hide();if(callback)callback(false);});$("#popup_ok").focus();$("#popup_ok, #popup_cancel").keypress(function(e){if(e.keyCode==13)$("#popup_ok").trigger('click');if(e.keyCode==27)$("#popup_cancel").trigger('click');});break;case'prompt':$("#popup_message").append('<br /><input type="text" size="30" id="popup_prompt" />').after('<div id="popup_panel"><input type="button" value="'+$.alerts.okButton+'" id="popup_ok" /> <input type="button" value="'+$.alerts.cancelButton+'" id="popup_cancel" /></div>');$("#popup_prompt").width($("#popup_message").width());$("#popup_ok").click(function(){var val=$("#popup_prompt").val();$.alerts._hide();if(callback)callback(val);});$("#popup_cancel").click(function(){$.alerts._hide();if(callback)callback(null);});$("#popup_prompt, #popup_ok, #popup_cancel").keypress(function(e){if(e.keyCode==13)$("#popup_ok").trigger('click');if(e.keyCode==27)$("#popup_cancel").trigger('click');});if(value)$("#popup_prompt").val(value);$("#popup_prompt").focus().select();break;}
if($.alerts.draggable){try{$("#popup_container").draggable({handle:$("#popup_title")});$("#popup_title").css({cursor:'move'});}catch(e){}}},_hide:function(){$("#popup_container").remove();$.alerts._overlay('hide');$.alerts._maintainPosition(false);},_overlay:function(status){switch(status){case'show':$.alerts._overlay('hide');$("BODY").append('<div id="popup_overlay"></div>');$("#popup_overlay").css({position:'absolute',zIndex:99998,top:'0px',left:'0px',width:'100%',height:$(document).height(),background:$.alerts.overlayColor,opacity:$.alerts.overlayOpacity});break;case'hide':$("#popup_overlay").remove();break;}},_reposition:function(){var top=(($(window).height()/2)-($("#popup_container").outerHeight()/2))+$.alerts.verticalOffset;var left=(($(window).width()/2)-($("#popup_container").outerWidth()/2))+$.alerts.horizontalOffset;if(top<0)top=0;if(left<0)left=0;if($.browser.msie&&parseInt($.browser.version)<=6)top=top+$(window).scrollTop();$("#popup_container").css({top:top+'px',left:left+'px'});$("#popup_overlay").height($(document).height());},_maintainPosition:function(status){if($.alerts.repositionOnResize){switch(status){case true:$(window).bind('resize',$.alerts._reposition);break;case false:$(window).unbind('resize',$.alerts._reposition);break;}}}};jAlert=function(message,title,callback){$.alerts.alert(message,title,callback);};jConfirm=function(message,title,callback){$.alerts.confirm(message,title,callback);};jPrompt=function(message,value,title,callback){$.alerts.prompt(message,value,title,callback);};jNotify=function(message,title,time){$.alerts.notify(message,time,title);};})(jQuery);
;(function($){$.extend({metadata:{defaults:{type:'class',name:'metadata',cre:/({.*})/,single:'metadata'},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length)settings.single='metadata';var data=$.data(elem,settings.single);if(data)return data;data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m)
data=m[1];}else if(settings.type=="elem"){if(!elem.getElementsByTagName)
return undefined;var e=elem.getElementsByTagName(settings.name);if(e.length)
data=$.trim(e[0].innerHTML);}else if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr)
data=attr;}
if(data.indexOf('{')<0)
data="{"+data+"}";data=eval("("+data+")");$.data(elem,settings.single,data);return data;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);
;(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}
var validator=$.data(this[0],'validator');if(validator){return validator;}
validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this;});}
this.submit(function(event){if(validator.settings.debug)
event.preventDefault();function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);}
validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove();}
return false;}
return true;}
if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}
if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}
return handle();}else{validator.focusInvalid();return false;}});}
return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=true;var validator=$(this[0].form).validate();this.each(function(){valid&=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,'validator').settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages)
settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}
var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}
var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}
return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(""+a.value);},filled:function(a){return!!$.trim(""+a.value);},unchecked:function(a){return!a.checked;}});$.validator=function(options,form){this.settings=$.extend(true,{},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length==1)
return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};if(arguments.length>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1);}
if(params.constructor!=Array){params=[params];}
$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);this.addWrapper(this.errorsFor(element)).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)
this.element(element);else if(element.parentNode.name in this.submitted)
this.element(element.parentNode);},highlight:function(element,errorClass,validClass){if(element.type==='radio'){this.findByName(element.name).addClass(errorClass).removeClass(validClass);}else{$(element).addClass(errorClass).removeClass(validClass);}},unhighlight:function(element,errorClass,validClass){if(element.type==='radio'){this.findByName(element.name).removeClass(errorClass).addClass(validClass);}else{$(element).removeClass(errorClass).addClass(validClass);}}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator"),eventType="on"+event.type.replace(/^validate/,"");validator.settings[eventType]&&validator.settings[eventType].call(validator,this[0]);}
$(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",delegate).validateDelegate(":radio, :checkbox, select, option","click",delegate);if(this.settings.invalidHandler)
$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())
$(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}
return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}
if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}
this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}
this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}
this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm)
$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)
count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin");}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))
return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name).not(this.settings.ignore)[0];}
var rules=$(element).rules();var dependencyMismatch=false;for(var method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}
dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}
if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id
+", check the '"+rule.method+"' method",e);throw e;}}
if(dependencyMismatch)
return;if(this.objectLength(rules))
this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata)
return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined)
return arguments[i];}
return undefined;},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;if(typeof message=="function"){message=message.call(this,rule.parameters,element);}else if(theregex.test(message)){message=jQuery.format(message.replace(theregex,'{$1}'),rule.parameters);}
this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)
toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);this.showLabel(error.element,error.message);}
if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}
if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}
if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}}
this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}
if(!this.labelContainer.append(label).length)
this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);}
if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}
this.toShow=this.toShow.add(label);},errorsFor:function(element){var name=this.idOrName(element);return this.errors().filter(function(){return $(this).attr('for')==name;});},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return /radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))
return this.findByName(element.name).filter(':checked').length;}
return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)
this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();this.formSubmitted=false;}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false;}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(var method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}}
if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}
return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}
return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}
if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}
if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}
if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}
if(rules.messages){delete rules.messages;}
return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}
return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!=undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))
return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var val=$(element).val();return val&&val.length>0;case'input':if(this.checkable(element))
return this.getLength(value,element)>0;default:return $.trim(value).length>0;}},remote:function(value,element,param){if(this.optional(element))
return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])
this.settings.messages[element.name]={};previous.originalMessage=this.settings.messages[element.name].remote;this.settings.messages[element.name].remote=previous.message;param=typeof param=="string"&&{url:param}||param;if(this.pending[element.name]){return"pending";}
if(previous.old===value){return previous.valid;}
previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}else{var errors={};var message=response||validator.defaultMessage(element,"remote");errors[element.name]=previous.message=$.isFunction(message)?message(value):message;validator.showErrors(errors);}
previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param;},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))
return"dependency-mismatch";if(/[^0-9-]+/.test(value))
return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)
nDigit-=9;}
nCheck+=nDigit;bEven=!bEven;}
return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,'|'):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){var target=$(param).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid();});return value==target.val();}}});$.format=$.validator.format;})(jQuery);;(function($){var pendingRequests={};if($.ajaxPrefilter){$.ajaxPrefilter(function(settings,_,xhr){var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}
pendingRequests[port]=xhr;}});}else{var ajax=$.ajax;$.ajax=function(settings){var mode=("mode"in settings?settings:$.ajaxSettings).mode,port=("port"in settings?settings:$.ajaxSettings).port;if(mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}
return(pendingRequests[port]=ajax.apply(this,arguments));}
return ajax.apply(this,arguments);};}})(jQuery);;(function($){if(!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){this.addEventListener(original,handler,true);},teardown:function(){this.removeEventListener(original,handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};function handler(e){e=$.event.fix(e);e.type=fix;return $.event.handle.call(this,e);}});};$.extend($.fn,{validateDelegate:function(delegate,type,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});}});})(jQuery);
;(function(){function stripHtml(value){return value.replace(/<.[^<>]*?>/g,' ').replace(/&nbsp;|&#160;/gi,' ').replace(/[0-9.(),;:!?%#$'"_+=\/-]*/g,'');}
jQuery.validator.addMethod("maxWords",function(value,element,params){return this.optional(element)||stripHtml(value).match(/\b\w+\b/g).length<params;},jQuery.validator.format("Please enter {0} words or less."));jQuery.validator.addMethod("minWords",function(value,element,params){return this.optional(element)||stripHtml(value).match(/\b\w+\b/g).length>=params;},jQuery.validator.format("Please enter at least {0} words."));jQuery.validator.addMethod("rangeWords",function(value,element,params){return this.optional(element)||stripHtml(value).match(/\b\w+\b/g).length>=params[0]&&value.match(/bw+b/g).length<params[1];},jQuery.validator.format("Please enter between {0} and {1} words."));})();jQuery.validator.addMethod("letterswithbasicpunc",function(value,element){return this.optional(element)||/^[a-z-.,()'\"\s]+$/i.test(value);},"Letters or punctuation only please");jQuery.validator.addMethod("alphanumeric",function(value,element){return this.optional(element)||/^\w+$/i.test(value);},"Letters, numbers, spaces or underscores only please");jQuery.validator.addMethod("lettersonly",function(value,element){return this.optional(element)||/^[a-z]+$/i.test(value);},"Letters only please");jQuery.validator.addMethod("nowhitespace",function(value,element){return this.optional(element)||/^\S+$/i.test(value);},"No white space please");jQuery.validator.addMethod("ziprange",function(value,element){return this.optional(element)||/^90[2-5]\d\{2}-\d{4}$/.test(value);},"Your ZIP-code must be in the range 902xx-xxxx to 905-xx-xxxx");jQuery.validator.addMethod("integer",function(value,element){return this.optional(element)||/^-?\d+$/.test(value);},"A positive or negative non-decimal number please");jQuery.validator.addMethod("vinUS",function(v){if(v.length!=17)
return false;var i,n,d,f,cd,cdv;var LL=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"];var VL=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9];var FL=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2];var rs=0;for(i=0;i<17;i++){f=FL[i];d=v.slice(i,i+1);if(i==8){cdv=d;}
if(!isNaN(d)){d*=f;}
else{for(n=0;n<LL.length;n++){if(d.toUpperCase()===LL[n]){d=VL[n];d*=f;if(isNaN(cdv)&&n==8){cdv=LL[n];}
break;}}}
rs+=d;}
cd=rs%11;if(cd==10){cd="X";}
if(cd==cdv){return true;}
return false;},"The specified vehicle identification number (VIN) is invalid.");jQuery.validator.addMethod("dateITA",function(value,element){var check=false;var re=/^\d{1,2}\/\d{1,2}\/\d{4}$/;if(re.test(value)){var adata=value.split('/');var gg=parseInt(adata[0],10);var mm=parseInt(adata[1],10);var aaaa=parseInt(adata[2],10);var xdata=new Date(aaaa,mm-1,gg);if((xdata.getFullYear()==aaaa)&&(xdata.getMonth()==mm-1)&&(xdata.getDate()==gg))
check=true;else
check=false;}else
check=false;return this.optional(element)||check;},"Please enter a correct date");jQuery.validator.addMethod("dateNL",function(value,element){return this.optional(element)||/^\d\d?[\.\/-]\d\d?[\.\/-]\d\d\d?\d?$/.test(value);},"Vul hier een geldige datum in.");jQuery.validator.addMethod("time",function(value,element){return this.optional(element)||/^([01][0-9])|(2[0123]):([0-5])([0-9])$/.test(value);},"Please enter a valid time, between 00:00 and 23:59");jQuery.validator.addMethod("phoneUS",function(phone_number,element){phone_number=phone_number.replace(/\s+/g,"");return this.optional(element)||phone_number.length>9&&phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);},"Please specify a valid phone number");jQuery.validator.addMethod('phoneUK',function(phone_number,element){return this.optional(element)||phone_number.length>9&&phone_number.match(/^(\(?(0|\+44)[1-9]{1}\d{1,4}?\)?\s?\d{3,4}\s?\d{3,4})$/);},'Please specify a valid phone number');jQuery.validator.addMethod('mobileUK',function(phone_number,element){return this.optional(element)||phone_number.length>9&&phone_number.match(/^((0|\+44)7(5|6|7|8|9){1}\d{2}\s?\d{6})$/);},'Please specify a valid mobile number');jQuery.validator.addMethod("strippedminlength",function(value,element,param){return jQuery(value).text().length>=param;},jQuery.validator.format("Please enter at least {0} characters"));jQuery.validator.addMethod("email2",function(value,element,param){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},jQuery.validator.messages.email);jQuery.validator.addMethod("url2",function(value,element,param){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},jQuery.validator.messages.url);jQuery.validator.addMethod("creditcardtypes",function(value,element,param){if(/[^0-9-]+/.test(value))
return false;value=value.replace(/\D/g,"");var validTypes=0x0000;if(param.mastercard)
validTypes|=0x0001;if(param.visa)
validTypes|=0x0002;if(param.amex)
validTypes|=0x0004;if(param.dinersclub)
validTypes|=0x0008;if(param.enroute)
validTypes|=0x0010;if(param.discover)
validTypes|=0x0020;if(param.jcb)
validTypes|=0x0040;if(param.unknown)
validTypes|=0x0080;if(param.all)
validTypes=0x0001|0x0002|0x0004|0x0008|0x0010|0x0020|0x0040|0x0080;if(validTypes&0x0001&&/^(51|52|53|54|55)/.test(value)){return value.length==16;}
if(validTypes&0x0002&&/^(4)/.test(value)){return value.length==16;}
if(validTypes&0x0004&&/^(34|37)/.test(value)){return value.length==15;}
if(validTypes&0x0008&&/^(300|301|302|303|304|305|36|38)/.test(value)){return value.length==14;}
if(validTypes&0x0010&&/^(2014|2149)/.test(value)){return value.length==15;}
if(validTypes&0x0020&&/^(6011)/.test(value)){return value.length==16;}
if(validTypes&0x0040&&/^(3)/.test(value)){return value.length==16;}
if(validTypes&0x0040&&/^(2131|1800)/.test(value)){return value.length==15;}
if(validTypes&0x0080){return true;}
return false;},"Please enter a valid credit card number.");jQuery.validator.addMethod("ipv4",function(value,element,param){return this.optional(element)||/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i.test(value);},"Please enter a valid IP v4 address.");jQuery.validator.addMethod("ipv6",function(value,element,param){return this.optional(element)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(value);},"Please enter a valid IP v6 address.");
;jQuery.validator.addMethod("startWith",function(value,element,params)
{var regexp=new RegExp('^'+params[0]);return this.optional(element)||regexp.test(value);},jQuery.validator.format("Please start your value with {0}."));jQuery.validator.addMethod("europeanVAT",function(value,element)
{if(this.optional(element))
{return"dependency-mismatch";}
var previous=this.previousValue(element);if(!this.settings.messages[element.name])
{this.settings.messages[element.name]={};}
previous.originalMessage=this.settings.messages[element.name].europeanVAT;this.settings.messages[element.name].europeanVAT=previous.message;if(previous.old!==value)
{var country=value.substring(0,2);var numbers=value.substring(2);previous.old=value;var validator=this;this.startRequest(element);var url='http://isvat.appspot.com/'+country+'/'+numbers+'/?callback=?';$.getJSON(url,function(response)
{var valid=response=="true";if(valid)
{var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}
else
{var errors={};var message=(previous.message=response||validator.defaultMessage(element,"europeanVAT"));errors[element.name]=$.isFunction(message)?message(value):message;validator.showErrors(errors);}
previous.valid=valid;validator.stopRequest(element,valid);});return"pending";}
else if(this.pending[element.name])
{return"pending";}
return previous.valid;});
;String.prototype.isValidMail=function()
{var r=new RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?","i");return r.test(this);};String.prototype.reverse=function()
{return this.split("").reverse().join("");};String.prototype.isValidUrl=function()
{return /^(ht|f)tp(s)?:\/\/((\d+\.\d+\.\d+\.\d+)|(([\w-]+\.)+([a-z,A-Z][\w-]*)))(:[1-9][0-9]*)?(\/([\w-.\/:%+@&=]+[\w- .\/?:%+@&=]*)?)?(#(.*))?$/i.test(this);};String.prototype.utf8Encode=function()
{var string=this.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++)
{var c=string.charCodeAt(n);if(c<128)
{utftext+=String.fromCharCode(c);}
else if((c>127)&&(c<2048))
{utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}
else
{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}
return utftext;};String.prototype.utf8Decode=function()
{var string="";var i=0;var c=c1=c2=0;while(i<this.length)
{c=this.charCodeAt(i);if(c<128)
{string+=String.fromCharCode(c);i++;}
else if((c>191)&&(c<224))
{c2=this.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}
else
{c2=this.charCodeAt(i+1);c3=this.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}
return string;};function notify(txt,title,time)
{try
{jNotify(txt,title,time);}
catch(e)
{oAlert(txt);}};var oAlert=alert;function alert(txt,title,func)
{try
{jAlert(txt,title,func);}
catch(e)
{oAlert(txt);}};var oConfirm=confirm;function confirm(txt,title,func)
{try
{jConfirm(txt,title,func);}
catch(e)
{if(oConfirm(txt,title))func();}};var oPrompt=prompt;function prompt(txt,input,title,func)
{try
{jPrompt(txt,input,title,func);}
catch(e)
{func(prompt(txt,input,title));}};Array.prototype.in_array=function(p_val)
{var array=this;for(var i=0;i<array.length;i++)
{if(array[i]==p_val)
{return i;}}
return-1;};Array.prototype.unique=function()
{var r=new Array();var array=this;o:for(var i=0,n=array.length;i<n;i++)
{for(var x=0,y=r.length;x<y;x++)
{if(r[x]==array[i])
{continue o;}}
r[r.length]=array[i];}
return r;};Array.prototype.remove=function(data)
{var array=this;for(var i=0;i<array.length;i++)
{if(array[i]==data)
{array=array.splice(i,1);break;}}};var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(input)
{var output="";var chr1,chr2,chr3,enc1,enc2,enc3,enc4;var i=0;input=Base64._utf8_encode(input);while(i<input.length)
{chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2))
{enc3=enc4=64;}
else if(isNaN(chr3))
{enc4=64;}
output=output+
this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+
this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4);}
return output;},decode:function(input)
{var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i<input.length)
{enc1=this._keyStr.indexOf(input.charAt(i++));enc2=this._keyStr.indexOf(input.charAt(i++));enc3=this._keyStr.indexOf(input.charAt(i++));enc4=this._keyStr.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64)
{output=output+String.fromCharCode(chr2);}
if(enc4!=64)
{output=output+String.fromCharCode(chr3);}}
output=Base64._utf8_decode(output);return output;},_utf8_encode:function(string)
{string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++)
{var c=string.charCodeAt(n);if(c<128)
{utftext+=String.fromCharCode(c);}
else if((c>127)&&(c<2048))
{utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}
else
{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}
return utftext;},_utf8_decode:function(utftext)
{var string="";var i=0;var c=c1=c2=0;while(i<utftext.length)
{c=utftext.charCodeAt(i);if(c<128)
{string+=String.fromCharCode(c);i++;}
else if((c>191)&&(c<224))
{c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}
else
{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}
return string;}};var makeUrlFriendly=function(str)
{str=str.split('');strOut=[];var accents='ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';var accentsOut=['A','A','A','A','A','A','a','a','a','a','a','a','O','O','O','O','O','O','O','o','o','o','o','o','o','E','E','E','E','e','e','e','e','e','C','c','D','I','I','I','I','i','i','i','i','U','U','U','U','u','u','u','u','N','n','S','s','Y','y','y','Z','z'];for(var y=0;y<str.length;y++)
{if(accents.indexOf(str[y])!=-1)
{strOut[y]=accentsOut[accents.indexOf(str[y])];}
else
{strOut[y]=str[y];}}
return strOut.join('').replace(/ /g,'-').replace(/'/g,'-').replace(/[@#&"(§!)*`%+\?\/:;.,]/g,'').replace(/[$]/g,'dollar').replace(/\€/g,'euro').replace(/-{2}/g,'-').replace(/-$/g,'');};if(!('console'in window)||!('log'in window.console))
{window.console={log:function(){}};}
var centerOverlay=function(overlay)
{var offset=50;var padding=15;overlay.css({width:'auto',height:'auto',maxWidth:$('body').width(),maxHeight:$(window).height()-offset,top:15});var wrap=overlay.find(".contentWrap");if(wrap!=undefined)
{wrap.css({maxHeight:$(window).height()-offset-(padding*2)});}
setTimeout(function()
{overlay.css({left:($('body').width()/2)-(overlay.width()/2)});},200);};
;var initFormFieldForm=function()
{$('#valueType').change(function()
{var show=($(this).val()=='list'||$(this).val()=='states'||$(this).val()=='products')?'show':'hide';$('#multipleChoice').parents('p').eq(0)[show]();$('#isSortable').parents('p').eq(0)[show]();$('.valueList').parents('p')[show]();}).trigger('change');};var setEnabled=function(clas,field,value)
{field.find('.'+clas).eq(0)[value?'show':'hide']();};var enableDisableUpForFirstDownForLast=function(table)
{setEnabled('up',$(table).children('tr:first'),false);setEnabled('down',$(table).children('tr:first'),true);setEnabled('up',$(table).children('tr:last'),true);setEnabled('down',$(table).children('tr:last'),false);};var initFormForm=function()
{$('#form_edit_form_fields .up, #form_edit_form_fields .down').click(function(e)
{e.preventDefault();var direction=$(this).hasClass('up')?'up':'down';var me=$(this).parents('tr').eq(0);var theOther=me[direction=='up'?'prev':'next']('tr').eq(0);theOther[direction=='up'?'before':'after'](me);var myPriority=me.find('.positionField').val();var theOtherPriority=theOther.find('.positionField').val();me.find('.positionField').val(theOtherPriority);theOther.find('.positionField').val(myPriority);setEnabled('up',me,true);setEnabled('down',me,true);setEnabled('up',theOther,true);setEnabled('down',theOther,true);__hasLocalChanges=true;enableDisableUpForFirstDownForLast('#form_edit_form_fields tbody');});enableDisableUpForFirstDownForLast('#form_edit_form_fields tbody');};$().ready(function()
{if($('form#form_field_edit_form').length==1)
{initFormFieldForm();}
if($('form#form_edit_form').length==1)
{initFormForm();}
$('form.pdw_form').validate();});
;;(function($){var msOldDiv="";var dd=function(element,options)
{var sElement=element;var $this=this;var options=$.extend({height:120,visibleRows:7,rowHeight:23,showIcon:true,zIndex:9999,mainCSS:'dd',useSprite:false,onInit:'',style:''},options);this.ddProp=new Object();var selectedValue="";var actionSettings={};actionSettings.insideWindow=true;actionSettings.keyboardAction=false;actionSettings.currentKey=null;var ddList=false;var config={postElementHolder:'_msddHolder',postID:'_msdd',postTitleID:'_title',postTitleTextID:'_titletext',postChildID:'_child',postAID:'_msa',postOPTAID:'_msopta',postInputID:'_msinput',postArrowID:'_arrow',postInputhidden:'_inp'};var styles={dd:options.mainCSS,ddTitle:'ddTitle',arrow:'arrow',ddChild:'ddChild',ddTitleText:'ddTitleText',disabled:.30,ddOutOfVision:'ddOutOfVision'};var attributes={actions:"focus,blur,change,click,dblclick,mousedown,mouseup,mouseover,mousemove,mouseout,keypress,keydown,keyup",prop:"size,multiple,disabled,tabindex"};this.onActions=new Object();var elementid=$(sElement).attr("id");var inlineCSS=$(sElement).attr("style");options.style+=(inlineCSS==undefined)?"":inlineCSS;var allOptions=$(sElement).children();ddList=($(sElement).attr("size")>0||$(sElement).attr("multiple")==true)?true:false;if(ddList){options.visibleRows=$(sElement).attr("size");};var a_array={};var getPostID=function(id){return elementid+config[id];};var getOptionsProperties=function(option){var currentOption=option;var styles=$(currentOption).attr("style");return styles;};var matchIndex=function(index){var selectedIndex=$("#"+elementid+" option:selected");if(selectedIndex.length>1){for(var i=0;i<selectedIndex.length;i++){if(index==selectedIndex[i].index){return true;};};}else if(selectedIndex.length==1){if(selectedIndex[0].index==index){return true;};};return false;};var createA=function(currentOptOption,current,currentopt,tp){var aTag="";var aidoptfix=(tp=="opt")?getPostID("postOPTAID"):getPostID("postAID");var aid=(tp=="opt")?aidoptfix+"_"+(current)+"_"+(currentopt):aidoptfix+"_"+(current);var arrow="";var clsName="";if(options.useSprite!=false){clsName=' '+options.useSprite+' '+currentOptOption.className;}else{arrow=$(currentOptOption).attr("title");arrow=(arrow.length==0)?"":'<img src="'+arrow+'" align="absmiddle" /> ';};var sText=$(currentOptOption).text();var sValue=$(currentOptOption).val();var sEnabledClass=($(currentOptOption).attr("disabled")==true)?"disabled":"enabled";a_array[aid]={html:arrow+sText,value:sValue,text:sText,index:currentOptOption.index,id:aid};var innerStyle=getOptionsProperties(currentOptOption);if(matchIndex(currentOptOption.index)==true){aTag+='<a href="javascript:void(0);" class="selected '+sEnabledClass+clsName+'"';}else{aTag+='<a  href="javascript:void(0);" class="'+sEnabledClass+clsName+'"';};if(innerStyle!==false&&innerStyle!==undefined){aTag+=" style='"+innerStyle+"'";};aTag+=' id="'+aid+'">';aTag+=arrow+'<span class="'+styles.ddTitleText+'">'+sText+'</span></a>';return aTag;};var createATags=function(){var childnodes=allOptions;if(childnodes.length==0)return"";var aTag="";var aidfix=getPostID("postAID");var aidoptfix=getPostID("postOPTAID");childnodes.each(function(current){var currentOption=childnodes[current];if(currentOption.nodeName=="OPTGROUP"){aTag+="<div class='opta'>";aTag+="<span style='font-weight:bold;font-style:italic; clear:both;'>"+$(currentOption).attr("label")+"</span>";var optChild=$(currentOption).children();optChild.each(function(currentopt){var currentOptOption=optChild[currentopt];aTag+=createA(currentOptOption,current,currentopt,"opt");});aTag+="</div>";}else{aTag+=createA(currentOption,current,"","");};});return aTag;};var createChildDiv=function(){var id=getPostID("postID");var childid=getPostID("postChildID");var sStyle=options.style;sDiv="";sDiv+='<div id="'+childid+'" class="'+styles.ddChild+'"';if(!ddList){sDiv+=(sStyle!="")?' style="'+sStyle+'"':'';}else{sDiv+=(sStyle!="")?' style="border-top:1px solid #c3c3c3;display:block;position:relative;'+sStyle+'"':'';}
sDiv+='>';return sDiv;};var createTitleDiv=function(){var titleid=getPostID("postTitleID");var arrowid=getPostID("postArrowID");var titletextid=getPostID("postTitleTextID");var inputhidden=getPostID("postInputhidden");var sText="";var arrow="";if(document.getElementById(elementid).options.length>0){sText=$("#"+elementid+" option:selected").text();arrow=$("#"+elementid+" option:selected").attr("title");};arrow=(arrow.length==0||arrow==undefined||options.showIcon==false||options.useSprite!=false)?"":'<img src="'+arrow+'" align="absmiddle" /> ';var sDiv='<div id="'+titleid+'" class="'+styles.ddTitle+'"';sDiv+='>';sDiv+='<span id="'+arrowid+'" class="'+styles.arrow+'"></span><span class="'+styles.ddTitleText+'" id="'+titletextid+'">'+arrow+'<span class="'+styles.ddTitleText+'">'+sText+'</span></span></div>';return sDiv;};var applyEventsOnA=function(){var childid=getPostID("postChildID");$("#"+childid+" a.enabled").bind("click",function(event){event.preventDefault();manageSelection(this);if(!ddList){$("#"+childid).unbind("mouseover");setInsideWindow(false);var sText=(options.showIcon==false)?$(this).text():$(this).html();setTitleText(sText);$this.close();};setValue();});};var createDropDown=function(){var changeInsertionPoint=false;var id=getPostID("postID");var titleid=getPostID("postTitleID");var titletextid=getPostID("postTitleTextID");var childid=getPostID("postChildID");var arrowid=getPostID("postArrowID");var iWidth=$("#"+elementid).width();iWidth=iWidth+2;var sStyle=options.style;if($("#"+id).length>0){$("#"+id).remove();changeInsertionPoint=true;};var sDiv='<div id="'+id+'" class="'+styles.dd+'"';sDiv+=(sStyle!="")?' style="'+sStyle+'"':'';sDiv+='>';sDiv+=createTitleDiv();sDiv+=createChildDiv();sDiv+=createATags();sDiv+="</div>";sDiv+="</div>";if(changeInsertionPoint==true){var sid=getPostID("postElementHolder");$("#"+sid).after(sDiv);}else{$("#"+elementid).after(sDiv);};if(ddList){var titleid=getPostID("postTitleID");$("#"+titleid).hide();};$("#"+id).css("width",iWidth+"px");$("#"+childid).css("width",(iWidth-2)+"px");if(allOptions.length>options.visibleRows){var margin=parseInt($("#"+childid+" a:first").css("padding-bottom"))+parseInt($("#"+childid+" a:first").css("padding-top"));var iHeight=((options.rowHeight)*options.visibleRows)-margin;$("#"+childid).css("height",iHeight+"px");}else if(ddList){var iHeight=$("#"+elementid).height();$("#"+childid).css("height",iHeight+"px");};if(changeInsertionPoint==false){setOutOfVision();addRefreshMethods(elementid);};if($("#"+elementid).attr("disabled")==true){$("#"+id).css("opacity",styles.disabled);};applyEvents();$("#"+titleid).bind("mouseover",function(event){hightlightArrow(1);});$("#"+titleid).bind("mouseout",function(event){hightlightArrow(0);});applyEventsOnA();$("#"+childid+" a.disabled").css("opacity",styles.disabled);if(ddList){$("#"+childid).bind("mouseover",function(event){if(!actionSettings.keyboardAction){actionSettings.keyboardAction=true;$(document).bind("keydown",function(event){var keyCode=event.keyCode;actionSettings.currentKey=keyCode;if(keyCode==39||keyCode==40){event.preventDefault();event.stopPropagation();next();setValue();};if(keyCode==37||keyCode==38){event.preventDefault();event.stopPropagation();previous();setValue();};});}});};$("#"+childid).bind("mouseout",function(event){setInsideWindow(false);$(document).unbind("keydown");actionSettings.keyboardAction=false;actionSettings.currentKey=null;});$("#"+titleid).bind("click",function(event){setInsideWindow(false);if($("#"+childid+":visible").length==1){$("#"+childid).unbind("mouseover");}else{$("#"+childid).bind("mouseover",function(event){setInsideWindow(true);});$this.open();};});$("#"+titleid).bind("mouseout",function(evt){setInsideWindow(false);});if(options.showIcon&&options.useSprite!=false){setTitleImageSprite();};};var getByIndex=function(index){for(var i in a_array){if(a_array[i].index==index){return a_array[i];};};return-1;};var manageSelection=function(obj){var childid=getPostID("postChildID");if(!ddList){$("#"+childid+" a.selected").removeClass("selected");};var selectedA=$("#"+childid+" a.selected").attr("id");if(selectedA!=undefined){var oldIndex=(actionSettings.oldIndex==undefined||actionSettings.oldIndex==null)?a_array[selectedA].index:actionSettings.oldIndex;};if(obj&&!ddList){$(obj).addClass("selected");};if(ddList){var keyCode=actionSettings.currentKey;if($("#"+elementid).attr("multiple")==true){if(keyCode==17){actionSettings.oldIndex=a_array[$(obj).attr("id")].index;$(obj).toggleClass("selected");}else if(keyCode==16){$("#"+childid+" a.selected").removeClass("selected");$(obj).addClass("selected");var currentSelected=$(obj).attr("id");var currentIndex=a_array[currentSelected].index;for(var i=Math.min(oldIndex,currentIndex);i<=Math.max(oldIndex,currentIndex);i++){$("#"+getByIndex(i).id).addClass("selected");}}else{$("#"+childid+" a.selected").removeClass("selected");$(obj).addClass("selected");actionSettings.oldIndex=a_array[$(obj).attr("id")].index;};}else{$("#"+childid+" a.selected").removeClass("selected");$(obj).addClass("selected");actionSettings.oldIndex=a_array[$(obj).attr("id")].index;};};};var addRefreshMethods=function(id){var objid=id;document.getElementById(objid).refresh=function(e){$("#"+objid).msDropDown(options);};};var setInsideWindow=function(val){actionSettings.insideWindow=val;};var getInsideWindow=function(){return actionSettings.insideWindow;};var applyEvents=function(){var mainid=getPostID("postID");var actions_array=attributes.actions.split(",");for(var iCount=0;iCount<actions_array.length;iCount++){var action=actions_array[iCount];var actionFound=has_handler(action);if(actionFound==true){switch(action){case"focus":$("#"+mainid).bind("mouseenter",function(event){document.getElementById(elementid).focus();});break;case"click":$("#"+mainid).bind("click",function(event){$("#"+elementid).trigger("click");});break;case"dblclick":$("#"+mainid).bind("dblclick",function(event){$("#"+elementid).trigger("dblclick");});break;case"mousedown":$("#"+mainid).bind("mousedown",function(event){$("#"+elementid).trigger("mousedown");});break;case"mouseup":$("#"+mainid).bind("mouseup",function(event){$("#"+elementid).trigger("mouseup");});break;case"mouseover":$("#"+mainid).bind("mouseover",function(event){$("#"+elementid).trigger("mouseover");});break;case"mousemove":$("#"+mainid).bind("mousemove",function(event){$("#"+elementid).trigger("mousemove");});break;case"mouseout":$("#"+mainid).bind("mouseout",function(event){$("#"+elementid).trigger("mouseout");});break;};};};};var setOutOfVision=function(){var sId=getPostID("postElementHolder");$("#"+elementid).after("<div class='"+styles.ddOutOfVision+"' style='height:0px;overflow:hidden;position:absolute;' id='"+sId+"'></div>");$("#"+elementid).appendTo($("#"+sId));};var setTitleText=function(sText){var titletextid=getPostID("postTitleTextID");$("#"+titletextid).html(sText);};var next=function(){var titletextid=getPostID("postTitleTextID");var childid=getPostID("postChildID");var allAs=$("#"+childid+" a.enabled");for(var current=0;current<allAs.length;current++){var currentA=allAs[current];var id=$(currentA).attr("id");if($(currentA).hasClass("selected")&&current<allAs.length-1){$("#"+childid+" a.selected").removeClass("selected");$(allAs[current+1]).addClass("selected");var selectedA=$("#"+childid+" a.selected").attr("id");if(!ddList){var sText=(options.showIcon==false)?a_array[selectedA].text:a_array[selectedA].html;setTitleText(sText);};if(parseInt(($("#"+selectedA).position().top+$("#"+selectedA).height()))>=parseInt($("#"+childid).height())){$("#"+childid).scrollTop(($("#"+childid).scrollTop())+$("#"+selectedA).height()+$("#"+selectedA).height());};break;};};};var previous=function(){var titletextid=getPostID("postTitleTextID");var childid=getPostID("postChildID");var allAs=$("#"+childid+" a.enabled");for(var current=0;current<allAs.length;current++){var currentA=allAs[current];var id=$(currentA).attr("id");if($(currentA).hasClass("selected")&&current!=0){$("#"+childid+" a.selected").removeClass("selected");$(allAs[current-1]).addClass("selected");var selectedA=$("#"+childid+" a.selected").attr("id");if(!ddList){var sText=(options.showIcon==false)?a_array[selectedA].text:a_array[selectedA].html;setTitleText(sText);};if(parseInt(($("#"+selectedA).position().top+$("#"+selectedA).height()))<=0){$("#"+childid).scrollTop(($("#"+childid).scrollTop()-$("#"+childid).height())-$("#"+selectedA).height());};break;};};};var setTitleImageSprite=function(){if(options.useSprite!=false){var titletextid=getPostID("postTitleTextID");var sClassName=document.getElementById(elementid).options[document.getElementById(elementid).selectedIndex].className;if(sClassName.length>0){var childid=getPostID("postChildID");var id=$("#"+childid+" a."+sClassName).attr("id");var backgroundImg=$("#"+id).css("background-image");var backgroundPosition=$("#"+id).css("background-position");var paddingLeft=$("#"+id).css("padding-left");if(backgroundImg!=undefined){$("#"+titletextid).find("."+styles.ddTitleText).attr('style',"background:"+backgroundImg);};if(backgroundPosition!=undefined){$("#"+titletextid).find("."+styles.ddTitleText).css('background-position',backgroundPosition);};if(paddingLeft!=undefined){$("#"+titletextid).find("."+styles.ddTitleText).css('padding-left',paddingLeft);};$("#"+titletextid).find("."+styles.ddTitleText).css('background-repeat','no-repeat');$("#"+titletextid).find("."+styles.ddTitleText).css('padding-bottom','2px');};};};var setValue=function(){var childid=getPostID("postChildID");var allSelected=$("#"+childid+" a.selected");if(allSelected.length==1){var sText=$("#"+childid+" a.selected").text();var selectedA=$("#"+childid+" a.selected").attr("id");if(selectedA!=undefined){var sValue=a_array[selectedA].value;document.getElementById(elementid).selectedIndex=a_array[selectedA].index;};if(options.showIcon&&options.useSprite!=false)
setTitleImageSprite();}else if(allSelected.length>1){var alls=$("#"+elementid+" > option:selected").removeAttr("selected");for(var i=0;i<allSelected.length;i++){var selectedA=$(allSelected[i]).attr("id");var index=a_array[selectedA].index;document.getElementById(elementid).options[index].selected="selected";};};var sIndex=document.getElementById(elementid).selectedIndex;$this.ddProp["selectedIndex"]=sIndex;};var has_handler=function(name){if($("#"+elementid).attr("on"+name)!=undefined){return true;};var evs=$("#"+elementid).data("events");if(evs&&evs[name]){return true;};return false;};var checkMethodAndApply=function(){var childid=getPostID("postChildID");if(has_handler('change')==true){var currentSelectedValue=a_array[$("#"+childid+" a.selected").attr("id")].text;if(selectedValue!=currentSelectedValue){$("#"+elementid).trigger("change");};};if(has_handler('mouseup')==true){$("#"+elementid).trigger("mouseup");};if(has_handler('blur')==true){$(document).bind("mouseup",function(evt){$("#"+elementid).focus();$("#"+elementid)[0].blur();setValue();$(document).unbind("mouseup");});};};var hightlightArrow=function(ison){var arrowid=getPostID("postArrowID");if(ison==1)
$("#"+arrowid).css({backgroundPosition:'0 100%'});else
$("#"+arrowid).css({backgroundPosition:'0 0'});};var setOriginalProperties=function(){for(var i in document.getElementById(elementid)){if(typeof(document.getElementById(elementid)[i])!='function'&&document.getElementById(elementid)[i]!==undefined&&document.getElementById(elementid)[i]!==null){$this.set(i,document.getElementById(elementid)[i],true);};};};var setValueByIndex=function(prop,val){if(getByIndex(val)!=-1){document.getElementById(elementid)[prop]=val;var childid=getPostID("postChildID");$("#"+childid+" a.selected").removeClass("selected");$("#"+getByIndex(val).id).addClass("selected");var sText=getByIndex(document.getElementById(elementid).selectedIndex).html;setTitleText(sText);};};var addRemoveFromIndex=function(i,action){if(action=='d'){for(var key in a_array){if(a_array[key].index==i){delete a_array[key];break;};};};var count=0;for(var key in a_array){a_array[key].index=count;count++;};};this.open=function(){if(($this.get("disabled",true)==true)||($this.get("options",true).length==0))return;var childid=getPostID("postChildID");if(msOldDiv!=""&&childid!=msOldDiv){$("#"+msOldDiv).slideUp("fast");$("#"+msOldDiv).css({zIndex:'0'});};if($("#"+childid).css("display")=="none"){$(document).bind("keydown",function(event){var keyCode=event.keyCode;if(keyCode==39||keyCode==40){event.preventDefault();event.stopPropagation();next();};if(keyCode==37||keyCode==38){event.preventDefault();event.stopPropagation();previous();};if(keyCode==27||keyCode==13){$this.close();setValue();};if($("#"+elementid).attr("onkeydown")!=undefined){document.getElementById(elementid).onkeydown();};});$(document).bind("keyup",function(event){if($("#"+elementid).attr("onkeyup")!=undefined){document.getElementById(elementid).onkeyup();};});$(document).bind("mouseup",function(evt){if(getInsideWindow()==false){$this.close();};});$("#"+childid).css({zIndex:options.zIndex});$("#"+childid).slideDown("fast",function(){if($this.onActions["onOpen"]!=null){eval($this.onActions["onOpen"])($this);};});if(childid!=msOldDiv){msOldDiv=childid;};};};this.close=function(){var childid=getPostID("postChildID");$(document).unbind("keydown");$(document).unbind("keyup");$(document).unbind("mouseup");$("#"+childid).slideUp("fast",function(event){checkMethodAndApply();$("#"+childid).css({zIndex:'0'});if($this.onActions["onClose"]!=null){eval($this.onActions["onClose"])($this);};});};this.selectedIndex=function(i){$this.set("selectedIndex",i);};this.set=function(prop,val,isLocal){if(prop==undefined||val==undefined)throw{message:"set to what?"};$this.ddProp[prop]=val;if(isLocal!=true){switch(prop){case"selectedIndex":setValueByIndex(prop,val);break;case"disabled":$this.disabled(val,true);break;case"multiple":document.getElementById(elementid)[prop]=val;ddList=($(sElement).attr("size")>0||$(sElement).attr("multiple")==true)?true:false;if(ddList){var iHeight=$("#"+elementid).height();var childid=getPostID("postChildID");$("#"+childid).css("height",iHeight+"px");var titleid=getPostID("postTitleID");$("#"+titleid).hide();var childid=getPostID("postChildID");$("#"+childid).css({display:'block',position:'relative'});applyEventsOnA();}
break;case"size":document.getElementById(elementid)[prop]=val;if(val==0){document.getElementById(elementid).multiple=false;};ddList=($(sElement).attr("size")>0||$(sElement).attr("multiple")==true)?true:false;if(val==0){var titleid=getPostID("postTitleID");$("#"+titleid).show();var childid=getPostID("postChildID");$("#"+childid).css({display:'none',position:'absolute'});var sText="";if(document.getElementById(elementid).selectedIndex>=0){var aObj=getByIndex(document.getElementById(elementid).selectedIndex);sText=aObj.html;manageSelection($("#"+aObj.id));};setTitleText(sText);}else{var titleid=getPostID("postTitleID");$("#"+titleid).hide();var childid=getPostID("postChildID");$("#"+childid).css({display:'block',position:'relative'});};break;default:try{document.getElementById(elementid)[prop]=val;}catch(e){};break;};};};this.get=function(prop,forceRefresh){if(prop==undefined&&forceRefresh==undefined){return $this.ddProp;};if(prop!=undefined&&forceRefresh==undefined){return($this.ddProp[prop]!=undefined)?$this.ddProp[prop]:null;};if(prop!=undefined&&forceRefresh!=undefined){return document.getElementById(elementid)[prop];};};this.visible=function(val){var id=getPostID("postID");if(val==true){$("#"+id).show();}else if(val==false){$("#"+id).hide();}else{return $("#"+id).css("display");};};this.add=function(opt,index){var objOpt=opt;var sText=objOpt.text;var sValue=(objOpt.value==undefined||objOpt.value==null)?sText:objOpt.value;var img=(objOpt.title==undefined||objOpt.title==null)?'':objOpt.title;var i=(index==undefined||index==null)?document.getElementById(elementid).options.length:index;document.getElementById(elementid).options[i]=new Option(sText,sValue);if(img!='')document.getElementById(elementid).options[i].title=img;var ifA=getByIndex(i);if(ifA!=-1){var aTag=createA(document.getElementById(elementid).options[i],i,"","");$("#"+ifA.id).html(aTag);}else{var aTag=createA(document.getElementById(elementid).options[i],i,"","");var childid=getPostID("postChildID");$("#"+childid).append(aTag);applyEventsOnA();};};this.remove=function(i){document.getElementById(elementid).remove(i);if((getByIndex(i))!=-1){$("#"+getByIndex(i).id).remove();addRemoveFromIndex(i,'d');};if(document.getElementById(elementid).length==0){setTitleText("");}else{var sText=getByIndex(document.getElementById(elementid).selectedIndex).html;setTitleText(sText);};$this.set("selectedIndex",document.getElementById(elementid).selectedIndex);};this.disabled=function(dis,isLocal){document.getElementById(elementid).disabled=dis;var id=getPostID("postID");if(dis==true){$("#"+id).css("opacity",styles.disabled);$this.close();}else if(dis==false){$("#"+id).css("opacity",1);};if(isLocal!=true){$this.set("disabled",dis);};};this.form=function(){return(document.getElementById(elementid).form==undefined)?null:document.getElementById(elementid).form;};this.item=function(){if(arguments.length==1){return document.getElementById(elementid).item(arguments[0]);}else if(arguments.length==2){return document.getElementById(elementid).item(arguments[0],arguments[1]);}else{throw{message:"An index is required!"};};};this.namedItem=function(nm){return document.getElementById(elementid).namedItem(nm);};this.multiple=function(is){if(is==undefined){return $this.get("multiple");}else{$this.set("multiple",is);};};this.size=function(sz){if(sz==undefined){return $this.get("size");}else{$this.set("size",sz);};};this.addMyEvent=function(nm,fn){$this.onActions[nm]=fn;};this.fireEvent=function(nm){eval($this.onActions[nm])($this);};var updateCommonVars=function(){$this.set("version",$.msDropDown.version);$this.set("author",$.msDropDown.author);};var init=function(){createDropDown();setOriginalProperties();updateCommonVars();if(options.onInit!=''){eval(options.onInit)($this);};};init();};$.msDropDown={version:2.3,author:"Marghoob Suleman",create:function(id,opt){return $(id).msDropDown(opt).data("dd");}};$.fn.extend({msDropDown:function(options)
{return this.each(function()
{var mydropdown=new dd(this,options);$(this).data('dd',mydropdown);});}});})(jQuery);
;jQuery.fn.highlight=function(pat)
{function innerHighlight(node,pat)
{var skip=0;if(node.nodeType==3)
{var pos=node.data.toUpperCase().indexOf(pat);if(pos>=0)
{var spannode=document.createElement('span');spannode.className='highlight';var middlebit=node.splitText(pos);var endbit=middlebit.splitText(pat.length);var middleclone=middlebit.cloneNode(true);spannode.appendChild(middleclone);middlebit.parentNode.replaceChild(spannode,middlebit);skip=1;}}
else if(node.nodeType==1&&node.childNodes&&!/(script|style)/i.test(node.tagName))
{for(var i=0;i<node.childNodes.length;++i)
{i+=innerHighlight(node.childNodes[i],pat);}}
return skip;}
return this.each(function()
{innerHighlight(this,pat.toUpperCase());});};jQuery.fn.removeHighlight=function()
{function newNormalize(node)
{for(var i=0,children=node.childNodes,nodeCount=children.length;i<nodeCount;i++)
{var child=children[i];if(child.nodeType==1)
{newNormalize(child);continue;}
if(child.nodeType!=3)
{continue;}
var next=child.nextSibling;if(next==null||next.nodeType!=3)
{continue;}
var combined_text=child.nodeValue+next.nodeValue;new_node=node.ownerDocument.createTextNode(combined_text);node.insertBefore(new_node,child);node.removeChild(child);node.removeChild(next);i--;nodeCount--;}}
return this.find("span.highlight").each(function()
{var thisParent=this.parentNode;thisParent.replaceChild(this.firstChild,this);newNormalize(thisParent);}).end();};
;var timeOutMenu;var openedMenu;var timeOutMenuSeconds=2;var hideMenu=function(over)
{timeOutMenu=null;if(!over)
{openedMenu=null;$('#top #menu ul li ul').fadeOut('fast');$('#menu ul li.part, #menu ul li.pro, #menu ul li.sfa').css('opacity',1);$('#brd .social, #crumb').fadeIn('fast');}};$().ready(function()
{$('.hide').live('click',function()
{$(this).parent().fadeTo(400,0,function()
{$(this).slideUp(400);});return false;});$('span.codedirection').each(function(i)
{var email=new String($(this).html());return $(this).html('<a href="mailto:'+email.reverse()+'" rel="nofollow">'+email+'</a>');});$('#menu ul li.part, #menu ul li.pro, #menu ul li.sfa').hover(function()
{if(timeOutMenu)
{clearTimeout(timeOutMenu);hideMenu(openedMenu==$(this).attr('id'));}
if(!openedMenu||openedMenu!=$(this).attr('id'))
{$('#top #menu ul li ul').fadeOut('fast');$(this).css('opacity',1);$($(this).children('ul')[0]).fadeIn('fast');$('#menu ul li.part, #menu ul li.pro, #menu ul li.sfa').not($(this)).css('opacity',0.2);$('#brd .social, #crumb').fadeOut('fast');openedMenu=$(this).attr('id');}},function()
{if(timeOutMenu)
{clearTimeout(timeOutMenu);}
timeOutMenu=setTimeout("hideMenu()",timeOutMenuSeconds*1000);});$('#language').msDropDown({});$('a.mail').overlay({onBeforeLoad:function()
{var overlay=this.getOverlay();centerOverlay(overlay);var wrap=overlay.find(".contentWrap");wrap.empty().html('<p style="text-align: center; margin: 20px; opacity: 0.5;"><img src="/medias/design/loader.gif" alt="" /></p>').show();wrap.load(this.getTrigger().attr("href")+'/url/'+Base64.encode(this.getTrigger().attr("type")),function()
{centerOverlay(overlay);});},left:'center',top:25});$('.print, .projectPrint').click(function(e)
{e.preventDefault();window.print();});$('.facebook').click(function()
{window.open($(this).attr('href'),'sharer','toolbar=0,status=0,width=626,height=436');return false;});$('.twitter').click(function()
{window.open($(this).attr('href'),'Twitter','width=550, height=350, resizable=no, location=no, menubar=no, status=no, scrollbars=no');return false;});$('.social img[title]').tooltip({offset:[-10,0],onShow:function()
{this.getTrigger().fadeTo("fast",.7);},onHide:function()
{this.getTrigger().fadeTo("fast",1);}});var arrowTopPosition=[85,297,501,695,891];$('.productRange').click(function(e)
{e.preventDefault();$('.productRange').removeClass('selected');$(this).addClass('selected');var $parent=$(this).parents('.productRoom');var index=$('.productRoom').index($parent);$('.preview .arrow').stop(true,false).animate({left:arrowTopPosition[index]},'fast');$('.preview .container').empty().load($(this).attr('href'));});$('#seo').overlay({onBeforeLoad:function()
{var overlay=this.getOverlay();centerOverlay(overlay);var wrap=overlay.find(".contentWrap");wrap.empty().html('<p style="text-align: center; margin: 20px; opacity: 0.5;"><img src="/medias/design/loader.gif" alt="" /></p>').show();wrap.load(this.getTrigger().attr("href")+'/request/'+Base64.encode(encodeURIComponent(decodeURIComponent(window.location.pathname))),function()
{centerOverlay(overlay);});}});$('.shortcut').click(function()
{var url=$(this).attr('rel');if(/^http:\/\//.test(url))
{window.open(url);}
else
{window.location=url;}});$('#text-search').bind('keyup change',function(ev)
{var searchTerm=$(this).val();var parent=$('body');if($(this).attr('rel')!=undefined)
{parent=$($(this).attr('rel'));}
parent.removeHighlight();if(searchTerm)
{parent.highlight(searchTerm);}});});$.easing.bouncy=function(x,t,b,c,d)
{var 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;};$.tools.tooltip.addEffect("bouncy",function(done)
{this.getTip().animate({top:'+=15'},500,'bouncy',done).show();},function(done)
{this.getTip().animate({top:'-=15'},500,'bouncy',function()
{$(this).hide();done.call();});});
;if(jQuery)
{(function($)
{var __pdw_room_slide_interval;$.extend($.fn,{stopSlide:function()
{if(__pdw_room_slide_interval)
{clearInterval(__pdw_room_slide_interval);}
return this;},roomSlide:function(options)
{options=$.extend({speed:2,padding:2,borderRadius:10,autoPlay:5,start:5,extanded:{className:'extended',over:{width:563,height:101},width:556,height:295},retracted:{className:'retracted',over:{width:78,height:47},width:78,height:295},buttonColors:[]},options||{});var bigOverWidth=options.extanded.over.width;var bigOverHeight=options.extanded.over.height;var expandedWidth=options.extanded.width;var expandedHeight=options.extanded.height;var increment=0;var retractedWidth=options.retracted.width;var retractedHeight=options.retracted.height;var smallOverWidth=retractedWidth;var smallOverHeight=options.retracted.over.height;var extandedClass=options.extanded.className;var retractedClass=options.retracted.className;var buttonColors=options.buttonColors;var createDiv=function($parent,index,$p,childrenCounts,parentWidth)
{var parentId=$parent.attr('id');var title=$p.attr('title');var img=$p.children('img')[0];var imgSrc=$(img).attr('src');var $div=$('<div></div>');$div.attr('id',parentId+title);$div.addClass('roomSlideContainer');var width=parentWidth/childrenCounts;var leftPosition=(width+options.padding)*index;var borderRadius=options.borderRadius+'px '+options.borderRadius+'px 0 0';$div.css({width:width,height:expandedHeight,left:leftPosition,borderRadius:borderRadius});if($.browser.safari)
{$div.css('-webkit-border-radius',borderRadius);}
else if($.browser.mozilla)
{$div.css('-moz-border-radius',borderRadius);}
else if(/konqueror/.test(navigator.userAgent.toLowerCase()))
{$div.css('-khtml-border-radius',borderRadius);}
var $bg=$('<div></div>');$bg.addClass('slideBG');$bg.css({width:width,height:expandedHeight,background:'url('+imgSrc+') no-repeat scroll right top transparent',borderRadius:borderRadius});if($.browser.safari)
{$bg.css('-webkit-border-radius',borderRadius);}
else if($.browser.mozilla)
{$bg.css('-moz-border-radius',borderRadius);}
else if(/konqueror/.test(navigator.userAgent.toLowerCase()))
{$bg.css('-khtml-border-radius',borderRadius);}
$div.append($bg);var $shortOver=$('<div></div>');$shortOver.addClass('smallOverTitle');$shortOver.css({width:width,height:smallOverHeight,top:expandedHeight-smallOverHeight,background:'url(/medias/design/room_slide_short.png) no-repeat scroll right '+(-smallOverHeight*index)+'px transparent'});var $shortTitleP=$('<p></p>');$shortTitleP.addClass('smallRoomSlideTitle');$shortTitleP.html(title);$shortOver.append($shortTitleP);$div.append($shortOver);var $bigOver=$('<div></div>');$bigOver.addClass('bigOverTitle');$bigOver.css({width:bigOverWidth,height:bigOverHeight,background:'url(/medias/design/room_slide.png) no-repeat scroll right '+(-bigOverHeight*index)+'px transparent',top:expandedHeight-bigOverHeight});var $bigTitleP=$('<p></p>');var hTitle=$p.children('span.roomSlideTitle')[0].innerHTML;$bigTitleP.addClass('bigRoomSlideTitle');$bigTitleP.html(hTitle);$bigOver.append($bigTitleP);var shTilte=$p.children('span.roomSlideSubTitle')[0].innerHTML;var $bigSTitleP=$('<p></p>');$bigSTitleP.addClass('bigRoomSlideSubTitle');$bigSTitleP.html(shTilte);$bigOver.append($bigSTitleP);$bigOver.hide();var createButton=function(idx,top)
{if($p.children('a').eq(idx).length==0)
{return null;}
var $a=$p.children('a').eq(idx);var $button=$('<a></a>');$button.addClass('roomSlideButton');$button.css({color:buttonColors[index],top:top});$button.html($a.html());$button.attr('href',$a.attr('href'));if(!$.browser.msie)
{$button.css({borderBottom:'1px solid rgba(0, 0, 0, 0.25)',textShadow:'rgba(0, 0, 0, 0.25) 0 -1px 1px'});}
else
{$button.css({background:'url(/medias/design/room_slide_button.png) no-repeat middle right transparent'});}
if($.browser.safari)
{$button.css('-webkit-border-radius','25px').css('-webkit-box-shadow','0 1px 3px rgba(0, 0, 0, 0.5);');}
else if($.browser.mozilla)
{$button.css('-moz-border-radius','525px').css('-moz-box-shadow','0 1px 3px rgba(0, 0, 0, 0.5);');}
else if(/konqueror/.test(navigator.userAgent.toLowerCase()))
{$button.css('-khtml-border-radius','25px').css('-khtml-box-shadow','0 1px 3px rgba(0, 0, 0, 0.5);');}
return $button;};var $button=createButton(0,25);if($button!=null)
{$bigOver.append($button);}
$button=createButton(1,60);if($button!=null)
{$bigOver.append($button);}
$div.append($bigOver);$div.click(function()
{expand($parent,index);}).hover(function()
{if(options.autoPlay)
{clearInterval(__pdw_room_slide_interval);}},function()
{if(options.autoPlay)
{letsPlay($parent);}});$parent.append($div);$p.remove();};var expand=function($parent,index)
{var leftPosition=0;$parent.children('div').each(function(idx)
{$div=$(this);var width=index==idx?bigOverWidth:retractedWidth;$div.stop(true,false).animate({width:width,left:leftPosition},options.speed*1000);leftPosition+=width+options.padding;if(index==idx)
{$($div.children('.smallOverTitle')[0]).stop(true,true).animate({width:width,opacity:0},options.speed*1000);$($div.children('.bigOverTitle')[0]).stop(true,true).fadeIn(options.speed*1000);$($div.children('.slideBG')[0]).removeClass(retractedClass).addClass(extandedClass).stop(true,false).animate({width:expandedWidth},options.speed*1000);}
else
{$($div.children('.smallOverTitle')[0]).stop(true,true).animate({width:retractedWidth,opacity:1},options.speed*1000);$($div.children('.bigOverTitle')[0]).stop(true,true).fadeOut(options.speed*1000);$($div.children('.slideBG')[0]).stop(true,false).removeClass(extandedClass).addClass(retractedClass).animate({width:retractedWidth},options.speed*1000,function()
{if(options.autoPlay)
{letsPlay($parent);}});}});};if(options.autoPlay<options.speed)
{options.speed=options.autoPlay;}
var letsPlay=function($parent,start)
{var childrenCounts=$parent.children('div').length;var autoPlay=function()
{if(increment>=childrenCounts)
{increment=0;}
expand($parent,increment++);};if(__pdw_room_slide_interval)
{clearInterval(__pdw_room_slide_interval);}
var timeout=start||options.autoPlay;__pdw_room_slide_interval=self.setInterval(autoPlay,timeout*1000);};return this.each(function()
{var $parent=$(this);var parentId=$parent.attr('id');$parent.addClass('roomSlideMainContainer');var childrenCounts=$parent.children('p').length;var parentWidth=(bigOverWidth+options.padding)+((smallOverWidth+options.padding)*(childrenCounts-1));$parent.css({width:parentWidth,height:expandedHeight});$('#'+parentId+" p").each(function(index)
{createDiv($parent,index,$(this),childrenCounts,parentWidth);});if(options.autoPlay)
{expand($parent,0);letsPlay($parent,options.start);}
else
{expand($parent,0);}});}});})(jQuery);};
