(function(){var root=this;var previousUnderscore=root._;var ArrayProto=Array.prototype,ObjProto=Object.prototype,FuncProto=Function.prototype;var push=ArrayProto.push,slice=ArrayProto.slice,toString=ObjProto.toString,hasOwnProperty=ObjProto.hasOwnProperty;var nativeIsArray=Array.isArray,nativeKeys=Object.keys,nativeBind=FuncProto.bind,nativeCreate=Object.create;var Ctor=function(){};var _=function(obj){if(obj instanceof _)return obj;if(!(this instanceof _))return new _(obj);this._wrapped=obj;};if(typeof exports!=='undefined'){if(typeof module!=='undefined'&&module.exports){exports=module.exports=_;} exports._=_;}else{root._=_;} _.VERSION='1.8.3';var optimizeCb=function(func,context,argCount){if(context===void 0)return func;switch(argCount==null?3:argCount){case 1:return function(value){return func.call(context,value);};case 2:return function(value,other){return func.call(context,value,other);};case 3:return function(value,index,collection){return func.call(context,value,index,collection);};case 4:return function(accumulator,value,index,collection){return func.call(context,accumulator,value,index,collection);};} return function(){return func.apply(context,arguments);};};var cb=function(value,context,argCount){if(value==null)return _.identity;if(_.isFunction(value))return optimizeCb(value,context,argCount);if(_.isObject(value))return _.matcher(value);return _.property(value);};_.iteratee=function(value,context){return cb(value,context,Infinity);};var createAssigner=function(keysFunc,undefinedOnly){return function(obj){var length=arguments.length;if(length<2||obj==null)return obj;for(var index=1;index=0&&length<=MAX_ARRAY_INDEX;};_.each=_.forEach=function(obj,iteratee,context){iteratee=optimizeCb(iteratee,context);var i,length;if(isArrayLike(obj)){for(i=0,length=obj.length;i=0&&index0?0:length-1;if(arguments.length<3){memo=obj[keys?keys[index]:index];index+=dir;} return iterator(obj,iteratee,memo,keys,index,length);};} _.reduce=_.foldl=_.inject=createReduce(1);_.reduceRight=_.foldr=createReduce(-1);_.find=_.detect=function(obj,predicate,context){var key;if(isArrayLike(obj)){key=_.findIndex(obj,predicate,context);}else{key=_.findKey(obj,predicate,context);} if(key!==void 0&&key!==-1)return obj[key];};_.filter=_.select=function(obj,predicate,context){var results=[];predicate=cb(predicate,context);_.each(obj,function(value,index,list){if(predicate(value,index,list))results.push(value);});return results;};_.reject=function(obj,predicate,context){return _.filter(obj,_.negate(cb(predicate)),context);};_.every=_.all=function(obj,predicate,context){predicate=cb(predicate,context);var keys=!isArrayLike(obj)&&_.keys(obj),length=(keys||obj).length;for(var index=0;index=0;};_.invoke=function(obj,method){var args=slice.call(arguments,2);var isFunc=_.isFunction(method);return _.map(obj,function(value){var func=isFunc?method:value[method];return func==null?func:func.apply(value,args);});};_.pluck=function(obj,key){return _.map(obj,_.property(key));};_.where=function(obj,attrs){return _.filter(obj,_.matcher(attrs));};_.findWhere=function(obj,attrs){return _.find(obj,_.matcher(attrs));};_.max=function(obj,iteratee,context){var result=-Infinity,lastComputed=-Infinity,value,computed;if(iteratee==null&&obj!=null){obj=isArrayLike(obj)?obj:_.values(obj);for(var i=0,length=obj.length;iresult){result=value;}}}else{iteratee=cb(iteratee,context);_.each(obj,function(value,index,list){computed=iteratee(value,index,list);if(computed>lastComputed||computed===-Infinity&&result===-Infinity){result=value;lastComputed=computed;}});} return result;};_.min=function(obj,iteratee,context){var result=Infinity,lastComputed=Infinity,value,computed;if(iteratee==null&&obj!=null){obj=isArrayLike(obj)?obj:_.values(obj);for(var i=0,length=obj.length;ib||a===void 0)return 1;if(a0?0:length-1;for(;index>=0&&index0){i=idx>=0?idx:Math.max(idx+length,i);}else{length=idx>=0?Math.min(idx+1,length):idx+length+1;}}else if(sortedIndex&&idx&&length){idx=sortedIndex(array,item);return array[idx]===item?idx:-1;} if(item!==item){idx=predicateFind(slice.call(array,i,length),_.isNaN);return idx>=0?idx+i:-1;} for(idx=dir>0?i:length-1;idx>=0&&idxwait){if(timeout){clearTimeout(timeout);timeout=null;} previous=now;result=func.apply(context,args);if(!timeout)context=args=null;}else if(!timeout&&options.trailing!==false){timeout=setTimeout(later,remaining);} return result;};};_.debounce=function(func,wait,immediate){var timeout,args,context,timestamp,result;var later=function(){var last=_.now()-timestamp;if(last=0){timeout=setTimeout(later,wait-last);}else{timeout=null;if(!immediate){result=func.apply(context,args);if(!timeout)context=args=null;}}};return function(){context=this;args=arguments;timestamp=_.now();var callNow=immediate&&!timeout;if(!timeout)timeout=setTimeout(later,wait);if(callNow){result=func.apply(context,args);context=args=null;} return result;};};_.wrap=function(func,wrapper){return _.partial(wrapper,func);};_.negate=function(predicate){return function(){return!predicate.apply(this,arguments);};};_.compose=function(){var args=arguments;var start=args.length-1;return function(){var i=start;var result=args[start].apply(this,arguments);while(i--)result=args[i].call(this,result);return result;};};_.after=function(times,func){return function(){if(--times<1){return func.apply(this,arguments);}};};_.before=function(times,func){var memo;return function(){if(--times>0){memo=func.apply(this,arguments);} if(times<=1)func=null;return memo;};};_.once=_.partial(_.before,2);var hasEnumBug=!{toString:null}.propertyIsEnumerable('toString');var nonEnumerableProps=['valueOf','isPrototypeOf','toString','propertyIsEnumerable','hasOwnProperty','toLocaleString'];function collectNonEnumProps(obj,keys){var nonEnumIdx=nonEnumerableProps.length;var constructor=obj.constructor;var proto=(_.isFunction(constructor)&&constructor.prototype)||ObjProto;var prop='constructor';if(_.has(obj,prop)&&!_.contains(keys,prop))keys.push(prop);while(nonEnumIdx--){prop=nonEnumerableProps[nonEnumIdx];if(prop in obj&&obj[prop]!==proto[prop]&&!_.contains(keys,prop)){keys.push(prop);}}} _.keys=function(obj){if(!_.isObject(obj))return[];if(nativeKeys)return nativeKeys(obj);var keys=[];for(var key in obj)if(_.has(obj,key))keys.push(key);if(hasEnumBug)collectNonEnumProps(obj,keys);return keys;};_.allKeys=function(obj){if(!_.isObject(obj))return[];var keys=[];for(var key in obj)keys.push(key);if(hasEnumBug)collectNonEnumProps(obj,keys);return keys;};_.values=function(obj){var keys=_.keys(obj);var length=keys.length;var values=Array(length);for(var i=0;i':'>','"':'"',"'":''','`':'`'};var unescapeMap=_.invert(escapeMap);var createEscaper=function(map){var escaper=function(match){return map[match];};var source='(?:'+_.keys(map).join('|')+')';var testRegexp=RegExp(source);var replaceRegexp=RegExp(source,'g');return function(string){string=string==null?'':''+string;return testRegexp.test(string)?string.replace(replaceRegexp,escaper):string;};};_.escape=createEscaper(escapeMap);_.unescape=createEscaper(unescapeMap);_.result=function(object,property,fallback){var value=object==null?void 0:object[property];if(value===void 0){value=fallback;} return _.isFunction(value)?value.call(object):value;};var idCounter=0;_.uniqueId=function(prefix){var id=++idCounter+'';return prefix?prefix+id:id;};_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var noMatch=/(.)^/;var escapes={"'":"'",'\\':'\\','\r':'r','\n':'n','\u2028':'u2028','\u2029':'u2029'};var escaper=/\\|'|\r|\n|\u2028|\u2029/g;var escapeChar=function(match){return'\\'+escapes[match];};_.template=function(text,settings,oldSettings){if(!settings&&oldSettings)settings=oldSettings;settings=_.defaults({},settings,_.templateSettings);var matcher=RegExp([(settings.escape||noMatch).source,(settings.interpolate||noMatch).source,(settings.evaluate||noMatch).source].join('|')+'|$','g');var index=0;var source="__p+='";text.replace(matcher,function(match,escape,interpolate,evaluate,offset){source+=text.slice(index,offset).replace(escaper,escapeChar);index=offset+match.length;if(escape){source+="'+\n((__t=("+escape+"))==null?'':_.escape(__t))+\n'";}else if(interpolate){source+="'+\n((__t=("+interpolate+"))==null?'':__t)+\n'";}else if(evaluate){source+="';\n"+evaluate+"\n__p+='";} return match;});source+="';\n";if(!settings.variable)source='with(obj||{}){\n'+source+'}\n';source="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+ source+'return __p;\n';try{var render=new Function(settings.variable||'obj','_',source);}catch(e){e.source=source;throw e;} var template=function(data){return render.call(this,data,_);};var argument=settings.variable||'obj';template.source='function('+argument+'){\n'+source+'}';return template;};_.chain=function(obj){var instance=_(obj);instance._chain=true;return instance;};var result=function(instance,obj){return instance._chain?_(obj).chain():obj;};_.mixin=function(obj){_.each(_.functions(obj),function(name){var func=_[name]=obj[name];_.prototype[name]=function(){var args=[this._wrapped];push.apply(args,arguments);return result(this,func.apply(_,args));};});};_.mixin(_);_.each(['pop','push','reverse','shift','sort','splice','unshift'],function(name){var method=ArrayProto[name];_.prototype[name]=function(){var obj=this._wrapped;method.apply(obj,arguments);if((name==='shift'||name==='splice')&&obj.length===0)delete obj[0];return result(this,obj);};});_.each(['concat','join','slice'],function(name){var method=ArrayProto[name];_.prototype[name]=function(){return result(this,method.apply(this._wrapped,arguments));};});_.prototype.value=function(){return this._wrapped;};_.prototype.valueOf=_.prototype.toJSON=_.prototype.value;_.prototype.toString=function(){return''+this._wrapped;};if(typeof define==='function'&&define.amd){define('underscore',[],function(){return _;});}}.call(this));; /*! * jQuery JavaScript Library v1.6.4 * http://jquery.com/ * * Copyright 2011, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Mon Sep 12 18:54:48 2011 -0400 */ (function(window,undefined){var document=window.document,navigator=window.navigator,location=window.location;var jQuery=(function(){var jQuery=function(selector,context){return new jQuery.fn.init(selector,context,rootjQuery);},_jQuery=window.jQuery,_$=window.$,rootjQuery,quickExpr=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,rnotwhite=/\S/,trimLeft=/^\s+/,trimRight=/\s+$/,rdigit=/\d/,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,rvalidchars=/^[\],:{}\s]*$/,rvalidescape=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rvalidtokens=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rvalidbraces=/(?:^|:|,)(?:\s*\[)+/g,rwebkit=/(webkit)[ \/]([\w.]+)/,ropera=/(opera)(?:.*version)?[ \/]([\w.]+)/,rmsie=/(msie) ([\w.]+)/,rmozilla=/(mozilla)(?:.*? rv:([\w.]+))?/,rdashAlpha=/-([a-z]|[0-9])/ig,rmsPrefix=/^-ms-/,fcamelCase=function(all,letter){return(letter+"").toUpperCase();},userAgent=navigator.userAgent,browserMatch,readyList,DOMContentLoaded,toString=Object.prototype.toString,hasOwn=Object.prototype.hasOwnProperty,push=Array.prototype.push,slice=Array.prototype.slice,trim=String.prototype.trim,indexOf=Array.prototype.indexOf,class2type={};jQuery.fn=jQuery.prototype={constructor:jQuery,init:function(selector,context,rootjQuery){var match,elem,ret,doc;if(!selector){return this;} if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this;} if(selector==="body"&&!context&&document.body){this.context=document;this[0]=document.body;this.selector=selector;this.length=1;return this;} if(typeof selector==="string"){if(selector.charAt(0)==="<"&&selector.charAt(selector.length-1)===">"&&selector.length>=3){match=[null,selector,null];}else{match=quickExpr.exec(selector);} if(match&&(match[1]||!context)){if(match[1]){context=context instanceof jQuery?context[0]:context;doc=(context?context.ownerDocument||context:document);ret=rsingleTag.exec(selector);if(ret){if(jQuery.isPlainObject(context)){selector=[document.createElement(ret[1])];jQuery.fn.attr.call(selector,context,true);}else{selector=[doc.createElement(ret[1])];}}else{ret=jQuery.buildFragment([match[1]],[doc]);selector=(ret.cacheable?jQuery.clone(ret.fragment):ret.fragment).childNodes;} return jQuery.merge(this,selector);}else{elem=document.getElementById(match[2]);if(elem&&elem.parentNode){if(elem.id!==match[2]){return rootjQuery.find(selector);} this.length=1;this[0]=elem;} this.context=document;this.selector=selector;return this;}}else if(!context||context.jquery){return(context||rootjQuery).find(selector);}else{return this.constructor(context).find(selector);}}else if(jQuery.isFunction(selector)){return rootjQuery.ready(selector);} if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context;} return jQuery.makeArray(selector,this);},selector:"",jquery:"1.6.4",length:0,size:function(){return this.length;},toArray:function(){return slice.call(this,0);},get:function(num){return num==null?this.toArray():(num<0?this[this.length+num]:this[num]);},pushStack:function(elems,name,selector){var ret=this.constructor();if(jQuery.isArray(elems)){push.apply(ret,elems);}else{jQuery.merge(ret,elems);} ret.prevObject=this;ret.context=this.context;if(name==="find"){ret.selector=this.selector+(this.selector?" ":"")+selector;}else if(name){ret.selector=this.selector+"."+name+"("+selector+")";} return ret;},each:function(callback,args){return jQuery.each(this,callback,args);},ready:function(fn){jQuery.bindReady();readyList.done(fn);return this;},eq:function(i){return i===-1?this.slice(i):this.slice(i,+i+1);},first:function(){return this.eq(0);},last:function(){return this.eq(-1);},slice:function(){return this.pushStack(slice.apply(this,arguments),"slice",slice.call(arguments).join(","));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},end:function(){return this.prevObject||this.constructor(null);},push:push,sort:[].sort,splice:[].splice};jQuery.fn.init.prototype=jQuery.fn;jQuery.extend=jQuery.fn.extend=function(){var options,name,src,copy,copyIsArray,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=false;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2;} if(typeof target!=="object"&&!jQuery.isFunction(target)){target={};} if(length===i){target=this;--i;} for(;i0){return;} readyList.resolveWith(document,[jQuery]);if(jQuery.fn.trigger){jQuery(document).trigger("ready").unbind("ready");}}},bindReady:function(){if(readyList){return;} readyList=jQuery._Deferred();if(document.readyState==="complete"){return setTimeout(jQuery.ready,1);} if(document.addEventListener){document.addEventListener("DOMContentLoaded",DOMContentLoaded,false);window.addEventListener("load",jQuery.ready,false);}else if(document.attachEvent){document.attachEvent("onreadystatechange",DOMContentLoaded);window.attachEvent("onload",jQuery.ready);var toplevel=false;try{toplevel=window.frameElement==null;}catch(e){} if(document.documentElement.doScroll&&toplevel){doScrollCheck();}}},isFunction:function(obj){return jQuery.type(obj)==="function";},isArray:Array.isArray||function(obj){return jQuery.type(obj)==="array";},isWindow:function(obj){return obj&&typeof obj==="object"&&"setInterval"in obj;},isNaN:function(obj){return obj==null||!rdigit.test(obj)||isNaN(obj);},type:function(obj){return obj==null?String(obj):class2type[toString.call(obj)]||"object";},isPlainObject:function(obj){if(!obj||jQuery.type(obj)!=="object"||obj.nodeType||jQuery.isWindow(obj)){return false;} try{if(obj.constructor&&!hasOwn.call(obj,"constructor")&&!hasOwn.call(obj.constructor.prototype,"isPrototypeOf")){return false;}}catch(e){return false;} var key;for(key in obj){} return key===undefined||hasOwn.call(obj,key);},isEmptyObject:function(obj){for(var name in obj){return false;} return true;},error:function(msg){throw msg;},parseJSON:function(data){if(typeof data!=="string"||!data){return null;} data=jQuery.trim(data);if(window.JSON&&window.JSON.parse){return window.JSON.parse(data);} if(rvalidchars.test(data.replace(rvalidescape,"@").replace(rvalidtokens,"]").replace(rvalidbraces,""))){return(new Function("return "+data))();} jQuery.error("Invalid JSON: "+data);},parseXML:function(data){var xml,tmp;try{if(window.DOMParser){tmp=new DOMParser();xml=tmp.parseFromString(data,"text/xml");}else{xml=new ActiveXObject("Microsoft.XMLDOM");xml.async="false";xml.loadXML(data);}}catch(e){xml=undefined;} if(!xml||!xml.documentElement||xml.getElementsByTagName("parsererror").length){jQuery.error("Invalid XML: "+data);} return xml;},noop:function(){},globalEval:function(data){if(data&&rnotwhite.test(data)){(window.execScript||function(data){window["eval"].call(window,data);})(data);}},camelCase:function(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase);},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()===name.toUpperCase();},each:function(object,callback,args){var name,i=0,length=object.length,isObj=length===undefined||jQuery.isFunction(object);if(args){if(isObj){for(name in object){if(callback.apply(object[name],args)===false){break;}}}else{for(;i0&&elems[0]&&elems[length-1])||length===0||jQuery.isArray(elems));if(isArray){for(;i1?sliceDeferred.call(arguments,0):value;if(!(--count)){deferred.resolveWith(deferred,sliceDeferred.call(args,0));}};} if(length>1){for(;i
a";all=div.getElementsByTagName("*");a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return{};} select=document.createElement("select");opt=select.appendChild(document.createElement("option"));input=div.getElementsByTagName("input")[0];support={leadingWhitespace:(div.firstChild.nodeType===3),tbody:!div.getElementsByTagName("tbody").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/top/.test(a.getAttribute("style")),hrefNormalized:(a.getAttribute("href")==="/a"),opacity:/^0.55$/.test(a.style.opacity),cssFloat:!!a.style.cssFloat,checkOn:(input.value==="on"),optSelected:opt.selected,getSetAttribute:div.className!=="t",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};input.checked=true;support.noCloneChecked=input.cloneNode(true).checked;select.disabled=true;support.optDisabled=!opt.disabled;try{delete div.test;}catch(e){support.deleteExpando=false;} if(!div.addEventListener&&div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function(){support.noCloneEvent=false;});div.cloneNode(true).fireEvent("onclick");} input=document.createElement("input");input.value="t";input.setAttribute("type","radio");support.radioValue=input.value==="t";input.setAttribute("checked","checked");div.appendChild(input);fragment=document.createDocumentFragment();fragment.appendChild(div.firstChild);support.checkClone=fragment.cloneNode(true).cloneNode(true).lastChild.checked;div.innerHTML="";div.style.width=div.style.paddingLeft="1px";body=document.getElementsByTagName("body")[0];testElement=document.createElement(body?"div":"body");testElementStyle={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};if(body){jQuery.extend(testElementStyle,{position:"absolute",left:"-1000px",top:"-1000px"});} for(i in testElementStyle){testElement.style[i]=testElementStyle[i];} testElement.appendChild(div);testElementParent=body||documentElement;testElementParent.insertBefore(testElement,testElementParent.firstChild);support.appendChecked=input.checked;support.boxModel=div.offsetWidth===2;if("zoom"in div.style){div.style.display="inline";div.style.zoom=1;support.inlineBlockNeedsLayout=(div.offsetWidth===2);div.style.display="";div.innerHTML="
";support.shrinkWrapBlocks=(div.offsetWidth!==2);} div.innerHTML="
t
";tds=div.getElementsByTagName("td");isSupported=(tds[0].offsetHeight===0);tds[0].style.display="";tds[1].style.display="none";support.reliableHiddenOffsets=isSupported&&(tds[0].offsetHeight===0);div.innerHTML="";if(document.defaultView&&document.defaultView.getComputedStyle){marginDiv=document.createElement("div");marginDiv.style.width="0";marginDiv.style.marginRight="0";div.appendChild(marginDiv);support.reliableMarginRight=(parseInt((document.defaultView.getComputedStyle(marginDiv,null)||{marginRight:0}).marginRight,10)||0)===0;} testElement.innerHTML="";testElementParent.removeChild(testElement);if(div.attachEvent){for(i in{submit:1,change:1,focusin:1}){eventName="on"+i;isSupported=(eventName in div);if(!isSupported){div.setAttribute(eventName,"return;");isSupported=(typeof div[eventName]==="function");} support[i+"Bubbles"]=isSupported;}} testElement=fragment=select=opt=body=marginDiv=div=input=null;return support;})();jQuery.boxModel=jQuery.support.boxModel;var rbrace=/^(?:\{.*\}|\[.*\])$/,rmultiDash=/([A-Z])/g;jQuery.extend({cache:{},uuid:0,expando:"jQuery"+(jQuery.fn.jquery+Math.random()).replace(/\D/g,""),noData:{"embed":true,"object":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000","applet":true},hasData:function(elem){elem=elem.nodeType?jQuery.cache[elem[jQuery.expando]]:elem[jQuery.expando];return!!elem&&!isEmptyDataObject(elem);},data:function(elem,name,data,pvt){if(!jQuery.acceptData(elem)){return;} var thisCache,ret,internalKey=jQuery.expando,getByName=typeof name==="string",isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[jQuery.expando]:elem[jQuery.expando]&&jQuery.expando;if((!id||(pvt&&id&&(cache[id]&&!cache[id][internalKey])))&&getByName&&data===undefined){return;} if(!id){if(isNode){elem[jQuery.expando]=id=++jQuery.uuid;}else{id=jQuery.expando;}} if(!cache[id]){cache[id]={};if(!isNode){cache[id].toJSON=jQuery.noop;}} if(typeof name==="object"||typeof name==="function"){if(pvt){cache[id][internalKey]=jQuery.extend(cache[id][internalKey],name);}else{cache[id]=jQuery.extend(cache[id],name);}} thisCache=cache[id];if(pvt){if(!thisCache[internalKey]){thisCache[internalKey]={};} thisCache=thisCache[internalKey];} if(data!==undefined){thisCache[jQuery.camelCase(name)]=data;} if(name==="events"&&!thisCache[name]){return thisCache[internalKey]&&thisCache[internalKey].events;} if(getByName){ret=thisCache[name];if(ret==null){ret=thisCache[jQuery.camelCase(name)];}}else{ret=thisCache;} return ret;},removeData:function(elem,name,pvt){if(!jQuery.acceptData(elem)){return;} var thisCache,internalKey=jQuery.expando,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[jQuery.expando]:jQuery.expando;if(!cache[id]){return;} if(name){thisCache=pvt?cache[id][internalKey]:cache[id];if(thisCache){if(!thisCache[name]){name=jQuery.camelCase(name);} delete thisCache[name];if(!isEmptyDataObject(thisCache)){return;}}} if(pvt){delete cache[id][internalKey];if(!isEmptyDataObject(cache[id])){return;}} var internalCache=cache[id][internalKey];if(jQuery.support.deleteExpando||!cache.setInterval){delete cache[id];}else{cache[id]=null;} if(internalCache){cache[id]={};if(!isNode){cache[id].toJSON=jQuery.noop;} cache[id][internalKey]=internalCache;}else if(isNode){if(jQuery.support.deleteExpando){delete elem[jQuery.expando];}else if(elem.removeAttribute){elem.removeAttribute(jQuery.expando);}else{elem[jQuery.expando]=null;}}},_data:function(elem,name,data){return jQuery.data(elem,name,data,true);},acceptData:function(elem){if(elem.nodeName){var match=jQuery.noData[elem.nodeName.toLowerCase()];if(match){return!(match===true||elem.getAttribute("classid")!==match);}} return true;}});jQuery.fn.extend({data:function(key,value){var data=null;if(typeof key==="undefined"){if(this.length){data=jQuery.data(this[0]);if(this[0].nodeType===1){var attr=this[0].attributes,name;for(var i=0,l=attr.length;i-1){return true;}} return false;},val:function(value){var hooks,ret,elem=this[0];if(!arguments.length){if(elem){hooks=jQuery.valHooks[elem.nodeName.toLowerCase()]||jQuery.valHooks[elem.type];if(hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined){return ret;} ret=elem.value;return typeof ret==="string"?ret.replace(rreturn,""):ret==null?"":ret;} return undefined;} var isFunction=jQuery.isFunction(value);return this.each(function(i){var self=jQuery(this),val;if(this.nodeType!==1){return;} if(isFunction){val=value.call(this,i,self.val());}else{val=value;} if(val==null){val="";}else if(typeof val==="number"){val+="";}else if(jQuery.isArray(val)){val=jQuery.map(val,function(value){return value==null?"":value+"";});} hooks=jQuery.valHooks[this.nodeName.toLowerCase()]||jQuery.valHooks[this.type];if(!hooks||!("set"in hooks)||hooks.set(this,val,"value")===undefined){this.value=val;}});}});jQuery.extend({valHooks:{option:{get:function(elem){var val=elem.attributes.value;return!val||val.specified?elem.value:elem.text;}},select:{get:function(elem){var value,index=elem.selectedIndex,values=[],options=elem.options,one=elem.type==="select-one";if(index<0){return null;} for(var i=one?index:0,max=one?index+1:options.length;i=0;});if(!values.length){elem.selectedIndex=-1;} return values;}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attrFix:{tabindex:"tabIndex"},attr:function(elem,name,value,pass){var nType=elem.nodeType;if(!elem||nType===3||nType===8||nType===2){return undefined;} if(pass&&name in jQuery.attrFn){return jQuery(elem)[name](value);} if(!("getAttribute"in elem)){return jQuery.prop(elem,name,value);} var ret,hooks,notxml=nType!==1||!jQuery.isXMLDoc(elem);if(notxml){name=jQuery.attrFix[name]||name;hooks=jQuery.attrHooks[name];if(!hooks){if(rboolean.test(name)){hooks=boolHook;}else if(nodeHook){hooks=nodeHook;}}} if(value!==undefined){if(value===null){jQuery.removeAttr(elem,name);return undefined;}else if(hooks&&"set"in hooks&¬xml&&(ret=hooks.set(elem,value,name))!==undefined){return ret;}else{elem.setAttribute(name,""+value);return value;}}else if(hooks&&"get"in hooks&¬xml&&(ret=hooks.get(elem,name))!==null){return ret;}else{ret=elem.getAttribute(name);return ret===null?undefined:ret;}},removeAttr:function(elem,name){var propName;if(elem.nodeType===1){name=jQuery.attrFix[name]||name;jQuery.attr(elem,name,"");elem.removeAttribute(name);if(rboolean.test(name)&&(propName=jQuery.propFix[name]||name)in elem){elem[propName]=false;}}},attrHooks:{type:{set:function(elem,value){if(rtype.test(elem.nodeName)&&elem.parentNode){jQuery.error("type property can't be changed");}else if(!jQuery.support.radioValue&&value==="radio"&&jQuery.nodeName(elem,"input")){var val=elem.value;elem.setAttribute("type",value);if(val){elem.value=val;} return value;}}},value:{get:function(elem,name){if(nodeHook&&jQuery.nodeName(elem,"button")){return nodeHook.get(elem,name);} return name in elem?elem.value:null;},set:function(elem,value,name){if(nodeHook&&jQuery.nodeName(elem,"button")){return nodeHook.set(elem,value,name);} elem.value=value;}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(elem,name,value){var nType=elem.nodeType;if(!elem||nType===3||nType===8||nType===2){return undefined;} var ret,hooks,notxml=nType!==1||!jQuery.isXMLDoc(elem);if(notxml){name=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name];} if(value!==undefined){if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;}else{return(elem[name]=value);}}else{if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret;}else{return elem[name];}}},propHooks:{tabIndex:{get:function(elem){var attributeNode=elem.getAttributeNode("tabindex");return attributeNode&&attributeNode.specified?parseInt(attributeNode.value,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:undefined;}}}});jQuery.attrHooks.tabIndex=jQuery.propHooks.tabIndex;boolHook={get:function(elem,name){var attrNode;return jQuery.prop(elem,name)===true||(attrNode=elem.getAttributeNode(name))&&attrNode.nodeValue!==false?name.toLowerCase():undefined;},set:function(elem,value,name){var propName;if(value===false){jQuery.removeAttr(elem,name);}else{propName=jQuery.propFix[name]||name;if(propName in elem){elem[propName]=true;} elem.setAttribute(name,name.toLowerCase());} return name;}};if(!jQuery.support.getSetAttribute){nodeHook=jQuery.valHooks.button={get:function(elem,name){var ret;ret=elem.getAttributeNode(name);return ret&&ret.nodeValue!==""?ret.nodeValue:undefined;},set:function(elem,value,name){var ret=elem.getAttributeNode(name);if(!ret){ret=document.createAttribute(name);elem.setAttributeNode(ret);} return(ret.nodeValue=value+"");}};jQuery.each(["width","height"],function(i,name){jQuery.attrHooks[name]=jQuery.extend(jQuery.attrHooks[name],{set:function(elem,value){if(value===""){elem.setAttribute(name,"auto");return value;}}});});} if(!jQuery.support.hrefNormalized){jQuery.each(["href","src","width","height"],function(i,name){jQuery.attrHooks[name]=jQuery.extend(jQuery.attrHooks[name],{get:function(elem){var ret=elem.getAttribute(name,2);return ret===null?undefined:ret;}});});} if(!jQuery.support.style){jQuery.attrHooks.style={get:function(elem){return elem.style.cssText.toLowerCase()||undefined;},set:function(elem,value){return(elem.style.cssText=""+value);}};} if(!jQuery.support.optSelected){jQuery.propHooks.selected=jQuery.extend(jQuery.propHooks.selected,{get:function(elem){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex;}} return null;}});} if(!jQuery.support.checkOn){jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={get:function(elem){return elem.getAttribute("value")===null?"on":elem.value;}};});} jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]=jQuery.extend(jQuery.valHooks[this],{set:function(elem,value){if(jQuery.isArray(value)){return(elem.checked=jQuery.inArray(jQuery(elem).val(),value)>=0);}}});});var rnamespaces=/\.(.*)$/,rformElems=/^(?:textarea|input|select)$/i,rperiod=/\./g,rspaces=/ /g,rescape=/[^\w\s.|`]/g,fcleanup=function(nm){return nm.replace(rescape,"\\$&");};jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType===3||elem.nodeType===8){return;} if(handler===false){handler=returnFalse;}else if(!handler){return;} var handleObjIn,handleObj;if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;} if(!handler.guid){handler.guid=jQuery.guid++;} var elemData=jQuery._data(elem);if(!elemData){return;} var events=elemData.events,eventHandle=elemData.handle;if(!events){elemData.events=events={};} if(!eventHandle){elemData.handle=eventHandle=function(e){return typeof jQuery!=="undefined"&&(!e||jQuery.event.triggered!==e.type)?jQuery.event.handle.apply(eventHandle.elem,arguments):undefined;};} eventHandle.elem=elem;types=types.split(" ");var type,i=0,namespaces;while((type=types[i++])){handleObj=handleObjIn?jQuery.extend({},handleObjIn):{handler:handler,data:data};if(type.indexOf(".")>-1){namespaces=type.split(".");type=namespaces.shift();handleObj.namespace=namespaces.slice(0).sort().join(".");}else{namespaces=[];handleObj.namespace="";} handleObj.type=type;if(!handleObj.guid){handleObj.guid=handler.guid;} var handlers=events[type],special=jQuery.event.special[type]||{};if(!handlers){handlers=events[type]=[];if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle,false);}else if(elem.attachEvent){elem.attachEvent("on"+type,eventHandle);}}} if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid;}} handlers.push(handleObj);jQuery.event.global[type]=true;} elem=null;},global:{},remove:function(elem,types,handler,pos){if(elem.nodeType===3||elem.nodeType===8){return;} if(handler===false){handler=returnFalse;} var ret,type,fn,j,i=0,all,namespaces,namespace,special,eventType,handleObj,origType,elemData=jQuery.hasData(elem)&&jQuery._data(elem),events=elemData&&elemData.events;if(!elemData||!events){return;} if(types&&types.type){handler=types.handler;types=types.type;} if(!types||typeof types==="string"&&types.charAt(0)==="."){types=types||"";for(type in events){jQuery.event.remove(elem,type+types);} return;} types=types.split(" ");while((type=types[i++])){origType=type;handleObj=null;all=type.indexOf(".")<0;namespaces=[];if(!all){namespaces=type.split(".");type=namespaces.shift();namespace=new RegExp("(^|\\.)"+ jQuery.map(namespaces.slice(0).sort(),fcleanup).join("\\.(?:.*\\.)?")+"(\\.|$)");} eventType=events[type];if(!eventType){continue;} if(!handler){for(j=0;j=0){type=type.slice(0,-1);exclusive=true;} if(type.indexOf(".")>=0){namespaces=type.split(".");type=namespaces.shift();namespaces.sort();} if((!elem||jQuery.event.customEvent[type])&&!jQuery.event.global[type]){return;} event=typeof event==="object"?event[jQuery.expando]?event:new jQuery.Event(type,event):new jQuery.Event(type);event.type=type;event.exclusive=exclusive;event.namespace=namespaces.join(".");event.namespace_re=new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.)?")+"(\\.|$)");if(onlyHandlers||!elem){event.preventDefault();event.stopPropagation();} if(!elem){jQuery.each(jQuery.cache,function(){var internalKey=jQuery.expando,internalCache=this[internalKey];if(internalCache&&internalCache.events&&internalCache.events[type]){jQuery.event.trigger(event,data,internalCache.handle.elem);}});return;} if(elem.nodeType===3||elem.nodeType===8){return;} event.result=undefined;event.target=elem;data=data!=null?jQuery.makeArray(data):[];data.unshift(event);var cur=elem,ontype=type.indexOf(":")<0?"on"+type:"";do{var handle=jQuery._data(cur,"handle");event.currentTarget=cur;if(handle){handle.apply(cur,data);} if(ontype&&jQuery.acceptData(cur)&&cur[ontype]&&cur[ontype].apply(cur,data)===false){event.result=false;event.preventDefault();} cur=cur.parentNode||cur.ownerDocument||cur===event.target.ownerDocument&&window;}while(cur&&!event.isPropagationStopped());if(!event.isDefaultPrevented()){var old,special=jQuery.event.special[type]||{};if((!special._default||special._default.call(elem.ownerDocument,event)===false)&&!(type==="click"&&jQuery.nodeName(elem,"a"))&&jQuery.acceptData(elem)){try{if(ontype&&elem[type]){old=elem[ontype];if(old){elem[ontype]=null;} jQuery.event.triggered=type;elem[type]();}}catch(ieError){} if(old){elem[ontype]=old;} jQuery.event.triggered=undefined;}} return event.result;},handle:function(event){event=jQuery.event.fix(event||window.event);var handlers=((jQuery._data(this,"events")||{})[event.type]||[]).slice(0),run_all=!event.exclusive&&!event.namespace,args=Array.prototype.slice.call(arguments,0);args[0]=event;event.currentTarget=this;for(var j=0,l=handlers.length;j-1?jQuery.map(elem.options,function(elem){return elem.selected;}).join("-"):"";}else if(jQuery.nodeName(elem,"select")){val=elem.selectedIndex;} return val;},testChange=function testChange(e){var elem=e.target,data,val;if(!rformElems.test(elem.nodeName)||elem.readOnly){return;} data=jQuery._data(elem,"_change_data");val=getVal(elem);if(e.type!=="focusout"||elem.type!=="radio"){jQuery._data(elem,"_change_data",val);} if(data===undefined||val===data){return;} if(data!=null||val){e.type="change";e.liveFired=undefined;jQuery.event.trigger(e,arguments[1],elem);}};jQuery.event.special.change={filters:{focusout:testChange,beforedeactivate:testChange,click:function(e){var elem=e.target,type=jQuery.nodeName(elem,"input")?elem.type:"";if(type==="radio"||type==="checkbox"||jQuery.nodeName(elem,"select")){testChange.call(this,e);}},keydown:function(e){var elem=e.target,type=jQuery.nodeName(elem,"input")?elem.type:"";if((e.keyCode===13&&!jQuery.nodeName(elem,"textarea"))||(e.keyCode===32&&(type==="checkbox"||type==="radio"))||type==="select-multiple"){testChange.call(this,e);}},beforeactivate:function(e){var elem=e.target;jQuery._data(elem,"_change_data",getVal(elem));}},setup:function(data,namespaces){if(this.type==="file"){return false;} for(var type in changeFilters){jQuery.event.add(this,type+".specialChange",changeFilters[type]);} return rformElems.test(this.nodeName);},teardown:function(namespaces){jQuery.event.remove(this,".specialChange");return rformElems.test(this.nodeName);}};changeFilters=jQuery.event.special.change.filters;changeFilters.focus=changeFilters.beforeactivate;} function trigger(type,elem,args){var event=jQuery.extend({},args[0]);event.type=type;event.originalEvent={};event.liveFired=undefined;jQuery.event.handle.call(elem,event);if(event.isDefaultPrevented()){args[0].preventDefault();}} if(!jQuery.support.focusinBubbles){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){var attaches=0;jQuery.event.special[fix]={setup:function(){if(attaches++===0){document.addEventListener(orig,handler,true);}},teardown:function(){if(--attaches===0){document.removeEventListener(orig,handler,true);}}};function handler(donor){var e=jQuery.event.fix(donor);e.type=fix;e.originalEvent={};jQuery.event.trigger(e,null,e.target);if(e.isDefaultPrevented()){donor.preventDefault();}}});} jQuery.each(["bind","one"],function(i,name){jQuery.fn[name]=function(type,data,fn){var handler;if(typeof type==="object"){for(var key in type){this[name](key,data,type[key],fn);} return this;} if(arguments.length===2||data===false){fn=data;data=undefined;} if(name==="one"){handler=function(event){jQuery(this).unbind(event,handler);return fn.apply(this,arguments);};handler.guid=fn.guid||jQuery.guid++;}else{handler=fn;} if(type==="unload"&&name!=="one"){this.one(type,data,fn);}else{for(var i=0,l=this.length;imaxLevel){break;} event.currentTarget=match.elem;event.data=match.handleObj.data;event.handleObj=match.handleObj;ret=match.handleObj.origHandler.apply(match.elem,arguments);if(ret===false||event.isPropagationStopped()){maxLevel=match.level;if(ret===false){stop=false;} if(event.isImmediatePropagationStopped()){break;}}} return stop;} function liveConvert(type,selector){return(type&&type!=="*"?type+".":"")+selector.replace(rperiod,"`").replace(rspaces,"&");} jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup error").split(" "),function(i,name){jQuery.fn[name]=function(data,fn){if(fn==null){fn=data;data=null;} return arguments.length>0?this.bind(name,data,fn):this.trigger(name);};if(jQuery.attrFn){jQuery.attrFn[name]=true;}}); /*! * Sizzle CSS Selector Engine * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,done=0,toString=Object.prototype.toString,hasDuplicate=false,baseHasDuplicate=true,rBackslash=/\\/g,rNonWord=/\W/;[0,0].sort(function(){baseHasDuplicate=false;return 0;});var Sizzle=function(selector,context,results,seed){results=results||[];context=context||document;var origContext=context;if(context.nodeType!==1&&context.nodeType!==9){return[];} if(!selector||typeof selector!=="string"){return results;} var m,set,checkSet,extra,ret,cur,pop,i,prune=true,contextXML=Sizzle.isXML(context),parts=[],soFar=selector;do{chunker.exec("");m=chunker.exec(soFar);if(m){soFar=m[3];parts.push(m[1]);if(m[2]){extra=m[3];break;}}}while(m);if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context);}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector]){selector+=parts.shift();} set=posProcess(selector,set);}}}else{if(!seed&&parts.length>1&&context.nodeType===9&&!contextXML&&Expr.match.ID.test(parts[0])&&!Expr.match.ID.test(parts[parts.length-1])){ret=Sizzle.find(parts.shift(),context,contextXML);context=ret.expr?Sizzle.filter(ret.expr,ret.set)[0]:ret.set[0];} if(context){ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&(parts[0]==="~"||parts[0]==="+")&&context.parentNode?context.parentNode:context,contextXML);set=ret.expr?Sizzle.filter(ret.expr,ret.set):ret.set;if(parts.length>0){checkSet=makeArray(set);}else{prune=false;} while(parts.length){cur=parts.pop();pop=cur;if(!Expr.relative[cur]){cur="";}else{pop=parts.pop();} if(pop==null){pop=context;} Expr.relative[cur](checkSet,pop,contextXML);}}else{checkSet=parts=[];}} if(!checkSet){checkSet=set;} if(!checkSet){Sizzle.error(cur||selector);} if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet);}else if(context&&context.nodeType===1){for(i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&Sizzle.contains(context,checkSet[i]))){results.push(set[i]);}}}else{for(i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i]);}}}}else{makeArray(checkSet,results);} if(extra){Sizzle(extra,origContext,results,seed);Sizzle.uniqueSort(results);} return results;};Sizzle.uniqueSort=function(results){if(sortOrder){hasDuplicate=baseHasDuplicate;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i0;};Sizzle.find=function(expr,context,isXML){var set;if(!expr){return[];} for(var i=0,l=Expr.order.length;i":function(checkSet,part){var elem,isPartStr=typeof part==="string",i=0,l=checkSet.length;if(isPartStr&&!rNonWord.test(part)){part=part.toLowerCase();for(;i=0)){if(!inplace){result.push(elem);}}else if(inplace){curLoop[i]=false;}}} return false;},ID:function(match){return match[1].replace(rBackslash,"");},TAG:function(match,curLoop){return match[1].replace(rBackslash,"").toLowerCase();},CHILD:function(match){if(match[1]==="nth"){if(!match[2]){Sizzle.error(match[0]);} match[2]=match[2].replace(/^\+|\s*/g,'');var test=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(match[2]==="even"&&"2n"||match[2]==="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0;} else if(match[2]){Sizzle.error(match[0]);} match[0]=done++;return match;},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1]=match[1].replace(rBackslash,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name];} match[4]=(match[4]||match[5]||"").replace(rBackslash,"");if(match[2]==="~="){match[4]=" "+match[4]+" ";} return match;},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if((chunker.exec(match[3])||"").length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop);}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret);} return false;}}else if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true;} return match;},POS:function(match){match.unshift(true);return match;}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden";},disabled:function(elem){return elem.disabled===true;},checked:function(elem){return elem.checked===true;},selected:function(elem){if(elem.parentNode){elem.parentNode.selectedIndex;} return elem.selected===true;},parent:function(elem){return!!elem.firstChild;},empty:function(elem){return!elem.firstChild;},has:function(elem,i,match){return!!Sizzle(match[3],elem).length;},header:function(elem){return(/h\d/i).test(elem.nodeName);},text:function(elem){var attr=elem.getAttribute("type"),type=elem.type;return elem.nodeName.toLowerCase()==="input"&&"text"===type&&(attr===type||attr===null);},radio:function(elem){return elem.nodeName.toLowerCase()==="input"&&"radio"===elem.type;},checkbox:function(elem){return elem.nodeName.toLowerCase()==="input"&&"checkbox"===elem.type;},file:function(elem){return elem.nodeName.toLowerCase()==="input"&&"file"===elem.type;},password:function(elem){return elem.nodeName.toLowerCase()==="input"&&"password"===elem.type;},submit:function(elem){var name=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&"submit"===elem.type;},image:function(elem){return elem.nodeName.toLowerCase()==="input"&&"image"===elem.type;},reset:function(elem){var name=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&"reset"===elem.type;},button:function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&"button"===elem.type||name==="button";},input:function(elem){return(/input|select|textarea|button/i).test(elem.nodeName);},focus:function(elem){return elem===elem.ownerDocument.activeElement;}},setFilters:{first:function(elem,i){return i===0;},last:function(elem,i,match,array){return i===array.length-1;},even:function(elem,i){return i%2===0;},odd:function(elem,i){return i%2===1;},lt:function(elem,i,match){return imatch[3]-0;},nth:function(elem,i,match){return match[3]-0===i;},eq:function(elem,i,match){return match[3]-0===i;}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array);}else if(name==="contains"){return(elem.textContent||elem.innerText||Sizzle.getText([elem])||"").indexOf(match[3])>=0;}else if(name==="not"){var not=match[3];for(var j=0,l=not.length;j=0);}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match;},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName.toLowerCase()===match;},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1;},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!==check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false;},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array);}}}};var origPOS=Expr.match.POS,fescape=function(all,num){return"\\"+(num-0+1);};for(var type in Expr.match){Expr.match[type]=new RegExp(Expr.match[type].source+(/(?![^\[]*\])(?![^\(]*\))/.source));Expr.leftMatch[type]=new RegExp(/(^(?:.|\r|\n)*?)/.source+Expr.match[type].source.replace(/\\(\d+)/g,fescape));} var makeArray=function(array,results){array=Array.prototype.slice.call(array,0);if(results){results.push.apply(results,array);return results;} return array;};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType;}catch(e){makeArray=function(array,results){var i=0,ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array);}else{if(typeof array.length==="number"){for(var l=array.length;i";root.insertBefore(form,root.firstChild);if(document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[];}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match;};} root.removeChild(form);root=form=null;})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i]);}} results=tmp;} return results;};} div.innerHTML="";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2);};} div=null;})();if(document.querySelectorAll){(function(){var oldSizzle=Sizzle,div=document.createElement("div"),id="__sizzle__";div.innerHTML="

";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return;} Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&!Sizzle.isXML(context)){var match=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(query);if(match&&(context.nodeType===1||context.nodeType===9)){if(match[1]){return makeArray(context.getElementsByTagName(query),extra);}else if(match[2]&&Expr.find.CLASS&&context.getElementsByClassName){return makeArray(context.getElementsByClassName(match[2]),extra);}} if(context.nodeType===9){if(query==="body"&&context.body){return makeArray([context.body],extra);}else if(match&&match[3]){var elem=context.getElementById(match[3]);if(elem&&elem.parentNode){if(elem.id===match[3]){return makeArray([elem],extra);}}else{return makeArray([],extra);}} try{return makeArray(context.querySelectorAll(query),extra);}catch(qsaError){}}else if(context.nodeType===1&&context.nodeName.toLowerCase()!=="object"){var oldContext=context,old=context.getAttribute("id"),nid=old||id,hasParent=context.parentNode,relativeHierarchySelector=/^\s*[+~]/.test(query);if(!old){context.setAttribute("id",nid);}else{nid=nid.replace(/'/g,"\\$&");} if(relativeHierarchySelector&&hasParent){context=context.parentNode;} try{if(!relativeHierarchySelector||hasParent){return makeArray(context.querySelectorAll("[id='"+nid+"'] "+query),extra);}}catch(pseudoError){}finally{if(!old){oldContext.removeAttribute("id");}}}} return oldSizzle(query,context,extra,seed);};for(var prop in oldSizzle){Sizzle[prop]=oldSizzle[prop];} div=null;})();} (function(){var html=document.documentElement,matches=html.matchesSelector||html.mozMatchesSelector||html.webkitMatchesSelector||html.msMatchesSelector;if(matches){var disconnectedMatch=!matches.call(document.createElement("div"),"div"),pseudoWorks=false;try{matches.call(document.documentElement,"[test!='']:sizzle");}catch(pseudoError){pseudoWorks=true;} Sizzle.matchesSelector=function(node,expr){expr=expr.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!Sizzle.isXML(node)){try{if(pseudoWorks||!Expr.match.PSEUDO.test(expr)&&!/!=/.test(expr)){var ret=matches.call(node,expr);if(ret||!disconnectedMatch||node.document&&node.document.nodeType!==11){return ret;}}}catch(e){}} return Sizzle(expr,null,null,[node]).length>0;};}})();(function(){var div=document.createElement("div");div.innerHTML="
";if(!div.getElementsByClassName||div.getElementsByClassName("e").length===0){return;} div.lastChild.className="e";if(div.getElementsByClassName("e").length===1){return;} Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1]);}};div=null;})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i0){match=elem;break;}} elem=elem[dir];} checkSet[i]=match;}}} if(document.documentElement.contains){Sizzle.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):true);};}else if(document.documentElement.compareDocumentPosition){Sizzle.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16);};}else{Sizzle.contains=function(){return false;};} Sizzle.isXML=function(elem){var documentElement=(elem?elem.ownerDocument||elem:0).documentElement;return documentElement?documentElement.nodeName!=="HTML":false;};var posProcess=function(selector,context){var match,tmpSet=[],later="",root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"");} selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i0){for(n=length;n0:this.filter(selector).length>0);},closest:function(selectors,context){var ret=[],i,l,cur=this[0];if(jQuery.isArray(selectors)){var match,selector,matches={},level=1;if(cur&&selectors.length){for(i=0,l=selectors.length;i-1:jQuery(cur).is(match)){ret.push({selector:selector,elem:cur,level:level});}} cur=cur.parentNode;level++;}} return ret;} var pos=POS.test(selectors)||typeof selectors!=="string"?jQuery(selectors,context||this.context):0;for(i=0,l=this.length;i-1:jQuery.find.matchesSelector(cur,selectors)){ret.push(cur);break;}else{cur=cur.parentNode;if(!cur||!cur.ownerDocument||cur===context||cur.nodeType===11){break;}}}} ret=ret.length>1?jQuery.unique(ret):ret;return this.pushStack(ret,"closest",selectors);},index:function(elem){if(!elem){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1;} if(typeof elem==="string"){return jQuery.inArray(this[0],jQuery(elem));} return jQuery.inArray(elem.jquery?elem[0]:elem,this);},add:function(selector,context){var set=typeof selector==="string"?jQuery(selector,context):jQuery.makeArray(selector&&selector.nodeType?[selector]:selector),all=jQuery.merge(this.get(),set);return this.pushStack(isDisconnected(set[0])||isDisconnected(all[0])?all:jQuery.unique(all));},andSelf:function(){return this.add(this.prevObject);}});function isDisconnected(node){return!node||!node.parentNode||node.parentNode.nodeType===11;} jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null;},parents:function(elem){return jQuery.dir(elem,"parentNode");},parentsUntil:function(elem,i,until){return jQuery.dir(elem,"parentNode",until);},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},nextUntil:function(elem,i,until){return jQuery.dir(elem,"nextSibling",until);},prevUntil:function(elem,i,until){return jQuery.dir(elem,"previousSibling",until);},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until),args=slice.call(arguments);if(!runtil.test(name)){selector=until;} if(selector&&typeof selector==="string"){ret=jQuery.filter(selector,ret);} ret=this.length>1&&!guaranteedUnique[name]?jQuery.unique(ret):ret;if((this.length>1||rmultiselector.test(selector))&&rparentsprev.test(name)){ret=ret.reverse();} return this.pushStack(ret,name,args.join(","));};});jQuery.extend({filter:function(expr,elems,not){if(not){expr=":not("+expr+")";} return elems.length===1?jQuery.find.matchesSelector(elems[0],expr)?[elems[0]]:[]:jQuery.find.matches(expr,elems);},dir:function(elem,dir,until){var matched=[],cur=elem[dir];while(cur&&cur.nodeType!==9&&(until===undefined||cur.nodeType!==1||!jQuery(cur).is(until))){if(cur.nodeType===1){matched.push(cur);} cur=cur[dir];} return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType===1&&++num===result){break;}} return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){r.push(n);}} return r;}});function winnow(elements,qualifier,keep){qualifier=qualifier||0;if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){var retVal=!!qualifier.call(elem,i,elem);return retVal===keep;});}else if(qualifier.nodeType){return jQuery.grep(elements,function(elem,i){return(elem===qualifier)===keep;});}else if(typeof qualifier==="string"){var filtered=jQuery.grep(elements,function(elem){return elem.nodeType===1;});if(isSimple.test(qualifier)){return jQuery.filter(qualifier,filtered,!keep);}else{qualifier=jQuery.filter(qualifier,filtered);}} return jQuery.grep(elements,function(elem,i){return(jQuery.inArray(elem,qualifier)>=0)===keep;});} var rinlinejQuery=/ jQuery\d+="(?:\d+|null)"/g,rleadingWhitespace=/^\s+/,rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,rtagName=/<([\w:]+)/,rtbody=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;if(!jQuery.support.htmlSerialize){wrapMap._default=[1,"div
","
"];} jQuery.fn.extend({text:function(text){if(jQuery.isFunction(text)){return this.each(function(i){var self=jQuery(this);self.text(text.call(this,i,self.text()));});} if(typeof text!=="object"&&text!==undefined){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));} return jQuery.text(this);},wrapAll:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapAll(html.call(this,i));});} if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0]);} wrap.map(function(){var elem=this;while(elem.firstChild&&elem.firstChild.nodeType===1){elem=elem.firstChild;} return elem;}).append(this);} return this;},wrapInner:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i));});} return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html);}else{self.append(html);}});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},unwrap:function(){return this.parent().each(function(){if(!jQuery.nodeName(this,"body")){jQuery(this).replaceWith(this.childNodes);}}).end();},append:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType===1){this.appendChild(elem);}});},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType===1){this.insertBefore(elem,this.firstChild);}});},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this);});}else if(arguments.length){var set=jQuery(arguments[0]);set.push.apply(set,this.toArray());return this.pushStack(set,"before",arguments);}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});}else if(arguments.length){var set=this.pushStack(this,"after",arguments);set.push.apply(set,jQuery(arguments[0]).toArray());return set;}},remove:function(selector,keepData){for(var i=0,elem;(elem=this[i])!=null;i++){if(!selector||jQuery.filter(selector,[elem]).length){if(!keepData&&elem.nodeType===1){jQuery.cleanData(elem.getElementsByTagName("*"));jQuery.cleanData([elem]);} if(elem.parentNode){elem.parentNode.removeChild(elem);}}} return this;},empty:function(){for(var i=0,elem;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(elem.getElementsByTagName("*"));} while(elem.firstChild){elem.removeChild(elem.firstChild);}} return this;},clone:function(dataAndEvents,deepDataAndEvents){dataAndEvents=dataAndEvents==null?false:dataAndEvents;deepDataAndEvents=deepDataAndEvents==null?dataAndEvents:deepDataAndEvents;return this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents);});},html:function(value){if(value===undefined){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(rinlinejQuery,""):null;}else if(typeof value==="string"&&!rnocache.test(value)&&(jQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,"<$1>");try{for(var i=0,l=this.length;i1&&i0?this.clone(true):this).get();jQuery(insert[i])[original](elems);ret=ret.concat(elems);} return this.pushStack(ret,name,insert.selector);}};});function getAll(elem){if("getElementsByTagName"in elem){return elem.getElementsByTagName("*");}else if("querySelectorAll"in elem){return elem.querySelectorAll("*");}else{return[];}} function fixDefaultChecked(elem){if(elem.type==="checkbox"||elem.type==="radio"){elem.defaultChecked=elem.checked;}} function findInputs(elem){if(jQuery.nodeName(elem,"input")){fixDefaultChecked(elem);}else if("getElementsByTagName"in elem){jQuery.grep(elem.getElementsByTagName("input"),fixDefaultChecked);}} jQuery.extend({clone:function(elem,dataAndEvents,deepDataAndEvents){var clone=elem.cloneNode(true),srcElements,destElements,i;if((!jQuery.support.noCloneEvent||!jQuery.support.noCloneChecked)&&(elem.nodeType===1||elem.nodeType===11)&&!jQuery.isXMLDoc(elem)){cloneFixAttributes(elem,clone);srcElements=getAll(elem);destElements=getAll(clone);for(i=0;srcElements[i];++i){if(destElements[i]){cloneFixAttributes(srcElements[i],destElements[i]);}}} if(dataAndEvents){cloneCopyEvent(elem,clone);if(deepDataAndEvents){srcElements=getAll(elem);destElements=getAll(clone);for(i=0;srcElements[i];++i){cloneCopyEvent(srcElements[i],destElements[i]);}}} srcElements=destElements=null;return clone;},clean:function(elems,context,fragment,scripts){var checkScriptType;context=context||document;if(typeof context.createElement==="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;} var ret=[],j;for(var i=0,elem;(elem=elems[i])!=null;i++){if(typeof elem==="number"){elem+="";} if(!elem){continue;} if(typeof elem==="string"){if(!rhtml.test(elem)){elem=context.createTextNode(elem);}else{elem=elem.replace(rxhtmlTag,"<$1>");var tag=(rtagName.exec(elem)||["",""])[1].toLowerCase(),wrap=wrapMap[tag]||wrapMap._default,depth=wrap[0],div=context.createElement("div");div.innerHTML=wrap[1]+elem+wrap[2];while(depth--){div=div.lastChild;} if(!jQuery.support.tbody){var hasBody=rtbody.test(elem),tbody=tag==="table"&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]===""&&!hasBody?div.childNodes:[];for(j=tbody.length-1;j>=0;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j]);}}} if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)){div.insertBefore(context.createTextNode(rleadingWhitespace.exec(elem)[0]),div.firstChild);} elem=div.childNodes;}} var len;if(!jQuery.support.appendChecked){if(elem[0]&&typeof(len=elem.length)==="number"){for(j=0;j=0){return value+"px";}}else{return value;}}};});if(!jQuery.support.opacity){jQuery.cssHooks.opacity={get:function(elem,computed){return ropacity.test((computed&&elem.currentStyle?elem.currentStyle.filter:elem.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":computed?"1":"";},set:function(elem,value){var style=elem.style,currentStyle=elem.currentStyle,opacity=jQuery.isNaN(value)?"":"alpha(opacity="+value*100+")",filter=currentStyle&¤tStyle.filter||style.filter||"";style.zoom=1;if(value>=1&&jQuery.trim(filter.replace(ralpha,""))===""){style.removeAttribute("filter");if(currentStyle&&!currentStyle.filter){return;}} style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):filter+" "+opacity;}};} jQuery(function(){if(!jQuery.support.reliableMarginRight){jQuery.cssHooks.marginRight={get:function(elem,computed){var ret;jQuery.swap(elem,{"display":"inline-block"},function(){if(computed){ret=curCSS(elem,"margin-right","marginRight");}else{ret=elem.style.marginRight;}});return ret;}};}});if(document.defaultView&&document.defaultView.getComputedStyle){getComputedStyle=function(elem,name){var ret,defaultView,computedStyle;name=name.replace(rupper,"-$1").toLowerCase();if(!(defaultView=elem.ownerDocument.defaultView)){return undefined;} if((computedStyle=defaultView.getComputedStyle(elem,null))){ret=computedStyle.getPropertyValue(name);if(ret===""&&!jQuery.contains(elem.ownerDocument.documentElement,elem)){ret=jQuery.style(elem,name);}} return ret;};} if(document.documentElement.currentStyle){currentStyle=function(elem,name){var left,ret=elem.currentStyle&&elem.currentStyle[name],rsLeft=elem.runtimeStyle&&elem.runtimeStyle[name],style=elem.style;if(!rnumpx.test(ret)&&rnum.test(ret)){left=style.left;if(rsLeft){elem.runtimeStyle.left=elem.currentStyle.left;} style.left=name==="fontSize"?"1em":(ret||0);ret=style.pixelLeft+"px";style.left=left;if(rsLeft){elem.runtimeStyle.left=rsLeft;}} return ret===""?"auto":ret;};} curCSS=getComputedStyle||currentStyle;function getWH(elem,name,extra){var val=name==="width"?elem.offsetWidth:elem.offsetHeight,which=name==="width"?cssWidth:cssHeight;if(val>0){if(extra!=="border"){jQuery.each(which,function(){if(!extra){val-=parseFloat(jQuery.css(elem,"padding"+this))||0;} if(extra==="margin"){val+=parseFloat(jQuery.css(elem,extra+this))||0;}else{val-=parseFloat(jQuery.css(elem,"border"+this+"Width"))||0;}});} return val+"px";} val=curCSS(elem,name,name);if(val<0||val==null){val=elem.style[name]||0;} val=parseFloat(val)||0;if(extra){jQuery.each(which,function(){val+=parseFloat(jQuery.css(elem,"padding"+this))||0;if(extra!=="padding"){val+=parseFloat(jQuery.css(elem,"border"+this+"Width"))||0;} if(extra==="margin"){val+=parseFloat(jQuery.css(elem,extra+this))||0;}});} return val+"px";} if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.hidden=function(elem){var width=elem.offsetWidth,height=elem.offsetHeight;return(width===0&&height===0)||(!jQuery.support.reliableHiddenOffsets&&(elem.style.display||jQuery.css(elem,"display"))==="none");};jQuery.expr.filters.visible=function(elem){return!jQuery.expr.filters.hidden(elem);};} var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rhash=/#.*$/,rheaders=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,rinput=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,rlocalProtocol=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,rquery=/\?/,rscript=/)<[^<]*)*<\/script>/gi,rselectTextarea=/^(?:select|textarea)/i,rspacesAjax=/\s+/,rts=/([?&])_=[^&]*/,rurl=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,_load=jQuery.fn.load,prefilters={},transports={},ajaxLocation,ajaxLocParts,allTypes=["*/"]+["*"];try{ajaxLocation=location.href;}catch(e){ajaxLocation=document.createElement("a");ajaxLocation.href="";ajaxLocation=ajaxLocation.href;} ajaxLocParts=rurl.exec(ajaxLocation.toLowerCase())||[];function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){if(typeof dataTypeExpression!=="string"){func=dataTypeExpression;dataTypeExpression="*";} if(jQuery.isFunction(func)){var dataTypes=dataTypeExpression.toLowerCase().split(rspacesAjax),i=0,length=dataTypes.length,dataType,list,placeBefore;for(;i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);} var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=undefined;}else if(typeof params==="object"){params=jQuery.param(params,jQuery.ajaxSettings.traditional);type="POST";}} var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(jqXHR,status,responseText){responseText=jqXHR.responseText;if(jqXHR.isResolved()){jqXHR.done(function(r){responseText=r;});self.html(selector?jQuery("
").append(responseText.replace(rscript,"")).find(selector):responseText);} if(callback){self.each(callback,[responseText,status,jqXHR]);}}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||rselectTextarea.test(this.nodeName)||rinput.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val.replace(rCRLF,"\r\n")};}):{name:elem.name,value:val.replace(rCRLF,"\r\n")};}).get();}});jQuery.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=undefined;} return jQuery.ajax({type:method,url:url,data:data,success:callback,dataType:type});};});jQuery.extend({getScript:function(url,callback){return jQuery.get(url,undefined,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},ajaxSetup:function(target,settings){if(settings){ajaxExtend(target,jQuery.ajaxSettings);}else{settings=target;target=jQuery.ajaxSettings;} ajaxExtend(target,settings);return target;},ajaxSettings:{url:ajaxLocation,isLocal:rlocalProtocol.test(ajaxLocParts[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":allTypes},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":window.String,"text html":true,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){if(typeof url==="object"){options=url;url=undefined;} options=options||{};var s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=callbackContext!==s&&(callbackContext.nodeType||callbackContext instanceof jQuery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery._Deferred(),statusCode=s.statusCode||{},ifModifiedKey,requestHeaders={},requestHeadersNames={},responseHeadersString,responseHeaders,transport,timeoutTimer,parts,state=0,fireGlobals,i,jqXHR={readyState:0,setRequestHeader:function(name,value){if(!state){var lname=name.toLowerCase();name=requestHeadersNames[lname]=requestHeadersNames[lname]||name;requestHeaders[name]=value;} return this;},getAllResponseHeaders:function(){return state===2?responseHeadersString:null;},getResponseHeader:function(key){var match;if(state===2){if(!responseHeaders){responseHeaders={};while((match=rheaders.exec(responseHeadersString))){responseHeaders[match[1].toLowerCase()]=match[2];}} match=responseHeaders[key.toLowerCase()];} return match===undefined?null:match;},overrideMimeType:function(type){if(!state){s.mimeType=type;} return this;},abort:function(statusText){statusText=statusText||"abort";if(transport){transport.abort(statusText);} done(0,statusText);return this;}};function done(status,nativeStatusText,responses,headers){if(state===2){return;} state=2;if(timeoutTimer){clearTimeout(timeoutTimer);} transport=undefined;responseHeadersString=headers||"";jqXHR.readyState=status>0?4:0;var isSuccess,success,error,statusText=nativeStatusText,response=responses?ajaxHandleResponses(s,jqXHR,responses):undefined,lastModified,etag;if(status>=200&&status<300||status===304){if(s.ifModified){if((lastModified=jqXHR.getResponseHeader("Last-Modified"))){jQuery.lastModified[ifModifiedKey]=lastModified;} if((etag=jqXHR.getResponseHeader("Etag"))){jQuery.etag[ifModifiedKey]=etag;}} if(status===304){statusText="notmodified";isSuccess=true;}else{try{success=ajaxConvert(s,response);statusText="success";isSuccess=true;}catch(e){statusText="parsererror";error=e;}}}else{error=statusText;if(!statusText||status){statusText="error";if(status<0){status=0;}}} jqXHR.status=status;jqXHR.statusText=""+(nativeStatusText||statusText);if(isSuccess){deferred.resolveWith(callbackContext,[success,statusText,jqXHR]);}else{deferred.rejectWith(callbackContext,[jqXHR,statusText,error]);} jqXHR.statusCode(statusCode);statusCode=undefined;if(fireGlobals){globalEventContext.trigger("ajax"+(isSuccess?"Success":"Error"),[jqXHR,s,isSuccess?success:error]);} completeDeferred.resolveWith(callbackContext,[jqXHR,statusText]);if(fireGlobals){globalEventContext.trigger("ajaxComplete",[jqXHR,s]);if(!(--jQuery.active)){jQuery.event.trigger("ajaxStop");}}} deferred.promise(jqXHR);jqXHR.success=jqXHR.done;jqXHR.error=jqXHR.fail;jqXHR.complete=completeDeferred.done;jqXHR.statusCode=function(map){if(map){var tmp;if(state<2){for(tmp in map){statusCode[tmp]=[statusCode[tmp],map[tmp]];}}else{tmp=map[jqXHR.status];jqXHR.then(tmp,tmp);}} return this;};s.url=((url||s.url)+"").replace(rhash,"").replace(rprotocol,ajaxLocParts[1]+"//");s.dataTypes=jQuery.trim(s.dataType||"*").toLowerCase().split(rspacesAjax);if(s.crossDomain==null){parts=rurl.exec(s.url.toLowerCase());s.crossDomain=!!(parts&&(parts[1]!=ajaxLocParts[1]||parts[2]!=ajaxLocParts[2]||(parts[3]||(parts[1]==="http:"?80:443))!=(ajaxLocParts[3]||(ajaxLocParts[1]==="http:"?80:443))));} if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional);} inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);if(state===2){return false;} fireGlobals=s.global;s.type=s.type.toUpperCase();s.hasContent=!rnoContent.test(s.type);if(fireGlobals&&jQuery.active++===0){jQuery.event.trigger("ajaxStart");} if(!s.hasContent){if(s.data){s.url+=(rquery.test(s.url)?"&":"?")+s.data;delete s.data;} ifModifiedKey=s.url;if(s.cache===false){var ts=jQuery.now(),ret=s.url.replace(rts,"$1_="+ts);s.url=ret+((ret===s.url)?(rquery.test(s.url)?"&":"?")+"_="+ts:"");}} if(s.data&&s.hasContent&&s.contentType!==false||options.contentType){jqXHR.setRequestHeader("Content-Type",s.contentType);} if(s.ifModified){ifModifiedKey=ifModifiedKey||s.url;if(jQuery.lastModified[ifModifiedKey]){jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[ifModifiedKey]);} if(jQuery.etag[ifModifiedKey]){jqXHR.setRequestHeader("If-None-Match",jQuery.etag[ifModifiedKey]);}} jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+(s.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i]);} if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===false||state===2)){jqXHR.abort();return false;} for(i in{success:1,error:1,complete:1}){jqXHR[i](s[i]);} transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR);if(!transport){done(-1,"No Transport");}else{jqXHR.readyState=1;if(fireGlobals){globalEventContext.trigger("ajaxSend",[jqXHR,s]);} if(s.async&&s.timeout>0){timeoutTimer=setTimeout(function(){jqXHR.abort("timeout");},s.timeout);} try{state=1;transport.send(requestHeaders,done);}catch(e){if(state<2){done(-1,e);}else{jQuery.error(e);}}} return jqXHR;},param:function(a,traditional){var s=[],add=function(key,value){value=jQuery.isFunction(value)?value():value;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value);};if(traditional===undefined){traditional=jQuery.ajaxSettings.traditional;} if(jQuery.isArray(a)||(a.jquery&&!jQuery.isPlainObject(a))){jQuery.each(a,function(){add(this.name,this.value);});}else{for(var prefix in a){buildParams(prefix,a[prefix],traditional,add);}} return s.join("&").replace(r20,"+");}});function buildParams(prefix,obj,traditional,add){if(jQuery.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)){add(prefix,v);}else{buildParams(prefix+"["+(typeof v==="object"||jQuery.isArray(v)?i:"")+"]",v,traditional,add);}});}else if(!traditional&&obj!=null&&typeof obj==="object"){for(var name in obj){buildParams(prefix+"["+name+"]",obj[name],traditional,add);}}else{add(prefix,obj);}} jQuery.extend({active:0,lastModified:{},etag:{}});function ajaxHandleResponses(s,jqXHR,responses){var contents=s.contents,dataTypes=s.dataTypes,responseFields=s.responseFields,ct,type,finalDataType,firstDataType;for(type in responseFields){if(type in responses){jqXHR[responseFields[type]]=responses[type];}} while(dataTypes[0]==="*"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader("content-type");}} if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}} if(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break;} if(!firstDataType){firstDataType=type;}} finalDataType=finalDataType||firstDataType;} if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);} return responses[finalDataType];}} function ajaxConvert(s,response){if(s.dataFilter){response=s.dataFilter(response,s.dataType);} var dataTypes=s.dataTypes,converters={},i,key,length=dataTypes.length,tmp,current=dataTypes[0],prev,conversion,conv,conv1,conv2;for(i=1;i=options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();options.animatedProperties[this.prop]=true;for(i in options.animatedProperties){if(options.animatedProperties[i]!==true){done=false;}} if(done){if(options.overflow!=null&&!jQuery.support.shrinkWrapBlocks){jQuery.each(["","X","Y"],function(index,value){elem.style["overflow"+value]=options.overflow[index];});} if(options.hide){jQuery(elem).hide();} if(options.hide||options.show){for(var p in options.animatedProperties){jQuery.style(elem,p,options.orig[p]);}} options.complete.call(elem);} return false;}else{if(options.duration==Infinity){this.now=t;}else{n=t-this.startTime;this.state=n/options.duration;this.pos=jQuery.easing[options.animatedProperties[this.prop]](this.state,n,0,1,options.duration);this.now=this.start+((this.end-this.start)*this.pos);} this.update();} return true;}};jQuery.extend(jQuery.fx,{tick:function(){for(var timers=jQuery.timers,i=0;i").appendTo(body),display=elem.css("display");elem.remove();if(display==="none"||display===""){if(!iframe){iframe=document.createElement("iframe");iframe.frameBorder=iframe.width=iframe.height=0;} body.appendChild(iframe);if(!iframeDoc||!iframe.createElement){iframeDoc=(iframe.contentWindow||iframe.contentDocument).document;iframeDoc.write((document.compatMode==="CSS1Compat"?"":"")+"");iframeDoc.close();} elem=iframeDoc.createElement(nodeName);iframeDoc.body.appendChild(elem);display=jQuery.css(elem,"display");body.removeChild(iframe);} elemdisplay[nodeName]=display;} return elemdisplay[nodeName];} var rtable=/^t(?:able|d|h)$/i,rroot=/^(?:body|html)$/i;if("getBoundingClientRect"in document.documentElement){jQuery.fn.offset=function(options){var elem=this[0],box;if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i);});} if(!elem||!elem.ownerDocument){return null;} if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem);} try{box=elem.getBoundingClientRect();}catch(e){} var doc=elem.ownerDocument,docElem=doc.documentElement;if(!box||!jQuery.contains(docElem,elem)){return box?{top:box.top,left:box.left}:{top:0,left:0};} var body=doc.body,win=getWindow(doc),clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,scrollTop=win.pageYOffset||jQuery.support.boxModel&&docElem.scrollTop||body.scrollTop,scrollLeft=win.pageXOffset||jQuery.support.boxModel&&docElem.scrollLeft||body.scrollLeft,top=box.top+scrollTop-clientTop,left=box.left+scrollLeft-clientLeft;return{top:top,left:left};};}else{jQuery.fn.offset=function(options){var elem=this[0];if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i);});} if(!elem||!elem.ownerDocument){return null;} if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem);} jQuery.offset.initialize();var computedStyle,offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle,top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){if(jQuery.offset.supportsFixedPosition&&prevComputedStyle.position==="fixed"){break;} computedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle;top-=elem.scrollTop;left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop;left+=elem.offsetLeft;if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&rtable.test(elem.nodeName))){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0;} prevOffsetParent=offsetParent;offsetParent=elem.offsetParent;} if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible"){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0;} prevComputedStyle=computedStyle;} if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static"){top+=body.offsetTop;left+=body.offsetLeft;} if(jQuery.offset.supportsFixedPosition&&prevComputedStyle.position==="fixed"){top+=Math.max(docElem.scrollTop,body.scrollTop);left+=Math.max(docElem.scrollLeft,body.scrollLeft);} return{top:top,left:left};};} jQuery.offset={initialize:function(){var body=document.body,container=document.createElement("div"),innerDiv,checkDiv,table,td,bodyMarginTop=parseFloat(jQuery.css(body,"marginTop"))||0,html="
";jQuery.extend(container.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild;checkDiv=innerDiv.firstChild;td=innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(checkDiv.offsetTop!==5);this.doesAddBorderForTableAndCells=(td.offsetTop===5);checkDiv.style.position="fixed";checkDiv.style.top="20px";this.supportsFixedPosition=(checkDiv.offsetTop===20||checkDiv.offsetTop===15);checkDiv.style.position=checkDiv.style.top="";innerDiv.style.overflow="hidden";innerDiv.style.position="relative";this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(body.offsetTop!==bodyMarginTop);body.removeChild(container);jQuery.offset.initialize=jQuery.noop;},bodyOffset:function(body){var top=body.offsetTop,left=body.offsetLeft;jQuery.offset.initialize();if(jQuery.offset.doesNotIncludeMarginInBodyOffset){top+=parseFloat(jQuery.css(body,"marginTop"))||0;left+=parseFloat(jQuery.css(body,"marginLeft"))||0;} return{top:top,left:left};},setOffset:function(elem,options,i){var position=jQuery.css(elem,"position");if(position==="static"){elem.style.position="relative";} var curElem=jQuery(elem),curOffset=curElem.offset(),curCSSTop=jQuery.css(elem,"top"),curCSSLeft=jQuery.css(elem,"left"),calculatePosition=(position==="absolute"||position==="fixed")&&jQuery.inArray("auto",[curCSSTop,curCSSLeft])>-1,props={},curPosition={},curTop,curLeft;if(calculatePosition){curPosition=curElem.position();curTop=curPosition.top;curLeft=curPosition.left;}else{curTop=parseFloat(curCSSTop)||0;curLeft=parseFloat(curCSSLeft)||0;} if(jQuery.isFunction(options)){options=options.call(elem,i,curOffset);} if(options.top!=null){props.top=(options.top-curOffset.top)+curTop;} if(options.left!=null){props.left=(options.left-curOffset.left)+curLeft;} if("using"in options){options.using.call(elem,props);}else{curElem.css(props);}}};jQuery.fn.extend({position:function(){if(!this[0]){return null;} var elem=this[0],offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=rroot.test(offsetParent[0].nodeName)?{top:0,left:0}:offsetParent.offset();offset.top-=parseFloat(jQuery.css(elem,"marginTop"))||0;offset.left-=parseFloat(jQuery.css(elem,"marginLeft"))||0;parentOffset.top+=parseFloat(jQuery.css(offsetParent[0],"borderTopWidth"))||0;parentOffset.left+=parseFloat(jQuery.css(offsetParent[0],"borderLeftWidth"))||0;return{top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent||document.body;while(offsetParent&&(!rroot.test(offsetParent.nodeName)&&jQuery.css(offsetParent,"position")==="static")){offsetParent=offsetParent.offsetParent;} return offsetParent;});}});jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;jQuery.fn[method]=function(val){var elem,win;if(val===undefined){elem=this[0];if(!elem){return null;} win=getWindow(elem);return win?("pageXOffset"in win)?win[i?"pageYOffset":"pageXOffset"]:jQuery.support.boxModel&&win.document.documentElement[method]||win.document.body[method]:elem[method];} return this.each(function(){win=getWindow(this);if(win){win.scrollTo(!i?val:jQuery(win).scrollLeft(),i?val:jQuery(win).scrollTop());}else{this[method]=val;}});};});function getWindow(elem){return jQuery.isWindow(elem)?elem:elem.nodeType===9?elem.defaultView||elem.parentWindow:false;} jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn["inner"+name]=function(){var elem=this[0];return elem&&elem.style?parseFloat(jQuery.css(elem,type,"padding")):null;};jQuery.fn["outer"+name]=function(margin){var elem=this[0];return elem&&elem.style?parseFloat(jQuery.css(elem,type,margin?"margin":"border")):null;};jQuery.fn[type]=function(size){var elem=this[0];if(!elem){return size==null?null:this;} if(jQuery.isFunction(size)){return this.each(function(i){var self=jQuery(this);self[type](size.call(this,i,self[type]()));});} if(jQuery.isWindow(elem)){var docElemProp=elem.document.documentElement["client"+name],body=elem.document.body;return elem.document.compatMode==="CSS1Compat"&&docElemProp||body&&body["client"+name]||docElemProp;}else if(elem.nodeType===9){return Math.max(elem.documentElement["client"+name],elem.body["scroll"+name],elem.documentElement["scroll"+name],elem.body["offset"+name],elem.documentElement["offset"+name]);}else if(size===undefined){var orig=jQuery.css(elem,type),ret=parseFloat(orig);return jQuery.isNaN(ret)?orig:ret;}else{return this.css(type,typeof size==="string"?size:size+"px");}};});window.jQuery=window.$=jQuery;})(window);;(function(){var root=this;var previousBackbone=root.Backbone;var Backbone;if(typeof exports!=='undefined'){Backbone=exports;}else{Backbone=root.Backbone={};} Backbone.VERSION='0.5.3';var _=root._;if(!_&&(typeof require!=='undefined'))_=require('underscore')._;var $=root.jQuery||root.Zepto;Backbone.noConflict=function(){root.Backbone=previousBackbone;return this;};Backbone.emulateHTTP=false;Backbone.emulateJSON=false;Backbone.Events={bind:function(ev,callback,context){var calls=this._callbacks||(this._callbacks={});var list=calls[ev]||(calls[ev]=[]);list.push([callback,context]);return this;},unbind:function(ev,callback){var calls;if(!ev){this._callbacks={};}else if(calls=this._callbacks){if(!callback){calls[ev]=[];}else{var list=calls[ev];if(!list)return this;for(var i=0,l=list.length;i').hide().appendTo('body')[0].contentWindow;this.navigate(fragment);} if(this._hasPushState){$(window).bind('popstate',this.checkUrl);}else if('onhashchange'in window&&!oldIE){$(window).bind('hashchange',this.checkUrl);}else{setInterval(this.checkUrl,this.interval);} this.fragment=fragment;historyStarted=true;var loc=window.location;var atRoot=loc.pathname==this.options.root;if(this._wantsPushState&&!this._hasPushState&&!atRoot){this.fragment=this.getFragment(null,true);window.location.replace(this.options.root+'#'+this.fragment);return true;}else if(this._wantsPushState&&this._hasPushState&&atRoot&&loc.hash){this.fragment=loc.hash.replace(hashStrip,'');window.history.replaceState({},document.title,loc.protocol+'//'+loc.host+this.options.root+this.fragment);} if(!this.options.silent){return this.loadUrl();}},route:function(route,callback){this.handlers.unshift({route:route,callback:callback});},checkUrl:function(e){var current=this.getFragment();if(current==this.fragment&&this.iframe)current=this.getFragment(this.iframe.location.hash);if(current==this.fragment||current==decodeURIComponent(this.fragment))return false;if(this.iframe)this.navigate(current);this.loadUrl()||this.loadUrl(window.location.hash);},loadUrl:function(fragmentOverride){var fragment=this.fragment=this.getFragment(fragmentOverride);var matched=_.any(this.handlers,function(handler){if(handler.route.test(fragment)){handler.callback(fragment);return true;}});return matched;},navigate:function(fragment,triggerRoute){var frag=(fragment||'').replace(hashStrip,'');if(this.fragment==frag||this.fragment==decodeURIComponent(frag))return;if(this._hasPushState){var loc=window.location;if(frag.indexOf(this.options.root)!=0)frag=this.options.root+frag;this.fragment=frag;window.history.pushState({},document.title,loc.protocol+'//'+loc.host+frag);}else{window.location.hash=this.fragment=frag;if(this.iframe&&(frag!=this.getFragment(this.iframe.location.hash))){this.iframe.document.open().close();this.iframe.location.hash=frag;}} if(triggerRoute)this.loadUrl(fragment);}});Backbone.View=function(options){this.cid=_.uniqueId('view');this._configure(options||{});this._ensureElement();this.delegateEvents();this.initialize.apply(this,arguments);};var selectorDelegate=function(selector){return $(selector,this.el);};var eventSplitter=/^(\S+)\s*(.*)$/;var viewOptions=['model','collection','el','id','attributes','className','tagName'];_.extend(Backbone.View.prototype,Backbone.Events,{tagName:'div',$:selectorDelegate,initialize:function(){},render:function(){return this;},remove:function(){$(this.el).remove();return this;},make:function(tagName,attributes,content){var el=document.createElement(tagName);if(attributes)$(el).attr(attributes);if(content)$(el).html(content);return el;},delegateEvents:function(events){if(!(events||(events=this.events)))return;if(_.isFunction(events))events=events.call(this);$(this.el).unbind('.delegateEvents'+this.cid);for(var key in events){var method=this[events[key]];if(!method)throw new Error('Event "'+events[key]+'" does not exist');var match=key.match(eventSplitter);var eventName=match[1],selector=match[2];method=_.bind(method,this);eventName+='.delegateEvents'+this.cid;if(selector===''){$(this.el).bind(eventName,method);}else{$(this.el).delegate(selector,eventName,method);}}},_configure:function(options){if(this.options)options=_.extend({},this.options,options);for(var i=0,l=viewOptions.length;i/g,'>').replace(/"/g,'"').replace(/'/g,''').replace(/\//g,'/');};}).call(this);;jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;} var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;} expires='; expires='+date.toUTCString();} var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;itpercentage){if(cpercentage-incrementtpercentage){pb.config.cpercentage=tpercentage}else{pb.config.cpercentage+=increment;}} else{clearInterval(t);}},pb.config.speed);});};}});$.fn.extend({progressBar:$.progressBar.construct});})(jQuery);; /*! * jQuery Templates Plugin 1.0.0pre * http://github.com/jquery/jquery-tmpl * Requires jQuery 1.4.2 * * Copyright Software Freedom Conservancy, Inc. * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license */ (function(jQuery,undefined){var oldManip=jQuery.fn.domManip,tmplItmAtt="_tmplitem",htmlExpr=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,newTmplItems={},wrappedItems={},appendToTmplItems,topTmplItem={key:0,data:{}},itemKey=0,cloneIndex=0,stack=[];function newTmplItem(options,parentItem,fn,data){var newItem={data:data||(data===0||data===false)?data:(parentItem?parentItem.data:{}),_wrap:parentItem?parentItem._wrap:null,tmpl:null,parent:parentItem||null,nodes:[],calls:tiCalls,nest:tiNest,wrap:tiWrap,html:tiHtml,update:tiUpdate};if(options){jQuery.extend(newItem,options,{nodes:[],parent:parentItem});} if(fn){newItem.tmpl=fn;newItem._ctnt=newItem._ctnt||newItem.tmpl(jQuery,newItem);newItem.key=++itemKey;(stack.length?wrappedItems:newTmplItems)[itemKey]=newItem;} return newItem;} jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector),elems,i,l,tmplItems,parent=this.length===1&&this[0].parentNode;appendToTmplItems=newTmplItems||{};if(parent&&parent.nodeType===11&&parent.childNodes.length===1&&insert.length===1){insert[original](this[0]);ret=this;}else{for(i=0,l=insert.length;i0?this.clone(true):this).get();jQuery(insert[i])[original](elems);ret=ret.concat(elems);} cloneIndex=0;ret=this.pushStack(ret,name,insert.selector);} tmplItems=appendToTmplItems;appendToTmplItems=null;jQuery.tmpl.complete(tmplItems);return ret;};});jQuery.fn.extend({tmpl:function(data,options,parentItem){return jQuery.tmpl(this[0],data,options,parentItem);},tmplItem:function(){return jQuery.tmplItem(this[0]);},template:function(name){return jQuery.template(name,this[0]);},domManip:function(args,table,callback,options){if(args[0]&&jQuery.isArray(args[0])){var dmArgs=jQuery.makeArray(arguments),elems=args[0],elemsLength=elems.length,i=0,tmplItem;while(i").join(">").split('"').join(""").split("'").join("'");}});jQuery.extend(jQuery.tmpl,{tag:{"tmpl":{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},"wrap":{_default:{$2:"null"},open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},"each":{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},"html":{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(items){newTmplItems={};},afterManip:function afterManip(elem,fragClone,callback){var content=fragClone.nodeType===11?jQuery.makeArray(fragClone.childNodes):fragClone.nodeType===1?[fragClone]:[];callback.call(elem,fragClone);storeTmplItems(content);cloneIndex++;}});function build(tmplItem,nested,content){var frag,ret=content?jQuery.map(content,function(item){return(typeof item==="string")?(tmplItem.key?item.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+tmplItmAtt+"=\""+tmplItem.key+"\" $2"):item):build(item,tmplItem,item._ctnt);}):tmplItem;if(nested){return ret;} ret=ret.join("");ret.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(all,before,middle,after){frag=jQuery(middle).get();storeTmplItems(frag);if(before){frag=unencode(before).concat(frag);} if(after){frag=frag.concat(unencode(after));}});return frag?frag:unencode(ret);} function unencode(text){var el=document.createElement("div");el.innerHTML=text;return jQuery.makeArray(el.childNodes);} function buildTmplFn(markup){return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;"+"with($data){__.push('"+ jQuery.trim(markup).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(all,slash,type,fnargs,target,parens,args){var tag=jQuery.tmpl.tag[type],def,expr,exprAutoFnDetect;if(!tag){throw"Unknown template tag: "+type;} def=tag._default||[];if(parens&&!/\w$/.test(target)){target+=parens;parens="";} if(target){target=unescape(target);args=args?(","+unescape(args)+")"):(parens?")":"");expr=parens?(target.indexOf(".")>-1?target+unescape(parens):("("+target+").call($item"+args)):target;exprAutoFnDetect=parens?expr:"(typeof("+target+")==='function'?("+target+").call($item):("+target+"))";}else{exprAutoFnDetect=expr=def.$1||"null";} fnargs=unescape(fnargs);return"');"+ tag[slash?"close":"open"].split("$notnull_1").join(target?"typeof("+target+")!=='undefined' && ("+target+")!=null":"true").split("$1a").join(exprAutoFnDetect).split("$1").join(expr).split("$2").join(fnargs||def.$2||"")+"__.push('";})+"');}return __;");} function updateWrapped(options,wrapped){options._wrap=build(options,true,jQuery.isArray(wrapped)?wrapped:[htmlExpr.test(wrapped)?wrapped:jQuery(wrapped).html()]).join("");} function unescape(args){return args?args.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null;} function outerHtml(elem){var div=document.createElement("div");div.appendChild(elem.cloneNode(true));return div.innerHTML;} function storeTmplItems(content){var keySuffix="_"+cloneIndex,elem,elems,newClonedItems={},i,l,m;for(i=0,l=content.length;i=0;m--){processItemKey(elems[m]);} processItemKey(elem);} function processItemKey(el){var pntKey,pntNode=el,pntItem,tmplItem,key;if((key=el.getAttribute(tmplItmAtt))){while(pntNode.parentNode&&(pntNode=pntNode.parentNode).nodeType===1&&!(pntKey=pntNode.getAttribute(tmplItmAtt))){} if(pntKey!==key){pntNode=pntNode.parentNode?(pntNode.nodeType===11?0:(pntNode.getAttribute(tmplItmAtt)||0)):0;if(!(tmplItem=newTmplItems[key])){tmplItem=wrappedItems[key];tmplItem=newTmplItem(tmplItem,newTmplItems[pntNode]||wrappedItems[pntNode]);tmplItem.key=++itemKey;newTmplItems[itemKey]=tmplItem;} if(cloneIndex){cloneTmplItem(key);}} el.removeAttribute(tmplItmAtt);}else if(cloneIndex&&(tmplItem=jQuery.data(el,"tmplItem"))){cloneTmplItem(tmplItem.key);newTmplItems[tmplItem.key]=tmplItem;pntNode=jQuery.data(el.parentNode,"tmplItem");pntNode=pntNode?pntNode.key:0;} if(tmplItem){pntItem=tmplItem;while(pntItem&&pntItem.key!=pntNode){pntItem.nodes.push(el);pntItem=pntItem.parent;} delete tmplItem._ctnt;delete tmplItem._wrap;jQuery.data(el,"tmplItem",tmplItem);} function cloneTmplItem(key){key=key+keySuffix;tmplItem=newClonedItems[key]=(newClonedItems[key]||newTmplItem(tmplItem,newTmplItems[tmplItem.parent.key+keySuffix]||tmplItem.parent));}}} function tiCalls(content,tmpl,data,options){if(!content){return stack.pop();} stack.push({_:content,tmpl:tmpl,item:this,data:data,options:options});} function tiNest(tmpl,data,options){return jQuery.tmpl(jQuery.template(tmpl),data,options,this);} function tiWrap(call,wrapped){var options=call.options||{};options.wrapped=wrapped;return jQuery.tmpl(jQuery.template(call.tmpl),call.data,options,call.item);} function tiHtml(filter,textOnly){var wrapped=this._wrap;return jQuery.map(jQuery(jQuery.isArray(wrapped)?wrapped.join(""):wrapped).filter(filter||"*"),function(e){return textOnly?e.innerText||e.textContent:e.outerHTML||outerHtml(e);});} function tiUpdate(){var coll=this.nodes;jQuery.tmpl(null,null,null,this).insertBefore(coll[0]);jQuery(coll).remove();}})(jQuery);;var JSON;if(!JSON){JSON={};} (function(){"use strict";function f(n){return n<10?'0'+n:n;} if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+ f(this.getUTCMonth()+1)+'-'+ f(this.getUTCDate())+'T'+ f(this.getUTCHours())+':'+ f(this.getUTCMinutes())+':'+ f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};} var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';} function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);} if(typeof rep==='function'){value=rep.call(holder,key,value);} switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';} gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;inumChars) {return text.trim().substring(0,numChars).split(" ").slice(0,-1).join(" ")+append;}} return text;},_urlTitle:function(str,separator) {if(typeof str=='string') {if(typeof separator=='undefined') {separator='-';} str=str.toLowerCase();str=str.replace(/[^a-z0-9]+/g,separator);regex=new RegExp('/^'+separator+'+|'+separator+'+$/','g') str=str.replace(regex,'');} return str;}});;(function() {var QS=this.QS={};QS.$=QS.jQuery=this.jQuery;QS._=this._;QS.Backbone=this.Backbone;QS.JSON=this.JSON;$.noConflict(true);_.noConflict();Backbone.noConflict();QS.GetLibrary=function(lib) {return eval('QS.'+lib);}})();;(function(){QS.tlh=function(){if(!window.document.domain){return'';} var cookieName='qstlh',cookieValue='qstlhv',labels=document.domain.split('.'),tlh=document.domain;if(labels.length>=2){var host2Check='.'+labels[labels.length-1],i=labels.length-1,cset=false;while(i>=0&&!cset){QS.$.cookie(cookieName,cookieValue,{domain:host2Check});cset=(QS.$.cookie(cookieName)==cookieValue);QS.$.cookie(cookieName,null,{domain:host2Check});host2Check=cset?host2Check:'.'+labels[i-1]+ host2Check;i--;} tlh=cset?host2Check:tlh;} return tlh;};QS.ih=function(){var cookieName='qsih';var topLevelHost=QS.tlh();var cookieOptions={path:'/'} if(topLevelHost){cookieOptions.domain=topLevelHost;} if(QS.$.cookie(cookieName)===null){QS.$.cookie(cookieName,'n',cookieOptions);QS.$('body').one('mouseover',function(){QS.$.cookie(cookieName,'m',cookieOptions);});QS.$(document).one('keydown',function(){QS.$.cookie(cookieName,'k',cookieOptions);});}};})();;(function() {QS.EventProxy=QS.Backbone.Model.extend({listeners:[],bind:function(obj,event) {event=typeof event==="undefined"?"all":event;if(typeof QsWidgetEvents==="function") {obj.bind(event,QsWidgetEvents);} QS._.each(this.listeners,function(listener){obj.bind(listener.event,listener.callback);},this);},listen:function(callback,event) {this.listeners.push({callback:callback,event:event});}});QS._eventProxy=new QS.EventProxy();})();;(function() {QS.AjaxLoadEffect=QS.Backbone.Model.extend({defaultWaitMessage:'Searching ...',widget:null,construct:function(widget) {QS._.bindAll(this,"listener");this.widget=widget;},getWaitMessage:function() {if(this.widget.sv_1!==null) {return this.widget.sv_1;} else {return this.defaultWaitMessage;}}});QS.ProgressBarLoadEffect=QS.AjaxLoadEffect.extend({defaultWaitMessage:'Searching for schools ...',progressBarPercentage:5,maxProgressBarPercentage:100,updateProgressBarSetTimeOut:0,updateProgressBarTimeInterval:500,isSchoolListingReady:false,hideProgressBarSetTimeOut:0,hideProgressBarTimeInterval:100,minDivWidthWithoutProgressBar:350,construct:function(widget) {QS._.bindAll(this,"listener","updateProgressBar");this.widget=widget;},listener:function(event,obj) {switch(event) {case"QS.WidgetInstance:updateWidget:in":this.startEffect();break;case"QS.WidgetInstance:populate:in":case"QS.WidgetInstance:updateWidget:preAjax":this.updateProgressBar();break;case"QS.WidgetInstance:displayAndExit:in":case"QS.WidgetInstance:display:in":case"QS.WidgetInstance:render:in":this.completeProgressBar();break;case"QS.WidgetInstance:restoreOnPageWidgetAndExit:in":case"QS.WidgetInstance:qsit:out":this.completeProgressBar(true);break;}},startEffect:function() {var boxImage='../../hqx/images/progressbar.gif';var barImage='../../hqx/images/progressbg_green.gif';var loadingBoxImage=(this.widget.sv_2==null)?boxImage:this.widget.sv_2+boxImage;var loadingBarImage=(this.widget.sv_2==null)?barImage:this.widget.sv_2+barImage;var loadingDivName=this.widget.domId+'LoadingDiv';var loadingDiv=QS.$('
');if(!loadingDiv.css("border")) {loadingDiv.css("margin","20px 50px").css("padding-top","20px").css("padding-bottom","20px").css("border","1px solid #8FAC50").css("background-color","#E7EFDA");} var loadingWrapper=QS.$('
');loadingDiv.appendTo(loadingWrapper);loadingWrapper.appendTo(QS.$('#'+this.widget.domId).parent());if(this.minDivWidthWithoutProgressBar=this.progressBarPercentage) {QS.$('#'+loadingDivLoaderName).progressBar(this.progressBarPercentage,{topDivText:this.getWaitMessage(),textSearch:'   '});} var self=this;this.updateProgressBarSetTimeOut=setTimeout(function(){self.updateProgressBar();},this.updateProgressBarTimeInterval);} else {QS.$('#'+loadingDivLoaderName).progressBar(this.maxProgressBarPercentage,{topDivText:this.getWaitMessage(),textSearch:'   '});clearTimeout(this.updateProgressBarSetTimeOut);}},completeProgressBar:function(hideProgressBarDiv) {this.isSchoolListingReady=true;this.updateProgressBar();if(hideProgressBarDiv) {var self=this;this.hideProgressBarSetTimeOut=setTimeout(function(){self.hideProgressBar();},this.hideProgressBarTimeInterval);}},hideProgressBar:function() {QS.$('#'+this.widget.domId+'LoadingDiv').hide();clearTimeout(this.hideProgressBarSetTimeOut);}});QS.SpinnerLoadEffect=QS.AjaxLoadEffect.extend({listener:function(event,obj) {switch(event) {case"QS.WidgetInstance:updateWidget:in":this.startEffect();break;case"QS.WidgetInstance:qsit:in":case"QS.WidgetInstance:displayAndExit:in":this.hideSpinner();break;}},startEffect:function() {var spinnerImage="../../hqx/images/ajax-loader.gif";var loadingImage=(this.widget.sv_2==null)?spinnerImage:this.widget.sv_2+spinnerImage;var loadingDivName=this.widget.domId+'LoadingDiv';var loadingDiv=QS.$('
'+this.getWaitMessage()+'
');var bgImgvalue=loadingDiv.css("background-image");if(bgImgvalue=='none'||bgImgvalue==''||typeof bgImgvalue=='undefined') {loadingDiv.css("margin-top","30px").css("padding-top","40px").css("padding-bottom","50px").css("background-image","url("+loadingImage+")").css("background-repeat","no-repeat").css("background-position","center top");} var loadingWrapper=QS.$('
');loadingDiv.appendTo(loadingWrapper);if(this.widget.sv_4) {loadingDiv.css("clear","both");loadingWrapper.insertAfter('.'+this.widget.domId+'_filter_wrapper');} else {loadingWrapper.appendTo(QS.$('#'+this.widget.domId).parent());} if(this.widget.getAjaxLoadEffect()=='spinner-overlay') {QS.$('#'+loadingDivName).parent().css('position','relative');QS.$('#'+loadingDivName).css("background-color","#FFFFFF").css("opacity","0.75").css("filter","alpha(opacity=75)").css("position","absolute").css("width","100%");}},hideSpinner:function() {QS.$('#'+this.widget.domId+'LoadingDiv').detach();}});QS.AjaxLoadEffectProxy=QS.Backbone.Model.extend({construct:function() {QS._eventProxy.listen(this.widgetEvent,"QS.WidgetInstance:construct:out");},widgetEvent:function(widget) {var effect=null;switch(widget.getAjaxLoadEffect()) {case'progressBar':effect=new QS.ProgressBarLoadEffect();effect.construct(widget);break;case'spinner':effect=new QS.SpinnerLoadEffect();effect.construct(widget);break;} if(effect!=null) {widget.bind("all",effect.listener);}}});var ajaxLoadEffectProxy=new QS.AjaxLoadEffectProxy();ajaxLoadEffectProxy.construct();})();;(function() {QS.DataUnavailableException=QS.Backbone.Model.extend({});})();;(function() {QS.WidgetPage=QS.Backbone.Model.extend({construct:function(pageNumber,offset,pageSize,parentWidget) {QS._eventProxy.bind(this);this.trigger('QS.WidgetPage:construct:in',this);this.pageNumber=pageNumber;this.pageNumberDisplayed=pageNumber+1;this.offset=offset;this.pageSize=pageSize;this.parentWidget=parentWidget;this.impressionsLogged=false;this.listingPixelLogged=false;this.sv_5=false;this.trigger('QS.WidgetPage:construct:out',this);}});})();;(function() {QS.Program=QS.Backbone.Model.extend({construct:function(programJson,parentWidget,parentVendor,parentDealer) {QS._eventProxy.bind(this);this.trigger('QS.Program:construct:in',this);this.extraBPData=new QS.Attributes();this.extraBPData.construct(QS.$.isPlainObject(programJson.extraBPData)?programJson.extraBPData:{});this.parentWidget=parentWidget;this.parentVendor=parentVendor;this.parentDealer=parentDealer;this.programKey=programJson.eduprogramKey;this.displayName=programJson.displayName;this.descriptionData=programJson.description;this.qualificationList=programJson.qualificationList;this.subjectList=programJson.subjectList;this.nameCode=encodeURIComponent(programJson.nameCode);this.trigger('QS.Program:construct:out',this);},populate:function(data) {this.trigger('QS.Program:populate:in',this);if(data&&data['description']) {this.descriptionData=data['description'];} this.trigger('QS.Program:populate:out',this);},getExtraBPData:function() {return(this.data?this.data:this).extraBPData;},getParentWidget:function() {return(this.data)?this.data.parentWidget:this.parentWidget;},getParentVendor:function() {return(this.data)?this.data.parentVendor:this.parentVendor;},getParentDealer:function() {return(this.data)?this.data.parentDealer:this.parentDealer;},getProgramKey:function() {var self=this.data?this.data:this;return self.programKey;},getNameCode:function() {var self=this.data?this.data:this;return self.nameCode;},getDisplayName:function() {var self=this.data?this.data:this;return self.displayName;},getDescriptionData:function() {var self=this.data?this.data:this;return self.descriptionData;},getQualificationList:function() {var self=this.data?this.data:this;return self.qualificationList;},getSubjectList:function() {var self=this.data?this.data:this;return self.subjectList;},getDescription:function() {return this.getDescriptionData();},description:function() {return this.getDescriptionData();}});})();;(function() {QS.Asset=QS.Backbone.Model.extend({construct:function(assetJson) {QS._eventProxy.bind(this);this.trigger('QS.Asset:construct:in',this);this.description=(typeof assetJson.description!=="undefined")?assetJson.description:null;this.key=(typeof assetJson.key!=="undefined")?assetJson.key:null;this.title=(typeof assetJson.title!=="undefined")?assetJson.title:null;this.imageUrl=(typeof assetJson.imageUrl!=="undefined")?assetJson.imageUrl:null;this.ioNumber=(typeof assetJson.ioNumber!=="undefined")?assetJson.ioNumber:null;this.assetName=(typeof assetJson.name!=="undefined")?assetJson.name:null;this.servicesList=(typeof assetJson.servicesList!=="undefined")?assetJson.servicesList:null;this.trigger('QS.Asset:construct:out',this);},getDescription:function(stripTags) {var self=this.data?this.data:this;return stripTags===true?self.description.replace(/(<([^>]+)>)/ig,""):self.description;},getDescriptionTruncated:function(numChars,stripTags) {var self=this.data?this.data:this;var description=self.getDescription(stripTags);return self._truncateString(description,numChars);},getKey:function() {var self=this.data?this.data:this;return self.key;},getImageUrl:function() {var self=this.data?this.data:this;return self.imageUrl;},getServicesList:function() {var self=this.data?this.data:this;return self.servicesList;},getTitle:function(stripTags) {var self=this.data?this.data:this;return stripTags===true?self.title.replace(/(<([^>]+)>)/ig,""):self.title;},getIoNumber:function() {var self=this.data?this.data:this;return self.ioNumber;},getAssetName:function() {var self=this.data?this.data:this;return self.assetName;},getAssetType:function() {var self=this.data?this.data:this;var defaultAssetType='download';assetType=self.getAssetName();if(/dummy_|\.txt/ig.test(assetType)) {return assetType.replace(/dummy_|\.txt/ig,"");} else if(/\.pdf/ig.test(assetType)) {return"pdf";} else {return defaultAssetType;}},getAssetTypeCallToActionText:function() {var self=this.data?this.data:this;var assetTypeCallToText={"asset":"Register","courses":"Register","webcast":"Register","webinar":"Register","eseminar":"Register","eseminarseries":"Register","event":"Register","ondemand":"Register","tool":"Register","trial":"Download","whitepaper":"Download","pdf":"Download","download":"Download","article":"Download","podcast":"Download","software":"Download","demo":"Watch","video":"Watch","ebook":"Download","infographic":"Download","report":"Register","research":"Register","smartpaper":"Download",};return assetTypeCallToText[self.getAssetType()];},getIoNumberStripped:function() {var self=this.data?this.data:this;ioNumber=self.getIoNumber();periodPosition=ioNumber.indexOf('.');if(periodPosition!==-1) {return ioNumber.substring(0,periodPosition);} else {return ioNumber;}}});})();;(function() {QS.VendorBase=QS.Backbone.Model.extend({clientModelClickName:'CLICK',clientModelDtspName:'DTSP',clientModelPushName:'PUSH',clientModelPhoneName:'PHONE',displayUrlCTAString:'Visit',clientModelPreference:['PUSH','CLICK','DTSP','PHONE'],displayUrlCTADefault:'School Website',baseLogoDir:'/imageserver',construct:function(dataListingJson,parentWidget) {QS._eventProxy.bind(this);this.trigger('QS.VendorBase:construct:in',this);this.attributes=new QS.Attributes();this.attributes.construct(QS.$.isPlainObject(dataListingJson.attributes)?dataListingJson.attributes:{});this.parentWidget=parentWidget;this.BLUID=dataListingJson.BLUID;this.vendorAbbr=(typeof dataListingJson.abbr!=="undefined")?dataListingJson.abbr:null;this.vendorName=dataListingJson.vendorName;this.vendorKey=dataListingJson.vendorKey;this.parentVendorKey=dataListingJson.parentVendorKey;this.portalVendorKey=dataListingJson.portalVendorKey;this.phoneNumber=dataListingJson.phoneNumber;this.phoneExtension=dataListingJson.phoneExtension;this.position=dataListingJson.position;this.clientType=dataListingJson.clientType;this.featuredListing=(typeof dataListingJson.featuredListing!=="undefined")?dataListingJson.featuredListing:null;this.displayUrl=(typeof dataListingJson.displayUrl!=="undefined")?dataListingJson.displayUrl:'';this.campaignKey=(typeof dataListingJson.campaignKey!=="undefined")?dataListingJson.campaignKey:'';this.clientModel=(typeof dataListingJson.clientModelName!=="undefined")?dataListingJson.clientModelName:null;this.clickThroughUrl=(typeof dataListingJson.clickThroughUrl!=="undefined")?encodeURIComponent(dataListingJson.clickThroughUrl):null;this.logoPath=dataListingJson.logoPath;this.smallLogoPath=dataListingJson.smallLogoPath;this.vendorBlurbs=[];this.siblings=[];this.firstSibling=null;this.sibling=false;this.cities=[];this.states=[];this.dealers=[];this.numDealers=0;this.numUniqueDealersByCity=null;this.numUniqueDealersByState=null;this.numUniqueDealersByCityAndState=null;this.serviceRelevance=(typeof dataListingJson.serviceRelevance!=="undefined")?dataListingJson.serviceRelevance:null;this.trigger('QS.VendorBase:construct:out',this);},populate:function(data) {this.trigger('QS.VendorBase:populate:in',this);this.vendorBlurbs=[];if(data&&data['blurbs']) {this.vendorBlurbs['short']=data['blurbs']['short'];this.vendorBlurbs['medium']=data['blurbs']['medium'];this.vendorBlurbs['long']=data['blurbs']['long'];this.vendorBlurbs['richBlurb']=data['blurbs']['richBlurb'];this.vendorBlurbs['bio']=data['blurbs']['bio'];} this.trigger('QS.VendorBase:populate:out',this);},getClientType:function() {return(this.data?this.data:this).clientType;},getParentWidget:function() {return(this.data?this.data:this).parentWidget;},getPosition:function() {return(this.data?this.data:this).position;},getAttributes:function() {return(this.data?this.data:this).attributes;},getAttribute:function(name) {var attributes=(this.data?this.data:this).getAttributes();return(attributes[name])?attributes[name]:'';},getLogoPath:function() {var self=this.data?this.data:this;return self.logoPath;},getSmallLogoPath:function() {var self=this.data?this.data:this;return self.smallLogoPath;},getBluid:function(clientModel) {var self=this.data?this.data:this;self.trigger('QS.VendorBase:getBluid:in',self);vendor=self.getSibling(clientModel);return(vendor==null)?'':vendor.BLUID;self.trigger('QS.VendorBase:getBluid:out',self);},getVendorKey:function() {var self=this.data?this.data:this;return self.vendorKey;},getVendorAbbr:function(clientModel) {var self=this.data?this.data:this;self.trigger('QS.VendorBase:getVendorAbbr:in',self);vendor=self.getSibling(clientModel);return(vendor==null)?'':vendor.vendorAbbr;self.trigger('QS.VendorBase:getVendorAbbr:out',self);},getVendorName:function(clientModel) {var self=this.data?this.data:this;self.trigger('QS.VendorBase:getVendorName:in',self);vendor=self.getSibling(clientModel);return(vendor==null)?'':vendor.vendorName;self.trigger('QS.VendorBase:getVendorName:out',self);},hasSiblings:function() {return this.siblings.length>0||(this.firstSibling&&this.firstSibling.hasSiblings());},isSibling:function() {return this.sibling;},isMergedSibling:function() {return this.firstSibling!=null;},getSiblings:function() {if(this.siblings) {return this.siblings;} else if(this.firstSibling) {return this.firstSibling.getSiblings();} else {return null;}},getSiblingBluids:function() {var siblingBluids=[];QS._.each(this.siblings,function(sibling) {siblingBluids.push(sibling.BLUID?sibling.BLUID:'');});return siblingBluids;},isClickOnlyListing:function() {var self=this.data?this.data:this;return(!self.hasSiblings()&&self.isClickClient());},isDtspOnlyListing:function() {var self=this.data?this.data:this;return(!self.hasSiblings()&&self.getClientModel()===self.clientModelDtspName);},isCpcOnlyListing:function() {var self=this.data?this.data:this;return(!self.hasSiblings()&&self.getClientModel()===self.clientModelClickName);},isLeadOnlyListing:function() {var self=this.data?this.data:this;return(!self.hasSiblings()&&self.isLeadClient());},isMergedListing:function() {var self=this.data?this.data:this;return(self.hasSiblings()||self.isMergedSibling());},isLeadClient:function() {var self=this.data?this.data:this;return self.isClientModel(self.clientModelPushName);},isClickClient:function() {var self=(this.data)?this.data:this;self.trigger('QS.VendorBase:isClickClient:in',self);var isClickClient=false;var sibling=null;if(self.clientModel==self.clientModelClickName) {isClickClient=true;} else if(sibling=self.getClickSibling()) {isClickClient=true;} else if(self.firstSibling!==null) {isClickClient=self.firstSibling.clientModel===self.firstSibling.clientModelClickName;} self.trigger('QS.VendorBase:isClickClient:out',self);return isClickClient;},isPhoneClient:function() {var self=this.data?this.data:this;return self.isClientModel(self.clientModelPhoneName);},isFeaturedListing:function() {var self=(this.data)?this.data:this;return self.featuredListing;},isClientModel:function(clickModelName,method) {var self=(this.data)?this.data:this;var isClientModel=false;var sibling=null;self.trigger('QS.VendorBase:isClickClient:in',self);if(self.clientModel==clickModelName) {isClientModel=true;} else if(sibling=self.getSibling(clickModelName)) {isClientModel=true;} else if(self.firstSibling!==null) {isClientModel=self.firstSibling.clientModel===self.firstSibling.clientModelClickName;} self.trigger('QS.VendorBase:isClickClient:out',self);return isClientModel;},getClientModel:function() {return this.clientModel;},processClickThroughUrl:function(url) {var self=(this.data)?this.data:this;self.trigger('QS.VendorBase:processClickThroughUrl:in',self);if(self.parentWidget.sv_6!='') {} url+=("&cookiesEnabled="+((self.parentWidget.sv_7)?"1":"0"));if(this.parentWidget.getTag()) {url+='&tag='+this.parentWidget.getTag();} url=(self.getParentWidget().getXapiRequest().getClickBaseHref()?self.getParentWidget().getXapiRequest().getClickBaseHref():self.getDomain())+url;self.trigger('QS.VendorBase:processClickThroughUrl:out',self);return url;},getSibling:function(clientModelName) {var self=(this.data)?this.data:this;if(typeof clientModelName==="undefined"&&!self.hasSiblings()) {return self;} else if(typeof clientModelName!=="undefined") {return self.getSiblingByClientModel(clientModelName);} else {return self.getSiblingByClientModelPreference();}},getSiblingByClientModelPreference:function() {var self=(this.data)?this.data:this,theSibling=null,i=0,length=0;for(i=0,length=self.clientModelPreference.length;i"+vendor.vendorBlurbs[blurbLength]+"

").text();} else {return vendor.vendorBlurbs[blurbLength];}}},getVendorBlurbTruncated:function(blurbLength,numChars,clientModel) {var self=this.data?this.data:this;var blurb=self.getVendorBlurb(blurbLength,true,clientModel);return self._truncateString(blurb,numChars);},hasPhone:function() {var self=(this.data)?this.data:this;return self.getListingPhone()!=='';},getListingPhone:function() {var self=(this.data)?this.data:this,vendor=self.getSibling(self.clientModelPhoneName);if(!vendor) {return'';} else {formattedPhoneNum='';vendorPhoneNumber=vendor.phoneNumber.replace(/[^\d]/g,'');formattedPhoneNum=self.formatPhoneNumber(vendorPhoneNumber);return formattedPhoneNum;}},hasPhoneExtension:function() {var self=(this.data)?this.data:this;return self.getListingPhoneExtension()!=='';},formatPhoneNumber:function(phoneNumber) {formattedString='';arrChars=phoneNumber.split('');for(i=0;inumDealers);} else {return false;}},getStates:function() {var states=[];var self=this.data?this.data:this;QS._.each(self.dealers,function(dealer) {states.push(dealer.getState());});return states.sort();},getUniqueDealersByCity:function() {var dealers=[];var cities=[];var self=this.data?this.data:this;QS._.each(self.dealers,function(dealer) {if(dealer.isCampus()) {if(QS._.indexOf(cities,dealer.getCity())==-1) {dealers.push(dealer);cities.push(dealer.getCity());}}});self.numUniqueDealersByCity=dealers.length;return dealers;},getNumUniqueDealersByCity:function() {var self=this.data?this.data:this;if(self.numUniqueDealersByCity==null) {self.getUniqueDealersByCity();} return self.numUniqueDealersByCity;},hasMoreUniqueDealersByCity:function(numDealers) {var self=this.data?this.data:this;if(numDealers!=null) {return(self.numUniqueDealersByCity!=0&&self.numUniqueDealersByCity>numDealers);} else {return false;}},getCities:function() {var cities=[];var self=this.data?this.data:this;QS._.each(self.dealers,function(dealer) {cities.push(dealer.getCity());});return cities.sort();},getDealerName:function(numIndex) {var self=(this.data)?this.data:this;if(self.dealers.length>0) {return self.dealers[numIndex].dealerName;} return self.vendorName;},getDealerAbbr:function(numIndex) {var self=(this.data)?this.data:this;if(self.dealers.length>0) {return self.dealers[numIndex].dealerAbbr;} return self.vendorAbbr;},getCampaignKey:function() {return this.campaignKey;},setCampaignKey:function(campaignKey) {if(typeof campaignKey!=="undefined") {this.campaignKey=campaignKey;} return this;},getDomain:function() {var self=(this.data)?this.data:this;return self.parentWidget.isLocalTracking()?'':self.parentWidget.sv_9();},getCustomParam:function(param) {var self=(this.data)?this.data:this;return self.getParentWidget().getCustomParam(param);},addParametersToUrl:function(url,paramsList,delimiter) {if(paramsList&&typeof paramsList==='object') {delimiter=(typeof delimiter!=="undefined"&&delimiter)?delimiter:'&';for(var paramKey in paramsList) {if(paramsList.hasOwnProperty(paramKey)) {var methodName='get'+paramKey.slice(0,1).toUpperCase()+paramKey.slice(1),value='';if(typeof eval('this.'+methodName)==='function') {value=eval('this.'+methodName+'()');} else if(this.has(paramKey)) {value=this.get(paramKey);} if(value) {url+=delimiter+paramsList[paramKey]+'='+value;}}}} return url;}});})();;QS.Vendor=(function() {var randPool={};return QS.VendorBase.extend({baseLogoDir:'/imageserver',defaultSmallLogo:'/logos/120x60_blanklogo.gif',defaultLargeLogo:'/logos/200x100/200x100_blanklogo.gif',campusType:null,valueEnabled:'ENABLED',valueDisabled:'DISABLED',construct:function(dataListingJson,parentWidget) {QS._eventProxy.bind(this);this.trigger('QS.Vendor:construct:in',this);this.handlePrequal(dataListingJson);QS.VendorBase.prototype.construct.call(this,dataListingJson,parentWidget);this.gibill=(typeof dataListingJson.gibill!=="undefined")?dataListingJson.gibill:null;this.yellowRibbon=(typeof dataListingJson.yellowRibbon!=="undefined")?dataListingJson.yellowRibbon:null;this.ipedsData=(typeof dataListingJson.ipedsData!=="undefined")?dataListingJson.ipedsData:null;this.aoiFilter=(typeof dataListingJson.aoiFilter!=="undefined")?dataListingJson.aoiFilter:null;this.doiFilter=(typeof dataListingJson.doiFilter!=="undefined")?dataListingJson.doiFilter:null;this.serviceCode=(typeof dataListingJson.serviceCode!=="undefined")?dataListingJson.serviceCode:null;this.programs=[];this.hasMorePrograms=false;this.hasMoreUniquePrograms=false;this.numUniqueVendorPrograms=0;this.topLevelQualificationList={'Associate':'Associate','Bachelor':'Bachelor','Diploma':'Diploma','Doctor':'Doctorate','Certificate':'Certificate','Master':'Master','Coursework':'Coursework'};if(this.parentWidget.isJsonVersion1_1()&&dataListingJson.blurbs!==null&&dataListingJson.blurbs!=="undefined") {this.populate(dataListingJson);} else if(typeof dataListingJson.blurbs!=="undefined") {this.populate(dataListingJson);} if(this.parentWidget.isJsonVersion1_1()&&dataListingJson.dealerListings) {QS._.each(dataListingJson.dealerListings,function(dealer) {var vendorDealer=new QS.Dealer();vendorDealer.construct(dealer,this);this.dealers.push(vendorDealer);},this);this.numDealers=this.dealers.length;} else if(dataListingJson.eduDealerListings) {QS._.each(dataListingJson.eduDealerListings,function(dealer) {var vendorDealer=new QS.Dealer();vendorDealer.construct(dealer,this);this.dealers.push(vendorDealer);},this);this.numDealers=this.dealers.length;} if(dataListingJson.eduProgramListing) {QS._.each(dataListingJson.eduProgramListing,function(program) {var vendorProgram=new QS.Program();vendorProgram.construct(program,this.parentWidget,this,null);this.programs.push(vendorProgram);},this);} this.trigger('QS.Vendor:construct:out',this);},populate:function(data) {this.trigger('QS.Vendor:populate:in',this);QS.VendorBase.prototype.populate.call(this,data);this.yellowRibbon=(typeof data['yellowRibbon']!=="undefined")?data['yellowRibbon']:null;this.gibill=(typeof data['gibill']!=="undefined")?data['gibill']:null;this.featuredListing=(typeof data['featuredListing']!=="undefined")?data['featuredListing']:null;this.ipedsData=(typeof data['ipedsData']!=="undefined")?data['ipedsData']:null;this.trigger('QS.Vendor:populate:out',this);},handlePrequal:function(dataListingJson) {if(dataListingJson.clientModelName===this.clientModelClickName||dataListingJson.clientModelName===this.clientModelDtspName) {this.enablePrequal(dataListingJson);}},enablePrequal:function(dataListingJson) {if(/&$/.test(dataListingJson.clickThroughUrl)) {dataListingJson.clickThroughUrl+='pq=1';} else {dataListingJson.clickThroughUrl+='&pq=1';}},isClickClient:function() {var self=(this.data)?this.data:this,isClickClient=false;self.trigger('QS.eduvendor:isClickClient:in',self);if(self.getClickOrDtspSibling()) {isClickClient=true;} self.trigger('QS.eduvendor:isClickClient:out',self);return isClickClient;},getDtspUrl:function() {var self=(this.data)?this.data:this,vendor,returnUrl='';self.trigger('QS.eduVendor:getDtspUrl:in',self);if(vendor=self.getClickOrDtspSibling()) {returnUrl=vendor.clickThroughUrl;} self.trigger('QS.eduVendor:getDtspUrl:out',self);return returnUrl;},getUrl:function(passThroughUrl) {var self=(this.data)?this.data:this,vendor,returnUrl=passThroughUrl?passThroughUrl:'';self.trigger('QS.eduVendor:getUrl:in',self);if(vendor=self.getClickOrDtspSibling()) {returnUrl=self.processClickThroughUrl(decodeURIComponent(vendor.clickThroughUrl))} self.trigger('QS.eduVendor:getUrl:out',self);return returnUrl;},getDisplayUrl:function() {var self=(this.data)?this.data:this;var clickSibling=self.getClickOrDtspSibling();return self.displayUrlCTAString+' '+((clickSibling.displayUrl!=='')?clickSibling.displayUrl:self.displayUrlCTADefault);},getListingAbbr:function() {var self=this.data?this.data:this;self.trigger('QS.VendorBase:getListingAbbr:in',self);vendor=self.getSibling();if(vendor==null) {return'';} if(vendor.isSingleMatchedDealer()) {var dealer=vendor.getFirstDealer();self.trigger('QS.VendorBase:getListingAbbr:out',self);return(dealer.getDealerAbbr()!='')?dealer.getDealerAbbr():vendor.getVendorAbbr();} else {self.trigger('QS.VendorBase:getListingAbbr:out',self);return vendor.getVendorAbbr();}},getListingName:function() {var self=this.data?this.data:this;self.trigger('QS.VendorBase:getListingName:in',self);vendor=self.getSibling();if(vendor==null) {return'';} if(vendor.isSingleMatchedDealer()) {var dealer=vendor.getFirstDealer();self.trigger('QS.VendorBase:getListingName:out',self);return(dealer.getDealerAbbr()!=''&&dealer.getDealerAbbr()!=vendor.getVendorAbbr())?dealer.getDealerName():vendor.getVendorName();} else {self.trigger('QS.VendorBase:getListingName:out',self);return vendor.getVendorName();}},isSingleMatchedDealer:function() {var self=this.data?this.data:this;return(self.getNumDealers()==1);},getFirstDealer:function() {var self=this.data?this.data:this;if(self.getNumDealers()>0) {var dealers=self.getDealers();return dealers[0];} return null;},getGIBill:function() {var self=(this.data)?this.data:this;if(!self.gibill) {return'';} else {return self.gibill;}},getYellowRibbon:function() {var self=(this.data)?this.data:this;if(!self.yellowRibbon) {return'';} else {return self.yellowRibbon;}},getLogoPath:function(size,fallback) {size=typeof(size)!='undefined'?size:'small';fallback=typeof(fallback)!='undefined'?fallback:false;var self=(this.data)?this.data:this,vendor=self.getSibling();if(vendor==null) {return'';} var listingObj=vendor;if(vendor.isSingleMatchedDealer()) {var dealer=vendor.getFirstDealer();if(dealer.getDealerAbbr()!=''&&dealer.getDealerAbbr()!=vendor.getVendorAbbr()) {listingObj=dealer;}} var domain=(self.parentWidget&&self.parentWidget.shouldRelativePath())?'':self.getDomain();if(size=='large') {if(listingObj.logoPath) {return domain+self.baseLogoDir+((listingObj.logoPath.substr(0,1)!='../../index.html')?'/':'')+listingObj.logoPath;} else if(fallback===true&&listingObj.smallLogoPath) {return domain+self.baseLogoDir+((listingObj.smallLogoPath.substr(0,1)!='../../index.html')?'/':'')+listingObj.smallLogoPath;} else {return domain+self.baseLogoDir+listingObj.defaultLargeLogo;}} else if(size=='small') {if(listingObj.smallLogoPath) {return domain+self.baseLogoDir+((listingObj.smallLogoPath.substr(0,1)!='../../index.html')?'/':'')+listingObj.smallLogoPath;} else if(fallback===true&&listingObj.logoPath) {return domain+self.baseLogoDir+((listingObj.logoPath.substr(0,1)!='../../index.html')?'/':'')+listingObj.logoPath;} else {return domain+self.baseLogoDir+listingObj.defaultSmallLogo;}} else {return domain+self.baseLogoDir+listingObj.defaultLargeLogo;}},numVendorPrograms:function() {return this.programs.length;},getNumUniqueVendorPrograms:function() {var self=this.data?this.data:this;if(0self.parentWidget.sv_10);return programs;},getUniquePrograms:function(num) {var self=this.data?this.data:this;var programs=[];if((typeof num==="undefined")&&self.parentWidget.sv_10===null) {num=3;} var numPrograms=(typeof num==="undefined")?self.parentWidget.sv_10:num;var programNames=[];for(var i=0;inumPrograms);programs.length=(programs.length>numPrograms)?parseInt(numPrograms):programs.length;return programs;},getTopLevelQualificationList:function() {var qualificationList=[];for(var i=0;i-1) {self.campusType=(self.campusType=='Online School')?'Both':'Campus';} else if(dealers[i].getCampusType().toLowerCase().indexOf('online')>-1) {self.campusType=(self.campusType=='Campus')?'Both':'Online School';} if(self.campusType=='Both') {return self.campusType;}}} return self.campusType;},getFinancialAid:function(clientModel){var self=this.data?this.data:this;var vendor=self.getSibling(clientModel);return(vendor.ipedsData&&vendor.ipedsData.financialAidAvailable!==undefined)?vendor.ipedsData.financialAidAvailable:null;},getWeekendEveningCourses:function(clientModel){var self=this.data?this.data:this;var vendor=self.getSibling(clientModel);return(vendor.ipedsData&&vendor.ipedsData.weekendEveningCourses!==undefined)?vendor.ipedsData.weekendEveningCourses:0;},getAccreditation:function(clientModel){var self=this.data?this.data:this;var vendor=self.getSibling(clientModel);return(vendor.ipedsData&&vendor.ipedsData.nationallyAccredited!==undefined)?vendor.ipedsData.nationallyAccredited:null;},getAcceleratedPrograms:function(clientModel){var self=this.data?this.data:this;var vendor=self.getSibling(clientModel);return(vendor.ipedsData&&vendor.ipedsData.acceleratedPrograms!==undefined)?vendor.ipedsData.acceleratedPrograms:null;},getTransferStudents:function(clientModel){var self=this.data?this.data:this;var vendor=self.getSibling(clientModel);return(vendor.ipedsData&&vendor.ipedsData.transferStudents!==undefined)?vendor.ipedsData.transferStudents:null;},getTeacherToEnrolledStudentEQFactor:function(clientModel){var self=this.data?this.data:this;var vendor=self.getSibling(clientModel);return(vendor.ipedsData&&vendor.ipedsData.teacherToEnrolledStudentEQFactor!==undefined)?vendor.ipedsData.teacherToEnrolledStudentEQFactor:null;},getExtraAttributes:function(clientModel){var self=this.data?this.data:this;var vendor=self.getSibling(clientModel);return(vendor.ipedsData&&typeof(vendor.ipedsData.extraAttributes)==="object")?vendor.ipedsData.extraAttributes:null;},getExtraAttribute:function(attribute,clientModel) {var self=this.data?this.data:this;if(typeof attribute!=="undefined") {var extraAttributes=self.getExtraAttributes(clientModel);return(extraAttributes!=null&&typeof extraAttributes[attribute]!=="undefined")?extraAttributes[attribute]:null;} return null;},hasFinancialAid:function(clientModel){var self=this.data?this.data:this;return(self.getFinancialAid(clientModel))?true:false;},hasWeekendEveningCourses:function(clientModel){var self=this.data?this.data:this;return(self.getWeekendEveningCourses(clientModel))?true:false;},hasOnlineCourses:function(){var self=this.data?this.data:this;return(self.getCampusType()=='Both'||self.getCampusType()=='Online School')?true:false;},hasAccreditation:function(clientModel){var self=this.data?this.data:this;return(self.getAccreditation(clientModel))?true:false;},hasAcceleratedPrograms:function(clientModel){var self=this.data?this.data:this;return(self.getAcceleratedPrograms(clientModel))?true:false;},hasTransferStudents:function(clientModel){var self=this.data?this.data:this;return(self.getTransferStudents(clientModel))?true:false;},hasTeacherToEnrolledStudentEQFactor:function(clientModel){var self=this.data?this.data:this;return(self.getTeacherToEnrolledStudentEQFactor(clientModel))?true:false;},hasExtraAttributes:function(clientModel){var self=this.data?this.data:this;return(self.getExtraAttributes(clientModel))?true:false;},hasExtraAttribute:function(attribute,clientModel){if(typeof attribute!=="undefined") {var self=this.data?this.data:this;return(self.getExtraAttribute(attribute,clientModel)===null)?false:true;} return false;},getLeadLinkHref:function(passThrough,params,delimiter) {var self=this.data?this.data:this,url=QS.VendorBase.prototype.getLeadLinkHref.call(self,passThrough,params,delimiter),additionalParams={'QualificationServiceCode':'NS_PQUAL','SubjectServiceCode':'NS_PSUB'},requestParams={'CCID':'CCID','CLK':'CLK','QTR':'QTR'};url=self.addParametersToUrl(url,additionalParams,delimiter);return self.getParentWidget().sv_8.addParametersToUrl(url,requestParams,delimiter);},processUrl:function(url,delimiter) {var self=this.data?this.data:this,url=QS.VendorBase.prototype.processUrl.call(this,url,delimiter),requestParams={'webSiteName':'NS_PubWebSiteName','webPageUri':'NS_PubPageUri','InventoryType':'NS_inventoryType','cfurl':'cfurl','WebtrendsRecipe':'WebtrendsRecipe','DegreeStartTimeframe':'DegreeStartTimeframe'};return self.getParentWidget().sv_8.addParametersToUrl(url,requestParams,delimiter);},processClickThroughUrl:function(url) {var self=this.data?this.data:this,url=QS.VendorBase.prototype.processClickThroughUrl.call(self,url),delimiter='&',additionalParams={'matchingFallback':'matchingFallback'};var vendorKey=self.getVendorKey(this.clientModelClickName);if(vendorKey) {url+=delimiter+'vendorKey='+vendorKey;} return self.getParentWidget().sv_8.addParametersToUrl(url,additionalParams,delimiter);},getSibling:function(clientModel) {if(clientModel==this.clientModelClickName) {return this.getClickOrDtspSibling();} else {return QS.VendorBase.prototype.getSibling.call(this,clientModel);}},getCampaignKey:function(clientModel) {var self=this.data?this.data:this;self.trigger('QS.VendorBase:getCampaignKey:in',self);if(!clientModel) {return QS.VendorBase.prototype.getCampaignKey.call(this);} vendor=self.getSibling(clientModel);return(vendor==null)?'':vendor.campaignKey;self.trigger('QS.VendorBase:getCampaignKey:out',self);},getClickOrDtspSibling:function() {var theSibling=null;if(this.clientModel===this.clientModelClickName||this.clientModel===this.clientModelDtspName) {theSibling=this;} else if(QS._.isObject(this.firstSibling)&&this.firstSibling.clientModel===this.clientModelClickName||this.clientModel===this.clientModelDtspName) {theSibling=this.firstSibling;} else if(this.hasSiblings()) {var siblings=this.getSiblings(),sibling=null;for(var i=0,length=siblings.length;i"+this.data.dealerBlurbs[blurbLength]+"

").text();} else {return this.data.dealerBlurbs[blurbLength];}}},getParentVendor:function() {return this.parentVendor;}});})();;(function() {QS.Dealer=QS.DealerBase.extend({construct:function(dealerListingJson,parentVendor) {QS._eventProxy.bind(this);this.trigger('QS.Dealer:construct:in',this);QS.DealerBase.prototype.construct.call(this,dealerListingJson,parentVendor);this.programs=[];this.hasMorePrograms=false;this.hasMoreUniquePrograms=false;this.accreditation=(typeof dealerListingJson.accreditation!=="undefined")?dealerListingJson.accreditation:null;if(this.parentVendor.parentWidget.isJsonVersion1_1()) {this.populate(dealerListingJson);} else if(typeof dealerListingJson.blurbs!=="undefined") {this.populate(dealerListingJson);} else {this.setDefaultProperties();this.yellowRibbon=null;this.giBill=null;this.homePhone=null;this.workPhone=null;} if(dealerListingJson.eduDealerProgramListing) {QS._.each(dealerListingJson.eduDealerProgramListing,function(program) {var dealerProgram=new QS.Program();dealerProgram.construct(program,this.parentVendor.parentWidget,null,this);this.programs.push(dealerProgram);},this);} this.trigger('QS.Dealer:construct:out',this);},populate:function(data) {this.trigger('QS.Dealer:populate:in',this);QS.DealerBase.prototype.populate.call(this,data);this.yellowRibbon=(typeof data['yellowRibbon']!=="undefined")?data['yellowRibbon']:null;this.giBill=(typeof data['gibill']!=="undefined")?data['gibill']:null;this.homePhone=(typeof data['homePhone']!=="undefined")?data['homePhone']:null;this.workPhone=(typeof data['workPhone']!=="undefined")?data['workPhone']:null;this.enteredServices=(typeof data['enteredServices']!=="undefined")?data['enteredServices']:null;this.matchedService=(typeof data['matchedService']!=="undefined")?data['matchedService']:null;this.trigger('QS.Dealer:populate:out',this);},getYellowRibbon:function() {return this.yellowRibbon;},getGiBill:function() {return this.giBill;},getHomePhone:function() {return this.homePhone;},getWorkPhone:function() {return this.workPhone;},numDealerPrograms:function() {return this.programs.length;},getPrograms:function() {var programs=[];for(var i=0;ithis.data.parentVendor.parentWidget.sv_10);return programs;},getEnteredServices:function() {return this.enteredServices;},getMatchedService:function() {return this.matchedService;}});})();;(function() {QS.B2BDealer=QS.DealerBase.extend({construct:function(dealerListingJson,parentVendor) {QS._eventProxy.bind(this);this.trigger('QS.B2BDealer:construct:in',this);QS.DealerBase.prototype.construct.call(this,dealerListingJson,parentVendor);this.alphaCR=(typeof dealerListingJson.alphaCR!=="undefined")?dealerListingJson.alphaCR:null;this.alphaCTR=(typeof dealerListingJson.alphaCTR!=="undefined")?dealerListingJson.alphaCTR:null;this.betaCR=(typeof dealerListingJson.betaCR!=="undefined")?dealerListingJson.betaCR:null;this.betaCTR=(typeof dealerListingJson.betaCTR!=="undefined")?dealerListingJson.betaCTR:null;this.campaignKey=(typeof dealerListingJson.campaignKey!=="undefined")?dealerListingJson.campaignKey:'';this.discountFactor=(typeof dealerListingJson.discountFactor!=="undefined")?dealerListingJson.discountFactor:null;this.fallbackServiceCode=(typeof dealerListingJson.fallbackServiceCode!=="undefined")?dealerListingJson.fallbackServiceCode:null;this.returnRate=(typeof dealerListingJson.returnRate!=="undefined")?dealerListingJson.returnRate:null;this.revenue=(typeof dealerListingJson.revenue!=="undefined")?dealerListingJson.revenue:null;this.serviceCode=(typeof dealerListingJson.serviceCode!=="undefined")?dealerListingJson.serviceCode:null;this.serviceList=(typeof dealerListingJson.serviceList!=="undefined")?dealerListingJson.serviceList:null;if(this.parentVendor.parentWidget.isJsonVersion1_1()) {this.populate(dealerListingJson);} else if(typeof dealerListingJson.blurbs!=="undefined") {this.populate(dealerListingJson);} else {this.setDefaultProperties();} this.trigger('QS.B2BDealer:construct:out',this);},populate:function(data) {this.trigger('QS.B2BDealer:populate:in',this);QS.DealerBase.prototype.populate.call(this,data);this.trigger('QS.B2BDealer:populate:out',this);},getAlphaCR:function() {return this.alphaCR;},getAlphaCTR:function() {return this.alphaCTR;},getBetaCR:function() {return this.betaCR;},getBetaCTR:function() {return this.betaCTR;},getCampaignKey:function() {return this.campaignKey;},getDiscountFactor:function() {return this.discountFactor;},getFallbackServiceCode:function() {return this.fallbackServiceCode;},getReturnRate:function() {return this.returnRate;},getRevenue:function() {return this.revenue;},getServiceCode:function() {return this.serviceCode;},getServiceList:function() {return this.serviceList;}});})();;(function() {QS.HSDealer=QS.DealerBase.extend({construct:function(dataListingJson,parentVendor) {QS._eventProxy.bind(this);this.trigger('QS.HSDealer:construct:in',this);this.campaignKey=null;this.contactKey=null;this.firstName=null;this.score=null;this.serviceList=[];this.url=null;QS.DealerBase.prototype.construct.call(this,dataListingJson,parentVendor);this.setDealerAbbr(dataListingJson.abbr);this.setCampaignKey(dataListingJson.campaignKey);this.setContactKey(dataListingJson.contactKey);this.setFirstName(dataListingJson.firstName);this.setScore(dataListingJson.score);this.setServiceList(dataListingJson.serviceList);this.setUrl(dataListingJson.url);if(this.parentVendor.parentWidget.isJsonVersion1_1()) {this.populate(dataListingJson);} this.trigger('QS.HSDealer:construct:out',this);},setDealerAbbr:function(abbreviation) {if(jQuery.type(abbreviation)==='string') {this.dealerAbbr=abbreviation;}},setCampaignKey:function(campaignKey) {if(jQuery.type(campaignKey)==='number'||jQuery.type(campaignKey)==='string') {this.campaignKey=campaignKey;}},setContactKey:function(contactKey) {if(jQuery.type(contactKey)==='number'||jQuery.type(contactKey)==='string') {this.contactKey=contactKey;}},setFirstName:function(firstName) {if(jQuery.type(firstName)==='string') {this.firstName=firstName;}},setScore:function(score) {if(jQuery.type(score)==='number') {this.score=score;}},setServiceList:function(serviceList) {if(jQuery.isArray(serviceList)) {this.serviceList=serviceList;}},setUrl:function(url) {if(jQuery.type(url)==='string') {this.url=url;}},setParentVendor:function(vendor) {if(vendor instanceof QS.VendorBase) {this.parentVendor=vendor;}},getCampaignKey:function() {return(this.data?this.data:this).campaignKey;},getContactKey:function() {return(this.data?this.data:this).contactKey;},getFirstName:function() {return(this.data?this.data:this).firstName;},getScore:function() {return(this.data?this.data:this).score;},getServiceList:function() {return(this.data?this.data:this).serviceList;},getUrl:function() {return(this.data?this.data:this).url;},getVendorKey:function() {return(this.data?this.data:this).vendorKey;}});})();;(function() {QS.PersonalLoansDealer=QS.DealerBase.extend({construct:function(dataListingJson,parentVendor) {QS._eventProxy.bind(this);this.trigger('QS.PersonalLoansDealer:construct:in',this);this.campaignKey=null;this.minAPR=null;this.maxAPR=null;this.minTerm=null;this.maxTerm=null;this.maxLoanAmount=null;QS.DealerBase.prototype.construct.call(this,dataListingJson,parentVendor);this.setCampaignKey(dataListingJson.campaignKey);this.setProduct(dataListingJson.productDescription);this.trigger('QS.PersonalLoansDealer:construct:out',this);},setCampaignKey:function(campaignKey) {if(QS.$.type(campaignKey)==='number'||QS.$.type(campaignKey)==='string') {this.campaignKey=campaignKey;}},setProduct:function(product) {try {productObj=typeof product=="object"?product:QS.JSON.parse(product);this.minAPR=productObj.MIN_APR;this.maxAPR=productObj.MAX_APR;this.minTerm=productObj.MIN_TERM;this.maxTerm=productObj.MAX_TERM;this.maxLoanAmount=productObj.MAX_LOAN_AMOUNT;} catch(e) {}},setParentVendor:function(vendor) {if(vendor instanceof QS.VendorBase) {this.parentVendor=vendor;}},getCampaignKey:function() {return(this.data?this.data:this).campaignKey;},getMinAPR:function() {return(this.data?this.data:this).minAPR;},getMaxAPR:function() {return(this.data?this.data:this).maxAPR;},getMinTerm:function() {return(this.data?this.data:this).minTerm;},getMaxTerm:function() {return(this.data?this.data:this).maxTerm;},getMaxLoanAmount:function() {return(this.data?this.data:this).maxLoanAmount;}});})();;(function(){QS.ListingFilter=QS.Backbone.Model.extend({FILTER_ELEMENT_CLASS:'.qs-filter',dataValues:null,widgetInstance:null,listing:null,filterElements:null,filterElementsByPosition:null,elementFactory:null,construct:function(widget) {this.widgetInstance=widget;this.listing=this.widgetInstance.getDomElement();this.elementFactory=new QS.ElementFactory();this.dataValues=this.widgetInstance.getXapiRequest().getDataValues();this.populate();},populate:function() {this.resetFilterElements();this.populateFilterElements();},resetFilterElements:function() {this.filterElements=[];this.filterElementsByPosition={'header':[],'footer':[]};},populateFilterElements:function() {var filters=QS.$(this.FILTER_ELEMENT_CLASS,this.listing),filterElement;QS._.each(filters,function(filter) {filterElement=this.createFilterElement(QS.$(filter,this.listing));this.setFilter(filterElement);},this);},setFilter:function(filterElement) {if(filterElement) {this.filterElements.push(filterElement);this.filterElementsByPosition[filterElement.getPosition()].push(filterElement);}},createFilterElement:function(element) {var filterElement=this.elementFactory.createElement(element,this);return filterElement;},updateListing:function(position) {if(this.shouldUpdateListing()) {this.hideListingAndListingError();this.widgetInstance.setFilterSearchMode(true);this.disableFilters();this.updateRequest(position);this.widgetInstance.resetFilterParams();this.widgetInstance.updateWidget(this.widgetInstance.getXapiRequest());}},hideListingAndListingError:function() {QS.$('.'+this.widgetInstance.noListingErrorMsgClass,this.listing).detach();QS.$('.'+this.widgetInstance.domId+'_filter_wrapper',this.listing).hide();},shouldUpdateListing:function() {return true;},disableFilters:function() {QS._.each(this.filterElements,function(element) {if(element.shouldDisableOnUpdateListing()) {element.disable();}},this);},enableFilters:function() {QS._.each(this.filterElements,function(element) {element.enable();},this);},updateRequest:function(position) {QS._.each(this.filterElementsByPosition[position],function(element) {if(element.getDataValueKey()) {this.dataValues[element.getDataValueKey()]=element.getValue();}},this);this.widgetInstance.getXapiRequest().setDataValues(this.dataValues);},getDataValueByKey:function(key) {return this.dataValues[key]?this.dataValues[key]:'';},getWidgetInstance:function() {return this.widgetInstance;}});})();;(function(){QS.ElementFactory=QS.Backbone.Model.extend({typeOfElement:{'SELECT':'SelectElement','button':'ButtonElement'},createElement:function(filter,listingFilter) {var elementClass=this.typeOfElement[this.getFilterType(filter)];if(QS[elementClass]) {var element=new QS[elementClass]() element.construct(listingFilter,filter);return element;} return null;},getFilterType:function(filter) {var type=filter.attr('type');return type?type:filter.prop('tagName');}});})();;(function(){QS.BaseElement=QS.Backbone.Model.extend({DATA_POSITION_KEY:'position',DATA_DATA_VALUE_KEY:'data-value',DATA_PASS_EMPTY_STRING_VALUE:'pass-empty-string-value',DATA_INITIAL_VALUE:'initial-value',submitOnChangeClass:'qs-submit-on-change',disableOnSubmitClass:'qs-disable-on-submit',listingFilter:null,domElement:null,isSubmitOnChange:false,isDisableOnSubmit:false,isPassEmptyString:true,syncElement:null,position:'',dataValueKey:'',initialValue:'',construct:function(listingFilter,element) {this.setInitialValues(listingFilter,element);this.enable();},setInitialValues:function(listingFilter,element) {this.listingFilter=listingFilter;this.domElement=element;this.isSubmitOnChange=element.hasClass(this.submitOnChangeClass);this.isDisableOnSubmit=element.hasClass(this.disableOnSubmitClass);this.isPassEmptyString=element.data(this.DATA_PASS_EMPTY_STRING_VALUE);this.position=element.data(this.DATA_POSITION_KEY);this.dataValueKey=element.data(this.DATA_DATA_VALUE_KEY);this.initialValue=element.data(this.DATA_INITIAL_VALUE);this.setElementInitialValue();},setElementInitialValue:function() {var initialValue=this.getElementInitialValue();if(initialValue) {this.setValue(initialValue);}},getElementInitialValue:function() {if(this.getDataValueKey()&&this.listingFilter.getDataValueByKey(this.getDataValueKey())) {return this.listingFilter.getDataValueByKey(this.getDataValueKey());} else if(this.initialValue) {if(typeof this.listingFilter.getWidgetInstance()[this.initialValue]=="function") {return this.listingFilter.getWidgetInstance()[this.initialValue]();}}},setSyncElement:function(element) {this.syncElement=element;},synchronizeElement:function(value){if(this.syncElement) {this.syncElement.setValue(value);}},getValue:function() {var value=this.domElement.val();if(value===''&&!this.shouldPassEmptyString()) {return null} return value;},setValue:function(value) {this.domElement.val(value);},getPosition:function() {return this.position;},getDataValueKey:function() {return this.dataValueKey;},shouldDisableOnUpdateListing:function() {return this.isSubmitOnChange||this.isDisableOnSubmit;},shouldPassEmptyString:function() {return!(this.isPassEmptyString===false);},disable:function() {this.domElement.prop('disabled',true);},enable:function() {this.domElement.prop('disabled',false);}});})();;(function(){QS.SelectElement=QS.BaseElement.extend({construct:function(listingFilter,element) {QS.BaseElement.prototype.construct.call(this,listingFilter,element);this.bindEvent();},bindEvent:function() {this.domElement.change({'element':this},this.onChange);},onChange:function(event) {var element=event.data.element;element.synchronizeElement(element.getValue);if(element.isSubmitOnChange) {element.listingFilter.updateListing(element.getPosition());}}});})();;(function(){QS.ButtonElement=QS.BaseElement.extend({construct:function(listingFilter,element) {QS.BaseElement.prototype.construct.call(this,listingFilter,element);this.bindEvent();},bindEvent:function() {this.domElement.click({'element':this},this.onClick);},onClick:function(event) {var element=event.data.element;element.listingFilter.updateListing(element.getPosition());},shouldDisableOnUpdateListing:function() {return true;}});})();;(function() {QS.WidgetInstance=QS.Backbone.Model.extend({sv_12:'BusinessListingWidget',sv_13:'siteName',sv_14:'pageUri',sv_15:'stateCode',sv_16:'countryCode',sv_17:'sp_261170',sv_18:'sp_loadAddlListingData',sv_19:'sp_261160',sv_20:'sp_260840',sv_21:'tracking',sv_22:'sp_260780',sv_23:'sp_260850',sv_24:'sp_260860',sv_25:'sp_261270',sv_26:'sp_261260',sv_27:'subj',sv_28:'sp_261290',sv_29:'DegreeOfInterest',sv_30:'AreaOfInterest',sv_31:'filterDlrByState',sv_32:'sp_270390',sv_33:'alphabet',sv_34:'gibill',sv_35:'sp_matched',sv_36:'sp_261250',sv_37:'yellowribbon',sv_38:'getIPEDSData',sv_39:'getUserData',sv_40:'filterCriteria',sv_41:'dataValues',sv_42:'sp_260870',sv_43:'ClientModel',sv_44:'sp_260920',sv_11:'BLUID',sv_45:'bluids',sv_46:'ajaxLoadEffect',sv_47:'waitMessage',sv_48:'/getadditionaldata',sv_49:'/qsit',sv_50:'/qsct',sv_51:'/hqxapi/qsClick',sv_2:'//hqx-qmp.quinstreet.com',sv_52:'numPrograms',sv_53:'numListings',sv_54:'getAdditionalDealerData',sv_55:'contentService',sv_56:'getPageContent',sv_57:'Widget',sv_58:'Client',sv_59:'true',sv_60:'bluid_',sv_61:'WT_FPC',sv_62:'qsCookieTest',sv_63:'foobar',sv_64:'ALL',sv_65:'EXACT',sv_66:'BROAD',sv_67:10000,sv_68:'8000',sv_69:5000,sv_3:10000,sv_70:300,sv_71:2000,sv_72:'none',sv_73:{},sv_74:null,sv_75:null,sv_76:null,sv_77:null,sv_78:'AreaOfInterest',sv_79:'DegreeOfInterest',sv_80:'CampusType',sv_81:'Audience',sv_82:'PortalServiceCode',sv_83:'customParams',hqxServerKey:'hqxServer',trackingEndpointKey:'qsHqxapiTrackingEndpoint',xapiAjaxEndpointKey:'xapiAjaxEndpoint',useOnPageWrapperKey:'useOnPageWrapper',jsonVersion1_1:'1.1',categoryEducation:'education',categoryB2B:'b2b',categoryHS:'hs',categoryMedical:'medical',categoryMortgage:'mortgage',categoryDeposits:'deposits',categoryCreditCards:'creditcards',categoryAuto:'auto',categoryLife:'life',categoryHomeInsurance:'homeinsurance',categoryHealth:'health',categoryKeyEducation:5149,categoryKeyB2B:9258,categoryKeyHS:5151,categoryKeyMedical:9259,categoryKeyPersonalLoans:5150,headerFilterClass:'.qs-headerFilterBox',headerFilterSearchButtonClass:'.qs-headerFilterSubmit',headerFilterSubjectClass:'.qs-headerFilterSubject',headerFilterProgramClass:'.qs-headerFilterProgram',headerFilterQualificationClass:'.qs-headerFilterDegree',headerFilterCampusTypeClass:'.qs-headerFilterCampusType',headerFilterZipClass:'.qs-headerFilterZip',headerFilterPhraseClass:'.qs-headerFilterPhrase',headerDegreeStartTimeframeClass:'.qs-headerFilterDegreeStartTimeframe',headerUsAndCanZipCodeErrorMessageClass:'.qs-headerUsAndCanZipCodeErrorMessage',filterPhraseErrorMessageClass:'.qs-filterPhraseErrorMessage',footerFilterClass:'.qs-footerFilterBox',footerFilterSearchButtonClass:'.qs-footerFilterSubmit',footerFilterSubjectClass:'.qs-footerFilterSubject',footerFilterProgramClass:'.qs-footerFilterProgram',footerFilterQualificationClass:'.qs-footerFilterDegree',footerFilterCampusTypeClass:'.qs-footerFilterCampusType',footerFilterZipClass:'.qs-footerFilterZip',footerFilterPhraseClass:'.qs-footerFilterPhrase',footerDegreeStartTimeframeClass:'.qs-footerFilterDegreeStartTimeframe',footerUsAndCanZipCodeErrorMessageClass:'.qs-footerUsAndCanZipCodeErrorMessage',validateUsAndCanZipCodeClass:'.qs-validateUsAndCanZipCode',submitOnChangeClass:'.qs-submitOnChange',disableOnSubmitClass:'.qs-disableOnSubmit',headerMatchedCityFilterClass:'.qs-headerMatchedCityFilter',footerMatchedCityFilterClass:'.qs-footerMatchedCityFilter',filterClearButtonClass:'.qs-filterClearAllButton',allGroupClass:'qs-allGroup',noPreferenceGroupClass:'qs-noPreferenceGroup',noListingErrorMsgClass:'qs-noListingErrorMsg',noMatchErrorMsg:'Sorry! No results found matching your criteria. Please try another search.',listingTimeoutErrorMsg:'Unfortunately we have encountered an unexpected error. Please try the search again.',filterSubjectKey:'filterSubject',filterDegreeKey:'filterQual',filterCampusTypeKey:'filterCampusType',filterZipKey:'filterZip',filterPositionKey:'filterPosition',loadMoreButtonClass:'.loadMoreButton',phraseKey:'q',degreeStartTimeframeKey:'DegreeStartTimeframe',headerFilter:'headerFilter',footerFilter:'footerFilter',filterElementTypeCheckbox:'checkbox',filterElementRadioButton:'radio',currentRenderingTemplate:'',construct:function(domElement) {QS._eventProxy.bind(this);this.trigger('QS.WidgetInstance:construct:in',this);this.domElement=domElement;this.domId=domElement[0].id;this.sv_73=this.parseUrl();this.sv_84=new Array();this.sv_85=this.sv_86(this.sv_13);this.sv_87=this.sv_86(this.sv_22);this.sv_88=this.sv_86(this.sv_14);this.sv_89=this.sv_86(this.sv_44);this.sv_10=this.sv_86(this.sv_52);this.sv_90=this.sv_86(this.sv_53);this.sv_91=this.sv_86(this.sv_36);this.sv_92=this.sv_86(this.sv_15);this.sv_93=this.sv_86(this.sv_16);this.sv_94=this.sv_86(this.sv_17);this.sv_95=this.sv_86(this.sv_18);this.sv_96=this.sv_86(this.sv_19);this.sv_97=this.sv_86(this.sv_20);this.sv_98=decodeURIComponent(this.sv_86(this.sv_21));this.sv_99=this.sv_86(this.sv_23);this.sv_100=this.sv_86(this.sv_24);this.sv_101=this.sv_86(this.sv_42);this.sv_102=this.sv_86(this.sv_32);this.sv_103=this.sv_86(this.sv_25);this.sv_104=this.sv_86(this.sv_26);this.sv_105=this.sv_86(this.sv_27);this.sv_106=this.sv_86(this.sv_28);this.sv_107=this.sv_86(this.sv_29);this.sv_108=this.sv_86(this.sv_30);this.sv_109=this.sv_86(this.sv_31);this.sv_110=this.sv_86(this.sv_33);this.sv_72=(this.sv_86(this.sv_46)==null)?'spinner':this.sv_86(this.sv_46);this.sv_1=this.sv_86(this.sv_47);this.sv_111=this.sv_86(this.sv_34);this.sv_112=this.sv_86(this.sv_37);this.sv_113=this.sv_86(this.sv_38);this.sv_114=this.sv_86(this.sv_39);this.sv_115=this.sv_86(this.sv_40);this.sv_116=this.sv_86(this.sv_41);this.sv_117=this.sv_86(this.sv_54);this.sv_118=this.sv_86(this.sv_43);this.sv_119=this.sv_86(this.sv_35);this.useOnPageWrapper=this.sv_86(this.useOnPageWrapperKey);this.sv_120='/xapi';this.sv_121='/hqxapi';this.sv_122='/it';this.sv_123=this.sv_121+this.sv_122;this.sv_124=this.sv_121+this.sv_122;this.sv_125=false;this.sv_8=null;this.sv_126=null;this.sv_127=null;this.sv_128=null;this.sv_129=null;this.sv_130=null;this.sv_131=null;this.sv_132=null;this.sv_133=null;this.sv_134=null;this.sv_135=null;this.sv_136=null;this.pageNumber='1';this.currentPage=0;this.pageSize='';this.sv_87=(this.sv_87===null)?'':this.sv_87;this.totalResults=0;this.sv_137=[];this.programs=[];this.sv_5=false;this.setCtHandlers('.qsctCached');this.sv_138=null;this.sv_139=null;this.pages=null;this.sv_140=false;this.sv_141=false;this.sv_142=false;this.sv_143=false;this.sv_144=false;this.sv_4=false;this.shouldSetFilterHandlers=true;this.sv_7=false;this.sv_145='';this.sv_74='';this.sv_75='';this.sv_76='';this.sv_77='';this.sv_6='';this.jsonVersion=0;this.jsonRID=0;this.relevanceThreshold=200;this.bootstrapped=false;this.sv_146=false;this.sv_147={};this.sv_148=null;this.phrase=null;this.degreeStartTimeframe=null;this.shouldInitializeFilterValue=true;this.sv_149={};this.isMultiWidget=window.qsIsMultiWidget;var sanitizeFuncRegex=/^[0-9]+$|^[0-9]|[^a-zA-Z0-9_$]/g;var functionPostfix=this.isMultiWidget?this.domId.replace(sanitizeFuncRegex,'_'):'';this.getWidgetData=window['qsSlWidgetData'+functionPostfix];this.sv_150();this.envOverride();this.trigger('QS.WidgetInstance:construct:out',this);},envOverride:function() {if(typeof this.getWidgetData!=="undefined") {var widgetData=this.getWidgetData();if(widgetData[this.trackingEndpointKey]) {this.sv_124=widgetData[this.trackingEndpointKey];} if(widgetData[this.hqxServerKey]) {this.sv_2=widgetData[this.hqxServerKey];} if(widgetData[this.xapiAjaxEndpointKey]) {this.setXapiAjaxEndpoint(widgetData[this.xapiAjaxEndpointKey]);}}},isAffiliate:function() {return!!this.sv_8.getDataValues().AffiliateKey;},isLocalTracking:function() {return(this.sv_8.getDataValues().localTracking&&this.sv_8.getDataValues().localTracking!=='false')?true:false;},sv_150:function() {if(QS.$.cookie(this.sv_61)) {this.sv_7=true;this.sv_6=QS.$.cookie(this.sv_61);} else {QS.$.cookie(this.sv_62,this.sv_63);this.sv_7=QS.$.cookie(this.sv_62)==this.sv_63;QS.$.cookie(this.sv_62,null);}},sv_86:function(key) {if(typeof(this.sv_73[key])!=="undefined") {return this.sv_73[key];} else {var el=QS.$('#'+this.domId+'_'+key);if(el[0]) {if(el[0].className) {return el[0].className;}} if(el.className) {return el.className;}} return null;},sv_9:function() {return this.sv_2?this.sv_2:'';},parseUrl:function() {var urlParams={};var e,a=/\+/g,r=/([^&=]+)=?([^&]*)/g,d=function(s){return decodeURIComponent(s.replace(a," "));},q=window.location.search.substring(1);while(e=r.exec(q)) urlParams[d(e[1])]=d(e[2]);return urlParams;},shouldGetAdditionalDealerData:function() {return(this.sv_117=='yes');},isRequestValid:function() {return((this.sv_85!=null&&this.sv_88!=null&&this.sv_89!=null)||(this.sv_116!=null&&this.sv_115!=null));},hideHeaderFooterTemplates:function() {if(QS.$('.qs-listing-footer').length>0) {QS.$('.qs-listing-footer').hide();} if(QS.$('.qs-listing-header').length>0) {QS.$('.qs-listing-header').hide();}},populate:function(widgetJson) {this.trigger('QS.WidgetInstance:populate:in',this);if(QS.$.isArray(widgetJson)&&(widgetJson[1]&&widgetJson[1].widgetInstance&&widgetJson[1].widgetInstance.contentType==this.sv_12&&widgetJson[1].widgetInstance.dataListingArr&&(widgetJson[1].widgetInstance.dataListingArr.length>0||this.getXapiRequest().isApiProductHqPlatform()||this.getXapiRequest().isApiProductHqScriptTag()))&&((this.sv_85!=null&&this.sv_88!=null&&this.sv_89!=null)||(this.sv_116!=null&&this.sv_115!=null))) {if(widgetJson[0]&&widgetJson[0].jsonVersion&&typeof widgetJson[0].jsonVersion!=="undefined") {this.jsonVersion=widgetJson[0].jsonVersion;} if(widgetJson[0]&&widgetJson[0].RID&&typeof widgetJson[0].RID!=="undefined") {this.jsonRID=widgetJson[0].RID;} this.sv_125=true;var widgetInstance=widgetJson[1].widgetInstance;this.sv_89=widgetInstance.widgetInstanceKey;this.sv_126=widgetInstance.widgetInstanceName;QS._.each(widgetInstance.matchedCities,function(city) {this.sv_84.push(city);},this);QS._.each(widgetInstance.matchedServices,function(service) {var matchedService=new QS.Service();matchedService.construct(service);this.sv_151.push(matchedService);},this);if(typeof widgetInstance.customParams!=="undefined") {this.sv_145=widgetInstance.customParams;this.sv_74=(typeof widgetInstance.customParams.AreaOfInterest!=="undefined"?widgetInstance.customParams.AreaOfInterest:null);this.sv_75=(typeof widgetInstance.customParams.DegreeOfInterest!=="undefined"?widgetInstance.customParams.DegreeOfInterest:null);this.sv_76=(typeof widgetInstance.customParams.Audience!=="undefined"?widgetInstance.customParams.Audience:null);this.sv_77=(typeof widgetInstance.customParams.PortalServiceCode!=="undefined"?widgetInstance.customParams.PortalServiceCode:null);} if(typeof this.getXapiRequest().customParams!=="undefined"&&typeof this.getXapiRequest().customParams==="object") {QS.$.extend(this.sv_145,this.getXapiRequest().customParams);} this.resetVendors();if(this.isJsonVersion1_1()) {if(widgetInstance.categoryKey) {switch(widgetInstance.categoryKey) {case this.categoryKeyB2B:this.populateB2BVendors(widgetInstance.dataListingArr);break;case this.categoryKeyHS:this.populateHSVendors(widgetInstance.dataListingArr);break;case this.categoryKeyMedical:this.populateMedicalVendors(widgetInstance.dataListingArr);break;case this.categoryKeyPersonalLoans:this.populatePersonalLoansVendors(widgetInstance.dataListingArr);break;default:this.populateEducationVendors(widgetInstance.dataListingArr);break;}}} else {this.populateEducationVendors(widgetInstance.dataListingArr);} this.sv_139=this.sv_98;this.processVendors();this.pageNumber=widgetInstance.pageNumber;if(parseInt(widgetInstance.pageSize)>0) {this.pageSize=parseInt(widgetInstance.pageSize);} else if(this.getNumVendors()>0) {this.pageSize=this.getNumVendors();} else {this.pageSize=1;} this.totalResults=this.sv_137.length;this.populatePages();this.getRequest().setCachedBluids(this.getImpressionBluids());if(widgetInstance.userGeo) {this.sv_148=widgetInstance.userGeo;} this.getRequest().setCachedListingPixelUrls(this.getListingPixelUrls());this.trigger('QS.WidgetInstance:populate:complete',this);this.render();if(widgetJson[1].widgetInstance.dataListingArr.length==0) {this.trigger('QS.WidgetInstance:dataListing:empty',this);this.hideHeaderFooterTemplates();this.displayErrorMessage();}} else {if(QS.$.isArray(widgetJson)&&widgetJson[0]&&widgetJson[0].RID&&widgetJson[0].RID!=="undefined") {this.jsonRID=widgetJson[0].RID;} if(QS.$.isArray(widgetJson)&&widgetJson[1]&&widgetJson[1].widgetInstance&&widgetJson[1].widgetInstance.contentType==this.sv_12&&widgetJson[1].widgetInstance.dataListingArr&&widgetJson[1].widgetInstance.dataListingArr.length==0) {this.trigger('QS.WidgetInstance:dataListing:empty',this);} else {this.trigger('QS.WidgetInstance:exception',new Error('could not parse/interpret matching json response: '+JSON.stringify(widgetJson)));} this.sv_125=false;this.trigger('QS.WidgetInstance:populate:complete',this);this.displayAndExit();} this.trigger('QS.WidgetInstance:populate:out',this);},resetVendors:function() {this.sv_137=[];},populateB2BVendors:function(dataListingArr) {QS._.each(dataListingArr,function(listing) {var vendor=new QS.B2BVendor();vendor.construct(listing,this);this.sv_137.push(vendor);},this);},populateEducationVendors:function(dataListingArr) {QS._.each(dataListingArr,function(listing) {var vendor=new QS.Vendor();vendor.construct(listing,this);this.sv_137.push(vendor);},this);if(this.sv_137.length>0) {this.sv_137[0].resetRandomNumberPool();}},populateHSVendors:function(dataListingArr) {QS._.each(dataListingArr,function(listing) {var vendor=new QS.HSVendor();vendor.construct(listing,this);this.sv_137.push(vendor);},this);},populateMedicalVendors:function(dataListingArr) {QS._.each(dataListingArr,function(listing) {var vendor=new QS.MedicalVendor();vendor.construct(listing,this);this.sv_137.push(vendor);},this);},populatePersonalLoansVendors:function(dataListingArr) {QS._.each(dataListingArr,function(listing) {var vendor=new QS.PersonalLoansVendor();vendor.construct(listing,this);this.sv_137.push(vendor);},this);},processVendors:function() {this.trigger('QS.WidgetInstance:processVendors:in',this);var lastPosition=-1;var firstSibling=null;var vendorKeysToRemove=[];QS._.each(this.sv_137,function(vendor) {if(lastPosition!==vendor.position) {lastPosition=vendor.position;firstSibling=vendor;} else {if(vendor.position==lastPosition) {vendor.sibling=true;vendor.firstSibling=firstSibling;firstSibling.siblings.push(vendor);firstSibling.sibling=true;vendorKeysToRemove.push(vendor.vendorKey);}}},this);if(vendorKeysToRemove.length>0) {var sv_152=[];QS._.each(this.sv_137,function(vendor) {if(QS._.indexOf(vendorKeysToRemove,vendor.vendorKey)===-1) {sv_152.push(vendor);}},this);this.sv_137=sv_152;} this.trigger('QS.WidgetInstance:processVendors:out',this);},populateAdditionalData:function(additionalDataJson) {this.trigger('QS.WidgetInstance:populateAdditionalData:in',this);this.trigger('QS.WidgetInstance:populateAdditionalData:out',this);},getAdditionalData:function(callback,pageNumber) {this.trigger('QS.WidgetInstance:getAdditionalData:in',this);this.trigger('QS.WidgetInstance:getAdditionalData:out',this);},applyFilterRule:function(element,key,value) {if(!value&&this.sv_149[key]) {return this.sv_149[key];} return value;},processFilterRequest:function(element) {var dataValues=this.getXapiRequest().getDataValues();dataValues[this.sv_30]=this.applyFilterRule(element,this.sv_30,this.sv_108);dataValues[this.sv_29]=this.sv_107;dataValues[this.sv_20]=this.sv_97;dataValues[this.sv_26]=this.sv_104;dataValues[this.phraseKey]=this.getPhrase();dataValues[this.degreeStartTimeframeKey]=this.getDegreeStartTimeframe()||this.getXapiRequest().getDegreeStartTimeframe();if(this.sv_103) {dataValues[this.sv_25]=this.sv_103;this.updateFilterCustomParams(element,this.sv_103);} else {delete dataValues[this.sv_25];this.updateFilterCustomParams(element,null);} delete dataValues[this.sv_31];this.getXapiRequest().setDataValues(dataValues);this.setFilterSearchMode(true);return this.getXapiRequest();},setFilterSearchMode:function(state) {this.sv_4=state;},updateWidget:function(request) {this.trigger('QS.WidgetInstance:updateWidget:in',this);var haveData=false;this.sv_138=QS.$('#'+this.domId+'_listing');if(typeof this.getWidgetData!=="undefined"&&!request) {var widgetData=this.getWidgetData();if(typeof widgetData[this.domId]!=="undefined") {var request=new QS.XapiRequest();request.setTemplate(decodeURIComponent(widgetData[this.domId].template));request.setFooterTemplate(decodeURIComponent(widgetData[this.domId].footerTemplate));request.setHeaderTemplate(decodeURIComponent(widgetData[this.domId].headerTemplate));request.setRenderedHeaderFilterTemplate(decodeURIComponent(widgetData[this.domId].renderedHeaderFilterTemplate));request.setRenderedFooterFilterTemplate(decodeURIComponent(widgetData[this.domId].renderedFooterFilterTemplate));request.setFilterCriteriaXml(decodeURIComponent(widgetData[this.domId].filterCriteria));request.setDataValuesXml(decodeURIComponent(widgetData[this.domId].dataValues));request.setCustomParams(widgetData[this.domId].customParams);request.setCachedBluids(widgetData[this.domId].cachedBluids);request.setCachedListingPixelUrls(widgetData[this.domId].cachedListingPixelUrls);request.setApiProduct(widgetData[this.domId].apiProduct);request.setBaseHref(widgetData[this.domId].baseHref);request.setClickBaseHref(widgetData[this.domId].clickBaseHref);request.setRequestInfoUrl(widgetData[this.domId].requestInfoUrl);request.setIncludeTracking("true");request.setTemplateVersion(widgetData[this.domId].templateVersion);request.setVertical(widgetData[this.domId].vertical);request.setJsonP(true);}} if(typeof request!=="undefined"&&typeof QS.SureHitsRequest==="function"&&request instanceof QS.SureHitsRequest) {this.sv_8=request;if(typeof this.getRequest().getTemplate()!=="undefined") {this.setListingTemplate(this.getRequest().getTemplate());} if(typeof this.getRequest().getHeaderTemplate()!=="undefined") {this.setHeaderTemplate(this.getRequest().getHeaderTemplate());} if(typeof this.getRequest().getFooterTemplate()!=="undefined") {this.setFooterTemplate(this.getRequest().getFooterTemplate());} if(this.getRequest().getHeaderFilterTemplate()) {this.setHeaderFilterTemplate(this.getRequest().getHeaderFilterTemplate());} if(this.getRequest().getFooterFilterTemplate()) {this.setFooterFilterTemplate(this.getRequest().getFooterFilterTemplate());} if(!haveData) {this.trigger('QS.WidgetInstance:jsonRequest:start',this);QS.$.ajax({url:typeof request.get('endpoint')!=="undefined"?request.get('endpoint'):this.sv_120,context:this,data:QS.$.param(request.getRequestParams()),processData:false,timeout:this.sv_68,success:this.populateSureHits,error:this.displayAndExit,cache:false,headers:QS.$.extend(request.getHttpHeaders(),this.getXapiRequestHeaders()),dataType:'json',jsonp:''});}} else {if(typeof request!=="undefined") {this.sv_8=request;if(typeof this.sv_8.getTemplate()!=="undefined") {this.setListingTemplate(this.sv_8.getTemplate());} if(typeof this.sv_8.getHeaderTemplate()!=="undefined") {this.setHeaderTemplate(this.sv_8.getHeaderTemplate());} if(typeof this.sv_8.getFooterTemplate()!=="undefined") {this.setFooterTemplate(this.sv_8.getFooterTemplate());} if(this.sv_8.getHeaderFilterTemplate()) {this.setHeaderFilterTemplate(this.sv_8.getHeaderFilterTemplate());} if(this.sv_8.getFooterFilterTemplate()) {this.setFooterFilterTemplate(this.sv_8.getFooterFilterTemplate());} if(typeof this.sv_8.getNumPrograms()!=="undefined") {this.sv_10=this.sv_8.getNumPrograms();} this.sv_8.setServiceName(this.sv_55);this.sv_8.setServiceMethod(this.sv_56);this.setEDV(this.sv_8.getEncodedDataValues());this.setEFC(this.sv_8.getEncodedFilterCriteria());if(typeof this.sv_8.getData()!=="undefined") {this.compileTemplates();this.populate(QS.JSON.parse(this.sv_8.getData()));haveData=true;}} else if(this.isRequestValid()) {this.sv_8=this.propertiesToXapiRequest();} if(!haveData) {this.trigger('QS.WidgetInstance:jsonRequest:start',this);QS.$.ajax({url:typeof this.sv_8.getXapiEndpoint()!=="undefined"?this.sv_8.getXapiEndpoint():this.sv_120,context:this,data:QS.$.param(this.sv_8.getRequestObject()),processData:false,timeout:(this.getRequest().getXapiTimeout())?this.getRequest().getXapiTimeout():this.sv_68,success:this.populate,error:this.displayAndExit,cache:false,headers:QS.$.extend(this.sv_8.getHttpHeaders(),this.getXapiRequestHeaders()),dataType:this.sv_8.isJsonPRequest()?'jsonp':'json',jsonp:this.sv_8.isJsonPRequest()?'jsonpcallback':''});}} if(!haveData) {this.compileTemplates();} this.bootstrap();this.trigger('QS.WidgetInstance:updateWidget:out',this);},propertiesToXapiRequest:function() {var xapiRequest=new QS.XapiRequest();xapiRequest.setServiceName(this.sv_55);xapiRequest.setServiceMethod(this.sv_56);xapiRequest.setIncludeTracking('true');if(this.sv_115!=null) {xapiRequest.setFilterCriteriaXml(this.sv_115);} else {xapiRequest.setFilterCriteria({sp_260880:this.sv_85,sp_260890:this.sv_88,sp_260910:this.sv_57,sp_260920:this.sv_89,sp_261250:this.sv_91});} if(this.sv_116!=null) {xapiRequest.setDataValuesXml(this.sv_116);} else {xapiRequest.setDataValues({sp_260770:this.sv_59,sp_260780:this.sv_87,sp_260790:this.sv_58,sp_260800:this.pageNumber,sp_260820:this.sv_92,sp_260830:this.sv_93,sp_261170:this.sv_94,sp_loadAddlListingData:this.sv_95,sp_260840:this.sv_97,sp_matched:this.sv_119,ClientModel:this.sv_118,sp_260850:this.sv_99,sp_260860:this.sv_100,sp_260870:this.sv_101,sp_270390:this.sv_102,sp_261270:this.sv_103,sp_261260:this.sv_104,AreaOfInterest:(this.sv_108!=null)?this.sv_108:this.sv_105,DegreeOfInterest:(this.sv_107!=null)?this.sv_107:this.sv_106,filterDlrByState:this.sv_109,alphabet:this.sv_110,gibill:this.sv_111,yellowribbon:this.sv_112,getIPEDSData:this.sv_113,getUserGeo:this.sv_114});} return xapiRequest;},getVendors:function() {return this.sv_137;},getNumVendors:function() {return(this.data)?this.data.sv_137.length:this.sv_137.length;},getDealers:function() {var dealers=[];QS._.each(this.sv_137,function(vendor) {QS._.each(vendor.getDealers(),function(dealer) {dealers.push(dealer)});});return dealers;},useXapiTracking:function() {return(this.sv_98!==null);},getTrackingObj:function() {return this.data?this.data.sv_153:this.sv_153;},removeCtHandlers:function(className) {},getVendorByBluid:function(bluid) {var theVendor=null;if(typeof bluid!=="undefined") {QS._.each(this.getVendors(),function(vendor) {if(vendor.BLUID===bluid) {theVendor=vendor;} else {QS._.each(vendor.getSiblings(),function(sibling) {if(sibling.BLUID===bluid) {theVendor=sibling;}});}});} return theVendor;},getVendorByKey:function(key) {var theVendor=null;if(typeof key!=="undefined") {QS._.each(this.getVendors(),function(vendor) {if(vendor.vendorKey==key) {theVendor=vendor;} else {QS._.each(vendor.getSiblings(),function(sibling) {if(sibling.vendorKey==key) {theVendor=sibling;}});}});} return theVendor;},getTotalResults:function() {return(this.data||this).getNumVendors();},getMatchedServices:function() {var self=(this.data)?this.data:this;return self.sv_151;},getMatchedCities:function() {return(this.data||this).sv_84;},getTag:function() {if(this.sv_8.getDataValues().TAG) {return this.sv_8.getDataValues().TAG;} else if(this.sv_8.getDataValues().tag) {return this.sv_8.getDataValues().tag;} else {return undefined;}},getWebSiteName:function() {if(this.sv_8.getFilterCriteria().sp_260880) {return this.sv_8.getFilterCriteria().sp_260880;} else {return undefined;}},setCtHandlers:function(className) {this.trigger("QS.WidgetInstance:setCtHandlers:in",this);if(className!='') {var ctElements=QS.$(className,this.domElement);var theWidget=this;var destinationHref,classes,bluid,vendor=null;QS._.each(ctElements,function(ctElement) {bluid=ctElement.id;classes=ctElement.className.split(/\s+/);QS._.each(classes,function(theClass) {if(theClass.substring(0,theWidget.sv_60.length)==theWidget.sv_60) {bluid=theClass.substring(theWidget.sv_60.length);}});destinationHref=QS.$(ctElement).attr('href');if(this.getVendors().length>0) {vendor=this.getVendorByBluid(bluid);if(vendor!=null) {if((vendor.isClickClient()&&className!='.qsctSite')||((vendor.getClientModel()===vendor.clientModelClickName||vendor.getClientModel()===vendor.clientModelDtspName)&&!vendor.hasSiblings()&&!vendor.isMergedSibling())) {destinationHref=vendor.getClickThroughUrl(destinationHref);QS.$(ctElement).attr('target','_blank');QS.$(ctElement).attr('href',destinationHref);} else {if(destinationHref.indexOf('BLUID')<0) {if(destinationHref.indexOf('?')>=0) {destinationHref+='&BLUID='+bluid} else {destinationHref+='?BLUID='+bluid;}} QS.$(ctElement).attr('href',destinationHref);}}}},this);} this.trigger("QS.WidgetInstance:setCtHandlers:out",this);},getBluids:function() {var bluids=[];if(this.useXapiTracking()) {var sv_153=QS.$.parseJSON(decodeURIComponent(this.sv_98));if(sv_153.listing) {QS._.each(sv_153.listing,function(listing) {if(listing.namedValues[2].name==this.sv_11) {bluids.push(listing.namedValues[2].value);}},this);}} else {QS._.each(this.sv_137,function(sv_154) {bluids.push(sv_154.BLUID);bluids=bluids.concat(sv_154.getSiblingBluids());},this);} return bluids;},removeUpdatedWidgetListing:function() {this.trigger('QS.WidgetInstance:removeUpdatedWidgetListing:in',this);if(QS.$('#'+this.domId+'_updated_listing').length) {QS.$('#'+this.domId+'_updated_listing').remove();} this.trigger('QS.WidgetInstance:removeUpdatedWidgetListing:out',this);},restoreOnPageWidgetAndExit:function(request,status,error) {this.trigger('QS.WidgetInstance:restoreOnPageWidgetAndExit:in',this);this.bootstrap();this.removeUpdatedWidgetListing();this.sv_138.appendTo(this.domElement);this.sv_98=this.sv_139;this.setCtHandlers('.qsctCached');this.activateListingFilter();this.bindLoadMoreVendors();this.domElement.show();this.qsit(this.domElement);this.trigger('QS.WidgetInstance:restoreOnPageWidgetAndExit:out',this);},display:function() {this.trigger('QS.WidgetInstance:display:in',this);this.bindLoadMoreVendors();this.domElement.show();this.qsit(this.domElement);this.removeCtHandlers('.qsctCached');this.setCtHandlers('.qsct');this.setCtHandlers('.qsctSite');this.setShouldSetFilterHandlers(true);this.trigger('QS.WidgetInstance:display:out',this);},displayAndExit:function(request,status,error) {this.trigger('QS.WidgetInstance:displayAndExit:in',this);if(this.shouldShowErrorMessage()) {this.displayErrorMessage(status);if(QS.$(this.headerFilterClass).length&&QS.$(this.footerFilterClass).length) {QS.$(this.footerFilterClass,this.getDomElement()).hide();}} if(QS.$(this.loadMoreButtonClass).length) {QS.$(this.loadMoreButtonClass).hide();} this.enableFilters();this.display();if(request&&request.isRejected()) {var errorMessage='matching called returned http error status: '+request.status+' and message : '+(request.responseText||request.statusText||status);if(this.sv_8&&typeof this.sv_8!=="undefined"&&this.sv_8.getWebSiteName()) {errorMessage+=' and pubWebsiteName : '+this.sv_8.getWebSiteName();} this.trigger('QS.WidgetInstance:httpException',new Error(errorMessage));} this.trigger('QS.WidgetInstance:displayAndExit:out',this);},enableFilters:function() {if(this.filter) {this.filter.enableFilters()} else {this.disableFilterElements(false);}},activateListingFilter:function() {if(this.shouldActivateListingFilter()) {if(this.getRequest().getVertical()===this.categoryEducation) {this.setFilterTemplateHandlers();} else {this.populateListingFilter();}}},shouldActivateListingFilter:function() {var request=this.getRequest();if(!request||(request&&request.shouldActivateListingFilter===false)) {return false;} return true;},populateListingFilter:function() {if(!this.filter) {this.filter=new QS.ListingFilter();this.filter.construct(this);} else {this.filter.populate();}},shouldShowErrorMessage:function() {return this.sv_4;},displayErrorMessage:function(status) {if(QS.$('.'+this.noListingErrorMsgClass).length) {QS.$('.'+this.noListingErrorMsgClass).remove();} var errorMessageText=(status=='timeout')?this.listingTimeoutErrorMsg:this.noMatchErrorMsg;var errorMsg=QS.$('
'+errorMessageText+'
');errorMsg.insertAfter('.'+this.domId+'_filter_wrapper');errorMsg.css('clear','both').css('text-align','center').css('color','#ff0000').css('padding-top','20px').css('padding-bottom','20px');this.setShouldSetFilterHandlers(false);},populatePages:function() {if(this.pages===null) {this.pages=[];if(this.getNumVendors()>this.getPageSize()) {var pages=Math.ceil(this.getNumVendors()/this.getPageSize());for(var page=0;page0) {var widgetPage=new QS.WidgetPage();widgetPage.construct(0,0,this.getPageSize(),this);this.pages[0]=widgetPage;}}},getPageSize:function() {return(this.data)?this.data.pageSize:this.pageSize;},getPages:function() {return(this.data)?this.data.pages:this.pages;},getNumPages:function() {return(this.data)?this.data.pages.length:this.pages.length;},getPageRange:function(range) {var self=(this.data)?this.data:this;var widgetPages=self.getPages();var pageRangeBefore=new Array();var pageRangeAfter=new Array();var pageRange=[];pageRange.push(self.getWidgetPage());var pages=[];if(range>=0) {var start=(self.currentPage-range<0)?0:self.currentPage-range;var end=(self.currentPage+range>(widgetPages.length-1))?(widgetPages.length-1):self.currentPage+range;for(var i=start;i0&&this.pages[whichPage])?this.pages[whichPage]:[];},getListingsPage:function(pageNumber) {var self=this.data?this.data:this;var whichPage=(pageNumber)?pageNumber:self.currentPage;var listingsData=self.sv_137;var page=[];var widgetPage=self.getWidgetPage(whichPage);if(widgetPage!=null) {var start=widgetPage.offset;var end=start+parseInt(widgetPage.pageSize);for(var i=start;i-1&&vendors[0].position>self.relevanceThreshold) {return true;} else {return false;}},getRelevanceThreshold:function() {return(this.data)?this.data.relevanceThreshold:this.relevanceThreshold;},getExpandedListingsPage:function(pageNumber) {var listings=this.getListingsPage(pageNumber);var expandedListings=[];QS._.each(listings,function(listing) {expandedListings.push(listing);expandedListings=expandedListings.concat(listing.getSiblings());});return expandedListings;},isScrollNeeded:function(event) {if(event.type=="click") {currentTarget=QS.$(event.currentTarget);if(currentTarget.parents('.qs-listing-footer').length>0) {return true;}} return false;},gotoHeaderPaginationIfNeeded:function(event) {if(this.isScrollNeeded(event)) {this.getFocusToListingTopSection();}},gotoPageLink:function(event) {event.preventDefault();var widget=event.data.widget;if(widget) {widget.currentPage=parseInt(this.className.replace('pageNumberLink',''));widget.sv_141=false;widget.sv_142=false;widget.render();widget.gotoHeaderPaginationIfNeeded(event);}},nextPage:function(event) {var widget=event.data.widget;if(widget) {widget.currentPage++;widget.sv_141=false;widget.sv_142=false;widget.render();widget.gotoHeaderPaginationIfNeeded(event);}},previousPage:function(event) {var widget=event.data.widget;if(widget) {widget.currentPage--;widget.sv_141=false;widget.sv_142=false;widget.render();widget.gotoHeaderPaginationIfNeeded(event);}},lastPage:function(event) {var widget=event.data.widget;if(widget) {widget.currentPage=widget.pages.length-1;widget.sv_141=false;widget.sv_142=false;widget.render();widget.gotoHeaderPaginationIfNeeded(event);}},firstPage:function(event) {var widget=event.data.widget;if(widget) {widget.currentPage=0;widget.sv_141=false;widget.sv_142=false;widget.render();widget.gotoHeaderPaginationIfNeeded(event);}},keyNavigation:function(event) {var widget=event.data.widget;if(event.keyCode==37) {if(!event.shiftKey) {if(widget.currentPage>0) {widget.previousPage(event);}} else {widget.firstPage(event);}} else if(event.keyCode==39) {if(!event.shiftKey) {if(widget.currentPage'+link[0].innerHTML+'') link.replaceWith(newLink);} else {link.click({widget:this},this.gotoPageLink);}},this);} var nextPageLinks=QS.$('.nextPageLink',el);QS._.each(nextPageLinks,function(nextPageLink) {if(nextPageOn) {QS.$(nextPageLink).click({widget:this},this.nextPage);} else {QS.$(nextPageLink).remove();}},this);var previousPageLinks=QS.$('.previousPageLink',el);QS._.each(previousPageLinks,function(previousPageLink) {if(previousPageOn) {QS.$(previousPageLink).click({widget:this},this.previousPage);} else {QS.$(previousPageLink).remove();}},this);var firstPageLinks=QS.$('.firstPageLink',el);QS._.each(firstPageLinks,function(firstPageLink) {if(firstPageOn) {QS.$(firstPageLink).click({widget:this},this.firstPage);} else {QS.$(firstPageLink).remove();}},this);var lastPageLinks=QS.$('.lastPageLink',el);QS._.each(lastPageLinks,function(lastPageLink) {if(lastPageOn) {QS.$(lastPageLink).click({widget:this},this.lastPage);} else {QS.$(lastPageLink).remove();}},this);},getImpressionBluids:function(pageNumber) {var whichPage=(pageNumber)?pageNumber:this.currentPage;var bluids=[];var listings=this.getListingsPage(whichPage);var siblingBluids=[];QS._.each(listings,function(listing) {bluids.push(listing.BLUID?listing.BLUID:'');bluids=bluids.concat(listing.getSiblingBluids());},this);return bluids;},getImpressionPixel:function() {this.trigger("QS.WidgetInstance:getImpressionPixel:in",this);var sv_155=null,sv_156=null,bluids='',cachedBluids='',impressionPixel=QS.$(),pixel=null,sv_157='';if(this.useXapiTracking()) {sv_157='y';if(typeof this.sv_8.getCachedBluids()!=="undefined"&&this.sv_8.getCachedBluids().length>0) {cachedBluids=this.sv_8.getCachedBluids();if(QS.$.isArray(cachedBluids)) {bluids=cachedBluids.join(',');} else if(QS._.isString(cachedBluids)) {bluids=cachedBluids;}} else {var bluidArray=QS.JSON.parse(decodeURIComponent(this.sv_86(this.sv_21)));if(QS._.isArray(bluidArray)) {bluids=bluidArray.join(',');}}} else {sv_157='n';bluids=this.getImpressionBluids().join(',');} if (bluids&&!this.getWidgetPage().impressionsLogged&&this.sv_8!==null&&this.sv_8.shouldIncludeTracking()) {var loggingUrl=(this.shouldRelativePath()?this.sv_123:this.sv_124)+'?'+QS.$.param({ids:bluids,ca:sv_157,coo:(this.sv_7)?'y':'n'});if(this.sv_8.isParamTrue(this.sv_8.getDataValues().lazyImpressionTracking)) {pixel=document.createElement('div');impressionPixel=QS.$(pixel);impressionPixel.attr('class','impressionPixel');impressionPixel.attr('data-url',loggingUrl);} else {pixel=document.createElement('img');impressionPixel=QS.$(pixel);impressionPixel.attr('class','impressionPixelImg');impressionPixel.attr('src',loggingUrl);} impressionPixel.attr('data-matchingRequest',encodeURIComponent(JSON.stringify(this.sv_8.getRequestObject())));impressionPixel.attr('height',1);impressionPixel.attr('width',1);impressionPixel.css({display:"none"});this.getWidgetPage().impressionsLogged=true;} this.trigger("QS.WidgetInstance:getImpressionPixel:out",this);return impressionPixel;},getListingPixelUrls:function(pageNumber) {var whichPage=(pageNumber)?pageNumber:this.currentPage;var urls=[];var listings=this.getListingsPage(whichPage);QS._.each(listings,function(listing) {var attribute=listing.getAttribute('listingPixelURL');if(attribute) {urls.push(attribute)}},this);return urls;},getListingPixels:function() {var impressionPixels=[],urls=[];if(this.useXapiTracking()) {if(typeof this.sv_8.getCachedListingPixelUrls()!=="undefined"&&this.sv_8.getCachedListingPixelUrls().length>0) {urls=this.sv_8.getCachedListingPixelUrls();}} else {urls=this.getListingPixelUrls();} if(!this.getWidgetPage().listingPixelLogged) {impressionPixels=QS._.map(urls,function(url){if(url.toLowerCase().indexOf('');}} else {this.wrapperElem=this.cloneableWrapperElem.clone();} var wrapperElem=this.wrapperElem,headerTemplate=null,footerTemplate=null,listingTemplate=null,renderedHeader=null,renderedFooter=null,renderedListing=null,renderedHeaderFilter=null,renderedFooterFilter=null;this.compileTemplates();if(this.getListingTemplate()!==null) {renderedListing=this.renderTemplate(this.getListingTemplate(),this.getListingsPage());} else if(typeof QS.$.template[this.domId+'_listing_template']=="function") {renderedListing=QS.$.tmpl(this.domId+'_listing_template',this.getListingsPage());} else if((listingTemplate=QS.$('#'+this.domId+'_listing_template')).length>0) {renderedListing=listingTemplate.tmpl(this.getListingsPage());} if(this.getHeaderTemplate()!==null&&this.getHeaderTemplate().length>0) {renderedHeader=this.renderTemplate(this.getHeaderTemplate());this.sv_141=true;} else if(typeof QS.$.template[this.domId+'_header_template']=="function") {renderedHeader=QS.$.tmpl(this.domId+'_header_template',this);this.sv_141=true;} else if((headerTemplate=QS.$('#'+this.domId+'_header_template')).length>0&&!this.sv_141) {renderedHeader=headerTemplate.tmpl(this);this.sv_141=true;} if(this.getFooterTemplate()!==null&&this.getFooterTemplate().length>0) {renderedFooter=this.renderTemplate(this.getFooterTemplate());this.sv_142=true;} else if(typeof QS.$.template[this.domId+'_footer_template']=="function") {renderedFooter=QS.$.tmpl(this.domId+'_footer_template',this);this.sv_142=true;} else if((footerTemplate=QS.$('#'+this.domId+'_footer_template')).length>0&&!this.sv_142) {renderedFooter=footerTemplate.tmpl(this);this.sv_142=true;} if(this.getHeaderFilterTemplate()!==null&&this.getHeaderFilterTemplate().length>0) {renderedHeaderFilter=this.renderTemplate(this.getHeaderFilterTemplate());this.sv_8.setRenderedHeaderFilterTemplate(QS.$('
').append(renderedHeaderFilter.clone()).html());} else if(!this.sv_143&&this.sv_8.getRenderedHeaderFilterTemplate()) {renderedHeaderFilter=QS.$(this.sv_8.getRenderedHeaderFilterTemplate());} if(this.getFooterFilterTemplate()!==null&&this.getFooterFilterTemplate().length>0) {renderedFooterFilter=this.renderTemplate(this.getFooterFilterTemplate());this.sv_8.setRenderedFooterFilterTemplate(QS.$('
').append(renderedFooterFilter.clone()).html());} else if(!this.sv_144&&this.sv_8.getRenderedFooterFilterTemplate()) {renderedFooterFilter=QS.$(this.sv_8.getRenderedFooterFilterTemplate());} if(renderedHeader) {renderedHeader.appendTo(wrapperElem);} if(renderedListing) {renderedListing.appendTo(wrapperElem);} if(renderedFooter) {renderedFooter.appendTo(wrapperElem);} if(this.sv_143) {renderedHeaderFilter=QS.$(this.headerFilterClass,updatedWidget);} if(this.sv_144) {renderedFooterFilter=QS.$(this.footerFilterClass,updatedWidget);} if(renderedListing&&renderedListing.length) {if(!this.sv_140) {this.setKeyboardHandlers(wrapperElem);this.sv_140=true;}} else {this.unsetKeyboardHandlers(wrapperElem);this.sv_140=false;} this.setPaginationHandlers(wrapperElem);if(updatedWidget[0]) {if(this.sv_146===true) {updatedWidget.children().appendTo(wrapperElem);updatedWidget.remove();} else {updatedWidget.replaceWith(wrapperElem);}} else {wrapperElem.appendTo(this.domElement);}} catch(e) {e.currentRenderingTemplate=this.currentRenderingTemplate;this.trigger('QS.WidgetInstance:exception',e);this.restoreOnPageWidgetAndExit();renderSuccess=false;} if((renderedHeaderFilter&&renderedHeaderFilter.length)||(renderedFooterFilter&&renderedFooterFilter.length)) {var id=this.getXapiRequest().getWidgetId()?this.getXapiRequest().getWidgetId():this.domId;QS.$('#'+this.domId+'_updated_listing',this.domElement).wrapInner('');} if(renderedHeaderFilter&&renderedHeaderFilter.length) {renderedHeaderFilter.prependTo(wrapperElem);this.sv_143=true;} if(renderedFooterFilter&&renderedFooterFilter.length) {renderedFooterFilter.appendTo(wrapperElem);this.sv_144=true} this.sv_98=null;this.qsit(wrapperElem);if(this.updatedWidget&&this.wrapperElem&&this.updatedWidget[0]) {if(this.sv_146===true) {this.updatedWidget.children().appendTo(this.wrapperElem);this.updatedWidget.remove();} else {this.updatedWidget.replaceWith(this.wrapperElem);}} else if(this.wrapperElem) {this.wrapperElem.appendTo(this.domElement);} this.trigger('QS.WidgetInstance:render:complete',this);this.display();if(renderSuccess) {this.activateListingFilter();this.trigger('QS.WidgetInstance:render:success',this);} this.trigger('QS.WidgetInstance:render:out',this);},renderTemplate:function(template,items) {var renderedListing='';this.currentRenderingTemplate=template;switch(this.getRequest().getTemplateVersion()) {case 2:renderedListing=QS.$.tmpl(template,this);break;case 3:renderedListing=QS.$('
'+(typeof template==='function'?template({QS:QS,widgetInstance:this}):QS._.template(template,{variable:'window'})({QS:QS,widgetInstance:this}))+'
');break;case 1:default:renderedListing=QS.$.tmpl(template,items||this);break;} return renderedListing},getAjaxLoadEffect:function() {var self=this.data?this.data:this;return self.sv_72;},getJsonVersion:function() {return this.jsonVersion;},isJsonVersion1_1:function() {return true;},getDomElement:function() {return this.domElement;},resetFilterParams:function() {this.sv_85=null;this.sv_87=null;this.sv_88=null;this.sv_89=null;this.sv_10=null;this.sv_90=null;this.sv_91=null;this.sv_92=null;this.sv_93=null;this.sv_94=null;this.sv_95=null;this.sv_96=null;this.sv_99=null;this.sv_100=null;this.sv_101=null;this.sv_102=null;this.sv_104=null;this.sv_105=null;this.sv_106=null;this.sv_109=null;this.sv_110=null;this.sv_72=null;this.sv_1=null;this.sv_111=null;this.sv_112=null;this.sv_115=null;this.sv_116=null;this.sv_117=null;this.sv_118=null;this.sv_119=null;this.useOnPageWrapper=null;this.pages=null;this.sv_141=false;this.sv_142=false;this.shouldSetFilterHandlers=true;this.sv_127=null;this.sv_128=null;this.sv_129=null;this.sv_130=null;this.sv_131=null;this.sv_132=null;this.sv_134=null;this.sv_133=null;this.sv_136=null;this.sv_135=null;this.currentPage=0;this.sv_146=false;},resetParams:function() {this.sv_4=false;this.sv_143=false;this.sv_144=false;this.sv_103=null;this.sv_107=null;this.sv_108=null;this.sv_97=null;this.sv_84=new Array();this.relevanceThreshold=200;this.phrase=null;this.degreeStartTimeframe=null;this.sv_149={};this.sv_8=null;this.set({"impressionHandler":''});this.resetFilterParams();},setPhrase:function(value) {this.phrase=value;return this;},setDegreeStartTimeframe:function(value) {this.degreeStartTimeframe=value;return this;},getPhrase:function() {return this.phrase;},getDegreeStartTimeframe:function() {return this.degreeStartTimeframe;},setMD:function(value) {this.sv_94=value;return this;},setAFL:function(value) {this.sv_99=value;return this;},setCT:function(value) {this.sv_97=value;return this;},setAOI:function(value) {this.sv_108=value;return this;},setDOI:function(value) {this.sv_107=value;return this;},setC:function(value) {this.sv_104=value;return this;},setZC:function(value) {this.sv_103=value;return this;},setPU:function(value) {this.sv_88=value;return this;},setSC:function(value) {this.sv_92=value;return this;},setFDBSY:function(value) {this.sv_31=value;return this;},setEDV:function(value) {this.sv_116=value;return this;},setEFC:function(value) {this.sv_115=value;return this;},getSN:function() {return this.sv_55;},getSM:function() {return this.sv_56;},setXapiAjaxEndpoint:function(value) {this.sv_120=value;return this;},getXapiAjaxEndpoint:function() {return this.sv_120;},setHqxapiAjaxEndpoint:function(value) {this.sv_121=value;return this;},getHqxapiAjaxEndpoint:function() {return this.sv_121;},setTrackingEndpoint:function(value) {this.sv_124=value;return this;},getTrackingEndpoint:function() {return this.sv_124;},setHqxServer:function(value) {this.sv_2=value;return this;},getHqxServer:function() {return this.sv_2;},getHqxRedirectEndpoint:function() {return this.sv_51;},getHqxRedirectService:function() {return this.getHqxServer()+this.getHqxRedirectEndpoint();},getHqxapiItControllerAction:function() {return this.sv_122;},isBootstrapped:function() {return this.bootstrapped;},setBootstrapped:function(bootstrapped) {this.bootstrapped=bootstrapped;return this;},getXapiRequest:function() {return this.sv_8;},getRequest:function() {return this.sv_8;},bootstrap:function() {if(!this.isBootstrapped()) {this.setBootstrapped(true);this.trigger('QS.WidgetInstance:bootstrapped',this);}},setCustomParam:function(key,value) {var success=false;if(this.sv_145[key]) {this.sv_145[key]=value;success=true;} return success;},getCustomParam:function(param) {var self=this.data?this.data:this;if(typeof param!=="undefined") {if(typeof self.sv_145[param]!=="undefined") {return self.sv_145[param];}} return'';},getCustomParamAreaOfInterest:function() {var self=this.data?this.data:this;if(self.sv_74!==null) {return self.sv_74;} else {return'';}},getCustomParamDegreeOfInterest:function() {var self=this.data?this.data:this;if(self.sv_75!==null) {return self.sv_75;} else {return'';}},getCustomParamAudience:function() {var self=this.data?this.data:this;if(self.sv_76!==null) {return self.sv_76;} else {return'';}},getCustomParamPortalServiceCode:function() {var self=this.data?this.data:this;if(self.sv_77!==null) {return self.sv_77;} else {return'';}},getTaxonomy:function(type) {var self=this.data?this.data:this;var taxonomy=[],taxonomyObject;switch(type) {case'subject':taxonomyObject=self.taxonomyManager.getInstance().getTaxonomy(self.taxonomyManager.getInstance().EDUCATION,type);taxonomy=self.getEduSubjectTaxonomy(taxonomyObject,self.sv_74.split(','),self);break;case'qualification':taxonomyObject=self.taxonomyManager.getInstance().getTaxonomy(self.taxonomyManager.getInstance().EDUCATION,type);if(taxonomyObject) {taxonomy=taxonomyObject.getTree().children;} break;} if(taxonomy.length==0) {taxonomy=taxonomyObject.getTree().children;} return taxonomy;},getEduSubjectTaxonomy:function(taxonomyObject,pageTaxonomy,self) {var taxonomy;if(taxonomyObject) {if(pageTaxonomy.length>1) {taxonomy=taxonomyObject.getSibling(self.getSubjectTaxonomy(pageTaxonomy));} else {taxonomy=taxonomyObject.getChildren(pageTaxonomy[0]) if(taxonomy.length==0) {taxonomy=taxonomyObject.getChildren(taxonomyObject.getNode(pageTaxonomy[0]).parent.taxCode);}} return taxonomy;}},getCampusTypes:function() {return[{name:'Campus and Online',taxCode:'BOTH',parent:null,children:[],siblings:[]},{name:'Campus',taxCode:'CAMPUS',parent:null,children:[],siblings:[]},{name:'Online',taxCode:'ONLINE',parent:null,children:[],siblings:[]}];},getTaxonomyNodeNameFromList:function(vertical,taxonomyName,nodeList) {var self=this.data?this.data:this,taxonomy=self.taxonomyManager.getInstance().getTaxonomy(vertical,taxonomyName),node={};for(var i=nodeList.length;i>=0;i--) {if(taxonomy.getNode(nodeList[i-1])!==null) {node=taxonomy.getNode(nodeList[i-1]);break;}} return(typeof node.name!=='undefined'?node.name:'');},getSubjectTaxonomy:function(pageTaxonomy) {var self=this.data?this.data:this,taxonomies=pageTaxonomy?pageTaxonomy:self.getCustomParamAreaOfInterest().split(',');return taxonomies[taxonomies.length-1];},getAreaOfInterestDisplayName:function() {var self=this.data?this.data:this,aoi=self.getTaxonomyNodeNameFromList(self.taxonomyManager.getInstance().EDUCATION,'subject',self.getCustomParamAreaOfInterest().split(','));return(aoi=='Subject'||aoi=='All')?'All subjects':aoi;},getDegreeOfInterestDisplayName:function() {var self=this.data?this.data:this,doi=self.getTaxonomyNodeNameFromList(self.taxonomyManager.getInstance().EDUCATION,'qualification',self.getCustomParamDegreeOfInterest().split(','));return(doi=='Qualification'||doi=='All')?'All degrees':doi;},getZipCode:function() {var self=this.data?this.data:this;return self.sv_103;},setFilterTemplateHandlers:function() {var headerFilterAttached=QS.$(this.headerFilterClass,this.getDomElement()),footerFilterAttached=QS.$(this.footerFilterClass,this.getDomElement());this.disableFilterElements(false);this.setFilterClearAllButtonHandlers();if(headerFilterAttached.length>0&&footerFilterAttached.length>0) {if(this.getShouldSetFilterHandlers()) {this.setFilterHandlers('both',this.headerFilterSearchButtonClass,this.footerFilterSearchButtonClass,'');this.setFilterHandlers('both',this.headerFilterSubjectClass,this.footerFilterSubjectClass,this.sv_30);this.setFilterHandlers('both',this.headerFilterProgramClass,this.footerFilterProgramClass,this.sv_30);this.setFilterHandlers('both',this.headerFilterQualificationClass,this.footerFilterQualificationClass,this.sv_29);this.setFilterHandlers('both',this.headerFilterCampusTypeClass,this.footerFilterCampusTypeClass,this.sv_80);this.setFilterHandlers('both',this.headerFilterZipClass,this.footerFilterZipClass,this.sv_25);this.setFilterHandlers('both',this.headerMatchedCityFilterClass,this.footerMatchedCityFilterClass,this.sv_26);this.setFilterHandlers('both',this.headerDegreeStartTimeframeClass,this.footerDegreeStartTimeframeClass,this.degreeStartTimeframeKey);this.setFilterHandlers('both',this.headerFilterPhraseClass,this.footerFilterPhraseClass,this.phraseKey);}} else if(headerFilterAttached.length>0) {if(this.getShouldSetFilterHandlers()) {this.setFilterHandlers('headerFilter',this.headerFilterSearchButtonClass,null,'');this.setFilterHandlers('headerFilter',this.headerFilterSubjectClass,null,this.sv_30);this.setFilterHandlers('headerFilter',this.headerFilterProgramClass,null,this.sv_30);this.setFilterHandlers('headerFilter',this.headerFilterQualificationClass,null,this.sv_29);this.setFilterHandlers('headerFilter',this.headerFilterCampusTypeClass,null,this.sv_80);this.setFilterHandlers('headerFilter',this.headerFilterZipClass,null,this.sv_25);this.setFilterHandlers('headerFilter',this.headerMatchedCityFilterClass,null,this.sv_26);this.setFilterHandlers('headerFilter',this.headerDegreeStartTimeframeClass,null,this.degreeStartTimeframeKey);this.setFilterHandlers('headerFilter',this.headerFilterPhraseClass,null,this.phraseKey);}} else if(footerFilterAttached.length>0) {if(this.getShouldSetFilterHandlers()) {this.setFilterHandlers('footerFilter',null,this.footerFilterSearchButtonClass,'');this.setFilterHandlers('footerFilter',null,this.footerFilterSubjectClass,this.sv_30);this.setFilterHandlers('footerFilter',null,this.footerFilterProgramClass,this.sv_30);this.setFilterHandlers('footerFilter',null,this.footerFilterQualificationClass,this.sv_29);this.setFilterHandlers('footerFilter',null,this.footerFilterCampusTypeClass,this.sv_80);this.setFilterHandlers('footerFilter',null,this.footerFilterZipClass,this.sv_25);this.setFilterHandlers('footerFilter',null,this.footerMatchedCityFilterClass,this.sv_26);this.setFilterHandlers('footerFilter',null,this.footerDegreeStartTimeframeClass,this.degreeStartTimeframeKey);this.setFilterHandlers('footerFilter',null,this.footerFilterPhraseClass,this.phraseKey);}} this.disableFilterValueInitialization();},setFilterClearAllButtonHandlers:function() {var clearAllButtons=QS.$(this.filterClearButtonClass,this.getDomElement());QS._.each(clearAllButtons,function(element,index) {var button=QS.$(element);var filter=button.data('filter');switch(filter) {case this.headerFilterSubjectClass:button.click({'widget':this,'checkboxes':QS.$(filter,button.data('container')),'category':this.sv_30},this.clearAllCheckboxes);break;}},this);},clearAllCheckboxes:function(event) {event.data.widget.uncheckFilterCheckboxes(event.data.checkboxes);event.data.widget.updateWidgetByFilterCategory(event.data.category,'');},disableFilterValueInitialization:function() {this.shouldInitializeFilterValue=false;},setFilterHandlers:function(type,headerFilterElementClass,footerFilterElementClass,updateCategory) {var headerFilterElement=null,footerFilterElement=null;switch(type) {case'both':if(QS.$(headerFilterElementClass).length) {headerFilterElement=QS.$(headerFilterElementClass,this.getDomElement());} if(QS.$(footerFilterElementClass).length) {footerFilterElement=QS.$(footerFilterElementClass,this.getDomElement());} if(headerFilterElement) {this.bindFilterEvents(headerFilterElement,footerFilterElement,updateCategory,this.headerFilter);this.initializeWidgetWithFilterValueByCategory(headerFilterElement,updateCategory);} if(footerFilterElement) {this.bindFilterEvents(footerFilterElement,headerFilterElement,updateCategory,this.footerFilter);} break;case'headerFilter':if(QS.$(headerFilterElementClass).length) {headerFilterElement=QS.$(headerFilterElementClass,this.getDomElement());this.bindFilterEvents(headerFilterElement,null,updateCategory,this.headerFilter);this.initializeWidgetWithFilterValueByCategory(headerFilterElement,updateCategory);} break;case'footerFilter':if(QS.$(footerFilterElementClass).length) {footerFilterElement=QS.$(footerFilterElementClass,this.getDomElement());this.bindFilterEvents(footerFilterElement,null,updateCategory,this.footerFilter);this.initializeWidgetWithFilterValueByCategory(footerFilterElement,updateCategory);} break;}},bindFilterEvents:function(element,syncElement,updateCategory,elementPosition) {if(element) {var elementType=element.prop('tagName'),type=element.attr('type');switch(elementType) {case'SELECT':element.change({"widget":this,"updateCategory":updateCategory,"syncElement":syncElement,"element":element,"elementPosition":elementPosition,"type":type},this.handleFilter);break;case'INPUT':if(type==='button') {element.click({"widget":this,"syncElement":syncElement,"element":element,"elementPosition":elementPosition,"type":type},this.filterSearch);} else if(this.isCheckbox(type)) {var noPreferenceCheckbox=this.getNoPreferenceCheckboxElement(element);if(noPreferenceCheckbox) {if(this.isCheckboxFilterChecked(noPreferenceCheckbox)) {noPreferenceCheckbox.prop("disabled",true);}} QS._.each(element,function(checkboxItem,index) {var checkbox=QS.$(checkboxItem);checkbox.change({"widget":this,"updateCategory":updateCategory,"syncElement":syncElement?syncElement[index]:syncElement,"element":checkbox,"parent":element,"elementPosition":elementPosition,"type":type,"allCheckbox":this.getAllCheckboxElement(element),"noPreferenceCheckbox":noPreferenceCheckbox},this.handleFilter);},this);} else if(this.isRadioButton(type)) {QS._.each(element,function(radioItem,index) {var radioButton=QS.$(radioItem);radioButton.change({"widget":this,"updateCategory":updateCategory,"syncElement":syncElement?syncElement[index]:syncElement,"element":radioButton,"parent":element,"elementPosition":elementPosition,"type":type},this.handleFilter);},this);} else {element.blur({"widget":this,"updateCategory":updateCategory,"syncElement":syncElement,"element":element,"elementPosition":elementPosition,"type":type},this.handleFilter);element.keydown({"widget":this,"updateCategory":updateCategory,"syncElement":syncElement,"element":element,"elementPosition":elementPosition,"type":type},this.enterKeySubmit);} break;}}},getAllCheckboxElement:function(element) {var allCheckbox=QS.$('.'+this.allGroupClass,element.parent());return allCheckbox.length>0?allCheckbox:null;},getNoPreferenceCheckboxElement:function(element) {var noPreferenceCheckBox=QS.$('.'+this.noPreferenceGroupClass,element.parent());return noPreferenceCheckBox.length>0?noPreferenceCheckBox:null;},disableFilterElements:function(state) {if(state!=='undefined') {var filterElementClass=new Array(this.submitOnChangeClass,this.disableOnSubmitClass,this.footerFilterSearchButtonClass,this.headerFilterSearchButtonClass);QS._.each(filterElementClass,function(element,index){QS.$(element,this.getDomElement()).prop('disabled',state);},this);}},validateFilters:function(event) {var widget=event.data.widget,isValidated=true;if(QS.$(widget.validateUsAndCanZipCodeClass,widget.getDomElement()).length) {isValidated=isValidated&&this.validateUsAndCanZipCodeHandler(event);} if(QS.$(widget.footerFilterPhraseClass,widget.getDomElement()).length||QS.$(widget.headerFilterPhraseClass,widget.getDomElement()).length) {isValidated=isValidated&&this.validatePhraseFilter(event);} return isValidated;},validatePhraseFilter:function(event) {var widget=event.data.widget,elementPosition=event.data.elementPosition,filterPhraseObject='',filterPhraseSyncObject='';switch(elementPosition) {case widget.headerFilter:filterPhraseObject=QS.$(widget.headerFilterPhraseClass,widget.getDomElement());filterPhraseSyncObject=QS.$(widget.footerFilterPhraseClass,widget.getDomElement());break;case widget.footerFilter:filterPhraseObject=QS.$(widget.footerFilterPhraseClass,widget.getDomElement());filterPhraseSyncObject=QS.$(widget.headerFilterPhraseClass,widget.getDomElement());break;} if(filterPhraseObject.length&&!(filterPhraseObject.data('optional'))) {var phraseValue=QS.$.trim(filterPhraseObject.val());if(phraseValue==null||phraseValue=='') {filterPhraseObject.val('');filterPhraseObject.focus();if(filterPhraseSyncObject.length) {filterPhraseSyncObject.val('');} QS.$(widget.filterPhraseErrorMessageClass,widget.getDomElement()).show();return false;} else {QS.$(widget.filterPhraseErrorMessageClass,widget.getDomElement()).hide();return true;}} return true;},validateUsAndCanZipCodeHandler:function(event) {var widget=event.data.widget,elementPosition=event.data.elementPosition,isValidated=true;if(QS.$(widget.headerUsAndCanZipCodeErrorMessageClass).is(":visible")) {QS.$(widget.headerUsAndCanZipCodeErrorMessageClass,widget.getDomElement()).hide();} if(QS.$(widget.footerUsAndCanZipCodeErrorMessageClass).is(":visible")) {QS.$(widget.footerUsAndCanZipCodeErrorMessageClass,widget.getDomElement()).hide();} switch(elementPosition) {case widget.headerFilter:isValidated=widget.validateUsAndCanZipCode(event,widget.headerFilterZipClass,widget.footerFilterZipClass,widget.headerUsAndCanZipCodeErrorMessageClass,widget.headerFilterCampusTypeClass);break;case widget.footerFilter:isValidated=widget.validateUsAndCanZipCode(event,widget.footerFilterZipClass,widget.headerFilterZipClass,widget.footerUsAndCanZipCodeErrorMessageClass,widget.footerFilterCampusTypeClass);break;} return isValidated;},validateUsAndCanZipCode:function(event,filterZipCodeClass,filterZipCodeSyncClass,filterErrorMessageClass,filterCampusTypeClass) {var filterZipCodeObject=QS.$(filterZipCodeClass,this.getDomElement()),filterZipCodeSyncObject=QS.$(filterZipCodeSyncClass,this.getDomElement()),zipCodeValue=QS.$.trim(filterZipCodeObject.val());if(filterZipCodeObject.length&&!(zipCodeValue==''&&(filterZipCodeObject.data('optional')||this.isCampusTypeOnline()))) {var zipCodeRegEx=new RegExp("^[0-9]{5}$|^[a-zA-Z][0-9][a-zA-Z][ ]?[0-9][a-zA-Z][0-9]$");if(zipCodeValue==null||zipCodeValue==='00000'||!zipCodeRegEx.test(zipCodeValue)) {if(QS.$(filterErrorMessageClass).length) {QS.$(filterErrorMessageClass,this.getDomElement()).show();this.trigger('QS.WidgetInstance:'+event.data.elementPosition+'.ValidationErrorMessage:show',this);} filterZipCodeObject.val('');filterZipCodeObject.focus();if(filterZipCodeSyncObject.length) {filterZipCodeSyncObject.val('');} return false;} else {if(zipCodeValue.length>5) {if(zipCodeValue.indexOf(' ')===-1) {zipCodeValue=zipCodeValue.substr(0,3)+' '+zipCodeValue.substr(3);} zipCodeValue=zipCodeValue.toUpperCase();filterZipCodeObject.val(zipCodeValue);if(filterZipCodeSyncObject.length) {filterZipCodeSyncObject.val(zipCodeValue);}} this.setZC(zipCodeValue);if(this.sv_97===null) {this.setCT(QS.$(filterCampusTypeClass).val());} return true;}} else {return true;}},filterSearch:function(event) {var widget=event.data.widget;widget.trigger('QS.WidgetInstance:'+event.data.elementPosition+':submit',widget);if(widget.validateFilters(event)) {widget.disableFilterElements(true);QS.$('.'+widget.noListingErrorMsgClass,widget.getDomElement()).detach();QS.$('.'+widget.domId+'_filter_wrapper',widget.getDomElement()).hide();if(QS.$(widget.footerFilterClass).length) {QS.$(widget.footerFilterClass,widget.getDomElement()).show();} if(event.data.element.data('position')==='footerFilterSubmit') {widget.getFocusToListingTopSection();} var requestObject=widget.processFilterRequest(event.data.element);widget.resetFilterParams();widget.updateWidget(requestObject);}},enterKeySubmit:function(event) {if(event.which==13) {event.preventDefault();event.data.widget.handleFilter(event);event.data.widget.filterSearch(event);}},initializeWidgetWithFilterValueByCategory:function(element,category) {if(this.shouldInitializeFilterValue&&element&&category) {var value;if(this.isCheckboxOrRadioButton(element.attr('type'))) {this.initializeWidgetWithCheckboxFilterByCategory(element,category);} else {value=this.getFilterElementValue(element);this.updateWidgetByFilterCategory(category,value);}}},setDefaultAllGroupValue:function(element,category) {if(element) {this.sv_149[category]=this.getFilterElementValue(element);}},initializeWidgetWithCheckboxFilterByCategory:function(element,category) {var allCheckbox=this.getAllCheckboxElement(element),value;this.setDefaultAllGroupValue(allCheckbox,category);if(this.isCheckboxFilterChecked(allCheckbox)) {this.checkFilterCheckboxes(element);value=this.getFilterElementValue(allCheckbox);} else {value=this.getCheckboxFilterValue(element);} this.updateWidgetByFilterCategory(category,value);},updateWidgetByFilterCategory:function(category,value) {switch(category) {case this.sv_30:this.setAOI(value);break;case this.sv_29:this.setDOI(value);break;case this.sv_80:this.setCT(value);break;case this.sv_25:this.setZC(value);break;case this.sv_26:this.setC(value);break;case this.phraseKey:this.setPhrase(value);break;case this.degreeStartTimeframeKey:this.setDegreeStartTimeframe(value);break;}},getValueByFilterCategory:function(category) {var value='';switch(category) {case this.sv_30:value=this.sv_108;break;case this.sv_29:value=this.sv_107;break;case this.sv_80:value=this.sv_97;break;case this.sv_25:value=this.sv_103;break;case this.sv_26:value=this.sv_104;break;case this.phraseKey:value=this.phrase;break;case this.degreeStartTimeframeKey:value=this.degreeStartTimeframe;break;} return value===null?'':value;},isAllGroup:function(event) {return event.data.allCheckbox?true:false;},isNoPreferenceGroup:function(event) {return event.data.noPreferenceCheckbox?true:false;},isAllCheckbox:function(element) {return element.hasClass(this.allGroupClass);},isNoPreferenceCheckbox:function(element) {return element.hasClass(this.noPreferenceGroupClass);},isCheckboxFilterChecked:function(element) {return element?element.prop('checked'):false;},isCheckboxOrRadioButton:function(type) {return this.isRadioButton(type)||this.isCheckbox(type);},isRadioButton:function(type) {return type===this.filterElementRadioButton;},isCheckbox:function(type) {return type===this.filterElementTypeCheckbox;},getFilterElementValue:function(element) {return element?element.val():null;},getCheckboxFilterValue:function(elements) {var values='',checkbox;for(var i=0;i=2;},setServiceName:function(serviceName) {this.service=serviceName;return this;},setServiceMethod:function(serviceMethod) {this.method=serviceMethod;return this;},getMatchingEndpoint:function() {return this.matchingEndpoint;},getRequestParams:function() {return this.getRequestObject();},getMatchingParams:function() {var self=this;var matchingParams={};QS._.each(this.plutoniumMatchingParams,function(param) {if(self.get(param)) {matchingParams[param]=self.get(param);}});return matchingParams;},setFilterCriteria:function(filterCriteria) {this.filterCriteriaObject='';this.filterCriteria=this.toXmlString(filterCriteria);this.encodedFilterCriteria=encodeURIComponent(this.filterCriteria);return this;},setDataValues:function(dataValues) {this.dataValuesObject='';this.dataValues=this.toXmlString(dataValues);this.encodedDataValues=encodeURIComponent(this.dataValues);return this;},setFilterCriteriaXml:function(sv_115) {this.filterCriteriaObject='';this.encodedFilterCriteria=sv_115;this.filterCriteria=decodeURIComponent(sv_115);return this;},setDataValuesXml:function(sv_116) {this.dataValuesObject='';this.encodedDataValues=sv_116;this.dataValues=decodeURIComponent(sv_116);return this;},setWidgetInstanceKey:function(widgetInstanceKey) {this.widgetInstanceKey=widgetInstanceKey;return this;},setVertical:function(vertical) {this.vertical=vertical;},getVertical:function() {return(this.vertical)?this.vertical:this.DEFAULT_VERTICAL;},applyVerticalDefaults:function() {var temp={};QS._.extend(temp,this.VERTICAL_DEFAULTS[this.getVertical()]||{},this.getParams());this.setParams(temp);},getEncodedDataValues:function() {return this.encodedDataValues;},getDataValues:function() {if(this.dataValues) {var dataValues=QS.$(QS.$.parseXML(this.dataValues));return this._getJsonFromXml(dataValues);} else {return{};}},getDataValuesParam:function(paramName) {if(!this.dataValuesObject) {this.dataValuesObject=this.getDataValues();} return this.dataValuesObject[paramName]||null;},getEncodedFilterCriteria:function() {return this.encodedFilterCriteria;},getFilterCriteria:function() {if(this.filterCriteria) {var filterCriteria=QS.$(QS.$.parseXML(this.filterCriteria));return this._getJsonFromXml(filterCriteria);} else {return{};}},getFilterCriteriaParam:function(paramName) {if(!this.filterCriteriaObject) {this.filterCriteriaObject=this.getFilterCriteria();} return this.filterCriteriaObject[paramName]||null;},getRequestObject:function() {var requestObject={service:this.service,method:this.method,filterCriteria:this.filterCriteria,dataValues:this.dataValues,apiProduct:this.apiProduct};return requestObject;},setTemplate:function(template) {this.template=template;return this;},getTemplate:function() {return this.template;},setHeaderTemplate:function(template) {this.headerTemplate=template;return this;},getHeaderTemplate:function() {return typeof this.headerTemplate!=="undefined"?this.headerTemplate:'';},setFooterTemplate:function(template) {this.footerTemplate=template;return this;},getFooterTemplate:function() {return typeof this.footerTemplate!=="undefined"?this.footerTemplate:'';},setHeaderFilterTemplate:function(template) {this.headerFilterTemplate=template;return this;},getHeaderFilterTemplate:function() {return typeof this.headerFilterTemplate!=='undefined'?this.headerFilterTemplate:'';},setFooterFilterTemplate:function(template) {this.footerFilterTemplate=template;return this;},getFooterFilterTemplate:function() {return typeof this.footerFilterTemplate!=='undefined'?this.footerFilterTemplate:'';},setRenderedHeaderFilterTemplate:function(template) {this.renderedHeaderFilterTemplate=template;return this;},getRenderedHeaderFilterTemplate:function() {return typeof this.renderedHeaderFilterTemplate!=='undefined'?this.renderedHeaderFilterTemplate:'';},setRenderedFooterFilterTemplate:function(template) {this.renderedFooterFilterTemplate=template;return this;},getRenderedFooterFilterTemplate:function() {return typeof this.renderedFooterFilterTemplate!=='undefined'?this.renderedFooterFilterTemplate:'';},setData:function(data) {this.data=data;return this;},getData:function() {return this.data;},setXapiTimeout:function(time) {this.xapiTimeout=(time";}},this);return xml+="";},_getJsonFromXml:function($xml) {var json={};QS.$.each($xml.find('e'),function(index,element) {var $element=QS.$(element);json[$element.attr('key')]=$element.text();});return json;},toJSON:function() {return{filterCriteria:this.getEncodedFilterCriteria(),dataValues:this.getEncodedDataValues(),template:encodeURIComponent(this.getTemplate()),headerTemplate:encodeURIComponent(this.getHeaderTemplate()),footerTemplate:encodeURIComponent(this.getFooterTemplate()),renderedHeaderFilterTemplate:encodeURIComponent(this.getRenderedHeaderFilterTemplate()),renderedFooterFilterTemplate:encodeURIComponent(this.getRenderedFooterFilterTemplate()),templateVersion:this.getTemplateVersion(),customParams:this.getCustomParams(),apiProduct:this.getApiProduct(),cachedBluids:this.getCachedBluids(),cachedListingPixelUrls:this.getCachedListingPixelUrls(),baseHref:this.getBaseHref(),clickBaseHref:this.getClickBaseHref(),requestInfoUrl:this.getRequestInfoUrl(),vertical:this.getVertical()};},addParametersToUrl:function(url,paramsList,delimiter) {if(paramsList&&typeof paramsList==='object') {delimiter=(typeof delimiter!=="undefined"&&delimiter)?delimiter:'&';for(var paramKey in paramsList) {if(paramsList.hasOwnProperty(paramKey)) {var methodName='get'+paramKey.slice(0,1).toUpperCase()+paramKey.slice(1),xapiValue='';if(typeof eval('this.'+methodName)==='function') {xapiValue=eval('this.'+methodName+'()');} else if(this.has(paramKey)) {xapiValue=this.get(paramKey);} if(xapiValue) {url+=delimiter+paramsList[paramKey]+'='+xapiValue;}}}} return url;},getWebSiteName:function() {if(this.getFilterCriteriaParam('sp_260880')) {return this.getFilterCriteriaParam('sp_260880');} else if(this.getFilterCriteriaParam('webSiteName')) {return this.getFilterCriteriaParam('webSiteName');}},getWebPageUri:function() {if(this.getFilterCriteriaParam('sp_260890')) {var webPageUri=this.getFilterCriteriaParam('sp_260890');} else if(this.getFilterCriteriaParam('webPageUri')) {var webPageUri=this.getFilterCriteriaParam('webPageUri');} if(webPageUri) {return encodeURIComponent(webPageUri);} return null;},getInventoryType:function() {return this.getDataValuesParam('InventoryType');},getCCID:function() {if(this.getDataValuesParam('CCID')) {return this.getDataValuesParam('CCID');} return null;},getCLK:function() {if(this.getDataValuesParam('CLK')) {return this.getDataValuesParam('CLK');} return null;},getQTR:function() {if(this.getDataValuesParam('QTR')) {return this.getDataValuesParam('QTR');} return null;},getCfurl:function() {var cfurl=this.getDataValuesParam('cfurl');if(cfurl) {return encodeURIComponent(cfurl);} return null;},getMatchingFallback:function() {return this.getDataValuesParam('matchingFallback');},getDegreeStartTimeframe:function() {return this.getDataValuesParam('DegreeStartTimeframe');},getWebtrendsRecipe:function() {return this.getDataValuesParam('WebtrendsRecipe');},shouldRelativePath:function() {return typeof this.getDataValuesParam('relativePath')!=="undefined"&&this.getDataValuesParam('relativePath')=="true";}});})();;(function(){QS.Model=QS.Backbone.Model.extend({get:function(attribute) {attribute=attribute.charAt(0)+attribute.slice(1);if(typeof eval('this.get'+attribute)==='function') {return eval('this.get'+attribute+'()');} else {return QS.Backbone.Model.prototype.get.apply(this,arguments);}},formatNumber:function(num,decimals) {return(Number(num)||0).toFixed(decimals);},set2:function(data,silent) {for(attribute in data) {attribute=attribute.charAt(0)+attribute.slice(1);if(typeof eval('this.html'+attribute)==='function') {eval('this.html'+attribute+'(data[attribute])');} else {var data2={};data2[attribute]=data[attribute];var args={};QS._.extend(args,arguments);args[0]=data2;QS.Backbone.Model.prototype.set.apply(this,args);}} return this;}});QS.XapiRequest=QS.XapiRequest.extend({SERVICE_PLUTONIUM:'plutoniumService',METHOD_GETPLUTONIUM:'getPlutoniumResult',PARAM_EDU_AFFILIATEKEY:'affiliateKey',PARAM_EDU_TAG:'tag',PARAM_MORTGAGE_PUBID:'mortgagePubId',PARAM_AUTO_PUBID:'autoPubId',PARAM_LIFE_PUBID:'lifePubId',PARAM_DEPOSITS_PUBID:'depositsPubId',PARAM_CREDITCARDS_PUBID:'creditCardsPubId',PARAM_HOMEINSURANCE_PUBID:'homeInsurancePubId',PARAM_HEALTH_PUBID:'healthPubId',PARAM_B2B_QUAD_LINK:'b2bLink',PARAM_HS_TAG:'tag',PARAM_MEDICAL_TAG:'tag',categoryEducation:'education',categoryB2B:'b2b',categoryHS:'hs',categoryMedical:'medical',categoryMortgage:'mortgage',categoryDeposits:'deposits',categoryCreditCards:'creditcards',categoryAuto:'auto',categoryLife:'life',categoryHomeInsurance:'homeinsurance',categoryHealth:'health',getPlutoniumFilterCriteria:function() {return this.toXmlString({phrase:this.get('q1'),phrase2:this.get('q2'),verticals:this.getCategoryList().join(',')});},isPlutonium:function() {return((this.isParamTrue(this.isPlutonium)||this.isParamTrue(this.get("isPlutonium")))?true:false);},shouldCallPlutonium:function() {return(this.get("q1")!==''||this.get("q2")!=='')},getPubId:function() {var vertical=this.get('vertical')?this.get('vertical'):this.categoryEducation;switch(vertical) {case this.categoryEducation:return this.get(this.PARAM_EDU_TAG) break;case this.categoryB2B:return this.get(this.PARAM_B2B_QUAD_LINK) break;case this.categoryHS:return this.get(this.PARAM_HS_TAG) break;case this.categoryMedical:return this.get(this.PARAM_MEDICAL_TAG) break;case this.categoryMortgage:return this.get(this.PARAM_MORTGAGE_PUBID) break;case this.categoryDeposits:return this.get(this.PARAM_DEPOSITS_PUBID) break;case this.categoryCreditCards:return this.get(this.PARAM_CREDITCARDS_PUBID) break;case this.categoryLife:return this.get(this.PARAM_LIFE_PUBID) break;case this.categoryAuto:return this.get(this.PARAM_AUTO_PUBID) break;case this.categoryHomeInsurance:return this.get(this.PARAM_HOMEINSURANCE_PUBID) break;case this.categoryHealth:return this.get(this.PARAM_HEALTH_PUBID) break;default:return this.get(this.PARAM_EDU_TAG);break;}},getCategoryList:function() {var categories=[];var verticalsToPass=this.get("verticals").split(",");if(this.get(this.PARAM_EDU_AFFILIATEKEY)&&this.get(this.PARAM_EDU_TAG)&&verticalsToPass.indexOf(this.categoryEducation)>=0) {categories.push(this.categoryEducation.toUpperCase());} if(this.get(this.PARAM_AUTO_PUBID)&&verticalsToPass.indexOf(this.categoryAuto)>=0) {categories.push(this.categoryAuto.toUpperCase());} if(this.get(this.PARAM_LIFE_PUBID)&&verticalsToPass.indexOf(this.categoryLife)>=0) {categories.push(this.categoryLife.toUpperCase());} if(this.get(this.PARAM_DEPOSITS_PUBID)&&verticalsToPass.indexOf(this.categoryDeposits)>=0) {categories.push(this.categoryDeposits.toUpperCase());} if(this.get(this.PARAM_CREDITCARDS_PUBID)&&verticalsToPass.indexOf(this.categoryCreditCards)>=0) {categories.push(this.categoryCreditCards.toUpperCase());} if(this.get(this.PARAM_MORTGAGE_PUBID)&&verticalsToPass.indexOf(this.categoryMortgage)>=0) {categories.push(this.categoryMortgage.toUpperCase());} if(this.get(this.PARAM_HOMEINSURANCE_PUBID)&&verticalsToPass.indexOf(this.categoryHomeInsurance)>=0) {categories.push(this.categoryHomeInsurance.toUpperCase());} if(this.get(this.PARAM_HEALTH_PUBID)&&verticalsToPass.indexOf(this.categoryHealth)>=0) {categories.push(this.categoryHealth.toUpperCase());} return categories;},getPlutoniumRequestObject:function() {return{service:this.SERVICE_PLUTONIUM,method:this.METHOD_GETPLUTONIUM,filterCriteria:this.getPlutoniumFilterCriteria()};}});QS.PlutoniumResponse=QS.Backbone.Model.extend({});}).call(this);;(function(){QS.SureHitsRequest=QS.XapiRequest.extend({XAPI_SERVICE_NAME:'',XAPI_METHOD_NAME:'',NUM_LISTINGS_DEFAULT:3,PARAM_FIXED_SIZE:'fixedSize',PARAM_IP:'ip',PARAM_USERAGENT:'ua',PARAM_REFERRER:'ref',PARAM_CACHE_IMPRESSIONS:'cache_impressions',PARAM_INCLUDE_UUID_TOKENS:'include_uuid_tokens',REQUEST_PARAM_STATE:'state',REQUEST_PARAM_ZIP:'zip',PARAM_STATE:'ssc',PARAM_ZIP:'zip',IP_LOCALHOST:'127.0.0.1',PARAM_SUREHITS_CARD_TYPE:'crd',PARAM_SUREHITS_CREDIT_RATING:'cccrate',VALUE_SUREHITS_BAD_CREDIT:'4',VALUE_SUREHITS_PREPAID_CARD:'18',VALUE_PLUTONIUM_HEADER_LINK:'headerLink',VALUE_PLUTONIUM_MORTGAGE_HEADER_LINK:'mortgageHeaderLink',VALUE_PLUTONIUM_AUTO_HEADER_LINK:'autoHeaderLink',VALUE_PLUTONIUM_LIFE_INSURANCE_HEADER_LINK:'lifeInsuranceHeaderLink',VALUE_PLUTONIUM_DEPOSITS_HEADER_LINK:'depositsHeaderLink',VALUE_PLUTONIUM_CREDITCARDS_HEADER_LINK:'creditCardsHeaderLink',VALUE_PLUTONIUM_BAD_CREDIT_HEADER_LINK:'badCreditCreditCardsHeaderLink',VALUE_PLUTONIUM_PREPAID_CARD_HEADER_LINK:'prepaidCreditCardsHeaderLink',VALUE_PLUTONIUM_HOME_INSURANCE_HEADER_LINK:'homeInsuranceHeaderLink',VALUE_PLUTONIUM_HEALTH_INSURANCE_HEADER_LINK:'healthInsuranceHeaderLink',VALUE_PLUTONIUM_EDUCATION_HEADER_LINK:'educationHeaderLink',matchingParams:['src','la','ssc','zip','rp','ni_rp','sh_rp','max','crd','cccrate','ccntwk','ccis','ni_seg_ci','ni_seg_m','ni_seg_h','ni_seg_a','ni_seg_medc','ni_seg_snr','ni_seg_smkr','ni_seg_dob','ni_seg_ht','ni_seg_wt','ni_seg_g','ni_seg_haz','ni_seg_instype','ni_sec_instypewhole','ni_seg_instypeterm','ni_seg_camt','ni_seg_cyrs','ni_seg_ac','ni_seg_subsidyqualify','ni_seg_houseincome','ni_seg_housesize','ni_seg_hpt','ni_ulo','proxy',],shouldAppendImpressionPixel:function() {return false;},getSrcId:function() {switch(this.get('vertical')) {case'mortgage':return this.get('mortgagePubId');break;case'auto':return this.get('autoPubId');break;case'life':return this.get('lifePubId');break;case'deposits':return this.get('depositsPubId');break;case'creditcards':return this.get('creditCardsPubId');break;case'homeinsurance':return this.get('homeInsurancePubId');break;case'health':return this.get('healthPubId');break;}},handleFixedSize:function() {if(this.get(this.PARAM_FIXED_SIZE)==="1") {this.set({"ni_ulo":1});}},getRequestParams:function() {this.handleFixedSize();var requestParams={json:1};var self=this;QS._.each(this.matchingParams,function(param) {if(self.get(param)) {requestParams[param]=self.get(param);}});requestParams[this.PARAM_STATE]=this.get(this.REQUEST_PARAM_STATE)||this.get(this.PARAM_STATE)||'';requestParams[this.PARAM_ZIP]=this.get(this.REQUEST_PARAM_ZIP)||'';requestParams[this.PARAM_USERAGENT]=encodeURIComponent(this.userAgent||'');requestParams[this.PARAM_REFERRER]=encodeURIComponent(this.requestUri||'');requestParams[this.PARAM_IP]=(this.browserIp&&this.browserIp!=this.IP_LOCALHOST)?this.browserIp:'';if(this.isCachedOfferMatchingCall()) {requestParams[this.PARAM_CACHE_IMPRESSIONS]=1;requestParams[this.PARAM_INCLUDE_UUID_TOKENS]=this.get(this.PARAM_INCLUDE_UUID_TOKENS)||1;} return requestParams;},getMatchingParams:function() {return this.getRequestParams();},getHeaderLink:function() {switch(this.get('vertical')) {case'mortgage':return this.get(this.VALUE_PLUTONIUM_MORTGAGE_HEADER_LINK);break;case'auto':return this.get(this.VALUE_PLUTONIUM_AUTO_HEADER_LINK);break;case'life':return this.get(this.VALUE_PLUTONIUM_LIFE_INSURANCE_HEADER_LINK);break;case'deposits':return this.get(this.VALUE_PLUTONIUM_DEPOSITS_HEADER_LINK);break;case'creditcards':return this.getCreditCardHeaderLink();break;case'homeinsurance':return this.get(this.VALUE_PLUTONIUM_HOME_INSURANCE_HEADER_LINK);break;case'health':return this.get(this.VALUE_PLUTONIUM_HEALTH_INSURANCE_HEADER_LINK);break;case'education':return this.get(this.VALUE_PLUTONIUM_EDUCATION_HEADER_LINK);break;default:return this.get(this.VALUE_PLUTONIUM_HEADER_LINK)||'';break;}},getCreditCardHeaderLink:function() {if(this.isBadCredit()) {return this.get(this.VALUE_PLUTONIUM_BAD_CREDIT_HEADER_LINK)||this.get(this.VALUE_PLUTONIUM_CREDITCARDS_HEADER_LINK)||this.get(this.VALUE_PLUTONIUM_HEADER_LINK)||'';} if(this.isPrepaid()) {return this.get(this.VALUE_PLUTONIUM_PREPAID_CARD_HEADER_LINK)||this.get(this.VALUE_PLUTONIUM_CREDITCARDS_HEADER_LINK)||this.get(this.VALUE_PLUTONIUM_HEADER_LINK)||'';} return this.get(this.VALUE_PLUTONIUM_CREDITCARDS_HEADER_LINK)||this.get(this.VALUE_PLUTONIUM_HEADER_LINK)||'';},isBadCredit:function() {return this.get(this.PARAM_SUREHITS_CREDIT_RATING)?(this.get(this.PARAM_SUREHITS_CREDIT_RATING)==this.VALUE_SUREHITS_BAD_CREDIT):false;},isPrepaid:function() {return this.get(this.PARAM_SUREHITS_CARD_TYPE)?(this.get(this.PARAM_SUREHITS_CARD_TYPE)==this.VALUE_SUREHITS_PREPAID_CARD):false;}});QS.SureHitsVendorBase=QS.Model.extend({parentWidget:null,getParentWidget:function() {return this.parentWidget;},setParentWidget:function(widget) {this.parentWidget=widget;return this;},getCustomParam:function(param) {return this.getCustomParams()[param]?this.getCustomParams()[param]:'';},getCustomParams:function() {return this.getParentWidget().getRequest().get('customParams')?this.getParentWidget().getRequest().get('customParams'):{};},getUniqueProducts:function(numProducts) {var productDescription='';var products=[];var done=false;var allProducts=this.get("Products").Product;var productsArray=[];if(!allProducts.length) {productsArray.push(allProducts);} else {productsArray=allProducts;} QS._.each(productsArray,function(product) {if(!done) {if(product.Description!==productDescription) {productDescription=product.Description;products.push(product);} if(products.length==numProducts) {done=true;}}});return products;},getProduct:function(description,alwaysReturn) {var theProduct='';var done=false;var allProducts=this.get("Products").Product;var productsArray=[];var i=1;var firstProduct={};if(!allProducts.length) {productsArray.push(allProducts);} else {productsArray=allProducts;} QS._.each(productsArray,function(product) {if(!done) {if(i==1&&alwaysReturn) {firstProduct=product;} if(product.Description==description) {theProduct=product;}} i++;});return theProduct!=''?theProduct:firstProduct;},stripBullets:function(numBullets,text) {try {var description=QS.$.parseXML(''+text+'');var ulNode=description.childNodes[0].firstChild;if(ulNode&&ulNode.nodeName&&ulNode.nodeName=='ul'&&ulNode.childNodes&&ulNode.childNodes.length>numBullets) {var liElements=description.getElementsByTagName('li');for(var i=numBullets;i<=(liElements.length-1);i++) {description.removeChild(liElements[i]);} return description.toString();} else {return text;}} catch(e) {return text;}}});QS.MortgageVendor=QS.SureHitsVendorBase.extend({});QS.InsuranceVendor=QS.SureHitsVendorBase.extend({getDescriptionBullets:function(numBullets) {return this.stripBullets(numBullets,this.get("description"));}});QS.AutoVendor=QS.InsuranceVendor.extend({});QS.LifeVendor=QS.InsuranceVendor.extend({});QS.HomeInsuranceVendor=QS.InsuranceVendor.extend({});QS.HealthVendor=QS.InsuranceVendor.extend({});QS.DepositsVendor=QS.SureHitsVendorBase.extend({getRateProductName:function() {return this.get("RateProduct").Name.replace(" Account","");},getDescriptionBullets:function(numBullets) {return this.stripBullets(numBullets,this.get("Creative").Description);}});QS.CreditCardsVendor=QS.SureHitsVendorBase.extend({});QS.WidgetInstance=QS.WidgetInstance.extend({populateMortgageVendors:function(data) {QS._.each(data,function(listing) {var vendor=new QS.MortgageVendor(listing);this.sv_137.push(vendor);},this);},populateDepositsVendors:function(data) {QS._.each(data,function(listing) {var vendor=new QS.DepositsVendor(listing);this.sv_137.push(vendor);},this);},populateAutoVendors:function(data) {QS._.each(data,function(listing) {var vendor=new QS.AutoVendor(listing);this.sv_137.push(vendor);},this);},populateLifeVendors:function(data) {QS._.each(data,function(listing) {var vendor=new QS.LifeVendor(listing);this.sv_137.push(vendor);},this);},populateHomeInsuranceVendors:function(data) {QS._.each(data,function(listing) {var vendor=new QS.HomeInsuranceVendor(listing);this.sv_137.push(vendor);},this);},populateHealthVendors:function(data) {QS._.each(data,function(listing) {var vendor=new QS.HealthVendor(listing);this.sv_137.push(vendor);},this);},populateCreditCardsVendors:function(data) {QS._.each(data,function(listing) {var vendor=new QS.CreditCardsVendor(listing);this.sv_137.push(vendor);},this);},populateSureHits:function(data) {this.trigger('QS.WidgetInstance:populateSureHits:in',this);var go=true;this.resetVendors();switch(this.getRequest().get('vertical')) {case this.categoryMortgage:if(data!==null&&typeof data=="object"&&data.ResultSet&&data.ResultSet.Listings&&data.ResultSet.Listings.Listing) {var vendorData=[];if(typeof data.ResultSet.Listings.Listing.length=="undefined") {vendorData.push(data.ResultSet.Listings.Listing);} else {vendorData=data.ResultSet.Listings.Listing;} this.populateMortgageVendors(vendorData);delete data.ResultSet.Listings;this.set({"ResultSet":data.ResultSet});this.set({"impressionHandler":data.ResultSet.ImpressionHandler||''})} else {go=false;this.displayAndExit();} break;case this.categoryDeposits:if(data!==null&&typeof data=="object"&&data.ResultSet&&data.ResultSet.Listings&&data.ResultSet.Listings.Listing) {var vendorData=[];if(typeof data.ResultSet.Listings.Listing.length=="undefined") {vendorData.push(data.ResultSet.Listings.Listing);} else {vendorData=data.ResultSet.Listings.Listing;} this.populateDepositsVendors(vendorData);delete data.ResultSet.Listings;this.set({"ResultSet":data.ResultSet});this.set({"impressionHandler":data.ResultSet.ImpressionHandler||''})} else {go=false;this.displayAndExit();} break;case this.categoryAuto:if(data!==null&&typeof data=="object"&&data.response&&data.response.listingset&&data.response.listingset.listing) {var vendorData=[];if(typeof data.response.listingset.listing.length=="undefined") {vendorData.push(data.response.listingset.listing);} else {vendorData=data.response.listingset.listing;} this.populateAutoVendors(vendorData);delete data.response.listingset.listing;this.set({"listingset":data.response.listingset});this.set({"impressionHandler":data.response.ImpressionHandler||''})} else {go=false;this.displayAndExit();} break;case this.categoryLife:if(data!==null&&typeof data=="object"&&data.response&&data.response.listingset&&data.response.listingset.listing) {var vendorData=[];if(typeof data.response.listingset.listing.length=="undefined") {vendorData.push(data.response.listingset.listing);} else {vendorData=data.response.listingset.listing;} this.populateLifeVendors(vendorData);delete data.response.listingset.listing;this.set({"listingset":data.response.listingset});this.set({"impressionHandler":data.response.ImpressionHandler||''})} else {go=false;this.displayAndExit();} break;case this.categoryHomeInsurance:if(data!==null&&typeof data=="object"&&data.response&&data.response.listingset&&data.response.listingset.listing) {var vendorData=[];if(typeof data.response.listingset.listing.length=="undefined") {vendorData.push(data.response.listingset.listing);} else {vendorData=data.response.listingset.listing;} this.populateHomeInsuranceVendors(vendorData);delete data.response.listingset.listing;this.set({"listingset":data.response.listingset});this.set({"impressionHandler":data.response.ImpressionHandler||''})} else {go=false;this.displayAndExit();} break;case this.categoryHealth:if(data!==null&&typeof data=="object"&&data.response&&data.response.listingset&&data.response.listingset.listing) {var vendorData=[];if(typeof data.response.listingset.listing.length=="undefined") {vendorData.push(data.response.listingset.listing);} else {vendorData=data.response.listingset.listing;} this.populateHealthVendors(vendorData);delete data.response.listingset.listing;this.set({"listingset":data.response.listingset});this.set({"impressionHandler":data.response.ImpressionHandler||''})} else {go=false;this.displayAndExit();} break;case this.categoryCreditCards:if(data!==null&&typeof data=="object"&&data.ResultSet&&data.ResultSet.Listing) {var vendorData=[];if(typeof data.ResultSet.Listing.length=="undefined") {vendorData.push(data.ResultSet.Listing);} else {vendorData=data.ResultSet.Listing;} this.populateCreditCardsVendors(vendorData);delete data.ResultSet.Listing;this.set({"ResultSet":data.ResultSet});this.set({"impressionHandler":data.ResultSet.ImpressionHandler||''})} else {go=false;this.displayAndExit();} break;default:go=false;break;} if(go) {QS._.each(this.sv_137,function(vendor) {vendor.setParentWidget(this);},this);this.pageSize=this.getNumVendors();this.totalResults=this.getNumVendors();this.populatePages();this.trigger('QS.WidgetInstance:populate:complete',this);this.render();this.trigger('QS.WidgetInstance:populateSureHits:out',this);this.trigger('QS.WidgetInstance:populate:out',this);}}});}).call(this);;var style=document.createElement('style');var css='#qs-hq .qs-listings.cachedWidget { display: none; }';document.getElementsByTagName('head')[0].appendChild(style);style.type='text/css';if(style.styleSheet) {style.styleSheet.cssText=css;} else {style.appendChild(document.createTextNode(css));} if(document.getElementsByTagName("html")[0].id.length<1) {document.getElementsByTagName("html")[0].id="qs-hq";} else if(document.getElementById("qs-hq")===null&&document.getElementsByTagName("body")[0].id.length<1) {document.getElementsByTagName("body")[0].id="qs-hq";} QS.$.support.cors=true;QS.$(document).ready(function($) {QS.ih();QS.$('.cachedWidget').each(function(){var widget=QS.$(this);widget.hide();var widgetInstance=new QS.WidgetInstance();widgetInstance.construct(widget);try {widgetInstance.updateWidget();} catch(e) {widgetInstance.restoreOnPageWidgetAndExit();}});});