/*
Files included:
	jquery-1.4.2.js
	sni-tc-cfg.js
	sni-core.js
	sni-tc.js
	jcarousellite_1.0.1.js
*/
/*!
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
(function(window,undefined){var jQuery=function(selector,context){return new jQuery.fn.init(selector,context);},_jQuery=window.jQuery,_$=window.$,document=window.document,rootjQuery,quickExpr=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/,rnotwhite=/\S/,rtrim=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,userAgent=navigator.userAgent,browserMatch,readyBound=false,readyList=[],DOMContentLoaded,toString=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty,push=Array.prototype.push,slice=Array.prototype.slice,indexOf=Array.prototype.indexOf;jQuery.fn=jQuery.prototype={init:function(selector,context){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){this.context=document;this[0]=document.body;this.selector="body";this.length=1;return this;}if(typeof selector==="string"){match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){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=buildFragment([match[1]],[doc]);selector=(ret.cacheable?ret.fragment.cloneNode(true):ret.fragment).childNodes;}return jQuery.merge(this,selector);}else{elem=document.getElementById(match[2]);if(elem){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&&/^\w+$/.test(selector)){this.selector=selector;this.context=document;selector=document.getElementsByTagName(selector);return jQuery.merge(this,selector);}else{if(!context||context.jquery){return(context||rootjQuery).find(selector);}else{return jQuery(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.4.2",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.slice(num)[0]:this[num]);},pushStack:function(elems,name,selector){var ret=jQuery();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();if(jQuery.isReady){fn.call(document,jQuery);}else{if(readyList){readyList.push(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||jQuery(null);},push:push,sort:[].sort,splice:[].splice};jQuery.fn.init.prototype=jQuery.fn;jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options,name,src,copy;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(;i<length;i++){if((options=arguments[i])!=null){for(name in options){src=target[name];copy=options[name];if(target===copy){continue;}if(deep&&copy&&(jQuery.isPlainObject(copy)||jQuery.isArray(copy))){var clone=src&&(jQuery.isPlainObject(src)||jQuery.isArray(src))?src:jQuery.isArray(copy)?[]:{};target[name]=jQuery.extend(deep,clone,copy);}else{if(copy!==undefined){target[name]=copy;}}}}}return target;};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep){window.jQuery=_jQuery;}return jQuery;},isReady:false,ready:function(){if(!jQuery.isReady){if(!document.body){return setTimeout(jQuery.ready,13);}jQuery.isReady=true;if(readyList){var fn,i=0;while((fn=readyList[i++])){fn.call(document,jQuery);}readyList=null;}if(jQuery.fn.triggerHandler){jQuery(document).triggerHandler("ready");}}},bindReady:function(){if(readyBound){return;}readyBound=true;if(document.readyState==="complete"){return jQuery.ready();}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 toString.call(obj)==="[object Function]";},isArray:function(obj){return toString.call(obj)==="[object Array]";},isPlainObject:function(obj){if(!obj||toString.call(obj)!=="[object Object]"||obj.nodeType||obj.setInterval){return false;}if(obj.constructor&&!hasOwnProperty.call(obj,"constructor")&&!hasOwnProperty.call(obj.constructor.prototype,"isPrototypeOf")){return false;}var key;for(key in obj){}return key===undefined||hasOwnProperty.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(/^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return window.JSON&&window.JSON.parse?window.JSON.parse(data):(new Function("return "+data))();}else{jQuery.error("Invalid JSON: "+data);}},noop:function(){},globalEval:function(data){if(data&&rnotwhite.test(data)){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.support.scriptEval){script.appendChild(document.createTextNode(data));}else{script.text=data;}head.insertBefore(script,head.firstChild);head.removeChild(script);}},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(;i<length;){if(callback.apply(object[i++],args)===false){break;}}}}else{if(isObj){for(name in object){if(callback.call(object[name],name,object[name])===false){break;}}}else{for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}}return object;},trim:function(text){return(text||"").replace(rtrim,"");},makeArray:function(array,results){var ret=results||[];if(array!=null){if(array.length==null||typeof array==="string"||jQuery.isFunction(array)||(typeof array!=="function"&&array.setInterval)){push.call(ret,array);}else{jQuery.merge(ret,array);}}return ret;},inArray:function(elem,array){if(array.indexOf){return array.indexOf(elem);}for(var i=0,length=array.length;i<length;i++){if(array[i]===elem){return i;}}return -1;},merge:function(first,second){var i=first.length,j=0;if(typeof second.length==="number"){for(var l=second.length;j<l;j++){first[i++]=second[j];}}else{while(second[j]!==undefined){first[i++]=second[j++];}}first.length=i;return first;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++){if(!inv!==!callback(elems[i],i)){ret.push(elems[i]);}}return ret;},map:function(elems,callback,arg){var ret=[],value;for(var i=0,length=elems.length;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret[ret.length]=value;}}return ret.concat.apply([],ret);},guid:1,proxy:function(fn,proxy,thisObject){if(arguments.length===2){if(typeof proxy==="string"){thisObject=fn;fn=thisObject[proxy];proxy=undefined;}else{if(proxy&&!jQuery.isFunction(proxy)){thisObject=proxy;proxy=undefined;}}}if(!proxy&&fn){proxy=function(){return fn.apply(thisObject||this,arguments);};}if(fn){proxy.guid=fn.guid=fn.guid||proxy.guid||jQuery.guid++;}return proxy;},uaMatch:function(ua){ua=ua.toLowerCase();var match=/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||!/compatible/.test(ua)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"};},browser:{}});browserMatch=jQuery.uaMatch(userAgent);if(browserMatch.browser){jQuery.browser[browserMatch.browser]=true;jQuery.browser.version=browserMatch.version;}if(jQuery.browser.webkit){jQuery.browser.safari=true;}if(indexOf){jQuery.inArray=function(elem,array){return indexOf.call(array,elem);};}rootjQuery=jQuery(document);if(document.addEventListener){DOMContentLoaded=function(){document.removeEventListener("DOMContentLoaded",DOMContentLoaded,false);jQuery.ready();};}else{if(document.attachEvent){DOMContentLoaded=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",DOMContentLoaded);jQuery.ready();}};}}function doScrollCheck(){if(jQuery.isReady){return;}try{document.documentElement.doScroll("left");}catch(error){setTimeout(doScrollCheck,1);return;}jQuery.ready();}function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"});}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");}if(elem.parentNode){elem.parentNode.removeChild(elem);}}function access(elems,key,value,exec,fn,pass){var length=elems.length;if(typeof key==="object"){for(var k in key){access(elems,k,key[k],exec,fn,value);}return elems;}if(value!==undefined){exec=!pass&&exec&&jQuery.isFunction(value);for(var i=0;i<length;i++){fn(elems[i],key,exec?value.call(elems[i],i,fn(elems[i],key)):value,pass);}return elems;}return length?fn(elems[0],key):undefined;}function now(){return(new Date).getTime();}(function(){jQuery.support={};var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+now();div.style.display="none";div.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return;}jQuery.support={leadingWhitespace:div.firstChild.nodeType===3,tbody:!div.getElementsByTagName("tbody").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:/^0.55$/.test(a.style.opacity),cssFloat:!!a.style.cssFloat,checkOn:div.getElementsByTagName("input")[0].value==="on",optSelected:document.createElement("select").appendChild(document.createElement("option")).selected,parentNode:div.removeChild(div.appendChild(document.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};script.type="text/javascript";try{script.appendChild(document.createTextNode("window."+id+"=1;"));}catch(e){}root.insertBefore(script,root.firstChild);if(window[id]){jQuery.support.scriptEval=true;delete window[id];}try{delete script.test;}catch(e){jQuery.support.deleteExpando=false;}root.removeChild(script);if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function click(){jQuery.support.noCloneEvent=false;div.detachEvent("onclick",click);});div.cloneNode(true).fireEvent("onclick");}div=document.createElement("div");div.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var fragment=document.createDocumentFragment();fragment.appendChild(div.firstChild);jQuery.support.checkClone=fragment.cloneNode(true).cloneNode(true).lastChild.checked;jQuery(function(){var div=document.createElement("div");div.style.width=div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div).style.display="none";div=null;});var eventSupported=function(eventName){var el=document.createElement("div");eventName="on"+eventName;var isSupported=(eventName in el);if(!isSupported){el.setAttribute(eventName,"return;");isSupported=typeof el[eventName]==="function";}el=null;return isSupported;};jQuery.support.submitBubbles=eventSupported("submit");jQuery.support.changeBubbles=eventSupported("change");root=script=div=all=a=null;})();jQuery.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var expando="jQuery"+now(),uuid=0,windowData={};jQuery.extend({cache:{},expando:expando,noData:{"embed":true,"object":true,"applet":true},data:function(elem,name,data){if(elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()]){return;}elem=elem==window?windowData:elem;var id=elem[expando],cache=jQuery.cache,thisCache;if(!id&&typeof name==="string"&&data===undefined){return null;}if(!id){id=++uuid;}if(typeof name==="object"){elem[expando]=id;thisCache=cache[id]=jQuery.extend(true,{},name);}else{if(!cache[id]){elem[expando]=id;cache[id]={};}}thisCache=cache[id];if(data!==undefined){thisCache[name]=data;}return typeof name==="string"?thisCache[name]:thisCache;},removeData:function(elem,name){if(elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()]){return;}elem=elem==window?windowData:elem;var id=elem[expando],cache=jQuery.cache,thisCache=cache[id];if(name){if(thisCache){delete thisCache[name];if(jQuery.isEmptyObject(thisCache)){jQuery.removeData(elem);}}}else{if(jQuery.support.deleteExpando){delete elem[jQuery.expando];}else{if(elem.removeAttribute){elem.removeAttribute(jQuery.expando);}}delete cache[id];}}});jQuery.fn.extend({data:function(key,value){if(typeof key==="undefined"&&this.length){return jQuery.data(this[0]);}else{if(typeof key==="object"){return this.each(function(){jQuery.data(this,key);});}}var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length){data=jQuery.data(this[0],key);}return data===undefined&&parts[1]?this.data(parts[0]):data;}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});}});jQuery.extend({queue:function(elem,type,data){if(!elem){return;}type=(type||"fx")+"queue";var q=jQuery.data(elem,type);if(!data){return q||[];}if(!q||jQuery.isArray(data)){q=jQuery.data(elem,type,jQuery.makeArray(data));}else{q.push(data);}return q;},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),fn=queue.shift();if(fn==="inprogress"){fn=queue.shift();}if(fn){if(type==="fx"){queue.unshift("inprogress");}fn.call(elem,function(){jQuery.dequeue(elem,type);});}}});jQuery.fn.extend({queue:function(type,data){if(typeof type!=="string"){data=type;type="fx";}if(data===undefined){return jQuery.queue(this[0],type);}return this.each(function(i,elem){var queue=jQuery.queue(this,type,data);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type);}});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});},delay:function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(){var elem=this;setTimeout(function(){jQuery.dequeue(elem,type);},time);});},clearQueue:function(type){return this.queue(type||"fx",[]);}});var rclass=/[\n\t]/g,rspace=/\s+/,rreturn=/\r/g,rspecialurl=/href|src|style/,rtype=/(button|input)/i,rfocusable=/(button|input|object|select|textarea)/i,rclickable=/^(a|area)$/i,rradiocheck=/radio|checkbox/;jQuery.fn.extend({attr:function(name,value){return access(this,name,value,true,jQuery.attr);},removeAttr:function(name,fn){return this.each(function(){jQuery.attr(this,name,"");if(this.nodeType===1){this.removeAttribute(name);}});},addClass:function(value){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.addClass(value.call(this,i,self.attr("class")));});}if(value&&typeof value==="string"){var classNames=(value||"").split(rspace);for(var i=0,l=this.length;i<l;i++){var elem=this[i];if(elem.nodeType===1){if(!elem.className){elem.className=value;}else{var className=" "+elem.className+" ",setClass=elem.className;for(var c=0,cl=classNames.length;c<cl;c++){if(className.indexOf(" "+classNames[c]+" ")<0){setClass+=" "+classNames[c];}}elem.className=jQuery.trim(setClass);}}}}return this;},removeClass:function(value){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.removeClass(value.call(this,i,self.attr("class")));});}if((value&&typeof value==="string")||value===undefined){var classNames=(value||"").split(rspace);for(var i=0,l=this.length;i<l;i++){var elem=this[i];if(elem.nodeType===1&&elem.className){if(value){var className=(" "+elem.className+" ").replace(rclass," ");for(var c=0,cl=classNames.length;c<cl;c++){className=className.replace(" "+classNames[c]+" "," ");}elem.className=jQuery.trim(className);}else{elem.className="";}}}}return this;},toggleClass:function(value,stateVal){var type=typeof value,isBool=typeof stateVal==="boolean";if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.toggleClass(value.call(this,i,self.attr("class"),stateVal),stateVal);});}return this.each(function(){if(type==="string"){var className,i=0,self=jQuery(this),state=stateVal,classNames=value.split(rspace);while((className=classNames[i++])){state=isBool?state:!self.hasClass(className);self[state?"addClass":"removeClass"](className);}}else{if(type==="undefined"||type==="boolean"){if(this.className){jQuery.data(this,"__className__",this.className);}this.className=this.className||value===false?"":jQuery.data(this,"__className__")||"";}}});},hasClass:function(selector){var className=" "+selector+" ";for(var i=0,l=this.length;i<l;i++){if((" "+this[i].className+" ").replace(rclass," ").indexOf(className)>-1){return true;}}return false;},val:function(value){if(value===undefined){var elem=this[0];if(elem){if(jQuery.nodeName(elem,"option")){return(elem.attributes.value||{}).specified?elem.value:elem.text;}if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type==="select-one";if(index<0){return null;}for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery(option).val();if(one){return value;}values.push(value);}}return values;}if(rradiocheck.test(elem.type)&&!jQuery.support.checkOn){return elem.getAttribute("value")===null?"on":elem.value;}return(elem.value||"").replace(rreturn,"");}return undefined;}var isFunction=jQuery.isFunction(value);return this.each(function(i){var self=jQuery(this),val=value;if(this.nodeType!==1){return;}if(isFunction){val=value.call(this,i,self.val());}if(typeof val==="number"){val+="";}if(jQuery.isArray(val)&&rradiocheck.test(this.type)){this.checked=jQuery.inArray(self.val(),val)>=0;}else{if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(val);jQuery("option",this).each(function(){this.selected=jQuery.inArray(jQuery(this).val(),values)>=0;});if(!values.length){this.selectedIndex=-1;}}else{this.value=val;}}});}});jQuery.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(elem,name,value,pass){if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined;}if(pass&&name in jQuery.attrFn){return jQuery(elem)[name](value);}var notxml=elem.nodeType!==1||!jQuery.isXMLDoc(elem),set=value!==undefined;name=notxml&&jQuery.props[name]||name;if(elem.nodeType===1){var special=rspecialurl.test(name);if(name==="selected"&&!jQuery.support.optSelected){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex;}}}if(name in elem&&notxml&&!special){if(set){if(name==="type"&&rtype.test(elem.nodeName)&&elem.parentNode){jQuery.error("type property can't be changed");}elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue;}if(name==="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");return attributeNode&&attributeNode.specified?attributeNode.value:rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:undefined;}return elem[name];}if(!jQuery.support.style&&notxml&&name==="style"){if(set){elem.style.cssText=""+value;}return elem.style.cssText;}if(set){elem.setAttribute(name,""+value);}var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}return jQuery.style(elem,name,value);}});var rnamespaces=/\.(.*)$/,fcleanup=function(nm){return nm.replace(/[^\w\s\.\|`]/g,function(ch){return"\\"+ch;});};jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType===3||elem.nodeType===8){return;}if(elem.setInterval&&(elem!==window&&!elem.frameElement)){elem=window;}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=elemData.events||{},eventHandle=elemData.handle,eventHandle;if(!eventHandle){elemData.handle=eventHandle=function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?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;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;}var ret,type,fn,i=0,all,namespaces,namespace,special,eventType,handleObj,origType,elemData=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(var j=0;j<eventType.length;j++){handleObj=eventType[j];if(all||namespace.test(handleObj.namespace)){jQuery.event.remove(elem,origType,handleObj.handler,j);eventType.splice(j--,1);}}continue;}special=jQuery.event.special[type]||{};for(var j=pos||0;j<eventType.length;j++){handleObj=eventType[j];if(handler.guid===handleObj.guid){if(all||namespace.test(handleObj.namespace)){if(pos==null){eventType.splice(j--,1);}if(special.remove){special.remove.call(elem,handleObj);}}if(pos!=null){break;}}}if(eventType.length===0||pos!=null&&eventType.length===1){if(!special.teardown||special.teardown.call(elem,namespaces)===false){removeEvent(elem,type,elemData.handle);}ret=null;delete events[type];}}if(jQuery.isEmptyObject(events)){var handle=elemData.handle;if(handle){handle.elem=null;}delete elemData.events;delete elemData.handle;if(jQuery.isEmptyObject(elemData)){jQuery.removeData(elem);}}},trigger:function(event,data,elem){var type=event.type||event,bubbling=arguments[3];if(!bubbling){event=typeof event==="object"?event[expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);event.exclusive=true;}if(!elem){event.stopPropagation();if(jQuery.event.global[type]){jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type]){jQuery.event.trigger(event,data,this.handle.elem);}});}}if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined;}event.result=undefined;event.target=elem;data=jQuery.makeArray(data);data.unshift(event);}event.currentTarget=elem;var handle=jQuery.data(elem,"handle");if(handle){handle.apply(elem,data);}var parent=elem.parentNode||elem.ownerDocument;try{if(!(elem&&elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()])){if(elem["on"+type]&&elem["on"+type].apply(elem,data)===false){event.result=false;}}}catch(e){}if(!event.isPropagationStopped()&&parent){jQuery.event.trigger(event,data,parent,true);}else{if(!event.isDefaultPrevented()){var target=event.target,old,isClick=jQuery.nodeName(target,"a")&&type==="click",special=jQuery.event.special[type]||{};if((!special._default||special._default.call(elem,event)===false)&&!isClick&&!(target&&target.nodeName&&jQuery.noData[target.nodeName.toLowerCase()])){try{if(target[type]){old=target["on"+type];if(old){target["on"+type]=null;}jQuery.event.triggered=true;target[type]();}}catch(e){}if(old){target["on"+type]=old;}jQuery.event.triggered=false;}}}},handle:function(event){var all,handlers,namespaces,namespace,events;event=arguments[0]=jQuery.event.fix(event||window.event);event.currentTarget=this;all=event.type.indexOf(".")<0&&!event.exclusive;if(!all){namespaces=event.type.split(".");event.type=namespaces.shift();namespace=new RegExp("(^|\\.)"+namespaces.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");}var events=jQuery.data(this,"events"),handlers=events[event.type];if(events&&handlers){handlers=handlers.slice(0);for(var j=0,l=handlers.length;j<l;j++){var handleObj=handlers[j];if(all||namespace.test(handleObj.namespace)){event.handler=handleObj.handler;event.data=handleObj.data;event.handleObj=handleObj;var ret=handleObj.handler.apply(this,arguments);if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}if(event.isImmediatePropagationStopped()){break;}}}}return event.result;},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(event){if(event[expando]){return event;}var originalEvent=event;event=jQuery.Event(originalEvent);for(var i=this.props.length,prop;i;){prop=this.props[--i];event[prop]=originalEvent[prop];}if(!event.target){event.target=event.srcElement||document;}if(event.target.nodeType===3){event.target=event.target.parentNode;}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement===event.target?event.toElement:event.fromElement;}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode;}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey;}if(!event.which&&event.button!==undefined){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));}return event;},guid:100000000,proxy:jQuery.proxy,special:{ready:{setup:jQuery.bindReady,teardown:jQuery.noop},live:{add:function(handleObj){jQuery.event.add(this,handleObj.origType,jQuery.extend({},handleObj,{handler:liveHandler}));},remove:function(handleObj){var remove=true,type=handleObj.origType.replace(rnamespaces,"");jQuery.each(jQuery.data(this,"events").live||[],function(){if(type===this.origType.replace(rnamespaces,"")){remove=false;return false;}});if(remove){jQuery.event.remove(this,handleObj.origType,liveHandler);}}},beforeunload:{setup:function(data,namespaces,eventHandle){if(this.setInterval){this.onbeforeunload=eventHandle;}return false;},teardown:function(namespaces,eventHandle){if(this.onbeforeunload===eventHandle){this.onbeforeunload=null;}}}}};var removeEvent=document.removeEventListener?function(elem,type,handle){elem.removeEventListener(type,handle,false);}:function(elem,type,handle){elem.detachEvent("on"+type,handle);};jQuery.Event=function(src){if(!this.preventDefault){return new jQuery.Event(src);}if(src&&src.type){this.originalEvent=src;this.type=src.type;}else{this.type=src;}this.timeStamp=now();this[expando]=true;};function returnFalse(){return false;}function returnTrue(){return true;}jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e){return;}if(e.preventDefault){e.preventDefault();}e.returnValue=false;},stopPropagation:function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e){return;}if(e.stopPropagation){e.stopPropagation();}e.cancelBubble=true;},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation();},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};var withinElement=function(event){var parent=event.relatedTarget;try{while(parent&&parent!==this){parent=parent.parentNode;}if(parent!==this){event.type=event.data;jQuery.event.handle.apply(this,arguments);}}catch(e){}},delegate=function(event){event.type=event.data;jQuery.event.handle.apply(this,arguments);};jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(orig,fix){jQuery.event.special[orig]={setup:function(data){jQuery.event.add(this,fix,data&&data.selector?delegate:withinElement,orig);},teardown:function(data){jQuery.event.remove(this,fix,data&&data.selector?delegate:withinElement);}};});if(!jQuery.support.submitBubbles){jQuery.event.special.submit={setup:function(data,namespaces){if(this.nodeName.toLowerCase()!=="form"){jQuery.event.add(this,"click.specialSubmit",function(e){var elem=e.target,type=elem.type;if((type==="submit"||type==="image")&&jQuery(elem).closest("form").length){return trigger("submit",this,arguments);}});jQuery.event.add(this,"keypress.specialSubmit",function(e){var elem=e.target,type=elem.type;if((type==="text"||type==="password")&&jQuery(elem).closest("form").length&&e.keyCode===13){return trigger("submit",this,arguments);}});}else{return false;}},teardown:function(namespaces){jQuery.event.remove(this,".specialSubmit");}};}if(!jQuery.support.changeBubbles){var formElems=/textarea|input|select/i,changeFilters,getVal=function(elem){var type=elem.type,val=elem.value;if(type==="radio"||type==="checkbox"){val=elem.checked;}else{if(type==="select-multiple"){val=elem.selectedIndex>-1?jQuery.map(elem.options,function(elem){return elem.selected;}).join("-"):"";}else{if(elem.nodeName.toLowerCase()==="select"){val=elem.selectedIndex;}}}return val;},testChange=function testChange(e){var elem=e.target,data,val;if(!formElems.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";return jQuery.event.trigger(e,arguments[1],elem);}};jQuery.event.special.change={filters:{focusout:testChange,click:function(e){var elem=e.target,type=elem.type;if(type==="radio"||type==="checkbox"||elem.nodeName.toLowerCase()==="select"){return testChange.call(this,e);}},keydown:function(e){var elem=e.target,type=elem.type;if((e.keyCode===13&&elem.nodeName.toLowerCase()!=="textarea")||(e.keyCode===32&&(type==="checkbox"||type==="radio"))||type==="select-multiple"){return 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 formElems.test(this.nodeName);},teardown:function(namespaces){jQuery.event.remove(this,".specialChange");return formElems.test(this.nodeName);}};changeFilters=jQuery.event.special.change.filters;}function trigger(type,elem,args){args[0].type=type;return jQuery.event.handle.apply(elem,args);}if(document.addEventListener){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){jQuery.event.special[fix]={setup:function(){this.addEventListener(orig,handler,true);},teardown:function(){this.removeEventListener(orig,handler,true);}};function handler(e){e=jQuery.event.fix(e);e.type=fix;return jQuery.event.handle.call(this,e);}});}jQuery.each(["bind","one"],function(i,name){jQuery.fn[name]=function(type,data,fn){if(typeof type==="object"){for(var key in type){this[name](key,data,type[key],fn);}return this;}if(jQuery.isFunction(data)){fn=data;data=undefined;}var handler=name==="one"?jQuery.proxy(fn,function(event){jQuery(this).unbind(event,handler);return fn.apply(this,arguments);}):fn;if(type==="unload"&&name!=="one"){this.one(type,data,fn);}else{for(var i=0,l=this.length;i<l;i++){jQuery.event.add(this[i],type,handler,data);}}return this;};});jQuery.fn.extend({unbind:function(type,fn){if(typeof type==="object"&&!type.preventDefault){for(var key in type){this.unbind(key,type[key]);}}else{for(var i=0,l=this.length;i<l;i++){jQuery.event.remove(this[i],type,fn);}}return this;},delegate:function(selector,types,data,fn){return this.live(types,data,fn,selector);},undelegate:function(selector,types,fn){if(arguments.length===0){return this.unbind("live");}else{return this.die(types,null,fn,selector);}},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result;}},toggle:function(fn){var args=arguments,i=1;while(i<args.length){jQuery.proxy(fn,args[i++]);}return this.click(jQuery.proxy(fn,function(event){var lastToggle=(jQuery.data(this,"lastToggle"+fn.guid)||0)%i;jQuery.data(this,"lastToggle"+fn.guid,lastToggle+1);event.preventDefault();return args[lastToggle].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver);}});var liveMap={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};jQuery.each(["live","die"],function(i,name){jQuery.fn[name]=function(types,data,fn,origSelector){var type,i=0,match,namespaces,preType,selector=origSelector||this.selector,context=origSelector?this:jQuery(this.context);if(jQuery.isFunction(data)){fn=data;data=undefined;}types=(types||"").split(" ");while((type=types[i++])!=null){match=rnamespaces.exec(type);namespaces="";if(match){namespaces=match[0];type=type.replace(rnamespaces,"");}if(type==="hover"){types.push("mouseenter"+namespaces,"mouseleave"+namespaces);continue;}preType=type;if(type==="focus"||type==="blur"){types.push(liveMap[type]+namespaces);type=type+namespaces;}else{type=(liveMap[type]||type)+namespaces;}if(name==="live"){context.each(function(){jQuery.event.add(this,liveConvert(type,selector),{data:data,selector:selector,handler:fn,origType:type,origHandler:fn,preType:preType});});}else{context.unbind(liveConvert(type,selector),fn);}}return this;};});function liveHandler(event){var stop,elems=[],selectors=[],args=arguments,related,match,handleObj,elem,j,i,l,data,events=jQuery.data(this,"events");if(event.liveFired===this||!events||!events.live||event.button&&event.type==="click"){return;}event.liveFired=this;var live=events.live.slice(0);for(j=0;j<live.length;j++){handleObj=live[j];if(handleObj.origType.replace(rnamespaces,"")===event.type){selectors.push(handleObj.selector);}else{live.splice(j--,1);}}match=jQuery(event.target).closest(selectors,event.currentTarget);for(i=0,l=match.length;i<l;i++){for(j=0;j<live.length;j++){handleObj=live[j];if(match[i].selector===handleObj.selector){elem=match[i].elem;related=null;if(handleObj.preType==="mouseenter"||handleObj.preType==="mouseleave"){related=jQuery(event.relatedTarget).closest(handleObj.selector)[0];}if(!related||related!==elem){elems.push({elem:elem,handleObj:handleObj});}}}}for(i=0,l=elems.length;i<l;i++){match=elems[i];event.currentTarget=match.elem;event.data=match.handleObj.data;event.handleObj=match.handleObj;if(match.handleObj.origHandler.apply(match.elem,args)===false){stop=false;break;}}return stop;}function liveConvert(type,selector){return"live."+(type&&type!=="*"?type+".":"")+selector.replace(/\./g,"`").replace(/ /g,"&");}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(fn){return fn?this.bind(name,fn):this.trigger(name);};if(jQuery.attrFn){jQuery.attrFn[name]=true;}});if(window.attachEvent&&!window.addEventListener){window.attachEvent("onunload",function(){for(var id in jQuery.cache){if(jQuery.cache[id].handle){try{jQuery.event.remove(jQuery.cache[id].handle.elem);}catch(e){}}}});
/*!
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, 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;[0,0].sort(function(){baseHasDuplicate=false;return 0;});var Sizzle=function(selector,context,results,seed){results=results||[];var origContext=context=context||document;if(context.nodeType!==1&&context.nodeType!==9){return[];}if(!selector||typeof selector!=="string"){return results;}var parts=[],m,set,checkSet,extra,prune=true,contextXML=isXML(context),soFar=selector;while((chunker.exec(""),m=chunker.exec(soFar))!==null){soFar=m[3];parts.push(m[1]);if(m[2]){extra=m[3];break;}}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])){var ret=Sizzle.find(parts.shift(),context,contextXML);context=ret.expr?Sizzle.filter(ret.expr,ret.set)[0]:ret.set[0];}if(context){var 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){var 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(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i]);}}}else{for(var 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;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1);}}}}return results;};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set);};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[];}for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.leftMatch[type].exec(expr))){var left=match[1];match.splice(1,1);if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break;}}}}if(!set){set=context.getElementsByTagName("*");}return{set:set,expr:expr};};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.leftMatch[type].exec(expr))!=null&&match[2]){var filter=Expr.filter[type],found,item,left=match[1];anyFound=false;match.splice(1,1);if(left.substr(left.length-1)==="\\"){continue;}if(curLoop===result){result=[];}if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true;}else{if(match===true){continue;}}}if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true;}else{curLoop[i]=false;}}else{if(pass){result.push(item);anyFound=true;}}}}}if(found!==undefined){if(!inplace){curLoop=result;}expr=expr.replace(Expr.match[type],"");if(!anyFound){return[];}break;}}}if(expr===old){if(anyFound==null){Sizzle.error(expr);}else{break;}}old=expr;}return curLoop;};Sizzle.error=function(msg){throw"Syntax error, unrecognized expression: "+msg;};var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href");}},relative:{"+":function(checkSet,part){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag){part=part.toLowerCase();}for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}checkSet[i]=isPartStrNotTag||elem&&elem.nodeName.toLowerCase()===part?elem||false:elem===part;}}if(isPartStrNotTag){Sizzle.filter(part,checkSet,true);}},">":function(checkSet,part){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=part.toLowerCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName.toLowerCase()===part?parent:false;}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part;}}if(isPartStr){Sizzle.filter(part,checkSet,true);}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();checkFn=dirNodeCheck;}checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML);},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();checkFn=dirNodeCheck;}checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML);}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[];}},NAME:function(match,context){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i]);}}return ret.length===0?null:ret;}},TAG:function(match,context){return context.getElementsByTagName(match[1]);}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match;}for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").replace(/[\t\n]/g," ").indexOf(match)>=0)){if(!inplace){result.push(elem);}}else{if(inplace){curLoop[i]=false;}}}}return false;},ID:function(match){return match[1].replace(/\\/g,"");},TAG:function(match,curLoop){return match[1].toLowerCase();},CHILD:function(match){if(match[1]==="nth"){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;}match[0]=done++;return match;},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name];}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){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){return"text"===elem.type;},radio:function(elem){return"radio"===elem.type;},checkbox:function(elem){return"checkbox"===elem.type;},file:function(elem){return"file"===elem.type;},password:function(elem){return"password"===elem.type;},submit:function(elem){return"submit"===elem.type;},image:function(elem){return"image"===elem.type;},reset:function(elem){return"reset"===elem.type;},button:function(elem){return"button"===elem.type||elem.nodeName.toLowerCase()==="button";},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName);}},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 i<match[3]-0;},gt:function(elem,i,match){return i>match[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||getText([elem])||"").indexOf(match[3])>=0;}else{if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false;}}return true;}else{Sizzle.error("Syntax error, unrecognized expression: "+name);}}}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case"only":case"first":while((node=node.previousSibling)){if(node.nodeType===1){return false;}}if(type==="first"){return true;}node=elem;case"last":while((node=node.nextSibling)){if(node.nodeType===1){return false;}}return true;case"nth":var first=match[2],last=match[3];if(first===1&&last===0){return true;}var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count;}}parent.sizcache=doneName;}var diff=elem.nodeIndex-last;if(first===0){return diff===0;}else{return(diff%first===0&&diff/first>=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;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,function(all,num){return"\\"+(num-0+1);}));}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 ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array);}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i]);}}else{for(var i=0;array[i];i++){ret.push(array[i]);}}}return ret;};}var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){if(!a.compareDocumentPosition||!b.compareDocumentPosition){if(a==b){hasDuplicate=true;}return a.compareDocumentPosition?-1:1;}var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true;}return ret;};}else{if("sourceIndex" in document.documentElement){sortOrder=function(a,b){if(!a.sourceIndex||!b.sourceIndex){if(a==b){hasDuplicate=true;}return a.sourceIndex?-1:1;}var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true;}return ret;};}else{if(document.createRange){sortOrder=function(a,b){if(!a.ownerDocument||!b.ownerDocument){if(a==b){hasDuplicate=true;}return a.ownerDocument?-1:1;}var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.setStart(a,0);aRange.setEnd(a,0);bRange.setStart(b,0);bRange.setEnd(b,0);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true;}return ret;};}}}function getText(elems){var ret="",elem;for(var i=0;elems[i];i++){elem=elems[i];if(elem.nodeType===3||elem.nodeType===4){ret+=elem.nodeValue;}else{if(elem.nodeType!==8){ret+=getText(elem.childNodes);}}}return ret;}(function(){var form=document.createElement("div"),id="script"+(new Date).getTime();form.innerHTML="<a name='"+id+"'/>";var root=document.documentElement;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="<a href='#'></a>";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");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return;}Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra);}catch(e){}}return oldSizzle(query,context,extra,seed);};for(var prop in oldSizzle){Sizzle[prop]=oldSizzle[prop];}div=null;})();}(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";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;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i;}if(elem.nodeName.toLowerCase()===cur){match=elem;break;}elem=elem[dir];}checkSet[i]=match;}}}function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i;}if(typeof cur!=="string"){if(elem===cur){match=true;break;}}else{if(Sizzle.filter(cur,[elem]).length>0){match=elem;break;}}}elem=elem[dir];}checkSet[i]=match;}}}var contains=document.compareDocumentPosition?function(a,b){return !!(a.compareDocumentPosition(b)&16);}:function(a,b){return a!==b&&(a.contains?a.contains(b):true);};var isXML=function(elem){var documentElement=(elem?elem.ownerDocument||elem:0).documentElement;return documentElement?documentElement.nodeName!=="HTML":false;};var posProcess=function(selector,context){var tmpSet=[],later="",match,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;i<l;i++){Sizzle(selector,root[i],tmpSet);}return Sizzle.filter(later,tmpSet);};jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters;jQuery.unique=Sizzle.uniqueSort;jQuery.text=getText;jQuery.isXMLDoc=isXML;jQuery.contains=contains;return;window.Sizzle=Sizzle;})();var runtil=/Until$/,rparentsprev=/^(?:parents|prevUntil|prevAll)/,rmultiselector=/,/,slice=Array.prototype.slice;var winnow=function(elements,qualifier,keep){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return !!qualifier.call(elem,i,elem)===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;});};jQuery.fn.extend({find:function(selector){var ret=this.pushStack("","find",selector),length=0;for(var i=0,l=this.length;i<l;i++){length=ret.length;jQuery.find(selector,this[i],ret);if(i>0){for(var n=length;n<ret.length;n++){for(var r=0;r<length;r++){if(ret[r]===ret[n]){ret.splice(n--,1);break;}}}}}return ret;},has:function(target){var targets=jQuery(target);return this.filter(function(){for(var i=0,l=targets.length;i<l;i++){if(jQuery.contains(this,targets[i])){return true;}}});},not:function(selector){return this.pushStack(winnow(this,selector,false),"not",selector);},filter:function(selector){return this.pushStack(winnow(this,selector,true),"filter",selector);},is:function(selector){return !!selector&&jQuery.filter(selector,this).length>0;},closest:function(selectors,context){if(jQuery.isArray(selectors)){var ret=[],cur=this[0],match,matches={},selector;if(cur&&selectors.length){for(var i=0,l=selectors.length;i<l;i++){selector=selectors[i];if(!matches[selector]){matches[selector]=jQuery.expr.match.POS.test(selector)?jQuery(selector,context||this.context):selector;}}while(cur&&cur.ownerDocument&&cur!==context){for(selector in matches){match=matches[selector];if(match.jquery?match.index(cur)>-1:jQuery(cur).is(match)){ret.push({selector:selector,elem:cur});delete matches[selector];}}cur=cur.parentNode;}}return ret;}var pos=jQuery.expr.match.POS.test(selectors)?jQuery(selectors,context||this.context):null;return this.map(function(i,cur){while(cur&&cur.ownerDocument&&cur!==context){if(pos?pos.index(cur)>-1:jQuery(cur).is(selectors)){return cur;}cur=cur.parentNode;}return null;});},index:function(elem){if(!elem||typeof elem==="string"){return jQuery.inArray(this[0],elem?jQuery(elem):this.parent().children());}return jQuery.inArray(elem.jquery?elem[0]:elem,this);},add:function(selector,context){var set=typeof selector==="string"?jQuery(selector,context||this.context):jQuery.makeArray(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);if(!runtil.test(name)){selector=until;}if(selector&&typeof selector==="string"){ret=jQuery.filter(selector,ret);}ret=this.length>1?jQuery.unique(ret):ret;if((this.length>1||rmultiselector.test(selector))&&rparentsprev.test(name)){ret=ret.reverse();}return this.pushStack(ret,name,slice.call(arguments).join(","));};});jQuery.extend({filter:function(expr,elems,not){if(not){expr=":not("+expr+")";}return 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;}});var rinlinejQuery=/ jQuery\d+="(?:\d+|null)"/g,rleadingWhitespace=/^\s+/,rxhtmlTag=/(<([\w:]+)[^>]*?)\/>/g,rselfClosing=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,rtagName=/<([\w:]+)/,rtbody=/<tbody/i,rhtml=/<|&#?\w+;/,rnocache=/<script|<object|<embed|<option|<style/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,fcloseTag=function(all,front,tag){return rselfClosing.test(tag)?all:front+"></"+tag+">";},wrapMap={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_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<div>","</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(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var html=this.outerHTML,ownerDocument=this.ownerDocument;if(!html){var div=ownerDocument.createElement("div");div.appendChild(this.cloneNode(true));html=div.innerHTML;}return jQuery.clean([html.replace(rinlinejQuery,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(rleadingWhitespace,"")],ownerDocument)[0];}else{return this.cloneNode(true);}});if(events===true){cloneCopyEvent(this,ret);cloneCopyEvent(this.find("*"),ret.find("*"));}return ret;},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,fcloseTag);try{for(var i=0,l=this.length;i<l;i++){if(this[i].nodeType===1){jQuery.cleanData(this[i].getElementsByTagName("*"));this[i].innerHTML=value;}}}catch(e){this.empty().append(value);}}else{if(jQuery.isFunction(value)){this.each(function(i){var self=jQuery(this),old=self.html();self.empty().append(function(){return value.call(this,i,old);});});}else{this.empty().append(value);}}}return this;},replaceWith:function(value){if(this[0]&&this[0].parentNode){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this),old=self.html();self.replaceWith(value.call(this,i,old));});}if(typeof value!=="string"){value=jQuery(value).detach();}return this.each(function(){var next=this.nextSibling,parent=this.parentNode;jQuery(this).remove();if(next){jQuery(next).before(value);}else{jQuery(parent).append(value);}});}else{return this.pushStack(jQuery(jQuery.isFunction(value)?value():value),"replaceWith",value);}},detach:function(selector){return this.remove(selector,true);},domManip:function(args,table,callback){var results,first,value=args[0],scripts=[],fragment,parent;if(!jQuery.support.checkClone&&arguments.length===3&&typeof value==="string"&&rchecked.test(value)){return this.each(function(){jQuery(this).domManip(args,table,callback,true);});}if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);args[0]=value.call(this,i,table?self.html():undefined);self.domManip(args,table,callback);});}if(this[0]){parent=value&&value.parentNode;if(jQuery.support.parentNode&&parent&&parent.nodeType===11&&parent.childNodes.length===this.length){results={fragment:parent};}else{results=buildFragment(args,this,scripts);}fragment=results.fragment;if(fragment.childNodes.length===1){first=fragment=fragment.firstChild;}else{first=fragment.firstChild;}if(first){table=table&&jQuery.nodeName(first,"tr");for(var i=0,l=this.length;i<l;i++){callback.call(table?root(this[i],first):this[i],i>0||results.cacheable||this.length>1?fragment.cloneNode(true):fragment);}}if(scripts.length){jQuery.each(scripts,evalScript);}}return this;function root(elem,cur){return jQuery.nodeName(elem,"table")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem;}}});function cloneCopyEvent(orig,ret){var i=0;ret.each(function(){if(this.nodeName!==(orig[i]&&orig[i].nodeName)){return;}var oldData=jQuery.data(orig[i++]),curData=jQuery.data(this,oldData),events=oldData&&oldData.events;if(events){delete curData.handle;curData.events={};for(var type in events){for(var handler in events[type]){jQuery.event.add(this,type,events[type][handler],events[type][handler].data);}}}});}function buildFragment(args,nodes,scripts){var fragment,cacheable,cacheresults,doc=(nodes&&nodes[0]?nodes[0].ownerDocument||nodes[0]:document);if(args.length===1&&typeof args[0]==="string"&&args[0].length<512&&doc===document&&!rnocache.test(args[0])&&(jQuery.support.checkClone||!rchecked.test(args[0]))){cacheable=true;cacheresults=jQuery.fragments[args[0]];if(cacheresults){if(cacheresults!==1){fragment=cacheresults;}}}if(!fragment){fragment=doc.createDocumentFragment();jQuery.clean(args,doc,fragment,scripts);}if(cacheable){jQuery.fragments[args[0]]=cacheresults?fragment:1;}return{fragment:fragment,cacheable:cacheable};}jQuery.fragments={};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),parent=this.length===1&&this[0].parentNode;if(parent&&parent.nodeType===11&&parent.childNodes.length===1&&insert.length===1){insert[original](this[0]);return this;}else{for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems);}return this.pushStack(ret,name,insert.selector);}};});jQuery.extend({clean:function(elems,context,fragment,scripts){context=context||document;if(typeof context.createElement==="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;}var ret=[];for(var i=0,elem;(elem=elems[i])!=null;i++){if(typeof elem==="number"){elem+="";}if(!elem){continue;}if(typeof elem==="string"&&!rhtml.test(elem)){elem=context.createTextNode(elem);}else{if(typeof elem==="string"){elem=elem.replace(rxhtmlTag,fcloseTag);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]==="<table>"&&!hasBody?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j]);}}}if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)){div.insertBefore(context.createTextNode(rleadingWhitespace.exec(elem)[0]),div.firstChild);}elem=div.childNodes;}}if(elem.nodeType){ret.push(elem);}else{ret=jQuery.merge(ret,elem);}}if(fragment){for(var i=0;ret[i];i++){if(scripts&&jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i]);}else{if(ret[i].nodeType===1){ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))));}fragment.appendChild(ret[i]);}}}return ret;},cleanData:function(elems){var data,id,cache=jQuery.cache,special=jQuery.event.special,deleteExpando=jQuery.support.deleteExpando;for(var i=0,elem;(elem=elems[i])!=null;i++){id=elem[jQuery.expando];if(id){data=cache[id];if(data.events){for(var type in data.events){if(special[type]){jQuery.event.remove(elem,type);}else{removeEvent(elem,type,data.handle);}}}if(deleteExpando){delete elem[jQuery.expando];}else{if(elem.removeAttribute){elem.removeAttribute(jQuery.expando);}}delete cache[id];}}}});var rexclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,ralpha=/alpha\([^)]*\)/,ropacity=/opacity=([^)]*)/,rfloat=/float/i,rdashAlpha=/-([a-z])/ig,rupper=/([A-Z])/g,rnumpx=/^-?\d+(?:px)?$/i,rnum=/^-?\d/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssWidth=["Left","Right"],cssHeight=["Top","Bottom"],getComputedStyle=document.defaultView&&document.defaultView.getComputedStyle,styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat",fcamelCase=function(all,letter){return letter.toUpperCase();};jQuery.fn.css=function(name,value){return access(this,name,value,true,function(elem,name,value){if(value===undefined){return jQuery.curCSS(elem,name);}if(typeof value==="number"&&!rexclude.test(name)){value+="px";}jQuery.style(elem,name,value);});};jQuery.extend({style:function(elem,name,value){if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined;}if((name==="width"||name==="height")&&parseFloat(value)<0){value=undefined;}var style=elem.style||elem,set=value!==undefined;if(!jQuery.support.opacity&&name==="opacity"){if(set){style.zoom=1;var opacity=parseInt(value,10)+""==="NaN"?"":"alpha(opacity="+value*100+")";var filter=style.filter||jQuery.curCSS(elem,"filter")||"";style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):opacity;}return style.filter&&style.filter.indexOf("opacity=")>=0?(parseFloat(ropacity.exec(style.filter)[1])/100)+"":"";}if(rfloat.test(name)){name=styleFloat;}name=name.replace(rdashAlpha,fcamelCase);if(set){style[name]=value;}return style[name];},css:function(elem,name,force,extra){if(name==="width"||name==="height"){var val,props=cssShow,which=name==="width"?cssWidth:cssHeight;function getWH(){val=name==="width"?elem.offsetWidth:elem.offsetHeight;if(extra==="border"){return;}jQuery.each(which,function(){if(!extra){val-=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;}if(extra==="margin"){val+=parseFloat(jQuery.curCSS(elem,"margin"+this,true))||0;}else{val-=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;}});}if(elem.offsetWidth!==0){getWH();}else{jQuery.swap(elem,props,getWH);}return Math.max(0,Math.round(val));}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style,filter;if(!jQuery.support.opacity&&name==="opacity"&&elem.currentStyle){ret=ropacity.test(elem.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return ret===""?"1":ret;}if(rfloat.test(name)){name=styleFloat;}if(!force&&style&&style[name]){ret=style[name];}else{if(getComputedStyle){if(rfloat.test(name)){name="float";}name=name.replace(rupper,"-$1").toLowerCase();var defaultView=elem.ownerDocument.defaultView;if(!defaultView){return null;}var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle){ret=computedStyle.getPropertyValue(name);}if(name==="opacity"&&ret===""){ret="1";}}else{if(elem.currentStyle){var camelCase=name.replace(rdashAlpha,fcamelCase);ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!rnumpx.test(ret)&&rnum.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=camelCase==="fontSize"?"1em":(ret||0);ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}}}return ret;},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options){elem.style[name]=old[name];}}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.hidden=function(elem){var width=elem.offsetWidth,height=elem.offsetHeight,skip=elem.nodeName.toLowerCase()==="tr";return width===0&&height===0&&!skip?true:width>0&&height>0&&!skip?false:jQuery.curCSS(elem,"display")==="none";};jQuery.expr.filters.visible=function(elem){return !jQuery.expr.filters.hidden(elem);};}var jsc=now(),rscript=/<script(.|\s)*?\/script>/gi,rselectTextarea=/select|textarea/i,rinput=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,jsre=/=\?(&|$)/,rquery=/\?/,rts=/(\?|&)_=.*?(&|$)/,rurl=/^(\w+:)?\/\/([^\/?#]+)/,r20=/%20/g,_load=jQuery.fn.load;jQuery.fn.extend({load:function(url,params,callback){if(typeof url!=="string"){return _load.call(this,url);}else{if(!this.length){return this;}}var off=url.indexOf(" ");if(off>=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=null;}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(res,status){if(status==="success"||status==="notmodified"){self.html(selector?jQuery("<div />").append(res.responseText.replace(rscript,"")).find(selector):res.responseText);}if(callback){self.each(callback,[res.responseText,status,res]);}}});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};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:window.XMLHttpRequest&&(window.location.protocol!=="file:"||!window.ActiveXObject)?function(){return new window.XMLHttpRequest();}:function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP");}catch(e){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(origSettings){var s=jQuery.extend(true,{},jQuery.ajaxSettings,origSettings);var jsonp,status,data,callbackContext=origSettings&&origSettings.context||s,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional);}if(s.dataType==="jsonp"){if(type==="GET"){if(!jsre.test(s.url)){s.url+=(rquery.test(s.url)?"&":"?")+(s.jsonp||"callback")+"=?";}}else{if(!s.data||!jsre.test(s.data)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";}}s.dataType="json";}if(s.dataType==="json"&&(s.data&&jsre.test(s.data)||jsre.test(s.url))){jsonp=s.jsonpCallback||("jsonp"+jsc++);if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");}s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=window[jsonp]||function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head){head.removeChild(script);}};}if(s.dataType==="script"&&s.cache===null){s.cache=false;}if(s.cache===false&&type==="GET"){var ts=now();var ret=s.url.replace(rts,"$1_="+ts+"$2");s.url=ret+((ret===s.url)?(rquery.test(s.url)?"&":"?")+"_="+ts:"");}if(s.data&&type==="GET"){s.url+=(rquery.test(s.url)?"&":"?")+s.data;}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart");}var parts=rurl.exec(s.url),remote=parts&&(parts[1]&&parts[1]!==location.protocol||parts[2]!==location.host);if(s.dataType==="script"&&type==="GET"&&remote){var head=document.getElementsByTagName("head")[0]||document.documentElement;var script=document.createElement("script");script.src=s.url;if(s.scriptCharset){script.charset=s.scriptCharset;}if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){done=true;success();complete();script.onload=script.onreadystatechange=null;if(head&&script.parentNode){head.removeChild(script);}}};}head.insertBefore(script,head.firstChild);return undefined;}var requestDone=false;var xhr=s.xhr();if(!xhr){return;}if(s.username){xhr.open(type,s.url,s.async,s.username,s.password);}else{xhr.open(type,s.url,s.async);}try{if(s.data||origSettings&&origSettings.contentType){xhr.setRequestHeader("Content-Type",s.contentType);}if(s.ifModified){if(jQuery.lastModified[s.url]){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]);}if(jQuery.etag[s.url]){xhr.setRequestHeader("If-None-Match",jQuery.etag[s.url]);}}if(!remote){xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");}xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend.call(callbackContext,xhr,s)===false){if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop");}xhr.abort();return false;}if(s.global){trigger("ajaxSend",[xhr,s]);}var onreadystatechange=xhr.onreadystatechange=function(isTimeout){if(!xhr||xhr.readyState===0||isTimeout==="abort"){if(!requestDone){complete();}requestDone=true;if(xhr){xhr.onreadystatechange=jQuery.noop;}}else{if(!requestDone&&xhr&&(xhr.readyState===4||isTimeout==="timeout")){requestDone=true;xhr.onreadystatechange=jQuery.noop;status=isTimeout==="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";var errMsg;if(status==="success"){try{data=jQuery.httpData(xhr,s.dataType,s);}catch(err){status="parsererror";errMsg=err;}}if(status==="success"||status==="notmodified"){if(!jsonp){success();}}else{jQuery.handleError(s,xhr,status,errMsg);}complete();if(isTimeout==="timeout"){xhr.abort();}if(s.async){xhr=null;}}}};try{var oldAbort=xhr.abort;xhr.abort=function(){if(xhr){oldAbort.call(xhr);}onreadystatechange("abort");};}catch(e){}if(s.async&&s.timeout>0){setTimeout(function(){if(xhr&&!requestDone){onreadystatechange("timeout");}},s.timeout);}try{xhr.send(type==="POST"||type==="PUT"||type==="DELETE"?s.data:null);}catch(e){jQuery.handleError(s,xhr,null,e);complete();}if(!s.async){onreadystatechange();}function success(){if(s.success){s.success.call(callbackContext,data,status,xhr);}if(s.global){trigger("ajaxSuccess",[xhr,s]);}}function complete(){if(s.complete){s.complete.call(callbackContext,xhr,status);}if(s.global){trigger("ajaxComplete",[xhr,s]);}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop");}}function trigger(type,args){(s.context?jQuery(s.context):jQuery.event).trigger(type,args);}return xhr;},handleError:function(s,xhr,status,e){if(s.error){s.error.call(s.context||s,xhr,status,e);}if(s.global){(s.context?jQuery(s.context):jQuery.event).trigger("ajaxError",[xhr,s,e]);}},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol==="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status===304||xhr.status===1223||xhr.status===0;}catch(e){}return false;},httpNotModified:function(xhr,url){var lastModified=xhr.getResponseHeader("Last-Modified"),etag=xhr.getResponseHeader("Etag");if(lastModified){jQuery.lastModified[url]=lastModified;}if(etag){jQuery.etag[url]=etag;}return xhr.status===304||xhr.status===0;},httpData:function(xhr,type,s){var ct=xhr.getResponseHeader("content-type")||"",xml=type==="xml"||!type&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==="parsererror"){jQuery.error("parsererror");}if(s&&s.dataFilter){data=s.dataFilter(data,type);}if(typeof data==="string"){if(type==="json"||!type&&ct.indexOf("json")>=0){data=jQuery.parseJSON(data);}else{if(type==="script"||!type&&ct.indexOf("javascript")>=0){jQuery.globalEval(data);}}}return data;},param:function(a,traditional){var s=[];if(traditional===undefined){traditional=jQuery.ajaxSettings.traditional;}if(jQuery.isArray(a)||a.jquery){jQuery.each(a,function(){add(this.name,this.value);});}else{for(var prefix in a){buildParams(prefix,a[prefix]);}}return s.join("&").replace(r20,"+");function buildParams(prefix,obj){if(jQuery.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||/\[\]$/.test(prefix)){add(prefix,v);}else{buildParams(prefix+"["+(typeof v==="object"||jQuery.isArray(v)?i:"")+"]",v);}});}else{if(!traditional&&obj!=null&&typeof obj==="object"){jQuery.each(obj,function(k,v){buildParams(prefix+"["+k+"]",v);});}else{add(prefix,obj);}}}function add(key,value){value=jQuery.isFunction(value)?value():value;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value);}}});var elemdisplay={},rfxtypes=/toggle|show|hide/,rfxnum=/^([+-]=)?([\d+-.]+)(.*)$/,timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];jQuery.fn.extend({show:function(speed,callback){if(speed||speed===0){return this.animate(genFx("show",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");this[i].style.display=old||"";if(jQuery.css(this[i],"display")==="none"){var nodeName=this[i].nodeName,display;if(elemdisplay[nodeName]){display=elemdisplay[nodeName];}else{var elem=jQuery("<"+nodeName+" />").appendTo("body");display=elem.css("display");if(display==="none"){display="block";}elem.remove();elemdisplay[nodeName]=display;}jQuery.data(this[i],"olddisplay",display);}}for(var j=0,k=this.length;j<k;j++){this[j].style.display=jQuery.data(this[j],"olddisplay")||"";}return this;}},hide:function(speed,callback){if(speed||speed===0){return this.animate(genFx("hide",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");if(!old&&old!=="none"){jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"));}}for(var j=0,k=this.length;j<k;j++){this[j].style.display="none";}return this;}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var bool=typeof fn==="boolean";if(jQuery.isFunction(fn)&&jQuery.isFunction(fn2)){this._toggle.apply(this,arguments);}else{if(fn==null||bool){this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]();});}else{this.animate(genFx("toggle",3),fn,fn2);}}return this;},fadeTo:function(speed,to,callback){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);if(jQuery.isEmptyObject(prop)){return this.each(optall.complete);}return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType===1&&jQuery(this).is(":hidden"),self=this;for(p in prop){var name=p.replace(rdashAlpha,fcamelCase);if(p!==name){prop[name]=prop[p];delete prop[p];p=name;}if(prop[p]==="hide"&&hidden||prop[p]==="show"&&!hidden){return opt.complete.call(this);}if((p==="height"||p==="width")&&this.style){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}if(jQuery.isArray(prop[p])){(opt.specialEasing=opt.specialEasing||{})[p]=prop[p][1];prop[p]=prop[p][0];}}if(opt.overflow!=null){this.style.overflow="hidden";}opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(rfxtypes.test(val)){e[val==="toggle"?hidden?"show":"hide":val](prop);}else{var parts=rfxnum.exec(val),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!=="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1]){end=((parts[1]==="-="?-1:1)*end)+start;}e.custom(start,end,unit);}else{e.custom(start,val,"");}}});return true;});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue){this.queue([]);}this.each(function(){for(var i=timers.length-1;i>=0;i--){if(timers[i].elem===this){if(gotoEnd){timers[i](true);}timers.splice(i,1);}}});if(!gotoEnd){this.dequeue();}return this;}});jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback);};});jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&typeof speed==="object"?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue();}if(jQuery.isFunction(opt.old)){opt.old.call(this);}};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig){options.orig={};}}});jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this);}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block";}},cur:function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop];}var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;if(t()&&jQuery.timers.push(t)&&!timerId){timerId=setInterval(jQuery.fx.tick,13);}},show:function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now(),done=true;if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false;}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;var old=jQuery.data(this.elem,"olddisplay");this.elem.style.display=old?old:this.options.display;if(jQuery.css(this.elem,"display")==="none"){this.elem.style.display="block";}}if(this.options.hide){jQuery(this.elem).hide();}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.style(this.elem,p,this.options.orig[p]);}}this.options.complete.call(this.elem);}return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;var specialEasing=this.options.specialEasing&&this.options.specialEasing[this.prop];var defaultEasing=this.options.easing||(jQuery.easing.swing?"swing":"linear");this.pos=jQuery.easing[specialEasing||defaultEasing](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{tick:function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++){if(!timers[i]()){timers.splice(i--,1);}}if(!timers.length){jQuery.fx.stop();}},stop:function(){clearInterval(timerId);timerId=null;},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.style(fx.elem,"opacity",fx.now);},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null){fx.elem.style[fx.prop]=(fx.prop==="width"||fx.prop==="height"?Math.max(0,fx.now):fx.now)+fx.unit;}else{fx.elem[fx.prop]=fx.now;}}}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem;}).length;};}function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type;});return obj;}if("getBoundingClientRect" in document.documentElement){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);}var box=elem.getBoundingClientRect(),doc=elem.ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.support.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.support.boxModel&&docElem.scrollLeft||body.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 offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,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&&/^t(able|d|h)$/i.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.curCSS(body,"marginTop",true))||0,html="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";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);body=container=innerDiv=checkDiv=table=td=null;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.curCSS(body,"marginTop",true))||0;left+=parseFloat(jQuery.curCSS(body,"marginLeft",true))||0;}return{top:top,left:left};},setOffset:function(elem,options,i){if(/static/.test(jQuery.curCSS(elem,"position"))){elem.style.position="relative";}var curElem=jQuery(elem),curOffset=curElem.offset(),curTop=parseInt(jQuery.curCSS(elem,"top",true),10)||0,curLeft=parseInt(jQuery.curCSS(elem,"left",true),10)||0;if(jQuery.isFunction(options)){options=options.call(elem,i,curOffset);}var props={top:(options.top-curOffset.top)+curTop,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=/^body|html$/i.test(offsetParent[0].nodeName)?{top:0,left:0}:offsetParent.offset();offset.top-=parseFloat(jQuery.curCSS(elem,"marginTop",true))||0;offset.left-=parseFloat(jQuery.curCSS(elem,"marginLeft",true))||0;parentOffset.top+=parseFloat(jQuery.curCSS(offsetParent[0],"borderTopWidth",true))||0;parentOffset.left+=parseFloat(jQuery.curCSS(offsetParent[0],"borderLeftWidth",true))||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&&(!/^body|html$/i.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=this[0],win;if(!elem){return null;}if(val!==undefined){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;}});}else{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];}};});function getWindow(elem){return("scrollTo" in elem&&elem.document)?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(){return this[0]?jQuery.css(this[0],type,false,"padding"):null;};jQuery.fn["outer"+name]=function(margin){return this[0]?jQuery.css(this[0],type,false,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]()));});}return("scrollTo" in elem&&elem.document)?elem.document.compatMode==="CSS1Compat"&&elem.document.documentElement["client"+name]||elem.document.body["client"+name]:(elem.nodeType===9)?Math.max(elem.documentElement["client"+name],elem.body["scroll"+name],elem.documentElement["scroll"+name],elem.body["offset"+name],elem.documentElement["offset"+name]):size===undefined?jQuery.css(elem,type):this.css(type,typeof size==="string"?size:size+"px");};});window.jQuery=window.$=jQuery;})(window);

if(typeof SNI=="undefined"||!SNI){var SNI={};}SNI.Config={env:"prod",site:"TC",domain:"www.travelchannel.com",adServerUrl:"adsremote.scrippsnetworks.com",snapPlayListUrl:"",snapBinary:"",snapConfigs:"",autoSuggestContainer:"",autoSuggestService:"",omnitureMultiVariable:"prop14,eVar16,prop15,eVar18,prop16,eVar17,prop17,eVar19,prop18,prop19,eVar20,prop20",omnitureSingleVariable:"prop26",rsiKeyWord:"searchTerm",UR3:true,animationSpeed:250,navDropJsonPath:"",navHoverDelay:350,Community:{ur3Domain:"my.travelchannel.com"}};if(typeof(SNI.TC)==="undefined"){SNI.TC={};}if(typeof(SNI.Data)==="undefined"){SNI.Data={};}if(typeof(SNI.Data.fbMostLiked)==="undefined"){SNI.Data.fbMostLiked=[];}

if(typeof(SNI.Util)=="undefined"){SNI.Util={};}SNI.Util.inputField=function(elem,defaultText,preventDefault){var elem=$(elem);var preventDefault=preventDefault==null?"blank":preventDefault;var hintClass="input-hint";if(elem.length>0){var input=elem.get(0);if($(input).is("input[type=text]")){if($.trim(elem.val())===""){elem.val(defaultText);elem.addClass(hintClass);}elem.blur(function(){if($.trim(this.value)===""){this.value=defaultText;elem.addClass(hintClass);}});elem.focus(function(){if(this.value==defaultText){this.value="";}elem.removeClass(hintClass);});if(preventDefault===true||preventDefault=="blank"){form=$(elem.get(0).form);if(form){form.submit(function(event){if($.trim(elem.val())==defaultText||$.trim(elem.val())==""){if(preventDefault===true){event.preventDefault();elem.focus();}else{elem.val("");}}return true;});}}}}};SNI.Util.popup=function(url,w,h,menu){x=Math.floor((screen.width-w)/2);y=Math.floor((screen.height-h)/2);now=new Date();features="screenx="+x+",screeny="+y+",left="+x+",top="+y+",width="+w+",height="+h+",location=no,resizable=yes"+",directories=no,status=no,scrollbars=yes";if(menu!=null){features+=",menubar=yes,toolbar=yes";}else{features+=",menubar=no,toolbar=no";}window.open(url,"newwin",features);};SNI.Util.getUrlParam=function(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null){return"";}else{return results[1];}};SNI.Util.truncate=function(str,length,truncation){length=length||30;truncation=truncation==undefined?"...":truncation;return str.length>length?str.slice(0,length-truncation.length)+truncation:str;};SNI.Util.ImageEnlarge={init:function(element,config){config=$.extend({clickCtrl:"a.img-enlarge",insertPoint:element,imgFrame:"#blow-up",closeCtrl:"#blow-up a.close",closeCtrlBtn:"#blow-up a.close-btn"},config);$(config.clickCtrl).click(function(){$(config.insertPoint).prepend(SNI.Util.ImageEnlarge.htmlImage(this.href));$(config.closeCtrl).click(SNI.Util.ImageEnlarge.closeImg);$(config.closeCtrlBtn).click(SNI.Util.ImageEnlarge.closeImg);return false;});},htmlImage:function(imgURL){retHTML="<div id='blow-up' class='clrfix'><div class=\"flyout fxlg\"><div class=\"fly-hd\"></div>";retHTML+='<div class="fly-bd"><a class="close" href="#"></a><img width=\'616\' src=\''+imgURL+"'>";retHTML+='<p class="blow-up-btn clrfix"><a href="#" class="button close-btn"><span>Close</span></a></p>';if((typeof pgalurl)!="undefined"){retHTML+="<span class='pgal-link'>or <a href='"+pgalurl+"'>Go to Photo Gallery</a></span>";}retHTML+='</div><div class="fly-ft"></div></div></div>';return retHTML;},closeImg:function(e){$(this).parents().find("#blow-up").remove();return false;}};SNI.Util.cloneObject=function(obj){var newObj=(obj instanceof Array)?[]:{};for(var i in obj){if(obj[i]&&typeof obj[i]=="object"){newObj[i]=SNI.Util.cloneObject(obj[i]);}else{newObj[i]=obj[i];}}return newObj;};SNI.Util.mergeObjects=function(trg,src){var lastArg=arguments[arguments.length-1];var deep=arguments.length>2&&typeof(lastArg)=="boolean"?lastArg:false;var result=SNI.Util.cloneObject(trg);if(typeof(src)!="object"||src==null){return result;}for(prop in src){if(typeof(trg[prop])=="undefined"||trg[prop].constructor==Array||typeof(trg[prop])!="object"||!deep){result[prop]=src[prop];continue;}result[prop]=SNI.Util.mergeObjects(trg[prop],src[prop],deep);}return result;};SNI.Util.Cookie={SEARCH:"S",UI:"U",get:function(name){var nameEQ=name+"=";var ca=document.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" "){c=c.substring(1,c.length);}if(c.indexOf(nameEQ)===0){return c.substring(nameEQ.length,c.length);}}return null;},set:function(name,value,days,path){var expires="";if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toGMTString();}if(!path){path="/";}document.cookie=name+"="+value+expires+"; path="+path;},remove:function(name){this.set(name,"",-1);},persist:function(cookieName,key,value,days){var cookie=this.get(cookieName);days=days||30;if(typeof value=="undefined"){if(cookie==null){return null;}else{var values=this.getPersistValues(cookie);return values[key];}}else{if(cookie==null){var values={};values[key]=value;}else{var values=this.getPersistValues(cookie);values[key]=value;}this.set(cookieName,this.buildPersistString(values),days);}},getPersistValues:function(cookie){var values={};var temp="";$.each(cookie.split("&"),function(k,v){temp=v.split("=");if(temp[0]){values[temp[0]]=unescape(temp[1]);}});return values;},buildPersistString:function(values){var result=[];$.each(values,function(k,v){if(v!=null){result.push(k+"="+escape(v));}});return result.join("&");}};SNI.Util.LazyLoad=function(img_element,src){if(img_element.attr("src")){return;}var image_src=src||img_element.attr("data-src");img_element.attr("src",image_src);return img_element;};SNI.Util.Url={setParameter:function(url,param,val){var curPairs;var paramPair;var hashString="";if(url.indexOf("#")>-1){hashString=url.substr(url.indexOf("#")+1);url=url.substring(0,url.indexOf("#"));}var allPairs=[];var urlParts=url.split("?");if(urlParts.length>1){curPairs=urlParts[1].split("&");jQuery(curPairs).each(function(index){var paramPair=this;var paramParts=paramPair.split("=");if(paramParts[0]!=param){allPairs.push(paramParts[0]+"="+(typeof paramParts[1]!="undefined"?paramParts[1]:""));}});}if(val!==null&&typeof val!=="undefined"){allPairs.push(param+"="+val);}return urlParts[0]+"?"+allPairs.join("&")+(hashString?"#"+hashString:"");},getParameter:function(url,param){var i,urlParts,curPairs,paramParts;if(url.indexOf("#")>-1){url=url.substring(0,url.indexOf("#"));}urlParts=url.split("?");if(urlParts.length>1){curPairs=urlParts[1].split("&");for(i=0;i<curPairs.length;i++){var paramPair=curPairs[i];paramParts=paramPair.split("=");if(paramParts[0]===param){return paramParts[1];}}}return null;},getHash:function(url){if(url.indexOf("#")>-1){return url.substring(url.indexOf("#")+1);}return"";}};SNI.MetaData={};SNI.MetaData.Parameter=function(){var parameters={};this.addParameter=function(key,value){key=key.toUpperCase();if(!parameters[key]){parameters[key]=[];}parameters[key].push(value);};this.getParameter=function(key,separator){key=key.toUpperCase();if(!parameters[key]){return;}return parameters[key].join(separator);};this.getParameterArray=function(key){key=key.toUpperCase();if(!parameters[key]){return;}return parameters[key][0];};this.getKeys=function(){return parameters;};this.setParameter=function(key,value){key=key.toUpperCase();parameters[key]=[];parameters[key].push(value);};};SNI.MetaData.Manager=function(){var m=new SNI.MetaData.Parameter();this.addParameter=m.addParameter;this.getParameter=m.getParameter;this.getParameterArray=m.getParameterArray;this.getKeys=m.getKeys;this.setParameter=m.setParameter;this.getParameterString=function(key){var s=this.getParameter(key," ");if(s==null){s="";}return s;};this.getPageType=function(){return this.getParameterString("Type");};this.getPageTitle=function(){return this.getParameterString("Title");};this.getSite=function(){return this.getParameterString("Site");};this.getSctnId=function(){return this.getParameterString("SctnId");};this.getSctnName=function(){return this.getParameterString("SctnName");};this.getSponsorship=function(){return this.getParameterString("Sponsorship");};this.getAbstract=function(){return this.getParameterString("Abstract");};this.getKeywords=function(){return this.getParameterString("Keywords");};this.getClassification=function(){return this.getParameterString("Classification");};this.getSctnDspName=function(){return this.getParameterString("SctnDspName");};this.getCategoryDspName=function(){return this.getParameterString("CategoryDspName");};this.getShowAbbr=function(){return this.getParameterString("Show_Abbr");};this.getRole=function(){return this.getParameterString("Role");};this.getDetailId=function(){return this.getParameterString("DetailId");};this.getPageNumber=function(){return this.getParameterString("PageNumber");};this.getUniqueId=function(){return this.getParameterString("UniqueId");};this.getUserId=function(){return this.getParameterString("UserId");};this.getUserIdEmail=function(){return this.getParameterString("UserIdEmail");};this.getUserIdCreateDt=function(){return this.getParameterString("UserIdCreateDt");};this.getUserIdVersion=function(){return this.getParameterString("UserIdVersion");};this.getFilters=function(){return this.getParameterString("Filters");};this.getMultimediaFlag=function(){return this.getParameterString("MultimediaFlag");};this.getChefName=function(){return this.getParameterString("ChefName");};this.getMealPart=function(){return this.getParameterString("MealPart");};this.getCuisine=function(){return this.getParameterString("Cuisine");};this.getOccasion=function(){return this.getParameterString("Occasion"," ");};this.getMainIngredient=function(){return this.getParameterString("MainIngredient");};this.getTechnique=function(){return this.getParameterString("Technique"," ");};this.getDish=function(){return this.getParameterString("Dish"," ");};this.getMealType=function(){return this.getParameterString("MealType"," ");};this.getNutrition=function(){return this.getParameterString("Nutrition"," ");};this.getDifficulty=function(){return this.getParameterString("Difficulty"," ");};this.getSearchTerm=function(){var args=parseQueryString();for(var arg in args){var s=arg.toUpperCase();if(s=="SEARCHSTRING"){return args[arg];}}return"";};this.setMultimediaFlag=function(flag){if(flag!=null){this.addParameter("MultimediaFlag",flag);}else{this.addParameter("MultimediaFlag","");}};this.parseQueryString=function(str){str=str?str:document.location.search;var query=str.charAt(0)=="?"?str.substring(1):str;var args={};if(query){var fields=query.split("&");for(var f=0;f<fields.length;f++){var field=fields[f].split("=");args[unescape(field[0].replace(/\+/g," "))]=unescape(field[1].replace(/\+/g," "));}}return args;};};var MetaDataManager=SNI.MetaData.Manager;if(typeof(SNI.Ads)=="undefined"){SNI.Ads={_adServerHostname:SNI.Config.adServerUrl};}SNI.Ads.Url=function(){var p=new SNI.MetaData.Parameter();this.addParameter=p.addParameter;this.getParameter=p.getParameter;this.getKeys=p.getKeys;this.url="";this.buildUrl=buildUrl;this.buildExpandedUrl=buildExpandedUrl;this.setUrl=setUrl;this.getUrl=getUrl;this.buildQueryStringValuePairs=buildQueryStringValuePairs;this.buildExpandedQueryStringValuePairs=buildExpandedQueryStringValuePairs;function setUrl(u){this.url=u;}function getUrl(){return this.url;}function buildQueryStringValuePairs(){var queryString="";for(key in this.getKeys()){if(queryString!==""){queryString+="&";}queryString+=key+"="+this.getParameter(key,",");}return queryString;}function buildUrl(){return this.getUrl()+this.buildQueryStringValuePairs();}function buildExpandedQueryStringValuePairs(){var queryString="";for(key in this.getKeys()){var item=this.getParameter(key,",");var iArray=item.split(",");for(i=0;i<iArray.length;i++){if(queryString!==""&&iArray[i]!==""&&iArray[i]!==undefined){queryString+="&";}if(iArray[i]!==""&&iArray[i]!==undefined){queryString+=key+"="+iArray[i];}}}return queryString;}function buildExpandedUrl(){var sJitterbug="";if(window.location.hostname.indexOf("jitterbug")!=(-1)){sJitterbug="&domain=jitterbug";}var sRSI="";if((SNI.Ads.UseRSI)&&(segQS.length>0)){sRSI=segQS;}return this.getUrl()+this.buildExpandedQueryStringValuePairs()+sJitterbug+sRSI;}};Ad.prototype=new SNI.Ads.Url();function Ad(){var url=new SNI.Ads.Url();this.addParameter=url.addParameter;this.getParameter=url.getParameter;this.getKeys=url.getKeys;this.buildUrl=url.buildUrl;this.buildExpandedUrl=url.buildExpandedUrl;var feature=new SNI.MetaData.Parameter();this.useFeature=useFeature;this.getFeature=getFeature;this.debug=debug;this.write=write;this.deferrable=1;function useFeature(key){feature.addParameter(key,"T");}function getFeature(key){return feature.getParameter(key,",");}function debug(){document.write('<div style="background:red;color:white;">'+this.buildExpandedUrl()+"</div>");}function write(){}}DartAd.prototype=new Ad();function DartAd(){DartAd.prototype=new Ad();this.write=write;this.useFeature("site");this.useFeature("category");this.useFeature("vgncontent");this.useFeature("ord");this.useFeature("topic");this.useFeature("tile");this.useFeature("pagetype");this.useFeature("SECTION_ID");this.useFeature("SUBSECTION");this.useFeature("page");this.useFeature("uniqueid");this.useFeature("adkey1");this.useFeature("adkey2");this.useFeature("chef");this.useFeature("show");this.useFeature("delvfrmt");this.useFeature("source");this.useFeature("filter");this.useFeature("difficulty");this.useFeature("keyword");this.useFeature("ingredient");this.useFeature("occasion");this.useFeature("mealpart");this.useFeature("technique");this.adClass="AD_CLASS";function write(){if(navigator.userAgent.indexOf("#sni-loadtest#")!==-1){return;}document.write('<script type="text/javascript" src="'+this.buildExpandedUrl()+'"><\/script>');}}AdUrl.prototype=new Ad();function AdUrl(){AdUrl.prototype=new Ad();this.write=write;this.useFeature("site");this.useFeature("category");this.useFeature("vgncontent");this.useFeature("ord");this.useFeature("topic");this.useFeature("tile");this.useFeature("pagetype");this.useFeature("SECTION_ID");this.useFeature("SUBSECTION");this.useFeature("page");this.useFeature("uniqueid");this.useFeature("SearchKeywords");this.useFeature("SearchFilters");this.useFeature("adkey1");this.useFeature("adkey2");this.useFeature("chef");this.useFeature("show");this.useFeature("delvfrmt");this.useFeature("source");this.useFeature("filter");this.useFeature("difficulty");this.useFeature("keyword");this.useFeature("ingredient");this.useFeature("occasion");this.useFeature("mealpart");this.useFeature("technique");function write(){}}DartAdvanceAd.prototype=new DartAd();function DartAdvanceAd(){DartAdvanceAd.prototype=new DartAd();this.write=write;this.align="";this.frameborder=0;this.height="";this.longdesc="";this.marginheight=0;this.marginwidth=0;this.name="";this.scrolling="no";this.width="100%";this.useIframe=false;function write(){if(navigator.userAgent.indexOf("#sni-loadtest#")!==-1){return;}if(this.useIframe==false){this.setUrl("http://"+SNI.Ads._adServerHostname+"/js.ng/");document.write('<script type="text/javascript" src="'+this.buildExpandedUrl()+'"><\/script>');}else{this.setUrl("http://"+SNI.Ads._adServerHostname+"/html.ng/");document.write('<iframe src ="'+this.buildExpandedUrl()+'" align ="'+this.align+'" frameborder ="'+this.frameborder+'" height ="'+this.height+'" longdesc ="'+this.longdesc+'" marginheight ="'+this.marginheight+'" marginwidth ="'+this.marginwidth+'" name ="'+this.name+'" scrolling ="'+this.scrolling+'" width ="'+this.width+'"></iframe>');}}}function AdManager(){var p=new SNI.MetaData.Parameter();this.addParameter=p.addParameter;this.getParameter=p.getParameter;this.setParameter=p.setParameter;this.getKeys=p.getKeys;this.createAd=createAd;this.createDeferredAd=createDeferredAd;this.moveAds=moveAds;this.ads=[];this.defer=false;if(document.deferAds!==null&&document.deferAds==1&&document.deferEnabled!==null&&document.deferEnabled==1){this.defer=true;}function createAd(ad){for(key in this.getKeys()){if(ad.getFeature(key)!==undefined){ad.addParameter(key,this.getParameter(key,","));}}if(document.debug==1){ad.debug();}ad.write();}function createDeferredAd(i){}function moveAds(){}}function AdRestriction(){var p=new SNI.MetaData.Parameter();this.addParameter=p.addParameter;this.getParameter=p.getParameter;this.getKeys=p.getKeys;this.isActive=true;this.isIframe=false;}function AdDefault(){var p=new SNI.MetaData.Parameter();this.addParameter=p.addParameter;this.getParameter=p.getParameter;this.getKeys=p.getKeys;this.display=false;}function AdRestrictionManager(){this.restriction=[];this.adDefaults=[];this.isActive=isActive;this.isIframe=isIframe;this.isMatch=isMatch;this.startMatch=startMatch;function isActive(ad,mdm){var value=false;var adDefaultMatch=false;var defaultReturnValue=true;for(var i=0;i<this.adDefaults.length;i++){adDefaultMatch=this.startMatch(ad,mdm,this.adDefaults[i]);if(adDefaultMatch==true){defaultReturnValue=this.adDefaults[i].display;break;}}for(var i=0;i<this.restriction.length;i++){adRestriction=this.restriction[i];if(!adRestriction.isActive){value=this.startMatch(ad,mdm,adRestriction);}if(value==true){return !defaultReturnValue;}}return defaultReturnValue;}function isIframe(ad,mdm){var value=false;for(var i=0;i<this.restriction.length;i++){adRestriction=this.restriction[i];if(adRestriction.isIframe){value=this.startMatch(ad,mdm,adRestriction);}}return value;}function startMatch(ad,mdm,adRestriction){var match=true;for(var key in adRestriction.getKeys()){var restrictions=adRestriction.getParameter(key,",");var value=mdm.getParameter(key,"----");match=this.isMatch(value,restrictions);if(!match){value=ad.getParameter(key,"----");match=this.isMatch(value,restrictions);}if(!match){return false;}}return match;}function isMatch(value,restrictions){var match=false;if(value){splitValue=value.split("----");for(var x=0;x<splitValue.length;x++){if(restrictions==splitValue[x]){match=true;}for(var a;a<restrictions.length;a++){if(splitValue[x]==restrictions[a]){return true;}}}}return match;}}function initAdManager(adm,mdm){function admAppendParam(key,val){if(val!=""){val=val.replace(/-/g,"_");val=val.replace(/ /g,"_");s=val.split(",",1);adm.addParameter(key,s);}}var ranNum=String(Math.round(Math.random()*10000000000));var now=new Date();var ad_ord=now.getTime()%10000000000;var amPageType=mdm.getPageType();var amSponsorship=mdm.getSponsorship();var amKeywords=mdm.getKeywords();amPageType=amPageType.replace(/-/g,"_");var amUniqueId=mdm.getUniqueId();amUniqueId=amUniqueId.replace(/-/g,"_");if(amSponsorship!==""&&amSponsorship!==undefined){amSponsorship=amSponsorship.replace(/-/g,"_");amSponsorship=amSponsorship.replace(/ /g,"_");}if(amKeywords!==""&&amKeywords!==undefined){amKeywords=amKeywords.replace(/,/g,"_");}amSctns=mdm.getClassification();amSctns=amSctns.split(",");if(amSctns.length>1){for(var i=0;i<amSctns.length;i++){if(i==(amSctns.length-1)){adm.addParameter("sitesection",amSctns[i]);}else{if(i==(amSctns.length-2)){adm.addParameter("category",amSctns[i]);}else{if(i==(amSctns.length-3)){adm.addParameter("vgncontent",amSctns[i]);}else{adm.addParameter("SUBSECTION",amSctns[i]);}}}}}else{var c=mdm.getClassification();adm.addParameter("category",c);}if(amPageType=="SECTION"){if(!adm.getParameter("vgncontent"," ")){adm.addParameter("page","MAIN");}}var s=mdm.getSite();adm.addParameter("site",s);var gsId=mdm.getSctnId();adm.addParameter("tile",ranNum+gsId);adm.addParameter("ord",ad_ord);adm.addParameter("topic",amSponsorship);adm.addParameter("keywords",amKeywords);adm.addParameter("pagetype",amPageType);adm.addParameter("uniqueid",amUniqueId);var sId=mdm.getSctnId();adm.addParameter("SECTION_ID",sId);admAppendParam("adkey1",mdm.getParameterString("AdKey1").toUpperCase());admAppendParam("adkey2",mdm.getParameterString("AdKey2").toUpperCase());admAppendParam("delvfrmt",mdm.getParameterString("DelvFrmt"));admAppendParam("source",mdm.getParameterString("Source"));admAppendParam("filter",mdm.getParameterString("filter"));admAppendParam("chef",mdm.getParameterString("ChefName"));admAppendParam("show",mdm.getParameterString("Show_Abbr"));admAppendParam("difficulty",mdm.getParameterString("Difficulty"));admAppendParam("keyword",mdm.getParameterString("keyword"));admAppendParam("ingredient",mdm.getParameterString("MainIngredient"));admAppendParam("occasion",mdm.getParameterString("Occasion"));admAppendParam("mealpart",mdm.getParameterString("MealPart"));admAppendParam("technique",mdm.getParameterString("Technique"));}if(typeof(SNI)=="undefined"){SNI={};}if(typeof(SNI.RSI)=="undefined"){SNI.RSI={};}var segQS="";SNI.RSI.rdcookie=function(){var rsi_segs=[];var segs_beg=document.cookie.indexOf("rsi_segs=");if(segs_beg>=0){segs_beg=document.cookie.indexOf("=",segs_beg)+1;if(segs_beg>0){var segs_end=document.cookie.indexOf(";",segs_beg);if(segs_end==-1){segs_end=document.cookie.length;}rsi_segs=document.cookie.substring(segs_beg,segs_end).split("|");}}var segLen=20;if(rsi_segs.length<segLen){segLen=rsi_segs.length;}for(var i=0;i<segLen;i++){segQS+=("&rsi"+"="+rsi_segs[i]);}SNI.Ads.UseRSI=true;return;};SNI.RSI.rdcookie();SNI.RSI.setvars=function(){A09802.DM_cat(mdManager.getParameter("Classification").split(",").reverse().join(" > "));A09802.DM_addEncToLoc("keyword",mdManager.getParameter(SNI.Config.rsiKeyWord));A09802.DM_tag();};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/,"");};if(typeof(SNI.UR)=="undefined"){SNI.UR={};}var userIdCookieUserId;var userIdEmail;var userIdCookieCreateDt;var userIdCookieVersion;SNI.UR.IdCookie=function(){this.id="";this.email="";this.createDate=new Date();this.version="2.0";this.domain=getPrimaryDomain();this.secure="";this.path="/";this.cookieName="userIdCookie";this.expirationDate=new Date(new Date().getTime()+(10000*1000*60*60*24));function getCookieKeyValue(cookie_value,key,delimeter){if(cookie_value!=null){var keystring=key+delimeter;var thiscookie_start=cookie_value.indexOf(keystring)+keystring.length;var thiscookie_end=cookie_value.indexOf(delimeter,thiscookie_start);var keyvalue=cookie_value.substring(thiscookie_start,thiscookie_end);return keyvalue;}return null;}function getPrimaryDomain(){var theUrl=document.domain;var urlLength=theUrl.length;var firstDot=theUrl.lastIndexOf(".");var secondDot=theUrl.lastIndexOf(".",firstDot-1);var primaryDomain=theUrl.substr(secondDot);return primaryDomain;}function getRandNumber(numDigits){var randNum="";var thisDigit="";for(var i=0;i<numDigits;i++){thisDigit=Math.floor(Math.random()*10);randNum=randNum+thisDigit;}return randNum;}function setGlobalValues(){userIdCookieUserId=this.id;userIdEmail=this.email;userIdCookieCreateDt=this.createDate;userIdCookieVersion=this.version;}this.createCookie=function(cookies,user){var updtCookie=false;if(cookies["userIdCookie"]!=undefined){this.id=getCookieKeyValue(cookies["userIdCookie"],"userId","ZZ");this.email=getCookieKeyValue(cookies["userIdCookie"],"email","ZZ");this.createDate=getCookieKeyValue(cookies["userIdCookie"],"createDate","ZZ");this.version=getCookieKeyValue(cookies["userIdCookie"],"cookieVersion","ZZ");}if(user.isLoggedIn){if(this.id!=user.getUserId()){this.id=user.getUserId();updtCookie=true;}if(this.email!=user.getEmail()){this.email=user.getEmail();updtCookie=true;}}if(this.id==""){this.id=getRandNumber(10);updtCookie=true;}setGlobalValues();if(updtCookie){this.writeCookie();}};this.writeCookie=function(){var cookieValue="userIdZZ"+this.id+"ZZemailZZ"+this.email+"ZZcreateDateZZ"+this.createDate+"ZZcookieVersionZZ"+this.version+"ZZ";document.cookie=this.cookieName+"="+escape(cookieValue)+((this.expirationDate)?";expires="+this.expirationDate.toGMTString():"")+((this.path)?";path="+this.path:"")+((this.domain)?";domain="+this.domain:"")+((this.secure)?";secure=":"");};};SNI.UR.ApplicationConfig=function(){this.applicationName="";this.applicationCode="";this.applicationEntryPage="";this.applicationPath="";this.loginServer={"DEV":"","STAGE":"","PROD":""};this.requiredRoles=[];this.requiresLogin=false;this.getLoginServer=function(env){if(this.loginServer[env]){return this.loginServer[env];}return null;};this.addRole=function(role){this.requiredRoles.push(role);};this.urVersion=function(){return 1;};};SNI.UR.ApplicationRole=function(name,date){this.name=name;this.date=date;};UrCookie=SNI.UR.UrCookie=function(){this.info=[];this.clear=this.clearInfo=function(){for(var i=0;i<this.info.length;i++){delete this.info[i];}this.info=[];};this.parse=this.parseCookie=function(cookie){var cookieArray=cookie.split("|");for(var i=0;i<cookieArray.length;i++){var chips=cookieArray[i].split(":");this.info[chips[0]]=chips[1];}};};SNI.UR.ValueCookie=function(){this.info=new SNI.UR.UrCookie();this.clear=this.clearInfo=this.info.clear;this.parse=this.parseCookie=this.info.parse;this.getEmail=function(){return this.info["email"];};this.getBirthYear=function(){return this.info["birth_year"];};this.getCity=function(){return this.info["city"];};this.getConfirm=function(){return this.info["confirm"];};this.getFirstName=function(){return this.info["first_name"];};this.getGender=function(){return this.info["gender"];};this.getLastName=function(){return this.info["last_name"];};this.getParentEmail=function(){return this.info["parent_email"];};this.getPersist=function(){return this.info["persist"];};this.getPhone=function(){return this.info["phone"];};this.getPostalCode=function(){return this.info["postal_code"];};this.getStatus=function(){return this.info["status"];};this.getTransComplete=function(){return this.info["transcomplete"];};this.getUserId=function(){return this.info["user_id"];};this.getUserName=function(){return this.info["user_name"];};this.getUserType=function(){return this.info["usertype"];};};SNI.UR.RoleCookie=function(){this.info=new SNI.UR.UrCookie();this.clear=this.clearInfo=this.info.clear;this.parse=this.parseCookie=this.info.parse;this.getRoleByName=function(name){return this.info[name];};};SNI.UR.UrLite=function(){function getPrimaryDomain(){var theUrl=document.domain;var urlLength=theUrl.length;var firstDot=theUrl.lastIndexOf(".");var secondDot=theUrl.lastIndexOf(".",firstDot-1);var primaryDomain=theUrl.substr(secondDot);return primaryDomain;}this.login=function(urUser,applicationConfig){var cookies=this.loadCookies();if(cookies["value"]){urUser.vignetteValueCookie.parse(cookies["value"]);}if(cookies["UserLoginCookie"]){urUser.valueCookie.parse(cookies["UserLoginCookie"]);}if(urUser.getUserId()==null||urUser.getUserId()<0){if(applicationConfig.requiresLogin==true){writeIdCookie(cookies,urUser);this.redirectToUr(urUser,applicationConfig);}}else{urUser.isLoggedIn=true;}this.writeIdCookie(cookies,urUser);if(cookies["UserRoleCookie"]){urUser.roleCookie.parse(cookies["UserRoleCookie"]);}if(cookies["role"]){urUser.vignetteRoleCookie.parse(cookies["role"]);}if(applicationConfig.requiredRoles!=null&&applicationConfig.requiredRoles.length>0&&applicationConfig.requiresLogin==true){for(var i=0;i<applicationConfig.requiredRoles.length;i++){if(urUser.hasRoleByName(applicationConfig.requiredRoles[i])==false){this.redirectToUr(urUser,applicationConfig);}}}};this.logout=function(urUser,applicationConfig){var domain=getPrimaryDomain();this.deleteLoginCookie("value","/",domain);this.deleteLoginCookie("role","/",domain);this.deleteLoginCookie("userLoginCookie","/",domain);this.deleteLoginCookie("userRoleCookie","/",domain);urUser.valueCookie.clear();urUser.roleCookie.clear();urUser.vignetteValueCookie.clear();urUser.vignetteRoleCookie.clear();urUser.isLoggedIn=false;};this.deleteLoginCookie=function(name,path,domain){document.cookie=name+"="+"; path="+path+"; domain="+domain+"; expires=Thu, 01-Jan-70 00:00:01 GMT";};this.getEnvironment=function(){switch(document.location.hostname){case"localhost":case"127.0.0.1":case"vdev2.scrippsnetworks.com":return"DEV";case"staging.scrippsweb.com":return"STAGE";default:return"PROD";}};this.redirectToUr=function(urUser,applicationConfig){window.location=this.getLoginPath(applicationConfig);};this.getLoginPath=function(applicationConfig){var loginPath;if(applicationConfig.urVersion()=="1"){loginPath=applicationConfig.loginServer[this.getEnvironment()]+applicationConfig.applicationPath+"?a=fflogin&url="+escape(applicationConfig.applicationEntryPage)+"&an="+escape(applicationConfig.applicationName)+"&ac="+escape(applicationConfig.applicationCode);}else{loginPath=applicationConfig.loginServer[this.getEnvironment()]+applicationConfig.applicationPath+"urValidation.html?applicationId="+applicationConfig.applicationCode;}return loginPath;};this.loadCookies=function(){var cookies=[];if(document.cookie!=""){var cookieArray=document.cookie.split(";");for(var i=0;i<cookieArray.length;i++){var cookiesValues=cookieArray[i].split("=");cookies[cookiesValues[0].trim()]=cookiesValues[1];}}return cookies;};this.writeIdCookie=function(cookies,user){var id=new SNI.UR.IdCookie();id.createCookie(cookies,user);};};SNI.UR.UrUser=function(appConfig){this.valueCookie=new SNI.UR.ValueCookie();this.roleCookie=new SNI.UR.RoleCookie();this.vignetteValueCookie=new VignetteValueCookie();this.vignetteRoleCookie=new VignetteRoleCookie();this.applicationConfig=appConfig;this.urLite=new SNI.UR.UrLite();this.isLoggedIn=false;this.getAvatar=function(){if(this.vignetteValueCookie.getAvatar()!=null){return this.vignetteValueCookie.getAvatar();}};this.getBirthYear=function(){if(this.valueCookie.getBirthYear()!=null){return this.valueCookie.getBirthYear();}if(this.vignetteValueCookie.getBirthYear()!=null){return this.vignetteValueCookie.getBirthYear();}};this.getCity=function(){if(this.valueCookie.getCity()!=null){return this.valueCookie.getCity();}if(this.vignetteValueCookie.getCity()!=null){return this.vignetteValueCookie.getCity();}};this.getConfirm=function(){if(this.valueCookie.getConfirm()!=null){return this.valueCookie.getConfirm();}if(this.vignetteValueCookie.getConfirm()!=null){return this.vignetteValueCookie.getConfirm();}};this.getEmail=function(){if(this.valueCookie.getEmail()!=null){return this.valueCookie.getEmail();}if(this.vignetteValueCookie.getEmail()!=null){return this.vignetteValueCookie.getEmail();}};this.getFirstName=function(){if(this.valueCookie.getFirstName()!=null){return this.valueCookie.getFirstName();}if(this.vignetteValueCookie.getFirstName()!=null){return this.vignetteValueCookie.getFirstName();}};this.getFullName=function(){return this.getFirstName()+" "+this.getLastName();};this.getGender=function(){if(this.valueCookie.getGender()!=null){return this.valueCookie.getGender();}if(this.vignetteValueCookie.getGender()!=null){return this.vignetteValueCookie.getGender();}};this.getLastName=function(){if(this.valueCookie.getLastName()!=null){return this.valueCookie.getLastName();}if(this.vignetteValueCookie.getLastName()!=null){return this.vignetteValueCookie.getLastName();}};this.getParentEmail=function(){if(this.valueCookie.getParentEmail()!=null){return this.valueCookie.getParentEmail();}if(this.vignetteValueCookie.getParentEmail()!=null){return this.vignetteValueCookie.getParentEmail();}};this.getPersist=function(){if(this.valueCookie.getPersist()!=null){return this.valueCookie.getPersist();}if(this.vignetteValueCookie.getPersist()!=null){return this.vignetteValueCookie.getPersist();}};this.getPhone=function(){if(this.valueCookie.getPhone()!=null){return this.valueCookie.getPhone();}if(this.vignetteValueCookie.getPhone()!=null){return this.vignetteValueCookie.getPhone();}};this.getPostalCode=function(){if(this.valueCookie.getPostalCode()!=null){return this.valueCookie.getPostalCode();}if(this.vignetteValueCookie.getPostalCode()!=null){return this.vignetteValueCookie.getPostalCode();}};this.getStatus=function(){if(this.valueCookie.getStatus()!=null){return this.valueCookie.getStatus();}if(this.vignetteValueCookie.getStatus()!=null){return this.vignetteValueCookie.getStatus();}};this.getTransComplete=function(){if(this.valueCookie.getTransComplete()!=null){return this.valueCookie.getTransComplete();}if(this.vignetteValueCookie.getTransComplete()!=null){return this.vignetteValueCookie.getTransComplete();}};this.getUserId=function(){if(this.valueCookie.getUserId()!=null){return this.valueCookie.getUserId();}if(this.vignetteValueCookie.getUserId()!=null){return this.vignetteValueCookie.getUserId();}};this.getUserName=function(){if(this.valueCookie.getUserName()!=null){return this.valueCookie.getUserName();}if(this.vignetteValueCookie.getUserName()!=null){return this.vignetteValueCookie.getUserName();}};this.getUserType=function(){if(this.valueCookie.getUserId()!=null){return this.valueCookie.getUserId();}if(this.vignetteValueCookie.getUserType()!=null){return this.vignetteValueCookie.getUserType();}};this.hasRole=function(role){if(this.roleCookie.getRoleByName(role.name)!=null){if(this.roleCookie.getRoleByName(role.name)>=role.date){return true;}return false;}if(this.vignetteRoleCookie.getRoleByName(role.name)!=null){return true;}return false;};this.hasRoleById=function(roleId){if(this.vignetteRoleCookie.getRoleById(roleId)!=null){return true;}return false;};this.logout=function(){if(this.isLoggedIn){this.urLite.logout(this,this.applicationConfig);}};this.urLite.login(this,appConfig);};SNI.UR.VignetteCookie=function(){this.info=[];this.parse=parseCookie;this.parseCookie=parseCookie;this.parseSingleValueChip=parseSingleValueChip;this.parseMultiValueChip=parseMultiValueChip;this.cookieName="";this.cookiePath="/";this.cookieDomain="";this.clear=clearInfo;function clearInfo(){for(var i=0;i<this.info.length;i++){delete this.info[i];}this.info=[];}function stripHeader(string){return string.substring(23);}function stripTrailer(string){return string.substring(0,string.length-3);}function parseCookie(cookie){cookie=stripHeader(cookie);cookie=stripTrailer(cookie);var cookieArray=cookie.split("ZZ%");for(var i=0;i<cookieArray.length;++i){chip=cookieArray[i];chip=chip.substring(6);if(chip.substring(0,1)=="s"){chip=chip.substring(1);}else{chip=chip.substring(3);}if(chip.match("\\+")=="+"){this.parseMultiValueChip(chip);}else{this.parseSingleValueChip(chip);}}}function parseSingleValueChip(chip){chip=URLDecode(chip);var values=chip.split("ZZ");if(values.length<2){this.info[values[0]]="";}else{this.info[values[0]]=values[1];}}function parseMultiValueChip(chip){var multivalue=[];chip=URLDecode(chip);var key=chip.split("ZZ")[0];chip=chip.substring(key.length);chip=chip.replace(/ZZZZ/g,"ZZ");var chips=chip.split("+");for(var i=0;i<chips.length;++i){part=chips[i];var parts=part.split("ZZ");multivalue[parts[1]]=parts[2];}this.info[key]=multivalue;}function URLDecode(encodedString){var output=encodedString;var binVal,thisString;var myregexp=/(%.{2})/;while((match=myregexp.exec(output))!=null&&match.length>1&&match[1]!=""){binVal=parseInt(match[1].substr(1),16);thisString=String.fromCharCode(binVal);output=output.replace(match[1],thisString);}return output;}};VignetteValueCookie.prototype=new SNI.UR.VignetteCookie();function VignetteValueCookie(){VignetteValueCookie.prototype=new SNI.UR.VignetteCookie();this.getEmail=function(){return this.info["email"];};this.getBirthYear=function(){return this.info["birth_year"];};this.getCity=function(){return this.info["city"];};this.getConfirm=function(){return this.info["confirm"];};this.getFirstName=function(){return this.info["first_name"];};this.getGender=function(){return this.info["gender"];};this.getLastName=function(){return this.info["last_name"];};this.getParentEmail=function(){return this.info["parent_email"];};this.getPersist=function(){return this.info["persist"];};this.getPhone=function(){return this.info["phone"];};this.getPostalCode=function(){return this.info["postal_code"];};this.getStatus=function(){return this.info["status"];};this.getTransComplete=function(){return this.info["transcomplete"];};this.getUserId=function(){return this.info["user_id"];};this.getUserName=function(){return this.info["user_name"];};this.getUserType=function(){return this.info["usertype"];};this.getAvatar=function(){return this.info["my_photo"];};}VignetteRoleCookie.prototype=new SNI.UR.VignetteCookie();function VignetteRoleCookie(){VignetteRoleCookie.prototype=new SNI.UR.VignetteCookie();this.getPersist=function(){return this.info["persist"];};this.getUserId=function(){return this.info["user_id"];};this.getRoleByName=function(name){if(this.info["roles"]!=undefined){for(var i=0;i<this.info["roles"].length;i++){if(this.info["roles"][i]!=undefined&&this.info["roles"][i]==name){return this.info["roles"][i];}}}};this.getRoleById=function(id){if(this.info["roles"]!=undefined){return this.info["roles"][id];}};}if(typeof(SNI)=="undefined"){SNI={};}if(typeof(SNI.Community)=="undefined"){SNI.Community={};}if(typeof(SNI.Community.UR)=="undefined"){SNI.Community.UR={};}SNI.Community.UR.getCookie=function(name){var cookies=document.cookie;if(cookies.indexOf(name)!=-1){var startpos=cookies.indexOf(name)+name.length+1;var endpos=cookies.indexOf(";",startpos)-1;if(endpos==-2){endpos=cookies.length;}return unescape(cookies.substring(startpos,endpos));}else{return false;}};SNI.Community.UR.init=function(){SNI.Community.xUrlPre="";if(location.hostname.toLowerCase().indexOf("dev")>-1){SNI.Community.xUrlPre="test1-";}else{if(location.hostname.toLowerCase().indexOf("staging")>-1){SNI.Community.xUrlPre="test2-";}}if((SNI.Community.UR.getCookie("SMSESSION")==null)||(SNI.Community.UR.getCookie("SMSESSION")=="")){var orig_domain=document.location.href.substring(0,document.location.href.indexOf(location.hostname)+location.hostname.length);var x=document.createElement("script");x.src="http://"+SNI.Community.xUrlPre+"www.scrippscontroller.com/sso/checkcontrollercookie.html?DEST_URL="+document.location.href+"&orig_domain="+orig_domain;document.getElementsByTagName("head")[0].appendChild(x);}};if(SNI.Config.UR3){SNI.Community.UR.init();}SNI.Community.UR.Core={};SNI.Community.UR.Core.extendedInit=function(){SNI.Community.mainSiteDomain="";SNI.Community.ur3Domain="";if(typeof(SNI.Config.Community)!="undefined"){SNI.Community.mainSiteDomain=SNI.Config.domain;SNI.Community.ur3Domain=SNI.Config.Community.ur3Domain;}};SNI.Community.UR.Core.logout=function(){return SNI.Community.ur3Domain+"/redirectors/logout_redirector.jsp?DEST_URL="+escape(window.location.href);};SNI.Community.UR.Core.getLoginLink=function(){return SNI.Community.ur3Domain+"/registration/login.esi";};SNI.Community.UR.Core.getRegisterLink=function(){return SNI.Community.ur3Domain+"/registration/register.esi";};SNI.Community.UR.Core.getRegisterLiteLink=function(){return SNI.Community.ur3Domain+"/registration/register_lite.esi?DEST_URL="+escape(window.location.href);};SNI.Community.UR.Core.displayName=function(){var name=this.ViewingUserDisplayName;if(typeof name!="string"||name==""){var email=this.ViewingUserName;if(typeof email=="string"&&email.indexOf("@")!=-1){return email.substring(0,email.indexOf("@"));}return email;}return name;};if(typeof(SNI.Omniture)=="undefined"){SNI.Omniture={};}SNI.Omniture.timeout=null;SNI.Omniture.queue=[];SNI.Omniture.getLinkText=function($elt){var linkText="";linkText=$.trim($elt.closest("a").text());if(linkText==""&&$elt.is("img")){linkText="Photo : "+$elt.attr("alt");}return linkText;};SNI.Omniture.MultiVar=function(jsel,module,searchKey){var $el=$(jsel);if($el.length==0||$el.data("events.click.omniture")){return;}$el.bind("click.omniture",function(e){SNI.Omniture.ClickTrackFire(e.target,module,searchKey);e.stopPropagation();});};SNI.Omniture.SingleVar=function(jsel,module,section){var $el=$(jsel);var sv=this;sv.getLinkText=SNI.Omniture.getLinkText;if($el.length==0||$el.data("events.click.omniture")){return;}$el.bind("click.omniture",function(e){var $clicked=$(e.target);if($clicked.is("a")||$clicked.parent().is("a")){var linkText=sv.getLinkText($clicked);var s={};s.linkTrackVars=SNI.Config.omnitureSingleVariable;s.prop26=section+" : "+module+" : "+linkText;s.element=this;SNI.Omniture.ClickTrackTrigger(s);e.stopPropagation();}});};SNI.Omniture.dynamicSingleVar=function(omnitureValues){if(omnitureValues){var s={};s.linkTrackVars=SNI.Config.omnitureSingleVariable;s.prop26=omnitureValues.section+" : "+omnitureValues.module+" : "+omnitureValues.linkText;s.element=omnitureValues.element;SNI.Omniture.ClickTrackTrigger(s);}};SNI.Omniture.ClickTrackFire=function(element,module,searchKey){var site;var originalElement=element;var element=$(element);var isLink=element.is("a");this.getLinkText=SNI.Omniture.getLinkText;if(isLink){var formId=element.parents().filter("form").attr("id");if(formId=="hgSearchForm"||formId=="hgFtSearchForm"){return;}}var parentElement=element.parent();var isParentLink=parentElement.is("a");var isSubmit=element.attr("type")=="submit";if(isLink||isParentLink||isSubmit){if(isSubmit){site=SNI.Config.site+" : "+element.parents().filter("form").attr("name");}else{site=SNI.Config.site+" : "+module;}var s={};s.linkTrackVars=SNI.Config.omnitureMultiVariable;s.prop14=site;s.eVar16=s.prop14;var linkText=this.getLinkText(element);s.prop15=site+" : "+linkText;s.eVar18=s.prop15;var relid="relid?";var linkUrl=element.attr("href");if(isLink){relid=element.attr("rel");}else{if(isParentLink){relid=parentElement.attr("rel");linkUrl=parentElement.attr("href");}}s.prop16=site+" : "+relid;s.eVar17=s.prop16;s.prop17=site+" : "+linkUrl;s.eVar19=s.prop17;s.prop18=site+" : "+mdManager.getParameter("Url");if(typeof(searchKey)!=="undefined"){s.prop19="endeca: "+mdManager.getParameter(searchKey+"_name"," ");s.eVar20=s.prop19;s.prop20="endeca: "+mdManager.getParameter(searchKey+"_style"," ");}s.element=originalElement;SNI.Omniture.ClickTrackTrigger(s);}};SNI.Omniture.ClickTrackTrigger=function(data){if(typeof data=="object"){SNI.Omniture.queue.push(data);}if(typeof s_gi=="function"){if(SNI.Omniture.timeout!==null){clearTimeout(SNI.Omniture.timeout);SNI.Omniture.timeout=null;}}else{SNI.Omniture.timeout=setTimeout(function(){clearTimeout(SNI.Omniture.timeout);SNI.Omniture.timeout=null;SNI.Omniture.ClickTrackTrigger();},1000);return false;}while(SNI.Omniture.queue.length>0){var d=SNI.Omniture.queue.pop();var s=s_gi(s_account);$.each(d,function(key,value){if(key!="element"){s[key]=value;}});s.tl(d.element,"o","Link Name");}};(function($){var hitCountQueue=[];SNI.Config=$.extend(true,{},{Nielsen:{ci:"us-200639",autoTrackPages:false,useIframeTracking:true,hitCountIframeContainer:"hitCountIframeContainer",hitCountHtmlUrl:((location.host=="www.hgtv.com")?"http://img.hgtv.com/webhgtv/hg20/html/fixHits.html":"http://frontend.scrippsnetworks.com/hgtv/fixHits.html")}},SNI.Config);var config=SNI.Config.Nielsen;config.element=$('<div id="'+config.hitCountIframeContainer+'" style="display: none;"></div>');$.extend(true,SNI,{Nielsen:{hitCount:function(){hitCountQueue.push(true);},trackPageView:function(){var d=new Image(1,1);d.onerror=d.onload=function(){d.onerror=d.onload=null;};d.src=["//secure-us.imrworldwide.com/cgi-bin/m?ci=",SNI.Config.Nielsen.ci,"&cg=0&cc=1&si=",escape(window.location.href),"&rp=",escape(document.referrer),"&ts=compact&rnd=",(new Date()).getTime()].join("");},trackNSE:function(){if(config.useIframeTracking){SNI.Nielsen.hitCount();}var d=new Image(1,1);d.src=["//secure-us.imrworldwide.com/cgi-bin/m?ci=",SNI.Config.Nielsen.ci,"&cg=0&cc=1&si=",escape(window.location.href),"&rp=",escape(document.referrer),"&c0=usergen,1&rnd=",(new Date()).getTime()].join("");}}});$(document).ready(function(){$(document.body).append(config.element);if(config.autoTrackPages){SNI.Nielsen.trackPageView();}SNI.Nielsen.hitCount=function(){var cacheBuster=new Date();$(config.element).append('<iframe class="hitCounter" src="'+config.hitCountHtmlUrl+"?t="+cacheBuster.getTime()+'" width="0" height="0" frameborder="0" style="height:0; width:0; display:none;"></iframe>');return;};$.each(hitCountQueue,function(){});});})(jQuery);
/*! SWFObject v2.2 <http://code.google.com/p/swfobject/>
 *  is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
 */
/*! SWFObject v2.2 <http://code.google.com/p/swfobject/>
    is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",EXPRESS_INSTALL_ID="SWFObjectExprInst",ON_READY_STATE_CHANGE="onreadystatechange",win=window,doc=document,nav=navigator,plugin=false,domLoadFnArr=[main],regObjArr=[],objIdArr=[],listenersArr=[],storedAltContent,storedAltContentId,storedCallbackFn,storedCallbackObj,isDomLoaded=false,isExpressInstallActive=false,dynamicStylesheet,dynamicStylesheetMedia,autoHideShow=true,ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF,u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=!+"\v1",playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d&&!(typeof nav.mimeTypes!=UNDEF&&nav.mimeTypes[FLASH_MIME_TYPE]&&!nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)){plugin=true;ie=false;d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/[a-zA-Z]/.test(d)?parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0;}}else{if(typeof win.ActiveXObject!=UNDEF){try{var a=new ActiveXObject(SHOCKWAVE_FLASH_AX);if(a){d=a.GetVariable("$version");if(d){ie=true;d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)];}}}catch(e){}}}return{w3:w3cdom,pv:playerVersion,wk:webkit,ie:ie,win:windows,mac:mac};}(),onDomLoad=function(){if(!ua.w3){return;}if((typeof doc.readyState!=UNDEF&&doc.readyState=="complete")||(typeof doc.readyState==UNDEF&&(doc.getElementsByTagName("body")[0]||doc.body))){callDomLoadFunctions();}if(!isDomLoaded){if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("DOMContentLoaded",callDomLoadFunctions,false);}if(ua.ie&&ua.win){doc.attachEvent(ON_READY_STATE_CHANGE,function(){if(doc.readyState=="complete"){doc.detachEvent(ON_READY_STATE_CHANGE,arguments.callee);callDomLoadFunctions();}});if(win==top){(function(){if(isDomLoaded){return;}try{doc.documentElement.doScroll("left");}catch(e){setTimeout(arguments.callee,0);return;}callDomLoadFunctions();})();}}if(ua.wk){(function(){if(isDomLoaded){return;}if(!/loaded|complete/.test(doc.readyState)){setTimeout(arguments.callee,0);return;}callDomLoadFunctions();})();}addLoadEvent(callDomLoadFunctions);}}();function callDomLoadFunctions(){if(isDomLoaded){return;}try{var t=doc.getElementsByTagName("body")[0].appendChild(createElement("span"));t.parentNode.removeChild(t);}catch(e){return;}isDomLoaded=true;var dl=domLoadFnArr.length;for(var i=0;i<dl;i++){domLoadFnArr[i]();}}function addDomLoadEvent(fn){if(isDomLoaded){fn();}else{domLoadFnArr[domLoadFnArr.length]=fn;}}function addLoadEvent(fn){if(typeof win.addEventListener!=UNDEF){win.addEventListener("load",fn,false);}else{if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("load",fn,false);}else{if(typeof win.attachEvent!=UNDEF){addListener(win,"onload",fn);}else{if(typeof win.onload=="function"){var fnOld=win.onload;win.onload=function(){fnOld();fn();};}else{win.onload=fn;}}}}}function main(){if(plugin){testPlayerVersion();}else{matchVersions();}}function testPlayerVersion(){var b=doc.getElementsByTagName("body")[0];var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);var t=b.appendChild(o);if(t){var counter=0;(function(){if(typeof t.GetVariable!=UNDEF){var d=t.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");ua.pv=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)];}}else{if(counter<10){counter++;setTimeout(arguments.callee,10);return;}}b.removeChild(o);t=null;matchVersions();})();}else{matchVersions();}}function matchVersions(){var rl=regObjArr.length;if(rl>0){for(var i=0;i<rl;i++){var id=regObjArr[i].id;var cb=regObjArr[i].callbackFn;var cbObj={success:false,id:id};if(ua.pv[0]>0){var obj=getElementById(id);if(obj){if(hasPlayerVersion(regObjArr[i].swfVersion)&&!(ua.wk&&ua.wk<312)){setVisibility(id,true);if(cb){cbObj.success=true;cbObj.ref=getObjectById(id);cb(cbObj);}}else{if(regObjArr[i].expressInstall&&canExpressInstall()){var att={};att.data=regObjArr[i].expressInstall;att.width=obj.getAttribute("width")||"0";att.height=obj.getAttribute("height")||"0";if(obj.getAttribute("class")){att.styleclass=obj.getAttribute("class");}if(obj.getAttribute("align")){att.align=obj.getAttribute("align");}var par={};var p=obj.getElementsByTagName("param");var pl=p.length;for(var j=0;j<pl;j++){if(p[j].getAttribute("name").toLowerCase()!="movie"){par[p[j].getAttribute("name")]=p[j].getAttribute("value");}}showExpressInstall(att,par,id,cb);}else{displayAltContent(obj);if(cb){cb(cbObj);}}}}}else{setVisibility(id,true);if(cb){var o=getObjectById(id);if(o&&typeof o.SetVariable!=UNDEF){cbObj.success=true;cbObj.ref=o;}cb(cbObj);}}}}}function getObjectById(objectIdStr){var r=null;var o=getElementById(objectIdStr);if(o&&o.nodeName=="OBJECT"){if(typeof o.SetVariable!=UNDEF){r=o;}else{var n=o.getElementsByTagName(OBJECT)[0];if(n){r=n;}}}return r;}function canExpressInstall(){return !isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)&&!(ua.wk&&ua.wk<312);}function showExpressInstall(att,par,replaceElemIdStr,callbackFn){isExpressInstallActive=true;storedCallbackFn=callbackFn||null;storedCallbackObj={success:false,id:replaceElemIdStr};var obj=getElementById(replaceElemIdStr);if(obj){if(obj.nodeName=="OBJECT"){storedAltContent=abstractAltContent(obj);storedAltContentId=null;}else{storedAltContent=obj;storedAltContentId=replaceElemIdStr;}att.id=EXPRESS_INSTALL_ID;if(typeof att.width==UNDEF||(!/%$/.test(att.width)&&parseInt(att.width,10)<310)){att.width="310";}if(typeof att.height==UNDEF||(!/%$/.test(att.height)&&parseInt(att.height,10)<137)){att.height="137";}doc.title=doc.title.slice(0,47)+" - Flash Player Installation";var pt=ua.ie&&ua.win?"ActiveX":"PlugIn",fv="MMredirectURL="+win.location.toString().replace(/&/g,"%26")+"&MMplayerType="+pt+"&MMdoctitle="+doc.title;if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+fv;}else{par.flashvars=fv;}if(ua.ie&&ua.win&&obj.readyState!=4){var newObj=createElement("div");replaceElemIdStr+="SWFObjectNew";newObj.setAttribute("id",replaceElemIdStr);obj.parentNode.insertBefore(newObj,obj);obj.style.display="none";(function(){if(obj.readyState==4){obj.parentNode.removeChild(obj);}else{setTimeout(arguments.callee,10);}})();}createSWF(att,par,replaceElemIdStr);}}function displayAltContent(obj){if(ua.ie&&ua.win&&obj.readyState!=4){var el=createElement("div");obj.parentNode.insertBefore(el,obj);el.parentNode.replaceChild(abstractAltContent(obj),el);obj.style.display="none";(function(){if(obj.readyState==4){obj.parentNode.removeChild(obj);}else{setTimeout(arguments.callee,10);}})();}else{obj.parentNode.replaceChild(abstractAltContent(obj),obj);}}function abstractAltContent(obj){var ac=createElement("div");if(ua.win&&ua.ie){ac.innerHTML=obj.innerHTML;}else{var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var c=nestedObj.childNodes;if(c){var cl=c.length;for(var i=0;i<cl;i++){if(!(c[i].nodeType==1&&c[i].nodeName=="PARAM")&&!(c[i].nodeType==8)){ac.appendChild(c[i].cloneNode(true));}}}}}return ac;}function createSWF(attObj,parObj,id){var r,el=getElementById(id);if(ua.wk&&ua.wk<312){return r;}if(el){if(typeof attObj.id==UNDEF){attObj.id=id;}if(ua.ie&&ua.win){var att="";for(var i in attObj){if(attObj[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){parObj.movie=attObj[i];}else{if(i.toLowerCase()=="styleclass"){att+=' class="'+attObj[i]+'"';}else{if(i.toLowerCase()!="classid"){att+=" "+i+'="'+attObj[i]+'"';}}}}}var par="";for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par+='<param name="'+j+'" value="'+parObj[j]+'" />';}}el.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+att+">"+par+"</object>";objIdArr[objIdArr.length]=attObj.id;r=getElementById(attObj.id);}else{var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);for(var m in attObj){if(attObj[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){o.setAttribute("class",attObj[m]);}else{if(m.toLowerCase()!="classid"){o.setAttribute(m,attObj[m]);}}}}for(var n in parObj){if(parObj[n]!=Object.prototype[n]&&n.toLowerCase()!="movie"){createObjParam(o,n,parObj[n]);}}el.parentNode.replaceChild(o,el);r=o;}}return r;}function createObjParam(el,pName,pValue){var p=createElement("param");p.setAttribute("name",pName);p.setAttribute("value",pValue);el.appendChild(p);}function removeSWF(id){var obj=getElementById(id);if(obj&&obj.nodeName=="OBJECT"){if(ua.ie&&ua.win){obj.style.display="none";(function(){if(obj.readyState==4){removeObjectInIE(id);}else{setTimeout(arguments.callee,10);}})();}else{obj.parentNode.removeChild(obj);}}}function removeObjectInIE(id){var obj=getElementById(id);if(obj){for(var i in obj){if(typeof obj[i]=="function"){obj[i]=null;}}obj.parentNode.removeChild(obj);}}function getElementById(id){var el=null;try{el=doc.getElementById(id);}catch(e){}return el;}function createElement(el){return doc.createElement(el);}function addListener(target,eventType,fn){target.attachEvent(eventType,fn);listenersArr[listenersArr.length]=[target,eventType,fn];}function hasPlayerVersion(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10)||0;v[2]=parseInt(v[2],10)||0;return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false;}function createCSS(sel,decl,media,newStyle){if(ua.ie&&ua.mac){return;}var h=doc.getElementsByTagName("head")[0];if(!h){return;}var m=(media&&typeof media=="string")?media:"screen";if(newStyle){dynamicStylesheet=null;dynamicStylesheetMedia=null;}if(!dynamicStylesheet||dynamicStylesheetMedia!=m){var s=createElement("style");s.setAttribute("type","text/css");s.setAttribute("media",m);dynamicStylesheet=h.appendChild(s);if(ua.ie&&ua.win&&typeof doc.styleSheets!=UNDEF&&doc.styleSheets.length>0){dynamicStylesheet=doc.styleSheets[doc.styleSheets.length-1];}dynamicStylesheetMedia=m;}if(ua.ie&&ua.win){if(dynamicStylesheet&&typeof dynamicStylesheet.addRule==OBJECT){dynamicStylesheet.addRule(sel,decl);}}else{if(dynamicStylesheet&&typeof doc.createTextNode!=UNDEF){dynamicStylesheet.appendChild(doc.createTextNode(sel+" {"+decl+"}"));}}}function setVisibility(id,isVisible){if(!autoHideShow){return;}var v=isVisible?"visible":"hidden";if(isDomLoaded&&getElementById(id)){getElementById(id).style.visibility=v;}else{createCSS("#"+id,"visibility:"+v);}}function urlEncodeIfNecessary(s){var regex=/[\\\"<>\.;]/;var hasBadChars=regex.exec(s)!=null;return hasBadChars&&typeof encodeURIComponent!=UNDEF?encodeURIComponent(s):s;}var cleanup=function(){if(ua.ie&&ua.win){window.attachEvent("onunload",function(){var ll=listenersArr.length;for(var i=0;i<ll;i++){listenersArr[i][0].detachEvent(listenersArr[i][1],listenersArr[i][2]);}var il=objIdArr.length;for(var j=0;j<il;j++){removeSWF(objIdArr[j]);}for(var k in ua){ua[k]=null;}ua=null;for(var l in swfobject){swfobject[l]=null;}swfobject=null;});}}();return{registerObject:function(objectIdStr,swfVersionStr,xiSwfUrlStr,callbackFn){if(ua.w3&&objectIdStr&&swfVersionStr){var regObj={};regObj.id=objectIdStr;regObj.swfVersion=swfVersionStr;regObj.expressInstall=xiSwfUrlStr;regObj.callbackFn=callbackFn;regObjArr[regObjArr.length]=regObj;setVisibility(objectIdStr,false);}else{if(callbackFn){callbackFn({success:false,id:objectIdStr});}}},getObjectById:function(objectIdStr){if(ua.w3){return getObjectById(objectIdStr);}},embedSWF:function(swfUrlStr,replaceElemIdStr,widthStr,heightStr,swfVersionStr,xiSwfUrlStr,flashvarsObj,parObj,attObj,callbackFn){var callbackObj={success:false,id:replaceElemIdStr};if(ua.w3&&!(ua.wk&&ua.wk<312)&&swfUrlStr&&replaceElemIdStr&&widthStr&&heightStr&&swfVersionStr){setVisibility(replaceElemIdStr,false);addDomLoadEvent(function(){widthStr+="";heightStr+="";var att={};if(attObj&&typeof attObj===OBJECT){for(var i in attObj){att[i]=attObj[i];}}att.data=swfUrlStr;att.width=widthStr;att.height=heightStr;var par={};if(parObj&&typeof parObj===OBJECT){for(var j in parObj){par[j]=parObj[j];}}if(flashvarsObj&&typeof flashvarsObj===OBJECT){for(var k in flashvarsObj){if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+k+"="+flashvarsObj[k];}else{par.flashvars=k+"="+flashvarsObj[k];}}}if(hasPlayerVersion(swfVersionStr)){var obj=createSWF(att,par,replaceElemIdStr);if(att.id==replaceElemIdStr){setVisibility(replaceElemIdStr,true);}callbackObj.success=true;callbackObj.ref=obj;}else{if(xiSwfUrlStr&&canExpressInstall()){att.data=xiSwfUrlStr;showExpressInstall(att,par,replaceElemIdStr,callbackFn);return;}else{setVisibility(replaceElemIdStr,true);}}if(callbackFn){callbackFn(callbackObj);}});}else{if(callbackFn){callbackFn(callbackObj);}}},switchOffAutoHideShow:function(){autoHideShow=false;},ua:ua,getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]};},hasFlashPlayerVersion:hasPlayerVersion,createSWF:function(attObj,parObj,replaceElemIdStr){if(ua.w3){return createSWF(attObj,parObj,replaceElemIdStr);}else{return undefined;}},showExpressInstall:function(att,par,replaceElemIdStr,callbackFn){if(ua.w3&&canExpressInstall()){showExpressInstall(att,par,replaceElemIdStr,callbackFn);}},removeSWF:function(objElemIdStr){if(ua.w3){removeSWF(objElemIdStr);}},createCSS:function(selStr,declStr,mediaStr,newStyleBoolean){if(ua.w3){createCSS(selStr,declStr,mediaStr,newStyleBoolean);}},addDomLoadEvent:addDomLoadEvent,addLoadEvent:addLoadEvent,getQueryParamValue:function(param){var q=doc.location.search||doc.location.hash;if(q){if(/\?/.test(q)){q=q.split("?")[1];}if(param==null){return urlEncodeIfNecessary(q);}var pairs=q.split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=")+1)));}}}return"";},expressInstallCallback:function(){if(isExpressInstallActive){var obj=getElementById(EXPRESS_INSTALL_ID);if(obj&&storedAltContent){obj.parentNode.replaceChild(storedAltContent,obj);if(storedAltContentId){setVisibility(storedAltContentId,true);if(ua.ie&&ua.win){storedAltContent.style.display="block";}}if(storedCallbackFn){storedCallbackFn(storedCallbackObj);}}isExpressInstallActive=false;}}};}();

if(typeof(SNI.TC)=="undefined"){SNI.TC={};}SNI.TC.episodelistpagecount1=0;SNI.TC.episodelistpagecount2=0;SNI.TC.ANIMATION_SPEED=150;if(typeof(SNI)=="undefined"){SNI={};}TCApplicationConfig.prototype=new SNI.UR.ApplicationConfig();function TCApplicationConfig(){TCApplicationConfig.prototype=new SNI.UR.ApplicationConfig();this.loginServer["DEV"]="http://vdev2.scrippsnetworks.com/";this.loginServer["STAGE"]="http://swwd.scrippsweb.com/";this.loginServer["PROD"]="http://web.TC.com/";this.urVersion=urVersion;function urVersion(){return 1;}}jQuery.dpl={init:function(type,config){return this.each(function(i){if(this.id){}else{this.id=type+"-"+new Date().getTime();}try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}var init=$.dpl[type];if($.isFunction(init)){init(this,config);}});},carousel:function(ele,config){config=$.extend({pause:null,scroll:1,animation:"slow",auto:0,wrap:null,pagelink:null,pagetext:null,start:1},config);var crsl_itemFirstInCallback=function(carousel,item,idx,state){if(config["pagelink"]=="text"){var tmpText=config["pagetext"];tmpText=tmpText.replace(/_current/ig,idx);tmpText=tmpText.replace(/_total/ig,carousel["options"]["size"]);carousel.container.find(".jcarousel-pagetext").html(tmpText);}else{if(config["pagelink"]=="image"){jQuery(ele).find(".jcarousel-pageimg a.current").removeClass("current");link=jQuery(ele).find(".jcarousel-pageimg a")[idx-1];jQuery(link).addClass("current");}}};var crsl_initCallback=function(carousel,state){if((config["pagelink"]=="text")||(config["pagelink"]=="both")){carousel.container.append('<div class="jcarousel-pagetext"></div>');}else{if((config["pagelink"]=="image")||(config["pagelink"]=="both")){var imgLinks="";for(var i=1;i<=carousel["options"]["size"];i++){imgLinks+='<a href="#'+i+'">'+i+"</a>";}carousel.container.append('<div class="jcarousel-pageimg"></div>');jQuery(ele).find(".jcarousel-pageimg").append(imgLinks);jQuery(ele).find(".jcarousel-pageimg").css("left",parseInt($(ele).width())/2-parseInt($(ele).find(".jcarousel-pageimg").width())/2);jQuery(ele).find(".jcarousel-pageimg a").bind("click",function(){carousel.scroll(jQuery.jcarousel.intval(jQuery(this).html()));return false;});}}};$(ele).find(".crsl").jcarousel({scroll:config["scroll"],animation:config["slow"],auto:config["auto"],wrap:config["wrap"],itemFirstInCallback:crsl_itemFirstInCallback,initCallback:crsl_initCallback,start:config["start"]});},dynlead:function(ele,config){config=$.extend({delay:15000,loops:0,showThumbnails:false,widthThumbails:110,pause:null},config);var _timeout;var currentSlide=0;var slides=$(ele).find(".dl-content li");var pageLinks=$(ele).find(".dl-menu");var maxSlides=slides.length;var countLoop=0;$(".video-cn").hide();$(ele).find(".videolink").click(function(){clearTimeout(_timeout);$(this).hide();$(this).parent().find(".video-cn").show();});var play=true;if(config["pause"]!=null){$(ele).find("."+config["pause"]).click(function(){txt=($(this).html()=="PAUSE")?"PLAY":"PAUSE";$(this).html(txt);if(play){clearTimeout(_timeout);play=false;}else{nextSlide(ele,config);play=true;}});}slides.not(":first").hide();pageLinks.find("ul > li:first-child").addClass("active");pageLinks.find("ul > li").each(function(i){var $this=$(this);if(config["showThumbnails"]){var thPreviewID=ele.id+"-cn-th-"+i;$this.attr({"rel":"#"+thPreviewID});$this.next(".content-th").attr({"id":thPreviewID});$this.cluetip({width:config["widthThumbails"],cluezIndex:6,cluetipClass:"content-th",local:true,showTitle:false,sticky:true,mouseOutClose:true,closePosition:"title",closeText:"",topOffset:6,leftOffset:-($this.parent().width()),positionBy:"fixed",dropShadow:false,cursor:"hand",titleAttribute:"",waitImage:false});$this.hover(function(e){height=$("#cluetip-inner").outerHeight();$("#cluetip").hide();opt={margin:true,padding:true,border:true,scroll:true};anchorPos=$(this).offset({scroll:true,margin:true,padding:true,border:true});_top=parseInt(anchorPos["top"])-parseInt(height);$("#cluetip").css("top",_top);$("#cluetip").show();},function(){if($("#cluetip").is(":visible")){$("#cluetip").hover(function(){$("#cluetip").show();},function(){$("#cluetip").hide();});$("#cluetip").hide();}});}$this.click(function(){clearTimeout(_timeout);currentSlide=i;nextSlide(ele,config);});});var nextSlide=function(ele,config){clearTimeout(_timeout);var currentID=ele.id;var currentPage=slides[currentSlide];$(ele).find("li.active").removeClass("active");pageLinks.find("ul > li:eq("+currentSlide+")").addClass("active");$(currentPage).fadeIn("slow").siblings().not(":hidden").fadeOut("slow");if(currentSlide==(maxSlides-1)){currentSlide=0;countLoop++;}else{currentSlide++;}if((countLoop<config["loops"])&&(config["loops"]>0)){_timeout=setTimeout(function(){nextSlide(ele,config);},config["delay"]);}};if((config["loops"]>0)){_timeout=setTimeout(function(){nextSlide(ele,config);},config["delay"]);}},accordion:function(el,config){config=$.extend({autoheight:true,header:".acco-link",animated:($.browser.msie?false:"easeOutSine")},config);jQuery(el).accordion(config);},tabs:function(el,config){jQuery(el).tabs(config);},collapser:function(el,config){config=$.extend({programguide:false,videochannels:false},config);if(config["programguide"]==true){var today=new Date();var current_time=today.getHours();var current_minutes=today.getMinutes();var dayofweek=today.getDay();var weekend=false;if(dayofweek==0||dayofweek==6){weekend=true;}if(weekend==true&&current_time>=7&&current_time<12){$("#prog-guide .morning").addClass("active");}else{if(current_time>=9&&current_time<12){$("#prog-guide .morning").addClass("active");}else{if(current_time>=12&&current_time<16){$("#prog-guide .daytime").addClass("active");}else{if(current_time>=16&&current_time<19){$("#prog-guide .evening").addClass("active");}else{if(current_time>=19&&current_time<23){$("#prog-guide .primetime").addClass("active");}else{$("#prog-guide .latenight").addClass("active");}}}}}}if(config["videochannels"]==true){togglelist=$(el).find("li.switch");togglelist.each(function(){var $this=$(this);var target=$this.find("h4");if(!$this.hasClass("active")){$this.find(".crsl-w").hide();}target.click(function(){if($this.hasClass("active")){$this.removeClass("active");$this.find(".crsl-w").hide(250);}else{$this.addClass("active");$this.find(".crsl-w").show(250);}});});}if(config["videochannels"]!=true){$(el).children(":first").each(function(){var $this=$(this);$this.click(function(){$this.parent().toggleClass("active");});});}}};jQuery.fn.dpl=jQuery.dpl.init;$.ui=$.ui||{};$.fn.extend({dropdown:function(options,data){if(navigator.userAgent.match(/iPhone|android|blackberry/i)){return;}var args=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof options=="string"){var dropdown=$.data(this,"ui-dropdown");dropdown[options].apply(dropdown,args);}else{if(!$(this).is(".ui-dropdown")){$.data(this,"ui-dropdown",new $.ui.dropdown(this,options));}}});}});$.ui.dropdown=function(container,options){this.element=$(container);this.options=options=$.extend({},$.ui.dropdown.defaults,options);this.options.title=this.options.title||this.element.find("option.select-title").text();this.element.addClass("ui-dropdown");this.list=buildList(this.element,this.options);this.element.after(this.list);this.css={position:this.element.css("position"),left:this.element.css("left")};this.element.hide();if(this.element.attr("disabled")){this.disable();}else{this.enable();}};$.extend($.ui.dropdown,{defaults:{title:"",disabled:false}});$.ui.dropdown.prototype={enable:function(){var element=this.element;var list=this.list;this.options.disabled=false;this.element.removeAttr("disabled");this.list.find(".disabled").removeClass("disabled");var handle=this.list.find("dt a");handle.mousedown(function(){hideDropDowns();list.find("dd").show();$(this).parent("dt").addClass("active");$("body").bind("mousedown",bodyClicked);return false;});return element;},disable:function(){this.options.disabled=true;this.element.attr("disabled","disabled");this.list.find("dt").addClass("disabled");var handle=this.list.find("dt a");handle.unbind("mousedown");return this.element;},destroy:function(){this.list.remove();this.element.show();this.element.removeClass("ui-dropdown");$.removeData(this.element,"ui-dropdown");},reset:function(){this.list.remove();this.options.title=this.element.find("option.select-title").text();this.list=buildList(this.element,this.options);this.element.after(this.list);},select:function(){select=this.element.get(0);option=select.selectedIndex>-1?select[select.selectedIndex]:false;if(option){this.list.find("dt a").html(option.text+"<em></em>");}},activate:function(event){dropdown=event&&event.data?event.data.dropdown:this;if(!dropdown.options.disabled){hideDropDowns();dropdown.list.find("dd").show();dropdown.list.find("dt").addClass("active");}}};function buildList(element,options){select=element.get(0);option=select.selectedIndex>-1?select[select.selectedIndex]:false;var selected=option?option.text:"";var ddList='<dl class="dd-list">';ddList+=options.disabled?'<dt class="dd-dt disabled">':'<dt class="dd-dt">';ddList+="<a>"+selected+"<em></em></a></dt>";ddList+='<dd style="display: none;">';ddList+='<div class="dd-hd"></div>';ddList+='<div class="dd-bd">';if(options.title){ddList+="<h3>"+options.title+'<a class="close"></a></h3>';}ddList+="</div>";ddList+='<div class="dd-ft"></div>';ddList+="</dd>";ddList+="</dl>";ddList=$(ddList);ddList.find(".close").click(function(){hideDropDowns();return false;});var list=$('<ul class="dd-ul"></ul>');element.children("option:not(.select-title)").each(function(i){var link=$('<a href="#">'+$(this).text()+"</a>");link.click(function(){ddList.find("dt a").html($(this).text()+"<em></em>");element.find("option:not(.select-title)")[i].selected=true;hideDropDowns();element.trigger("change");return false;});var item=$('<li class="dd-li"></li>').append(link);list.append(item);});ddList.find(".dd-bd").append(list);return ddList;}function hideDropDowns(event){if(event&&$.browser.mozilla&&$(event.target).hasClass("dd-ul")){return true;}$(".dd-list dd").hide();$(".dd-list .active").removeClass("active");$("body").unbind("mousedown",bodyClicked);return true;}function bodyClicked(event){var element=$(event.target);if(element.parents().is(".dd-list")){return false;}else{hideDropDowns();}}$.ui=$.ui||{};$.fn.extend({dependent_dropdowns:function(options,data){var args=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof options=="string"){var dependent_dropdowns=$.data(this,"ui-dependent-dropdowns");dependent_dropdowns[options].apply(dependent_dropdowns,args);}else{if(!$(this).is(".ui-dependent-dropdowns")){$.data(this,"ui-dependent-dropdowns",new $.ui.dependent_dropdowns(this,options));}}});}});$.ui.dependent_dropdowns=function(container,options){this.element=$(container);this.options=options=$.extend({},$.ui.dependent_dropdowns.defaults,options);this.dropdowns=this.options.dropdowns||this.element.find("select");this.data=this.options.data;this.element.addClass("ui-dependent-dropdowns");var dd=this;$.each(this.dropdowns,function(i,val){$(val).dropdown();$(val).bind("change",function(){index=$.inArray(this,dd.dropdowns);if(index!=-1){dd._updateValues(index+1);}});});this.enable();};$.ui.dependent_dropdowns.prototype={enable:function(){this._updateValues(0);this.defaults();},disable:function(){},destroy:function(){$.each(this.dropdowns,function(key,value){$(value).destroy();});this.element.removeClass("ui-dependent-dropdowns");$.removeData(this.element,"ui-dependent-dropdowns");},defaults:function(){if(this.data.defaults){var now=new Date();var hours=now.getHours()<10?"0"+now.getHours():now.getHours();var minutes=now.getMinutes()<10?"0"+now.getMinutes():now.getMinutes();var time=hours.toString()+minutes.toString();var dd=this;$.each(this.data.defaults,function(key,values){times=key.split("-");if(dd._checkTime(times[0],times[1],time)){index=0;$.each(values,function(k,v){if(select=dd.dropdowns[index]){$(select).find("option").each(function(){if($(this).val()==v){this.selected=true;$(select).dropdown("select");$(select).trigger("change");}});}index++;});}});}},_updateValues:function(index){if(index==null){index=0;}if(dropdown=this.dropdowns[index]){values=this._findValues(this.data.values,0,index);previous_value=$(dropdown).val()||false;if(this.data.titles&&this.data.titles[index]){options='<option value="" class="select-title">'+this.data.titles[index]+"</option>";}else{options="";}if(values){$.each(values,function(key,val){options+='<option value="'+key+'"';if(previous_value&&previous_value==key){options+=' selected="selected"';}options+=">"+val.label+"</option>";});}if(!values){$(dropdown).dropdown("disable");}$(dropdown).html(options);$(dropdown).dropdown("reset");if(values){$(dropdown).dropdown("enable");}this._updateValues(index+1);}},_findValues:function(values,start_index,end_index){if(start_index==end_index){return values;}else{values=values[$(this.dropdowns[start_index]).val()];if(values){return this._findValues(values.values,start_index+1,end_index);}else{return null;}}},_updateDropdown:function(dropdown){if(index=$.inArray(dropdown,this.dropdowns)){this._updateValues(index+1);}},_checkTime:function(from_time,to_time,time){if(to_time<from_time){if(time>=from_time&&time<2400){return true;}else{if(time<to_time&&time>=0){return true;}}}else{if(time>=from_time&&time<to_time){return true;}}return false;}};SNI.TC.Photogallery={gallery:function(){$("#pgallery .prev a.desc").hover(function(){$(".prev a.btn").addClass("hover");},function(){$(".prev a.btn").removeClass("hover");});$("#pgallery .next a.desc").hover(function(){$(".next a.btn").addClass("hover");},function(){$(".next a.btn").removeClass("hover");});var topmargin=13;var panelheight=$("#pgallery .imgpanel").height();var shrinkheight=panelheight-topmargin;$("#pgallery .close-btn").click(function(){$(".imgpanel").animate({bottom:-shrinkheight+"px"},500);$("#pgallery .imgpanel span.close-btn").css("display","none");$("#pgallery .imgpanel span.open-btn").css("display","block");});$("#pgallery .open-btn").click(function(){$(".imgpanel").animate({bottom:"1px"},500);$("#pgallery .imgpanel span.open-btn").css("display","none");$("#pgallery .imgpanel span.close-btn").css("display","block");});$(window).load(function(){$("#pgallery .largeImage .imgpanel").css("left","1px");$("#pgallery .largeImage .imgpanel").css("bottom","1px");});}};SNI.TC.Photogallery3={cbackHotSpotJSON:function(){if(SNI.TC.Photogallery3.ImageData[ITMCUR].bhs){SNI.TC.Photogallery3.doHotSpots(ITMCUR);}SNI.TC.Photogallery3.insertProdsTab();return;},doHotSpots:function(itmSel){if(typeof SNI.TC.Photogallery3.Hotspots=="undefined"){return;}imgId=$("#pgallery3 .pglnks li").eq(itmSel).find("a").attr("rel");for(i=0;i<SNI.TC.Photogallery3.Hotspots.images.length;++i){if(imgId==SNI.TC.Photogallery3.Hotspots.images[i].id){SNI.TC.Photogallery3.applyHotSpots(SNI.TC.Photogallery3.Hotspots.images[i],itmSel);break;}}return;},applyHotSpots:function(oHS,itmSel){$imgCont=$("#pgallery3 #img-"+(itmSel));vi="";vc="";if($imgCont.hasClass("vert-enl")){vi="-v";vc=" v";}$imgCont=$imgCont.find(".imgwrap");wImg=parseInt($imgCont.css("width"));hImg=parseInt($imgCont.css("height"));for(i=0;i<oHS.hotspots.length;++i){hsID="hs-"+itmSel+"-"+i+vi;hsRel="hs-"+oHS.id+"-"+oHS.hotspots[i].id;sHS='<span class="hs'+vc+'" id="'+hsID+'"><a href="'+oHS.hotspots[i].url+'" rel="'+hsRel+'">click</a><span>'+oHS.hotspots[i].name+"</span></span>";$imgCont.append(sHS);$jBtn=$imgCont.find("#"+hsID+" a");if(typeof wBtn=="undefined"){wBtn=parseInt($jBtn.css("width"));hBtn=parseInt($jBtn.css("height"));}xBtn=Math.round(wImg*oHS.hotspots[i].hotspotXPercent/100-wBtn/2,0);yBtn=Math.round(hImg*oHS.hotspots[i].hotspotYPercent/100-hBtn/2,0);$ePop=$jBtn.next();wPop=$ePop.width()+parseInt($ePop.css("padding-left"))+parseInt($ePop.css("padding-right"));hPop=$ePop.height()+parseInt($ePop.css("padding-top"))+parseInt($ePop.css("padding-bottom"));yPop=yBtn-4-hPop;if(yPop<7){yPop=Math.max(yBtn+(hBtn-hPop)/2,7);if(xBtn+wBtn/2>wImg/2){xPop=xBtn-4-wPop;}else{xPop=xBtn+wBtn+4;}}else{xPop=xBtn+(wBtn-wPop)/2;xPop=Math.min(Math.max(7,xPop),wImg-7-wPop);}$jBtn.css({"left":xBtn,"top":yBtn}).hover(function(){$(this).parent().find("span").addClass("on");},function(){$(this).parent().find("span").removeClass("on");}).bind("click",{oHSthis:oHS.hotspots[i]},function(e){SNI.TC.Omniture.HotSpotClick(e.data.oHSthis,"c");return SNI.TC.Photogallery3.showProd($(this));}).parent().find("span").css({"left":xPop,"top":yPop});}return;},showProd:function($hsLink){aID=$hsLink.parent().attr("id").split("-");imgNum=parseInt(aID[1]);hsNum=parseInt(aID[2]);aRel=$hsLink.attr("rel").split("-");imgCMA=aRel[1];hsCMA=aRel[2];imgSel="#pgallery3 #img-"+imgNum;prodSel="#pgallery3 #prod-"+imgNum;bNew=false;if($(prodSel).length==0){for(i=0;i<SNI.TC.Photogallery3.Hotspots.images.length;++i){if(imgCMA==SNI.TC.Photogallery3.Hotspots.images[i].id){oHS=SNI.TC.Photogallery3.Hotspots.images[i].hotspots;hTabs='<h4>Products From this Photo:</h4>\n<div class="tab-wrap">\n<ul class="tabs">\n';hCont='<ul class="cont">';bMkt=true;for(j=0;j<oHS.length;++j){hTabs+='<li><a href="'+oHS[j].url+'">'+oHS[j].name+"</a></li>\n";hCont+='<li>\n<h4><a target="_blank" href="'+oHS[j].url+'">'+SNI.Util.strTrimEllips(oHS[j].name,42)+"</a></h4>\n";hCont+='<a class="pframe" target="_blank" href="'+oHS[j].url+'"><img width="266" height="200" src="'+oHS[j].imageURL+'"><span>More Info</span></a>';hCont+="<p>"+SNI.Util.strTrimEllips(oHS[j].description,180)+"</p>\n</li>";bMkt=bMkt&&(oHS[j].marketplaceId!="");}hTabs+="</ul>\n</div>\n";hCont+="</ul>\n";break;}}hOut='<div class="prod clrfix" id="prod-'+imgNum+'">\n';hOut+='<div class="l clrfix">';hOut+='<a class="close" href="#"><img width="160" src="'+$(imgSel).find("img").attr("src")+'"></a>\n';hOut+='<p><a class="close" href="#">Back to Photo</a></p>';hOut+=hTabs;hOut+="</div>\n";hOut+='<div class="r">';hOut+='<a href="#" class="close">Close</a>\n';hOut+=hCont;if(bMkt){hOut+=SNI.TC.Photogallery3.getProdYMAL();}hOut+="</div>\n";$("#pgallery3 .pglnkmask").before(hOut);bNew=true;$(prodSel+" .r ul.cont li").each(function(i){$(this).find("a").bind("click",{oHSthis:oHS[i]},function(e){SNI.TC.Omniture.HotSpotClick(e.data.oHSthis,"l");return true;});});$(prodSel+" .l .tabs li a").click(function(){if($(this).parent().hasClass("sel")){return false;}$(prodSel).find(".l .tabs li").removeClass("sel");$(prodSel).find(".r .cont li").removeClass("sel");$(this).parent().addClass("sel");$(prodSel).find(".r .cont li").eq($(prodSel).find(".l .tabs li").index($(prodSel).find(".l .tabs li.sel"))).addClass("sel");if($(prodSel).find(".r .relProd").length>0){$(prodSel).find(".r .relProd").replaceWith(SNI.TC.Photogallery3.getProdYMAL());}return false;});$(prodSel+" a.close").click(function(){var $prodCont=$(this).parents(".prod");var aID=$prodCont.attr("id").split("-");var imgNum=parseInt(aID[1]);var imgSel="#pgallery3 #img-"+imgNum;$prodCont.hide();$(imgSel).show();return false;});}$(prodSel+" .l .tabs li").removeClass("sel").eq(hsNum).addClass("sel");$(prodSel+" .r .cont li").removeClass("sel").eq(hsNum).addClass("sel");$(imgSel).hide();$(prodSel).show();if(bNew){$(prodSel+" .tab-wrap").height($(prodSel).offset().top+$(prodSel).innerHeight()-parseInt($(prodSel).css("padding-bottom"))-$(prodSel+" .tab-wrap").offset().top);}return false;},getProdYMAL:function(){hRet="";if(typeof SNI.TC.ProductIdeas=="undefined"){return hRet;}iSrcLen=SNI.TC.ProductIdeas.length;if(iSrcLen==0){return hRet;}aSrc=new Array(iSrcLen);for(i=0;i<iSrcLen;++i){aSrc[i]=i;}iDrawnLen=Math.min(iSrcLen,3);aDrawn=new Array(iDrawnLen);for(i=0;i<iDrawnLen;++i){j=Math.floor(Math.random()*aSrc.length);aDrawn[i]=aSrc[j];aSrc.splice(j,1);}hRet='<div class="relProd clrfix">\n';hRet+='<a class="more" href="http://marketplace.TC.com/">More Products</a><h4>You Might Also Like:</h4>\n';hRet+='<ul class="clrfix">\n';itmClass="";for(i=0;i<iDrawnLen;++i){with(SNI.TC.ProductIdeas[aDrawn[i]]){if(i==iDrawnLen-1){itmClass=' class="last"';}hRet+="<li"+itmClass+'><a target="_blank" href="'+pURL+'"><img width="92" height="69" src="'+iURL+'" alt="'+iAlt+'" /><span>'+pName+"</span></a></li>\n";}}hRet+="</ul>\n";hRet+="</div>\n";return hRet;},insertProdsTab:function(){if(typeof SNI.TC.Photogallery3.Hotspots=="undefined"){return;}hRet="<ul>\n<h4>Products From This Gallery</h4>";for(i=0;i<SNI.TC.Photogallery3.Hotspots.images.length;++i){oHS=SNI.TC.Photogallery3.Hotspots.images[i].hotspots;for(j=0;j<oHS.length;++j){hRet+='<li><a target="_blank" href="'+oHS[j].url+'"><img src="'+oHS[j].imageURL+'" alt="'+oHS[j].name+'" />';hRet+='<p class="first"><a target="_blank" href="'+oHS[j].url+'">'+oHS[j].name+"</a></p></li>\n";}}hRet+="</ul>\n";$("#pgallery3 .endframe .tab.shop").append(hRet);$("#pgallery3 .endframe .nav .shop").show();},init:function(){EF_IMG_HTML='<img width="68" height="38" src="/static_files/images/share-photos-sm.gif" alt="Share Photos" />';ITMCUR=$("#pgallery3 .pglnks li").index($("#pgallery3 .pglnks li.sel"));BYLINE="";if($("#hg-w > .intro p.byline").length>0){BYLINE=$("#hg-w > .intro p.byline").text();}ITMPERPANEL=9;XBASE=$("#pgallery3 .pglnks").position().left;ITMLAST=$("#pgallery3 .pglnks li").length-1;ITMWIDTH=$("#pgallery3 .pglnks li").innerWidth()+parseInt($("#pgallery3 .pglnks li").css("margin-left"))+parseInt($("#pgallery3 .pglnks li").css("margin-right"));newwidth=(ITMLAST+1)*ITMWIDTH;if(ITMLAST>ITMPERPANEL){++newwidth;}$("#pgallery3 .pglnks").css("width",newwidth);$("#pgallery3 .pglnkmask .leftctrl a").click(function(){if($(this).hasClass("dis")){return false;}itmBaseCur=Math.round((XBASE-$("#pgallery3 .pglnks").position().left)/ITMWIDTH);itmBaseNew=Math.max(0,itmBaseCur-ITMPERPANEL);if(itmBaseCur==ITMLAST-ITMPERPANEL){$("#pgallery3 .pglnkmask .rightctrl a").removeClass("dis");}$("#pgallery3 .pglnks").animate({left:(XBASE-itmBaseNew*ITMWIDTH)+"px"},SNI.TC.ANIMATION_SPEED);if(itmBaseNew==0){$("#pgallery3 .pglnkmask .leftctrl a").addClass("dis");}return false;});$("#pgallery3 .pglnkmask .rightctrl a").click(function(){if($(this).hasClass("dis")){return false;}itmBaseCur=Math.round((XBASE-$("#pgallery3 .pglnks").position().left)/ITMWIDTH);itmBaseNew=Math.min(ITMLAST-ITMPERPANEL,itmBaseCur+ITMPERPANEL);if(itmBaseCur==0){$("#pgallery3 .pglnkmask .leftctrl a").removeClass("dis");}$("#pgallery3 .pglnks").animate({left:(XBASE-itmBaseNew*ITMWIDTH)+"px"},SNI.TC.ANIMATION_SPEED);if(itmBaseNew==ITMLAST-ITMPERPANEL){$("#pgallery3 .pglnkmask .rightctrl a").addClass("dis");}return false;});$("#pgallery3 .pglnks li a").bind("mouseenter",function(){if($(this).parent().hasClass("sel")){return false;}$(this).parent().find(".tnframe").show();$(this).parents(".pglnkmask").addClass("popactive");}).bind("mouseleave",function(){$(this).parent().find(".tnframe").hide();$(this).parents(".pglnkmask").removeClass("popactive");});$("#pgallery3 .photonav .prevlnk a").click(function(){setImg((ITMCUR+ITMLAST)%(ITMLAST+1));return false;});$("#pgallery3 .photonav .nextlnk a, #pgallery3 .largeImage a.bigimg").click(function(){setImg((ITMCUR+1)%(ITMLAST+1));return false;});$("#pgallery3 .pglnks a").click(function(){if(!$(this).parent().hasClass("sel")){$(this).parent().find(".tnframe").hide();setImg($(this).text()-1);}return false;});$("#pgallery3 .largeImage a.vtoggle.enl").click(function(){$myImgCont=$(this).parents(".largeImage");$myImgCont.removeClass("vert-shr").addClass("vert-enl");if($myImgCont.find(" .hs.v").length==0){SNI.TC.Photogallery3.doHotSpots(parseInt($(this).parents(".largeImage").attr("id").split("-")[1]));}return false;});$("#pgallery3 .largeImage a.vtoggle.shr").click(function(){$myImgCont=$(this).parents(".largeImage");$myImgCont.removeClass("vert-enl").addClass("vert-shr");return false;});$("#pgallery3 .largeImage .imgpanel a.open").click(function(){$myPanel=$(this).parent();$myPanel.find("a.open").hide();$myPanel.animate({bottom:"0"});$myPanel.find("a.close").show();return false;});$("#pgallery3 .largeImage .imgpanel a.close").click(function(){$myPanel=$(this).parent();myCollapseHt=parseInt(Math.max($myPanel.find("h2").outerHeight(),$myPanel.find("a.cap-lnk.close").outerHeight())+parseInt($myPanel.css("padding-top"))-$myPanel.innerHeight())+"px";$myPanel.find("a.close").hide();$myPanel.animate({bottom:myCollapseHt});$myPanel.find("a.open").show();return false;});function setImg(itmSel){if(itmSel==ITMCUR){return;}doDynOmni(itmSel);newImgCont="#pgallery3 #img-"+itmSel;if($(newImgCont).length>0){$("#pgallery3 .largeImage, #pgallery3 .prod").hide();$(newImgCont).show();}else{$("#pgallery3 .largeImage").eq(0).clone(true).attr("id","img-"+itmSel).insertAfter("#pgallery3 .largeImage:last");$(newImgCont).hide();$("#pgallery3 .largeImage.loading").show();$(newImgCont).find(".hs").remove();$(newImgCont+" img").remove();myImg=new Image();if($(newImgCont+" a.bigimg").length>0){$(myImg).appendTo(newImgCont+" a.bigimg");}else{$(myImg).appendTo(newImgCont+" .imgwrap");}$(myImg).load(function(){$("#pgallery3 .largeImage, #pgallery3 .prod").hide();$(newImgCont).show();if(SNI.TC.Photogallery3.ImageData[itmSel].bhs){SNI.TC.Photogallery3.doHotSpots(itmSel);}$("#pgallery3 .largeImage.loading").hide();});setImgData(SNI.TC.Photogallery3.ImageData[itmSel],$(newImgCont));}fixByLine(itmSel);if(itmSel==0){$("#pgallery3 .photonav .prevlnk").css("visibility","hidden");}else{if(ITMCUR==0){$("#pgallery3 .photonav .prevlnk").css("visibility","visible");}}$("#pgallery3 .photonav .pagen span").text(itmSel+1);topPrev="#pgallery3 .photonav .prevlnk";$(topPrev+" img").remove();$pgItmPrev=$("#pgallery3 .pglnks li").eq((itmSel+ITMLAST)%(ITMLAST+1));if($pgItmPrev.find("img").length>0){$pgItmPrev.find("img").clone().prependTo(topPrev+" a");}$(topPrev+" a").attr("href",$pgItmPrev.find("a").attr("href"));topNext="#pgallery3 .photonav .nextlnk";$(topNext+" img").remove();$pgItmNext=$("#pgallery3 .pglnks li").eq((itmSel+1)%(ITMLAST+1));if($pgItmNext.find("img").length>0){$pgItmNext.find("img").clone().prependTo(topNext+" a");}$(topNext+" a").attr("href",$pgItmNext.find("a").attr("href"));if($(newImgCont+" a.bigimg").length>0){$(newImgCont+" a.bigimg").attr("href",$pgItmNext.find("a").attr("href"));}$("#pgallery3 .pglnks li").eq(ITMCUR).removeClass("sel");$("#pgallery3 .pglnks li").eq(itmSel).addClass("sel");ITMCUR=itmSel;SNI.TC.DynAds.refresh();if($("#print-select a.this").length>0){plink=$("#print-select a.this").attr("href");i=itmSel+1;if(i<10){i="0"+parseInt(itmSel+1);}plink=$("#print-select a.this").attr("href");plink=plink.replace(/(.*ARTICLE-PRINT-PHOTO-GALLERY-CURRENT).*?(,00.html)$/,"$1_"+i+"$2");$("#print-select a.this").attr("href",plink);}setPanel();SNI.Util.hitCount();return;}function doDynOmni(i){++i;if(mdManager.getParameterString("oUrl")==""){mdManager.setParameter("oUrl",mdManager.getParameterString("Url"));}mdManager.setParameter("Url",mdManager.getParameter("oUrl")+"?i="+parseInt(i));if(i<10){i="0"+parseInt(i);}mdManager.setParameter("UniqueId",mdManager.getParameterString("UniqueId").replace(/(.*?)_([0-9]{1,2})$/,"$1_"+i));if(typeof s=="object"){s.t();}return;}function setImgData(imgData,$inImgCont){if(imgData.bvert){$inImgCont.removeClass("vert-enl").addClass("vert-shr");}else{$inImgCont.removeClass("vert-shr vert-enl");}$inImgCont.find("img").attr("src",imgData.iurl).attr("alt",imgData.ialt);$myPanel=$inImgCont.find(".imgpanel");$myPanel.find("h2").html(imgData.ititle);$myPanel.find("cite").html(imgData.icap);if((imgData.rurl!="")&&(imgData.rtxt!="")){$myPanel.find(".lgbtn a").attr("href",imgData.rurl);$myPanel.find(".lgbtn .lgbtn-text").text(imgData.rtxt);$myPanel.find(".lgbtn").removeClass("hide");}else{$myPanel.find(".lgbtn").addClass("hide");}if((imgData.ititle=="")&&(imgData.icap=="")&&(imgData.rurl=="")&&(imgData.rtxt=="")){$myPanel.addClass("hide");}else{$myPanel.find("a.open").hide();$myPanel.find("a.close").show();$myPanel.css({bottom:"0"});$myPanel.removeClass("hide");}return;}function fixByLine(itmSel){iCreator="";if(itmSel<SNI.TC.Photogallery3.ImageData.length){iCreator=SNI.TC.Photogallery3.ImageData[itmSel].creator;}if(iCreator!=""){if($("#hg-w > .intro p.byline").length==0){$("#hg-w > .intro").append('<p class="byline"></p>');}$("#hg-w > .intro p.byline").addClass("pic").text("By "+iCreator);}else{if($("#hg-w > .intro p.byline.pic").length>0){if(BYLINE!=""){$("#hg-w > .intro p.byline").removeClass("pic").text(BYLINE);}else{$("#hg-w > .intro p.byline").remove();}}}return;}$("#pgallery3 .endframe .nav a").click(function(){$("#pgallery3 .endframe .nav li.sel").removeClass("sel");$(".endframe .tab").hide();$(".endframe .tab."+$(this).parent().parent().attr("class")).show();$(this).parent().parent().addClass("sel");return false;});$("#pgallery3 .endframe div.share p#copylink a").click(function(){$("#embed_code").select();return false;});$("#pgallery3 .endframe .share .digg a").click(function(){window.open("http://digg.com/submit?url="+encodeURIComponent(location.href)+"&title="+encodeURIComponent(mdManager.getParameter("Title")));return false;});$("#pgallery3 .endframe .share .fb a").click(function(){window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(location.href)+"&t="+encodeURIComponent(mdManager.getParameter("Title")),"sharer","toolbar=0,status=0,width=626,height=436,resizable=yes");return false;});$("#pgallery3 .endframe .share .mysp a").click(function(){window.open("http://www.myspace.com/index.cfm?fuseaction=postto&"+"t="+encodeURIComponent(mdManager.getParameter("Title"))+"&u="+encodeURIComponent(location.href));return false;});$("#pgallery3 .endframe .share .deli a").click(function(){window.open("http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url="+encodeURIComponent(location.href)+"&amp;title="+encodeURIComponent(mdManager.getParameter("Title")),"delicious","toolbar=no,width=550,height=550,resizable=yes");return false;});function loadHotSpotJSON(){if(typeof SNI.TC.Photogallery3.hsJSON=="undefined"){return;}myJSONurl="http://"+location.hostname+SNI.TC.Photogallery3.hsJSON;$.ajax({url:myJSONurl,dataType:"script",cache:true,timeout:10000,success:successHotSpotJSON,error:errorHotSpotJSON,complete:completeHotSpotJSON});return;}function errorHotSpotJSON(oXHTTP,stat,oExc){return;}function successHotSpotJSON(dta,stat){$("#pgallery3").append('<script type="text/javascript">'+dta+"\n SNI.TC.Photogallery3.cbackHotSpotJSON();<\/script>");return;}function completeHotSpotJSON(oXHTTP,stat){if(stat=="success"){}return;}function setPanel(){itmBaseCur=Math.round((XBASE-$("#pgallery3 .pglnks").position().left)/ITMWIDTH);itmBaseNew=Math.max(0,Math.min(ITMLAST-ITMPERPANEL,Math.floor((ITMCUR-1)/ITMPERPANEL)*ITMPERPANEL));if(itmBaseCur!=itmBaseNew){itmBaseNew=Math.max(0,Math.min(ITMLAST-ITMPERPANEL,Math.floor((ITMCUR-1)/ITMPERPANEL)*ITMPERPANEL));$("#pgallery3 .pglnks").css("left",(XBASE-itmBaseNew*ITMWIDTH)+"px");if(itmBaseCur==0){$("#pgallery3 .pglnkmask .leftctrl a").removeClass("dis");}if(itmBaseNew==0){$("#pgallery3 .pglnkmask .leftctrl a").addClass("dis");}if(itmBaseCur==ITMLAST-ITMPERPANEL){$("#pgallery3 .pglnkmask .rightctrl a").removeClass("dis");}if(itmBaseNew==ITMLAST-ITMPERPANEL){$("#pgallery3 .pglnkmask .rightctrl a").addClass("dis");}}}function fixEndFrame(){if($("#pgallery3 .endframe .tab.shop img").length==0){$("#pgallery3 .endframe .nav .shop").hide();}if($("#pgallery3 .endframe .tab.ymal img").length==0){$("#pgallery3 .endframe .nav .ymal").hide();$("#pgallery3 .endframe .nav .email").addClass("sel");$("#pgallery3 .endframe .tab.email").show();}if($("#pgallery3 .pglnks li:last img").length==0){$("#pgallery3 .pglnks li:last .tnframe").append(EF_IMG_HTML);if((ITMCUR==ITMLAST)&&($("#pgallery3 .photonav .nextlnk img").length==0)){$("#pgallery3 .photonav .nextlnk").prepend(EF_IMG_HTML);}}return;}bHS=false;for(i=0;i<SNI.TC.Photogallery3.ImageData.length;i++){bHS=bHS||SNI.TC.Photogallery3.ImageData[i].bhs;}if(bHS){if(typeof SNI.TC.Photogallery3.hsJSON!="undefined"){loadHotSpotJSON();}}if(ITMCUR<SNI.TC.Photogallery3.ImageData.length){if(typeof SNI.TC.Photogallery3.hsJSON=="undefined"){if(SNI.TC.Photogallery3.ImageData[ITMCUR].bhs){SNI.TC.Photogallery3.doHotSpots(ITMCUR);}if(bHS){SNI.TC.Photogallery3.insertProdsTab();}}fixByLine(ITMCUR);}$("#pgallery3 .photowrap").append('<div class="largeImage loading"><span></span><p>loading</p></div>');SNI.TC.DynAds.init();var itmSel=ITMCUR;if($.query.has("i")){itmSel=parseInt($.query.get("i"));if(isNaN(itmSel)||(itmSel<1)||(itmSel>ITMLAST+1)){itmSel=ITMCUR;}else{--itmSel;}}if(itmSel!=ITMCUR){setImg(itmSel);}setPanel();fixEndFrame();return;}};SNI.TC.DynAds={descr:{active:true,refreshRate:3,interstitial:false},iparm:{iURL:"",iFmt:"",iHREF:"",iHeight:"",iWidth:"",iTrackURL:"",bURL:""},impressionCt:0,init:function(){myJSON=getDartEnterpriseUrl("PHOTO_DESCRIPTOR",1);myJSON+="&params.styles=photoGallery&callback=?";$.getJSON(myJSON,SNI.TC.DynAds.cback_descrJSON);return;},cback_descrJSON:function(oJSON){if(typeof oJSON!="object"){return false;}if(oJSON.photo_descriptor==undefined){return false;}oJSON=oJSON.photo_descriptor;if(oJSON.active==undefined){return false;}if(oJSON.refreshRate==undefined){return false;}if(oJSON.active!="true"){return false;}tmp=parseInt(oJSON.refreshRate);if(isNaN(tmp)){return false;}if(tmp<1||tmp>100){return false;}SNI.TC.DynAds.descr.active=true;SNI.TC.DynAds.descr.refreshRate=tmp;if(oJSON.interstitial==undefined){return false;}if(oJSON.interstitial=="true"){SNI.TC.DynAds.descr.interstitial=true;}return true;},refresh:function(){if(!this.descr.active){return;}$("#pgallery3 .interwrap").remove();this.impressionCt++;if(this.impressionCt==this.descr.refreshRate){this.impressionCt=0;if(this.descr.interstitial){myJSON=getDartEnterpriseUrl("PHOTO_INTERSTITIAL",1);myJSON+="&params.styles=photoGallery&callback=?";$.getJSON(myJSON,SNI.TC.DynAds.cback_interJSON);return;}else{setDartEnterpriseBanner("BIGBOX",getDartEnterpriseUrl("BIGBOX",5));}}return;},cback_interJSON:function(oJSON){$.each(SNI.TC.DynAds.iparm,function(key,val){SNI.TC.DynAds.iparm[key]="";});if(typeof oJSON!="object"){return false;}if(typeof oJSON.scrippsads!="object"){return false;}if(typeof oJSON.scrippsads.ad!="object"){return false;}for(i=0;i<oJSON.scrippsads.ad.length;++i){if(typeof oJSON.scrippsads.ad[i].position!="object"){return false;}with(oJSON.scrippsads.ad[i].position){with(SNI.TC.DynAds){if((iparm.iURL=="")&&(id=="interstitial")){iparm.iURL=media.src;iparm.iFmt=media.format;iparm.iHREF=media.href;iparm.iHeight=media.height;iparm.iWidth=media.width;if(typeof media.tracking.audit=="object"){iparm.iTrackURL=media.tracking.audit.src;}}if((iparm.bURL=="")&&(id=="300syncBanner")){iparm.bURL=media.src;}}}}with(SNI.TC.DynAds){if(iparm.iURL==""||iparm.iFmt==""||iparm.bURL==""){return false;}}SNI.TC.DynAds.gen_interstitial();return true;},gen_interstitial:function(){hRet="";with(SNI.TC.DynAds){hRet+='<div class="interwrap">';hRet+='<a href="#" class="close"><span></span>Next Photo</a>';hRet+="<h6>Advertisement</h6>";if(iparm.iFmt.toLowerCase()=="swf"){hRet+='<div id="interad"></div>';}else{if(iHREF!=""){hRet+='<a href="'+iparm.iHREF+'">';}hRet+='<img src ="'+iparm.iURL+'" />';if(iHREF!=""){hRet+="</a>";}}hRet+='<iframe class="tracker" width="0" height="0" frameborder="0"></iframe>';hRet+="</div>";$myImgCont=$("#pgallery3 #img-"+ITMCUR);if($myImgCont.hasClass("vert-enl")){$myImgCont.removeClass("vert-enl").addClass("vert-shr");}$("#pgallery3 .photowrap").append(hRet);$("#pgallery3 .interwrap .close").click(function(){$("#pgallery3 .interwrap").remove();return false;});if(iparm.iFmt.toLowerCase()=="swf"){swfobject.embedSWF(iparm.iURL,"interad",iparm.iWidth,iparm.iHeight,"9","http://common.scrippsnetworks.com/common/flash-express-install/expressInstall.swf","",{wmode:"opaque",allowScriptAccess:"always",quality:"high"});}setDartEnterpriseBanner("BIGBOX",iparm.bURL);$("#pgallery3 .interwrap .tracker").attr("src",iparm.iTrackURL);}return;}};SNI.TC.GetInspired={colorPicker:function(colorList,typeList,hrefList){var swfUrl="http://web.TC.com/webTC/hg20/swf/color-picker/color-picker.swf";var elementId="color-picker";var width=160;var height=160;var flashvars={colorList:colorList,typeList:typeList,hrefList:hrefList};var params={wmode:"transparent",allowScriptAccess:"always",quality:"high"};swfobject.embedSWF(swfUrl,elementId,width,height,"9","http://common.scrippsnetworks.com/common/flash-express-install/expressInstall.swf",flashvars,params,{});}};SNI.TC.ZoneFinder={init:function(){$("#zone-finder form").submit(function(){zip=$.trim($("#zone-zip").val());if(zip==""){return false;}var url="/cf/com/TC/zonefinder/ZipCodeSearch.cfc?method=findZone&zipCode="+zip;try{$.ajax({dataType:"text",url:url,success:function(zone){$("#zone-finder .message").hide();zone=$.trim(zone);if(zone=="-1"||zone=="-2"||zone==""){$("#zone-finder .error").show();}else{$("#zone-finder form").hide();success=$("#zone-finder .success");success.find(".zone").text("Zone "+zone.toUpperCase());success.find(".details").attr("href","/topics/garden-zone-"+parseInt(zone)+"/index.html");success.show();}}});}catch(e){}return false;});}};if(typeof(SNI.TC.Util)=="undefined"){SNI.TC.Util={};}SNI.TC.Util.liHover=function(el){if($.browser.msie&&parseInt($.browser.version)==6){$(el).find("li").hover(function(){$(this).addClass("hover");},function(){$(this).removeClass("hover");});}};jQuery.fn.sort=Array.prototype.sort;SNI.TC.Util.flyOuts={getScrollXY:function(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=="number"){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}}}return[scrOfX,scrOfY];},moveToView:function(settings){settings=jQuery.extend({object:null,anchorObj:null,yAlign:"left",useLftOffset:0,useTopOffset:0,overRideDflt:false},settings);settings.object.css({left:"",top:""});var p=SNI.TC.Util.flyOuts.getPosition(settings.object,true);var pc=SNI.TC.Util.flyOuts.getPosition(settings.anchorObj,true);var viewportHeight=$(window).height();var scrollTop=SNI.TC.Util.flyOuts.getScrollXY()[1];var viewportBottomY=scrollTop+viewportHeight;var containerMaxTopY=(viewportBottomY-(settings.object[0].offsetHeight+10));if((settings.anchorObj[0].offsetTop-4>containerMaxTopY)&&(165<=viewportHeight)){var top=containerMaxTopY;var left=(pc.width+pc.left)+(settings.useLftOffset);if(settings.pAlign=="left"){left=(pc.left-p.width)+(settings.useLftOffset);}settings.object.css({left:left+"px",top:top+"px"});}else{var top="";var left="";if(settings.overRideDflt){top=pc.top+settings.useTopOffset;left=(pc.width+pc.left)+(settings.useLftOffset);}if((jQuery.browser.msie)&&(!settings.overRideDflt)){left=pc.left;top=pc.top+15;}settings.object.css({left:left+"px",top:top+"px"});}},getPosition:function(obj){var $el=obj;var bHidden=false;var bUseOffset=true;if($el.is(":hidden")){bHidden=!!$el.css("visibility","hidden").show();}var pos=$.extend($el[bUseOffset===true?"offset":"position"](),{width:$el.outerWidth(),height:$el.outerHeight(),marginLeft:parseInt($.curCSS($el[0],"marginLeft",true),10)||0,marginRight:parseInt($.curCSS($el[0],"marginRight",true),10)||0,marginTop:parseInt($.curCSS($el[0],"marginTop",true),10)||0,marginBottom:parseInt($.curCSS($el[0],"marginBottom",true),10)||0});if(pos.marginTop<0){pos.top+=pos.marginTop;}if(pos.marginLeft<0){pos.left+=pos.marginLeft;}pos["bottom"]=pos.top+pos.height;pos["right"]=pos.left+pos.width;if(bHidden){$el.hide().css("visibility","visible");}return pos;},alphaCompare:function(a,b){a=a.toLowerCase();b=b.toLowerCase();return a<b?-1:a>b?1:0;}};SNI.Util.hitCount=function(){var myURL,cacheBuster=new Date();if(location.host=="www.TC.com"){myURL="http://img.TC.com/webTC/hg20/html/fixHits.html?c="+cacheBuster.getTime();}else{myURL="http://frontend.scrippsnetworks.com/TC/fixHits.html?c="+cacheBuster.getTime();}if($("#hitCounter").length>0){$("#hitCounter").remove();}$("head").append('<iframe id="hitCounter" src="'+myURL+'" width="0" height="0" frameborder="0" style="height:0; width:0; display:none;"></iframe>');return;};SNI.Util.Flyout={create:function(settings){var flyout={draw_list:function(items){var flyout=this;items=items||flyout.select.children("option").not(".excluded");var flyout_list=jQuery('<ul class="flyout-list"></ul>');items.each(function(i){var $this=jQuery(this);var list_item=jQuery("<li><span>"+jQuery.trim($this.text())+"</span></li>");if($this.attr("selected")){list_item.addClass("selected");}if($this.attr("disabled")){list_item.addClass("disabled");}list_item.not(".disabled").click(function(event){flyout.anchor.children("."+flyout.settings.trigger_class[0]).children("span").text(jQuery.trim($this.text()));$this.siblings().removeAttr("selected");$this.attr("selected","selected");flyout.hide();flyout.select.change();});flyout_list.append(list_item);});return flyout_list;},show:function(speed){var flyout=this;flyout.element.fadeIn(speed||100);flyout.anchor.addClass("flyout-is-open");},hide:function(speed){var flyout=this;flyout.element.fadeOut(speed||100);flyout.anchor.removeClass("flyout-is-open");},create_flyout:function(){var flyout=this;var html=jQuery("<div></div>");var id=flyout.flyout_id();var settings=flyout.settings;jQuery.each(settings.wrapper_classes,function(){html.addClass(this.toString());});if(id){html.attr("id",id);}var head=flyout._flyout_hd();head.children(".close").click(function(e){flyout.hide();});html.append(head);html.append(flyout._flyout_bd());html.append(flyout._flyout_ft());return html;},_flyout_hd:function(){var html=jQuery("<div></div>");jQuery.each(settings.header_wrap,function(){html.addClass(this.toString());});if(settings.close_button){html.prepend('<span class="close">Close</span>');}if(settings.title){html.prepend("<"+settings.title_element+' class="'+settings.title_class+'">'+settings.title+"</"+settings.title_element+">");}return html;},_flyout_bd:function(){var html=jQuery("<div></div>");jQuery.each(settings.body_wrap,function(){html.addClass(this.toString());});html.append(flyout.list);return html;},_flyout_ft:function(){var html=jQuery("<div></div>");jQuery.each(settings.footer_wrap,function(){html.addClass(this.toString());});return html;},flyout_id:function(){var flyout=this;var id;if(flyout.select&&flyout.select.attr("id")){id="flyout-for-"+flyout.select.attr("id");}return id;},build_options:function(settings){settings.title_element=settings.title_element||"h4";settings.title_class=settings.title_class||"flyout-title";settings.close_button=settings.close_button?true:false;settings.wrapper_classes=settings.wrapper_classes||["flyout"];settings.header_wrap=settings.header_wrap||["flyout-hd"];settings.body_wrap=settings.body_wrap||["flyout-bd"];settings.footer_wrap=settings.footer_wrap||["flyout-ft"];this.settings=settings;return settings;}};flyout.build_options(settings);return flyout;},createFor:function(select_element,settings){settings.wrapper_classes=["flyout","flyout-med","flyout-for-select"];settings.attach_to=settings.attach_to||select_element.parent();settings.anchor_class=settings.anchor_class||["select-flyout"];settings.trigger_class=settings.trigger_class||["select-flyout-selector"];settings.flyout_css=(settings.flyout_css===false)?false:true;var flyout=this.create(settings);flyout.anchor=jQuery("<div><div><span>"+jQuery.trim(select_element.children(":selected").text())+"</span></div></div>");flyout.select=select_element;flyout.list=flyout.draw_list(flyout.sele);flyout.element=flyout.create_flyout();if(flyout.select.attr("id")){flyout.anchor.attr("id","selector-for-"+flyout.select.attr("id"));}jQuery.each(settings.anchor_class,function(){flyout.anchor.addClass(this.toString());});jQuery.each(settings.trigger_class,function(){flyout.anchor.children("div").addClass(this.toString());});flyout.select.change(function(event){flyout.anchor.children("span").html(jQuery.trim(flyout.select.children(":selected").text()));flyout.select.children("option").not(".excluded").each(function(i){if(jQuery(this).is(":selected")){var selected_list_item=flyout.element.find(".flyout-list > li").eq(i);if(!selected_list_item.hasClass("selected")){selected_list_item.siblings().removeClass("selected");selected_list_item.addClass("selected");}return false;}});});if(settings.flyout_css===true){flyout.element.css({"position":"absolute","top":0,"left":0,"display":"none"});}flyout.anchor.append(flyout.element);var body_click=function(event){var fly=flyout;var element=$(event.target);if(fly.element.is(":visible")){if(element.parents().is("#"+fly.anchor.attr("id"))){event.stopPropagation();}else{fly.hide();jQuery("body").unbind("click",body_click);}}else{event.stopPropagation();}};flyout.anchor.children("."+settings.trigger_class[0]).bind("click focus",function(e){flyout.show();jQuery("body").bind("click",body_click);});select_element.hide();flyout.settings.attach_to.append(flyout.anchor);return flyout;}};if($.browser.msie){$(function(){$("button.button").mousedown(function(){$(this).addClass("active");}).mouseup(function(){$(this).removeClass("active");});$("a.button, .button-nav a, a.button-sm, .button-nav-sm a").mouseup(function(){$(this).blur();});});}SNI.TC.BrowserCheck={init:function(){if($.browser.msie&&parseInt($.browser.version)<7&&!window.XMLHttpRequest&&($("body#print").length==0)){var bc=this;if(SNI.Util.Cookie.get("upgradeReminderSet")==null){var html='<div id="ie6-msg" class="clrfix"><a href="#" class="close">Close</a><div id="ie6-txt"><h3>We Noticed You Are Using Internet Explorer 6.</h3><p>We detected your browser is out of date. For the best possible experience, upgrade to the latest version of <a href="http://www.browserforthebetter.com/download.html" target="_blank">Internet Explorer</a>, or try one of these fine browsers: <a href="http://www.firefox.com" target="_blank">Firefox</a> or <a href="http://www.apple.com/safari/download/" target="_blank">Safari</a>.</p>';if(SNI.Util.Cookie.get("upgradePreviouslyReminded")=="1"){html+='<p class="remind"><a href="#" class="yes">Remind Me in 30 Days</a> or <a href="#" class="no">Don\'t Remind Me</a></p>';}html+='</div><ul><li><a id="icn-ie" href="http://www.browserforthebetter.com/download.html" target="_blank">Get Internet Explorer</a></li><li><a id="icn-ff" href="http://www.firefox.com" target="_blank">Get Firefox</a></li><li><a id="icn-sf" href="http://www.apple.com/safari/download/" target="_blank">Get Safari</a></li></ul></div>';html=$(html);$("a.close, .remind a.yes",html).click(function(){bc.setReminder(30);$(html).slideUp();SNI.TC.Omniture.ClickTrackSingle(this,"UpgradeIE6 ","TC");return false;});$(".remind a.no",html).click(function(){bc.setReminder(365);$(html).slideUp();SNI.TC.Omniture.ClickTrackSingle(this,"UpgradeIE6 ","TC");return false;});if($("#hg-bd").length){$("#hg-bd").prepend(html);}else{$("#site-wrapper").prepend(html);}html.show();SNI.TC.Omniture.ClickTrackSingle("#ie6-msg #ie6-txt","UpgradeIE6 ","Food");SNI.TC.Omniture.ClickTrackSingle("#ie6-msg ul li","UpgradeIE6 ","Food");SNI.TC.Omniture.ClickTrackSingle("#ie6-msg .remind","UpgradeIE6 ","Food");}}},setReminder:function(days){SNI.Util.Cookie.set("upgradeReminderSet","1",days);SNI.Util.Cookie.set("upgradePreviouslyReminded","1",365*2);}};$(document).ready(function(){SNI.TC.BrowserCheck.init();});function TCAd(adtype,adsize,pos,keywords){if(pos<0||pos==undefined){pos=1;}if(keywords==undefined){keywords="";}var ad=new DartAd();ad.setUrl("http://"+SNI.Ads._adServerHostname+"/js.ng/");if(adtype=="BIGBOX"&&pos==5){ad.addParameter("adtype","BIGBOX");}else{ad.addParameter("adtype",adtype);}if(adtype=="LEADERBOARD"){ad.addParameter("Params.styles","SNI_LEADERBOARD");}ad.addParameter("adsize",adsize);ad.addParameter("PagePos",pos);ad.useFeature("tile");if(keywords!=""){var words=keywords.split(" ");for(i=0;i<words.length;i++){ad.addParameter("keyword",words[i]);}}switch(adtype){default:writeAd(ad);break;}}function writeAd(ad){if(typeof adRestrictionManager!="undefined"){ad.useIframe=adRestrictionManager.isIframe(ad,mdManager);if(adRestrictionManager.isActive(ad,mdManager)!=false){adManager.createAd(ad);}}else{if(typeof adManager!="undefined"){adManager.createAd(ad);}}}function LeaderboardAd(pos){if(pos<0||pos==undefined||pos==""){pos=1;}TCAd("LEADERBOARD","468x60",pos);}function PushdownAd(pos){if(pos<0||pos==undefined){pos=1;}TCAd("PUSHDOWN","",pos);}function GoogleBigboxAd(pos){if(pos<0||pos==undefined){pos=1;}TCAd("GOOGLE_BIGBOX","",pos);}function GoogleLeaderboardAd(pos){if(pos<0||pos==undefined){pos=1;}TCAd("GOOGLE_LEADERBOARD","",pos);}function BigboxAd(pos,keywords){if(typeof(mdManager)!=undefined&&mdManager.getParameterString("VideoPlayer")==""){if(pos<0||pos==undefined){pos=1;}TCAd("BIGBOX","",pos,keywords);}}function BigboxAd300x150(pos,keywords){if(pos<0||pos==undefined){pos=1;}TCAd("SPONSORSHIP_CONTENT","",pos,keywords);}function SuperstitialAd(pos){if(pos<0||pos==undefined){pos=1;}TCAd("SUPERSTITIAL","",pos);}function VideoPlayerAd(adtype,adsize,pos){var ad=new AdUrl();ad.setUrl("http://"+SNI.Ads._adServerHostname+"/html.ng/");if(adtype!=""){ad.addParameter("adtype",adtype);}if(adsize!=""){ad.addParameter("adsize",adsize);}if(!pos||pos==""){pos=1;}ad.addParameter("PagePos",pos);ad.useFeature("tile");writeAd(ad);return ad.buildExpandedUrl();}function getDartEnterpriseUrl(adtype,pos){adtype=adtype.toUpperCase();var strUrl=VideoPlayerAd(adtype,"",pos);return strUrl;}function setDartEnterpriseBanner(adType,sync_banner){if(adType=="LEADERBOARD"){if($("#leaderboard").length>0){boxW=728;boxH=90;$("#leaderboard").html("<iframe src='"+sync_banner+"' width='"+boxW+"' height='"+boxH+"'"+"frameborder='0' scrolling='no' marginheight='0' marginwidth='0'></iframe>");}}else{if($("#bigbox").length>0){boxW=300;boxH=250;if(sync_banner.indexOf("336x850")>-1){boxW=336;boxH=850;}else{if(sync_banner.indexOf("300x600")>-1){boxW=300;boxH=600;}}$("#bigbox").html("<iframe src='"+sync_banner+"' width='"+boxW+"' height='"+boxH+"'"+"frameborder='0' scrolling='no' marginheight='0' marginwidth='0'></iframe>");}}return;}function setDefaultBigboxAd(){if(typeof(mdManager)!=undefined&&mdManager.getParameterString("VideoPlayer")==""){return;}var default_ad=VideoPlayerAd("BIGBOX","",5);if($("#bigbox").length>0){boxW=300;boxH=250;if(default_ad.indexOf("336x850")>-1){boxW=336;boxH=850;}else{if(default_ad.indexOf("300x600")>-1){boxW=300;boxH=600;}}$("#bigbox").html("<iframe src='"+default_ad+"' width='"+boxW+"' height='"+boxH+"'"+"frameborder='0' scrolling='no' marginheight='0' marginwidth='0'></iframe>");}}function MultiLogoAd(adtype,logoNum){var ad=new DartAd();if(logoNum==undefined||logoNum==""||logoNum>4||logoNum<1){logoNum=4;}if(adtype==undefined||adtype==""){adtype="LOGO";}ad.setUrl("http://"+SNI.Ads._adServerHostname+"/snDigitalLogo"+logoNum+".html?");ad.addParameter("adtype",adtype);ad.addParameter("PagePos",1);if(logoNum>0){writeAd(ad);$(document).ready(function(){if($(".sponsor-multi-logo a img").length>0){if($(".sponsor-multi-logo").parent().hasClass("west-spons")){$(".sponsor-multi-logo").prepend("<em>Sponsored by</em>");$(".west-spons").css("display","block");}else{$(".sponsor-multi-logo").prepend("<em>Sponsored by</em>");}}});}}function sponsorLinks(adtype,linkNum){var ad=new DartAd();if(linkNum==undefined||linkNum==""||linkNum>6||linkNum<1){linkNum=6;}if(adtype==undefined||adtype==""){adtype="SPONSORLINKS";}ad.setUrl("http://"+SNI.Ads._adServerHostname+"/sndigital_textlinks.html?");ad.addParameter("adtype",adtype);ad.addParameter("PagePos",1);if(linkNum>0){writeAd(ad);}}function WDGuidedNavSearchAds(adtype,pos,keywords,filters,pageNo){var ad=new DartAd();if(pos<0||pos==undefined){pos=1;}if(pageNo>0&&pageNo!=undefined){ad.addParameter("Page",pageNo);}ad.setUrl("http://"+SNI.Ads._adServerHostname+"/js.ng/");ad.addParameter("adtype",adtype);ad.addParameter("adsize","");ad.addParameter("PagePos",pos);var words=keywords.split(" ");for(i=0;i<words.length;i++){ad.addParameter("keyword",words[i]);}var words=filters.split(" ");for(i=0;i<words.length;i++){ad.addParameter("filter",words[i]);}writeAd(ad);}function WDGuidedNavSiteAdAds(adtype,keywords,filters,pageNo){WDGuidedNavSearchAds(adtype,1,keywords,filters,pageNo);}if(typeof(SNI.TC.Toolbar)=="undefined"){SNI.TC.Toolbar={};}SNI.TC.Toolbar={toolbar:"#toolbar",toolbarElement:$(SNI.TC.Toolbar.toolbar),revealModule:function(trigger,module){$(SNI.TC.Toolbar.toolbar).find(trigger).click(function(){module.fadeIn(SNI.TC.ANIMATION_SPEED);$(this).addClass("active");return false;});},closeModule:function(trigger,module,speed){if(speed==null){speed=SNI.TC.ANIMATION_SPEED;}module.fadeOut(speed);if($(trigger).hasClass("active")){$(trigger).removeClass("active");}},fontResizeTgt:"#hg-art-we",fontResize:function(element){$(element).find("li").click(function(){var defaultSize="100%";$(element).find("li").removeClass("active");$(this).addClass("active");if($(this).hasClass("med")){$(SNI.TC.Toolbar.fontResizeTgt).css("font-size",defaultSize);}else{if($(this).hasClass("sm")){$(SNI.TC.Toolbar.fontResizeTgt).css("font-size","85%");}else{$(SNI.TC.Toolbar.fontResizeTgt).css("font-size","116%");}}});},printPage:function(){var module=$("#print-select");SNI.TC.Toolbar.revealModule(".print",module);$("em.close").click(function(){SNI.TC.Toolbar.closeModule(".print",module);});$(".email").click(function(){SNI.TC.Toolbar.closeModule(".print",module);});},emailAFriend:function(inMod){if(inMod==undefined){SNI.TC.Toolbar.emailAFriend1($("#email-a-friend"));}else{SNI.TC.Toolbar.emailAFriend2($(inMod));}},emailAFriend2:function(module){var form=module.find("form");initMessage=form.find("textarea").val();clear_form=function(){form.find("input:text").each(function(){$(this).val("");});form.find("textarea").val(initMessage);form.find("label").removeClass("error");module.find(".message").removeClass("alert").text("All fields are required.");return;};clear_form();$("#pgallery3 .email form .form-submit a").click(function(){clear_form();return false;});if(mdManager.getPageTitle){var page_title=mdManager.getPageTitle();success_message=module.find(".success strong");success_message.text(page_title);}else{success_message.text("this page");}form.validate({errorLabelContainer:false,rules:{from_name:{required:true},from_email:{required:true,email:true},to_emails:{required:true,multipleEmails:true}},messages:{from_name:{required:"Whoops. Please enter your name."},from_email:{required:"Whoops. Please enter your e-mail address.",email:"Whoops. Please check the format of your e-mail address and re-enter (i.e. joe@TC.com)."},to_emails:{required:"Whoops. Please enter at least one friend e-mail address.",multipleEmails:"Whoops. One or more of your friend e-mail addresses is not formatted correctly. Please check the format and re-enter (i.e. joe@TC.com)."}},showErrors:function(errorMap,errorList){if(errorList.length){module.find(".message").addClass("alert").html(errorList[0].message);element=$(errorList[0].element);if(element.hasClass("isemail")){element.select();}this.errorList=[this.errorList[0]];this.defaultShowErrors();}},submitHandler:function(){var txtarea=form.find('textarea[name="body"]');var txtarea_comment=txtarea.val();var page_title=mdManager.getPageTitle();var msg_body=form.find('input[name="from_name"]').val()+' thought you would be interested in this link to "'+page_title+'" on the  TC Web site:\n\n';msg_body+="http://"+location.hostname;msg_body+=mdManager.getParameter("Url")+"\n\n";if(txtarea.val()!=""){msg_body+="Comments from "+form.find('input[name="from_name"]').val()+":\n";msg_body+=txtarea.val();}module.find(".message").hide().removeClass("alert");form.find("fieldset").hide();form.find("label").removeClass("error");form.find("button").addClass("disabled").attr("disabled","disabled");form.find(".cancel").addClass("disabled");form.find(".loading").show();txtarea.val(msg_body);var form_data="";form.find(":input:not('button')").each(function(){var input_name=$(this).attr("name");var input_value=$(this).val();form_data+=input_name+"="+input_value+"&";});$.ajax({type:"POST",url:form.attr("action"),data:form_data.slice(0,-1),cache:false,success:function(data){form.find(".loading").hide();var response=$(data);var emailSent=response.eq(7).text();if(emailSent=="false"){txtarea.val(txtarea_comment);form.find("fieldset").show();form.find("button").removeClass("disabled").removeAttr("disabled");form.find(".cancel").removeClass("disabled");form.find("label[for='friends-email']").addClass("error");$("#friends-email").select();module.find(".message").addClass("alert").text("Whoops. The e-mail could not be sent to one or more of your friends. Please check the format of their e-mail address and re-enter (i.e. joe@TC.com).").show();}else{var success=module.find(".success");var page_title="this page";form.hide();success.show();var timeout=setTimeout(function(){success.hide();txtarea.val(txtarea_comment);module.find(".message").text("All fields are required.").show();form.find("input:text").each(function(){$(this).val("");});form.find("button").removeClass("disabled").removeAttr("disabled");form.find(".cancel").removeClass("disabled");form.find("fieldset").show();form.show();form.find("fieldset").show();},3000);$(".close").click(function(){clearTimeout(timeout);close_module();module.hide();success.hide();txtarea.val(txtarea_comment);module.find(".message").text("All fields are required.").show();form.find("input:text").each(function(){$(this).val("");});form.find("button").removeClass("disabled").removeAttr("disabled");form.find(".cancel").removeClass("disabled");form.find("fieldset").show();form.show();});}},error:function(){form.find(".loading").hide();txtarea.val(txtarea_comment);form.find("fieldset").show();form.find("button").removeClass("disabled").removeAttr("disabled");form.find(".cancel").removeClass("disabled");module.find(".message").addClass("alert").text("Whoops. We encountered an error when trying to e-mail this page. Please wait a few moments and try again.").show();}});}});},emailAFriend1:function(module){var form=module.find("form");var null_value="";var initMessage=form.find("textarea").val();module.click(function(e){e.stopPropagation();});$(".print").click(function(){SNI.TC.Toolbar.closeModule(".email",module);});SNI.TC.Toolbar.revealModule(".email",module);$(".close").click(function(){SNI.TC.Toolbar.closeModule(".email",module);});$(".form-submit a").click(function(){SNI.TC.Toolbar.closeModule(".email",module);return false;});if(mdManager.getPageTitle){var page_title=mdManager.getPageTitle();var success_message=module.find(".success strong");success_message.text(page_title);}else{success_message.text("this page");}form.validate({errorLabelContainer:false,rules:{from_name:{required:true},from_email:{required:true,email:true},to_emails:{required:true,multipleEmails:true}},messages:{from_name:{required:"Whoops. Please enter your name."},from_email:{required:"Whoops. Please enter your e-mail address.",email:"Whoops. Please check the format of your e-mail address and re-enter (i.e. joe@TC.com)."},to_emails:{required:"Whoops. Please enter at least one friend e-mail address.",multipleEmails:"Whoops. One or more of your friend e-mail addresses is not formatted correctly. Please check the format and re-enter (i.e. joe@TC.com)."}},showErrors:function(errorMap,errorList){if(errorList.length){module.find(".message").addClass("alert").html(errorList[0].message);element=$(errorList[0].element);if(element.hasClass("isemail")){element.select();}this.errorList=[this.errorList[0]];this.defaultShowErrors();}},submitHandler:function(){var txtarea=form.find('textarea[name="body"]');var txtarea_comment=txtarea.val();var page_title=mdManager.getPageTitle();var msg_body=form.find('input[name="from_name"]').val()+' thought you would be interested in this link to "'+page_title+'" on the  TC Web site:\n\n';msg_body+="http://"+location.hostname;msg_body+=mdManager.getParameter("Url")+"\n\n";if(txtarea.val()!=null_value){msg_body+="Comments from "+form.find('input[name="from_name"]').val()+":\n";msg_body+=txtarea.val();}module.find(".message").hide().removeClass("alert");form.find("fieldset").hide();form.find("label").removeClass("error");form.find("button").addClass("disabled").attr("disabled","disabled");form.find(".cancel").addClass("disabled");form.find(".loading").show();txtarea.val(msg_body);var form_data="";form.find(":input:not('button')").each(function(){var input_name=$(this).attr("name");var input_value=$(this).val();form_data+=input_name+"="+input_value+"&";});$.ajax({type:"POST",url:form.attr("action"),data:form_data.slice(0,-1),cache:false,success:function(data){form.find(".loading").hide();var response=$(data);var emailSent=response.eq(7).text();if(emailSent=="false"){txtarea.val(txtarea_comment);form.find("fieldset").show();form.find("button").removeClass("disabled").removeAttr("disabled");form.find(".cancel").removeClass("disabled");form.find("label[for='friends-email']").addClass("error");$("#friends-email").select();module.find(".message").addClass("alert").text("Whoops. The e-mail could not be sent to one or more of your friends. Please check the format of their e-mail address and re-enter (i.e. joe@TC.com).").show();}else{var success=module.find(".success");var page_title="this page";form.hide();success.show();var timeout=setTimeout(function(){SNI.TC.Toolbar.closeModule(".email",module,300);module.hide();success.hide();txtarea.val(txtarea_comment);module.find(".message").text("All fields are required.").show();form.find("input:text").each(function(){$(this).val("");});form.find("button").removeClass("disabled").removeAttr("disabled");form.find(".cancel").removeClass("disabled");form.find("fieldset").show();form.show();},3000);$(".close").click(function(){clearTimeout(timeout);SNI.TC.Toolbar.closeModule(".email",module);module.hide();success.hide();txtarea.val(txtarea_comment);module.find(".message").text("All fields are required.").show();form.find("input:text").each(function(){$(this).val("");});form.find("button").removeClass("disabled").removeAttr("disabled");form.find(".cancel").removeClass("disabled");form.find("fieldset").show();form.show();});}},error:function(){form.find(".loading").hide();txtarea.val(txtarea_comment);form.find("fieldset").show();form.find("button").removeClass("disabled").removeAttr("disabled");form.find(".cancel").removeClass("disabled");module.find(".message").addClass("alert").text("Whoops. We encountered an error when trying to e-mail this page. Please wait a few moments and try again.").show();}});}});},emailAFriendCaptcha:function(module){var module=$("#email-a-friend");var form=module.find("form");var null_value="";var initMessage=form.find("textarea").val();form.submit(function(e){e.preventDefault();return false;});function newCaptchaImg(){addtime=new Date().getTime();}$(".email").click(function(){form.find("#captcha-img").html('<img src="/app/emailservice2/captchaImg" height="30" width="93" />');});$("#captcha-request a").click(function(){newCaptchaImg();form.find("#captcha-img").html('<img src="/app/emailservice2/captchaImg?generateNew=true&t='+addtime+'" height="30" width="93" />');return false;});$(".print").click(function(){SNI.TC.Toolbar.closeModule(".email",module);});module.click(function(e){e.stopPropagation();});SNI.TC.Toolbar.revealModule(".email",module);$(".close").click(function(){SNI.TC.Toolbar.closeModule(".email",module);});$(".form-submit a").click(function(){SNI.TC.Toolbar.closeModule(".email",module);return false;});if(mdManager.getPageTitle){var page_title=mdManager.getPageTitle();var success_message=module.find(".success strong");success_message.text(page_title);}else{success_message.text("this page");}var captcha_msg="Whoops. Please enter the characters in the image to verify you are human.";form.validate({errorLabelContainer:form.find("p.message"),rules:{from_name:{required:true},from_email:{required:true,email:true},to_emails:{required:true,multipleEmails:true},captcha_answer:{required:true}},messages:{from_name:{required:"Whoops. Please enter your name."},from_email:{required:"Whoops. Please enter your e-mail address.",email:"Whoops. Please check the format of your e-mail address and re-enter (i.e. joe@TC.com)."},to_emails:{required:"Whoops. Please enter at least one friend e-mail address.",multipleEmails:"Whoops. One or more of your friend e-mail addresses is not formatted correctly. Please check the format and re-enter (i.e. joe@TC.com)."},captcha_answer:{required:captcha_msg}},showErrors:function(errorMap,errorList){if(errorList.length){module.find(".message").addClass("alert").html("");element=$(errorList[0].element);if(element.hasClass("isemail")){element.select();}this.errorList=[this.errorList[0]];this.defaultShowErrors();}},submitHandler:function(){var txtarea=form.find('textarea[name="body"]');var txtarea_comment=txtarea.val();var page_title=mdManager.getPageTitle();var msg_body=form.find('input[name="from_name"]').val()+' thought you would be interested in this link to "'+page_title+'" on the  TC Web site:\n\n';msg_body+="http://"+location.hostname;msg_body+=mdManager.getParameter("Url")+"\n\n";if(txtarea.val()!=null_value){msg_body+="Comments from "+form.find('input[name="from_name"]').val()+":\n";msg_body+=txtarea.val();}module.find(".message").hide().removeClass("alert");form.find("fieldset").hide();form.find("label").removeClass("error");form.find("button").addClass("disabled").attr("disabled","disabled");form.find(".cancel").addClass("disabled");form.find(".loading").show();txtarea.val(msg_body);var form_data="";form.find(":input:not('button')").each(function(){var input_name=$(this).attr("name");var input_value=$(this).val();form_data+=input_name+"="+input_value+"&";});$.ajax({type:"POST",url:form.attr("action"),dataType:"json",data:form_data.slice(0,-1),cache:false,success:function(data){form.find(".loading").hide();var response=$(data);var emailSent=data.emailSent;var captchaCorrect=data.captchaAnswerValid;if(!emailSent){txtarea.val(txtarea_comment);form.find("fieldset").show();form.find("button").removeClass("disabled").removeAttr("disabled");form.find(".cancel").removeClass("disabled");if(!captchaCorrect){form.find("label[for='captcha_answer']").addClass("error");$("#captcha_answer").select();module.find(".message").addClass("alert").text(captcha_msg).show();}else{form.find("label[for='friends-email']").addClass("error");$("#friends-email").select();module.find(".message").addClass("alert").text("Whoops. The e-mail could not be sent to one or more of your friends. Please check the format of their e-mail address and re-enter (i.e. joe@TC.com).").show();}}else{var success=module.find(".success");var page_title="this page";form.hide();success.show();var timeout=setTimeout(function(){SNI.TC.Toolbar.closeModule(".email",module,300);module.hide();success.hide();txtarea.val(txtarea_comment);module.find(".message").text("All fields are required.").show();form.find("input:text").each(function(){$(this).val("");});form.find("button").removeClass("disabled").removeAttr("disabled");form.find(".cancel").removeClass("disabled");form.find("fieldset").show();form.show();},3000);$(".close").click(function(){clearTimeout(timeout);SNI.TC.Toolbar.closeModule(".email",module);module.hide();success.hide();txtarea.val(txtarea_comment);module.find(".message").text("All fields are required.").show();form.find("input:text").each(function(){$(this).val("");});form.find("button").removeClass("disabled").removeAttr("disabled");form.find(".cancel").removeClass("disabled");form.find("fieldset").show();form.show();});}},error:function(){form.find(".loading").hide();txtarea.val(txtarea_comment);form.find("fieldset").show();form.find("button").removeClass("disabled").removeAttr("disabled");form.find(".cancel").removeClass("disabled");module.find(".message").addClass("alert").text("Whoops. We encountered an error when trying to e-mail this page. Please wait a few moments and try again.").show();}});}});},shareThis:function(){var share_url=SNI.Util.Url.setParameter(document.location.href,"soc","share");var page_title=jQuery("<div>"+mdManager.getPageTitle()+"</div>").text();var twitter_shared_object=SHARETHIS.addEntry({title:page_title+" #TC ",url:share_url});var facebook_shared_object=SHARETHIS.addEntry({title:page_title,url:share_url});twitter_shared_object.attachChicklet("twitter",SNI.TC.Toolbar.toolbarElement.find(".sharing .twitter a.chicklet")[0]);facebook_shared_object.attachChicklet("facebook",SNI.TC.Toolbar.toolbarElement.find(".sharing .facebook a.chicklet")[0]);},init:function(){if(!SNI.TC.Toolbar.toolbarElement||SNI.TC.Toolbar.toolbarElement.length==0){SNI.TC.Toolbar.toolbarElement=jQuery(SNI.TC.Toolbar.toolbar);}SNI.TC.Toolbar.fontResize(".font-resize");SNI.TC.Toolbar.printPage();if(SNI.TC.Toolbar.toolbarElement.find(".sharing .facebook a.chicklet").length>0){SNI.TC.Toolbar.shareThis();}if(jQuery("#email-a-friend form").attr("name")){SNI.TC.Toolbar.emailAFriendCaptcha();}else{SNI.TC.Toolbar.emailAFriend();}}};(function(){_egg=function(){return;if($("#fn-ft div.brand").length==0){return;}var o=$("#fn-ft .brand").get(0);if(o!==null){var ee=document.createElement("div");ee.className="_egg";o.appendChild(ee);$(ee).click(function(){if(document.getElementById("_egg-yolk")===null){var bd=document.getElementById("fn-bd");if(bd!=null){var img_w=620;var img_h=465;var x=($(window).width()-img_w)/2;var y=($(window).height()-img_h)/2;y+=window.scrollY;var yolk=document.createElement("div");yolk.setAttribute("id","_egg-yolk");yolk.style.left=Math.ceil(x)+"px";yolk.style.top=Math.ceil(y)+"px";bd.appendChild(yolk);$(yolk).click(function(){yolk.parentNode.removeChild(yolk);});$(yolk).animate({width:img_w+"px",height:img_h+"px"},700);}}});}};$(document).ready(_egg);})();SNI.TC.Newsletters={subscribe:function(){this.setupAccordion();$(".nl-bd .check-all a").click(function(){link=$(this);if(link.text()=="Check All"){checked="checked";link.html("<span>Uncheck All</span>");}else{checked="";link.html("<span>Check All</span>");}$(".nl-choose :checkbox").attr("checked",checked);return false;});$(".nl-bd form").validate({errorContainer:".nl-bd .form-errors",errorLabelContainer:".nl-bd .form-errors ul",wrapper:"li",rules:{newsletter:{required:true},fname:{required:true},lname:{required:true},email:{required:true,email:true},email2:{required:true,equalTo:"#email"},zip:"required"},messages:{newsletter:"Please choose at least one TC newsletter",fname:"Please enter your first name",lname:"Please enter your last name",email:{required:"Please enter your e-mail address",email:"Please check the format of your e-mail address and re-enter (i.e. joe@TC.com)"},email2:{required:"Please confirm your e-mail address",equalTo:"Please make sure your e-mail and confirmation e-mail match"},zip:"Please enter your zip code"},showErrors:function(errorMap,errorList){if(errorList.length){this.defaultShowErrors();element=errorList[0].element;if(element.type=="checkbox"){form=$(element.form);form.find("label[for="+element.id+"]").removeClass("error");form.find("label[for='newsletter']").addClass("error");}else{form.find("label[for='newsletter']").removeClass("error");}$("html, body").animate({scrollTop:$(".nl-bd .form-errors").offset().top-10},"slow");$(".nl-bd .form-errors").fadeIn();}}});},changeEmail:function(){$(".nl-bd form").validate({errorContainer:".nl-bd .form-errors",errorLabelContainer:".nl-bd .form-errors ul",wrapper:"li",rules:{oldemail:{required:true,email:true},newemail:{required:true,email:true},newemail2:{required:true,equalTo:"#new-email"}},messages:{oldemail:{required:"Please enter your old e-mail address",email:"Please check the format of your old e-mail address and re-enter (i.e. joe@TC.com)"},newemail:{required:"Please enter your new e-mail address",email:"Please check the format of your new e-mail address and re-enter (i.e. joe@TC.com)"},newemail2:{required:"Please confirm your new e-mail address",equalTo:"Please make sure your new e-mail and confirmation e-mail match"}},showErrors:function(errorMap,errorList){if(errorList.length){this.defaultShowErrors();$(".nl-bd .form-errors").fadeIn();}}});},unsubscribe:function(){this.setupAccordion();$(".nl-bd form").validate({errorContainer:".nl-bd .form-errors",errorLabelContainer:".nl-bd .form-errors ul",wrapper:"li",rules:{newsletter:{required:true},email:{required:true,email:true},email2:{required:true,equalTo:"#email"}},messages:{newsletter:"Please choose at least one TC newsletter",email:{required:"Please enter your e-mail address",email:"Please check the format of your e-mail address and re-enter (i.e. joe@TC.com)"},email2:{required:"Please confirm your e-mail address",equalTo:"Please make sure your e-mail and confirmation e-mail match"}},showErrors:function(errorMap,errorList){if(errorList.length){this.defaultShowErrors();element=errorList[0].element;if(element.type=="checkbox"){form=$(element.form);form.find("label[for="+element.id+"]").removeClass("error");form.find("label[for='newsletter']").addClass("error");}else{form.find("label[for='newsletter']").removeClass("error");}$("html, body").animate({scrollTop:$(".nl-bd .form-errors").offset().top-10},"slow");$(".nl-bd .form-errors").fadeIn();}}});},setupAccordion:function(){$(".nl-bd .acco-res li.selected").each(function(){$(this).find(".acco-bd").show();});$(".nl-bd .acco-res .acco-link").click(function(){acco_link=$(this);acco_bd=acco_link.next();acco_li=acco_link.parent();if(acco_li.hasClass("selected")){acco_bd.slideUp("slow");acco_li.removeClass("selected");}else{acco_bd.slideDown("slow");acco_li.addClass("selected");}});}};(function($){var NewsLetterAjax=function(form){var $nl_form,submit_url,$nl_error_list;$nl_form=$(form);$nl_error_list=$nl_form.find(".nl-errors");submit_url=$nl_form.attr("action");$nl_form.submit(function(e){$nl_form.find(".nl-loading").show();$nl_error_list.find("li").hide();var privacy=$nl_form.find("#nl-agree").attr("checked")?1:"";var ajax_url=submit_url+"?&list[]="+$nl_form.find("#nl-list").val()+"&email="+$nl_form.find("#nl-emailaddress").val()+"&privacy="+privacy;$.ajax({url:ajax_url,timeout:10000,dataType:"json",success:function(response){$nl_form.find(".highlight").removeClass("highlight");$nl_form.find("p.nl-intro").hide();if(response.success===true){$nl_form.find("fieldset").hide();$nl_form.find(".nl-thank-you").show();}else{if(response.error&&response.error.code){var error=response.error;$nl_error_list.find(".error-"+error.code).show();$nl_form.find(".highlight-"+error.code).addClass("highlight");}}$nl_form.find(".nl-loading").fadeOut("fast");}});e.preventDefault();return false;});return $nl_form;};SNI.TC.Newsletters.ajaxHandler=NewsLetterAjax;})(jQuery);SNI.TC.Contact={init:function(){$(".contact-bd select").dropdown();$(".contact-bd form").validate({errorContainer:".contact-bd .form-errors",errorLabelContainer:".contact-bd .form-errors ul",wrapper:"li",rules:{optionaldata5:"required",optionaldata6:"required",email:{required:true,email:true},confirm:{required:true,equalTo:"#email"},fname:"required",lname:"required",optionaldata4:"required",optionaldata7:"required"},messages:{optionaldata5:"Please select a reason for contacting us",optionaldata6:"Please select what this is regarding",email:{required:"Please enter your e-mail address",email:"Please check the format of your e-mail address and re-enter (i.e. joe@TC.com)"},confirm:{required:"Please confirm your e-mail address",equalTo:"Please make sure your e-mail and confirmation e-mail match"},fname:"Please enter your first name",lname:"Please enter your last name",optionaldata4:"Please enter your zip code",optionaldata7:"Please enter your message"},showErrors:function(errorMap,errorList){if(errorList.length){this.defaultShowErrors();$("html, body").animate({scrollTop:$(".contact-bd .form-errors").offset().top-10},"slow");$(".contact-bd .form-errors").fadeIn();}}});},liveChat:function(){$("form").validate({errorContainer:".form-errors",errorLabelContainer:".form-errors ul",wrapper:"li",rules:{fname:"required",lname:"required",email:{required:true,email:true},email2:{required:true,equalTo:"#email"}},messages:{fname:"Please enter your first name",lname:"Please enter your last name",email:{required:"Please enter your e-mail address",email:"Please check the format of your e-mail address and re-enter (i.e. joe@TC.com)"},email2:{required:"Please confirm your e-mail address",equalTo:"Please make sure your e-mail and confirmation e-mail match"}},showErrors:function(errorMap,errorList){if(errorList.length){$(".form-errors").fadeIn();this.defaultShowErrors();}}});}};if(typeof(SNI.TC.ImageEnlarge)=="undefined"){SNI.TC.ImageEnlarge={};}SNI.TC.ImageEnlarge={clickCtrl:".img-enlarge",insertPoint:"#hg-art-we",imgFrame:"#blow-up",closeCtrl:"#blow-up a.close",init:function(){$(SNI.TC.ImageEnlarge.clickCtrl).bind("click",SNI.TC.ImageEnlarge.clickExpand);},clickExpand:function(e){$(this).parents().filter(".thumb-wrap").before(SNI.TC.ImageEnlarge.htmlImage(this.href));$(SNI.TC.ImageEnlarge.closeCtrl).bind("click",SNI.TC.ImageEnlarge.closeImg);return false;},htmlImage:function(imgURL){retHTML="<div id='blow-up' class='clrfix'><div class='bu-hd'></div><div class='bu-bd'><div class='bu-bd-hd'><a class='close' href='#'>Close</a></div><img width='616' src='"+imgURL+"'><div class='bu-bd-ft clrfix'><!--[if IE]><center><![endif]-->";retHTML+="<p class='clrfix'><a class='close button' href='#'><span>Close</span></a>";if((typeof pgalurl)!="undefined"){retHTML+="<span class='pgal-link'>or <a href='"+pgalurl+"'>Go to Photo Gallery</a></span>";}retHTML+="</p><!--[if IE]></center><![endif]--></div></div><div class='bu-ft'></div>";return retHTML;},closeImg:function(e){$(SNI.TC.ImageEnlarge.imgFrame).remove();return false;}};SNI.TC.LazyImage={load:function(img_element,src){var image_src=src||img_element.attr("data-src");img_element.attr("src",image_src);return img_element;}};SNI.TC.ViewSlider=(function(){function ViewSlider(){this.updateImageList=function(){this.images=this.images.not("[src]");return this.images;},this.monitorScroll=function(){var sliding_window=this;var slider=sliding_window.slider;sliding_window.images=slider.find("img").not("[src]");if(sliding_window.images.length>0){slider.scroll(function(e){sliding_window.images.each(function(i){var $this=jQuery(this);if(($this.offset().left-slider.offset().left)<=slider.width()){SNI.TC.LazyImage.load($this);sliding_window.updateImageList();}});});}},this.calculateBodyWidth=function(slider_body){slider_body=slider_body||sliding_window.slider.children("ul");var total_body_width=0;slider_body.children("li").each(function(i){var $this=$(this);var list_item_width=$this.outerWidth()+parseInt($this.css("margin-left"))+parseInt($this.css("margin-right"));total_body_width=total_body_width+list_item_width;});return total_body_width;},this.init=function(element){var sliding_window=this;var slider=element||jQuery(".view-slider");sliding_window.slider=slider;slider.addClass("view-slider-setup");sliding_window.images=slider.find("img").not("[src]");var slider_body=slider.children("ul");var slider_body_width=sliding_window.calculateBodyWidth(slider_body);if(slider_body.width()!==slider_body_width){slider_body.width(slider_body_width);}sliding_window.images.each(function(i){var $this=jQuery(this);if($this.position().left<=sliding_window.slider.width()){SNI.TC.LazyImage.load($this);}});sliding_window.updateImageList();sliding_window.monitorScroll();};}return{init:function(element){var view_slider=new ViewSlider();view_slider.init(element);return view_slider;}};})();SNI.TC.Drops={init:function($eDrop,$eLnk){$eLnk.click(function(){if($eLnk.hasClass("sel")){$eDrop.find(".close").trigger("click");}else{$("body").trigger("click.drops_out");$eLnk.addClass("sel");$("body").bind("click.drops_out",function(ev){if($(ev.target).parents(".drops, .dd20").length==0){$eDrop.find(".close").trigger("click");}return true;});$eDrop.show();}return false;});$eDrop.find(".close").click(function(){$eDrop.hide();$eLnk.removeClass("sel");$("body").unbind("click.drops_out");return false;});return;}};SNI.TC.DynamicAds={descr:{active:true,refreshRate:4,interstitial:false},iparm:{iURL:"",iFmt:"",iHREF:"",iHeight:"",iWidth:"",iTrackURL:"",bURL:""},impressionCt:0,init:function(descriptor,param_styles,gen_inter_func){descriptor=descriptor||"PHOTO_DESCRIPTOR";param_styles=param_styles||"photoGallery";SNI.TC.DynamicAds.gen_interstitial=gen_inter_func||SNI.TC.DynamicAds.gen_interstitial;myJSON=getDartEnterpriseUrl(descriptor,1);myJSON+="&params.styles="+param_styles+"&callback=?";$.getJSON(myJSON,SNI.TC.DynamicAds.cback_descrJSON);return;},cback_descrJSON:function(oJSON){if(typeof oJSON!="object"){return false;}if(oJSON.photo_descriptor==undefined){return false;}oJSON=oJSON.photo_descriptor;if(oJSON.active==undefined){return false;}if(oJSON.refreshRate==undefined){return false;}if(oJSON.active!="true"){return false;}tmp=parseInt(oJSON.refreshRate);if(isNaN(tmp)){return false;}if(tmp<1||tmp>100){return false;}SNI.TC.DynamicAds.descr.active=true;SNI.TC.DynamicAds.descr.refreshRate=tmp;if(oJSON.interstitial==undefined){return false;}if(oJSON.interstitial=="true"){SNI.TC.DynamicAds.descr.interstitial=true;}return true;},refresh:function(interstitial_selector){if(!this.descr.active){return;}var interstitial_element=interstitial_selector||"#pgallery3 .interwrap";$(interstitial_element).remove();this.impressionCt++;if(this.impressionCt==this.descr.refreshRate){this.impressionCt=0;if(this.descr.interstitial){myJSON=getDartEnterpriseUrl("PHOTO_INTERSTITIAL",1);myJSON+="&params.styles=photoGallery&callback=?";$.getJSON(myJSON,SNI.TC.DynamicAds.cback_interJSON);return true;}else{setDartEnterpriseBanner("BIGBOX",getDartEnterpriseUrl("BIGBOX",5));}}return;},cback_interJSON:function(oJSON){$.each(SNI.TC.DynamicAds.iparm,function(key,val){SNI.TC.DynamicAds.iparm[key]="";});if(typeof oJSON!="object"){return false;}if(typeof oJSON.scrippsads!="object"){return false;}if(typeof oJSON.scrippsads.ad!="object"){return false;}for(i=0;i<oJSON.scrippsads.ad.length;++i){if(typeof oJSON.scrippsads.ad[i].position!="object"){return false;}with(oJSON.scrippsads.ad[i].position){with(SNI.TC.DynamicAds){if((iparm.iURL=="")&&(id=="interstitial")){iparm.iURL=media.src;iparm.iFmt=media.format;iparm.iHREF=media.href;iparm.iHeight=media.height;iparm.iWidth=media.width;if(typeof media.tracking.audit=="object"){iparm.iTrackURL=media.tracking.audit.src;}}if((iparm.bURL=="")&&(id=="300syncBanner")){iparm.bURL=media.src;}}}}with(SNI.TC.DynamicAds){if(iparm.iURL==""||iparm.iFmt==""||iparm.bURL==""){return false;}}SNI.TC.DynamicAds.gen_interstitial();return true;},gen_interstitial:function(){var hRet="";with(SNI.TC.DynamicAds){hRet+='<div class="interwrap">';hRet+='<a href="#" class="close"><span></span>Continue to Next Room</a>';hRet+="<h6>Advertisement</h6>";if(iparm.iFmt.toLowerCase()=="swf"){hRet+='<div id="interad"></div>';}else{if(iparm.iHREF!=""){hRet+='<a href="'+iparm.iHREF+'">';}hRet+='<img src ="'+iparm.iURL+'" />';if(iparm.iHREF!=""){hRet+="</a>";}}hRet+='<iframe class="tracker" width="0" height="0" frameborder="0"></iframe>';hRet+="</div>";$("#room-viewer").append(hRet);$("#room-viewer .interwrap .close").click(function(){SNI.TC.DesignPortfolio.RoomBrowser.goNextRoom();return false;});if(iparm.iFmt.toLowerCase()=="swf"){swfobject.embedSWF(iparm.iURL,"interad",iparm.iWidth,iparm.iHeight,"9","http://common.scrippsnetworks.com/common/flash-express-install/expressInstall.swf","",{wmode:"opaque",allowScriptAccess:"always",quality:"high"});}setDartEnterpriseBanner("BIGBOX",iparm.bURL);$("#room-viewer .interwrap .tracker").attr("src",iparm.iTrackURL);}return;}};if(typeof(SNI.Common)=="undefined"){SNI.Common={};}SNI.Common.Carousel=function(element,config){config=$.extend({btnNext:element+" .next-btn",btnPrev:element+" .prev-btn",visible:1,circular:false,displayPage:false,miniNav:false,start:1},config);return $(element+" .crsl-wrap").jCarouselLite({btnNext:config.btnNext,btnPrev:config.btnPrev,visible:config.visible,circular:config.circular,scroll:config.visible,displayPage:(config.displayPage),btnNavigation:(config.displayPage)?false:true,miniNav:config.miniNav,container:element,mouseWheel:true,start:config.start});};SNI.TC.Medialibrary=function(element,o){o=$.extend({crslLoad:null,crslAttr:"data-crsl-loaded",crslClass:".crsl",crslVisible:null},o);if(o.crslLoad){$(o.crslLoad).show();SNI.Common.Carousel(o.crslLoad,{visible:o.crslVisible});$(o.crslLoad).closest("h4").attr(o.crslAttr,"true");}togglelist=$(element).find("li.switch");togglelist.each(function(){var $this=$(this);var crsl=$this.find(".crsl").attr("id");var target=$this.find("h4");if(!$this.hasClass("active")){$this.find(o.crslClass).slideUp();target.attr(o.crslAttr,"false");}else{target.attr(o.crslAttr,"true");}target.click(function(){if($this.hasClass("active")){$this.removeClass("active");$this.find(o.crslClass).slideUp(250);}else{$this.addClass("active");$this.find(o.crslClass).slideDown(250);var load=$(this).attr(o.crslAttr);if(load=="false"){SNI.Common.Carousel("#"+crsl,{visible:o.crslVisible});target.attr(o.crslAttr,"true");}}});});};(function($){var oImgEnl=function(){var oImgEnl=this;var oImgDim={"vert":{"shr":{"w":"300","h":"400"},"enl":{"w":"602","h":"802"}},"hori":{"shr":{"w":"400","h":"300"},"enl":{"w":"602","h":"452"}},"sq":{"shr":{"w":"400","h":"400"},"enl":{"w":"602","h":"602"}}};oImgEnl.init=function($alink){$alink.click(function(){var $this=$(this);var imgType="hori";var w,h,b,p;if($this.parent().hasClass("vert")){imgType="vert";}else{if($this.parent().hasClass("sq")){imgType="sq";}}var imgScale="enl";if($this.parent().hasClass("enl")){imgScale="shr";}w=oImgDim[imgType][imgScale].w;h=oImgDim[imgType][imgScale].h;b=p=0;if(imgScale=="shr"){b=1;p=2;}$this.children("img").animate({height:h,width:w,borderWidth:b,padding:p},{duration:250,complete:function(){$(this).style="";}});b=p=0;if(imgScale=="shr"){w=parseInt(w)+6;h=parseInt(h)+6;}$this.find(".vtoggle").hide();$this.parent().animate({height:h,width:w},{duration:250,complete:function(){$this.parent().attr("style","");$this.parent().toggleClass("enl");$this.find(".vtoggle").attr("style","");}});return false;});};};SNI.ImgEnlarge2=new oImgEnl;})(jQuery);if(typeof(SNI.TC.Omniture)=="undefined"){SNI.TC.Omniture={};}SNI.Omniture.getLinkText=function($elt){var linkText="";linkText=$.trim($elt.closest("a").text());if(linkText==""&&$elt.is("img")){linkText="Photo : "+$elt.attr("alt");}else{if($elt.closest("#hg-sitenav .subnav").length>0){$thislink=$elt.closest("a");if(!$thislink.is("#hg-sitenav .subnav li.nav > a")){linkText=$elt.closest("#hg-sitenav .subnav > li.nav").children("a").text()+"-"+linkText;}linkText=$elt.closest("#hg-sitenav .topnav > li").children("a.toplink").text()+"-"+linkText;}}return linkText;};SNI.TC.Omniture.ClickTrack=SNI.Omniture.MultiVar;SNI.TC.Omniture.ClickTrackSingle=SNI.Omniture.SingleVar;SNI.TC.Omniture.ClickTrackSingleCustom=function(jsel,module,propVal,trackEvent){var $el=$(jsel);if($el.length==0||$el.data("events.click.omniture")){return;}$el.bind("click.omniture",function(e){var $clicked=$(e.target);var s=s_gi(s_account);s.linkTrackVars=propVal;if(trackEvent!=""){s.linkTrackEvents=trackEvent;}else{s.linkTrackEvents="None";}s[propVal]=module;s.tl(this,"o",propVal);e.stopPropagation();});};SNI.TC.Omniture.HotSpotClick=function(oHS,mode){var s=s_gi("scrippsTCnew");s.linkTrackVars="eVar46,eVar47,eVar48,events";if(mode=="c"){s.linkTrackEvents="event47";s.events="event47";}else{s.linkTrackEvents="event48";s.events="event48";}if((oHS.marketplaceId=="")||(oHS.marketplaceId=="0")){s.eVar46="Non-Marketplace";}else{s.eVar46=oHS.marketplaceId;}s.eVar47=oHS.name;s.eVar48=oHS.description;if(mode=="c"){s.tl(this,"o","Hotspot Click");}else{s.tl(this,"o","Hotspot Learn More");}s.linkTrackVars="";s.linkTrackEvents="";s.events="";s.eVar46="";s.eVar47="";s.eVar48="";return;};SNI.TC.Omniture.pageViewTrack=function(omnitureParams){jQuery.each(omnitureParams,function(key,value){mdManager.setParameter(key,value);});if(typeof s=="object"){s.t();}return;};(function($){var DEFAULT_CONFIG={gallery_title:"",current_index:0,thumbnail_loader:"/static_files/assets/css/i/backgrounds/ajax-loader.gif",default_product_image_sm:"../img/product_unavailable_sm.jpg",default_product_image_lg:"../img/product_unavailable_al.jpg",images:null,interstitial_refresh_rate:5000};var PhotoGallery=function(element,config){for(var prop in DEFAULT_CONFIG){if(!config.hasOwnProperty(prop)){config[prop]=DEFAULT_CONFIG[prop];}}config.images=config.images||imageData;var gallery=this,gallery_element,count_label,photo_display,thumbnails_button,thumbnails_frame,next_button,previous_button,ad_unit,photo_description,photo_author,caption_head,caption,toggler,endframe_info,template_element,hsproduct_wrapper,ymal,ymal_list,_load_once,current_index,loader_img=new Image(),default_product_img_sm=new Image(),default_product_img_lg=new Image(),inter_wrap,inter_next=false,print_link,inter_refreshed=true,dyn_load_origin="";loader_img.src=config.thumbnail_loader;function doDynOmni(i){var current_data=config.images[i];++i;var omniVars=new Object();if(mdManager.getParameterString("oUrl")==""){mdManager.setParameter("oUrl",mdManager.getParameterString("Url"));}mdManager.setParameter("Url",mdManager.getParameter("oUrl")+"/page-"+parseInt(i,10));if(i<10){i="0"+parseInt(i,10);}mdManager.setParameter("UniqueId",mdManager.getParameterString("UniqueId").replace(/(.*?)_([0-9]{1,2})$/,"$1_"+i));mdManager.setParameter("PageNumber",i);if(typeof s=="object"){omniVars=new Object();if(dyn_load_origin!=""){omniVars.prop26="TC : Photo Gallery : "+config.gallery_title+" : "+dyn_load_origin+" : "+i;dyn_load_origin="";}if(current_data.creator){omniVars.prop61=current_data.creator;}omniVars.pageName=mdManager.getParameter("Url");omniVars.prop9=mdManager.getParameter("UniqueId");if(typeof s.t!="undefined"){s.t(omniVars);}}return;}function createImageWrapper(current_data){var clone=template_element.clone(),clone_image=clone.find("a img"),new_image=new Image(),toggler=clone.children(".pg-toggler");clone.attr("id","pg-photo-"+current_data.iid);clone.find("a.photo").attr("href",current_data.pgUrl).attr("title",current_data.ialt).click(function(e){if(current_data.bhs!=-1){gallery.nextPhoto(e);}return false;});clone.children(".pg-hotspots").remove();clone_image.attr("alt",current_data.ialt);clone_image.attr("title",current_data.ialt);jQuery(new_image).load(function(response,status,xhr){clone.appendTo(photo_display);current_data.image_wrapper=clone;clone_image.attr("src",new_image.src);clone_image.attr("style","");clone.attr("style","");if(current_data.bvert){setupToggler(toggler,current_index);toggler.show();}else{toggler.hide();clone.removeClass("pg-fitted");}gallery_element.removeClass("pg-loading");clone.hide();clone.fadeIn("fast");}).error(function(){gallery_element.removeClass("pg-loading");gallery_element.addClass("pg-errored");});new_image.src=current_data.iurl;}function setupToggler(toggler,index){var enlarge=toggler.find(".pg-enlarge");var shrink=toggler.find(".pg-shrink");var current_data=config.images[index];current_data.image_wrapper.addClass("pg-fitted");current_data.toggler=toggler;current_data.toggler.enlarge=enlarge;current_data.toggler.shrink=shrink;enlarge.click(function(){current_data.image_wrapper.animate({width:"602px"},200);current_data.image_wrapper.find("a.photo img").animate({width:"602px"},200);enlarge.hide();shrink.show();});enlarge.children(".pg-toggler-button").hover(function(){enlarge.children(".pg-toggler-label").show();},function(){enlarge.children(".pg-toggler-label").hide();});enlarge.children(".pg-toggler-label").hover(function(){enlarge.children(".pg-toggler-label").show();},function(){enlarge.children(".pg-toggler-label").hide();});shrink.click(function(){current_data.image_wrapper.animate({width:"339px"},250);current_data.image_wrapper.find("a.photo img").animate({width:"339px"},250);shrink.hide();enlarge.show();});shrink.children(".pg-toggler-button").hover(function(){shrink.children(".pg-toggler-label").show();},function(){shrink.children(".pg-toggler-label").hide();});shrink.children(".pg-toggler-label").hover(function(){shrink.children(".pg-toggler-label").show();},function(){shrink.children(".pg-toggler-label").hide();});}function loadPhotoInfo(index){var current_data=config.images[index];var caption_length=5000;var cap_start,cap_end="";var next_index=(index+1)%config.images.length;doDynOmni(index);next_button.attr("href",config.images[next_index].pgUrl);if(print_link.length>0){var i=index+1;var plink=print_link.attr("href");plink=plink.replace(/(.*cp=).*?$/,"$1"+i);print_link.attr("href",plink);}gallery_element.addClass("pg-loading");count_label.html(index+1);if(current_data.iid!="endframe"){$meta_description.attr("content",current_data.icap_txt);document.title=page_title_text+" - photo "+(index+1);print_link.show();photo_description.show();endframe_info.hide();if(current_data.ititle.length>41){caption_length=157;}cap_start=current_data.icap_txt.substring(0,caption_length);if(cap_start.length<current_data.icap_txt.length){cap_end='<span class="pg-cap-elipse">&#8230; <span class="pg-show-caption">more</span></span><span class="pg-full-caption">'+current_data.icap_txt.substring(caption_length,current_data.icap_txt.length)+"</span>";photo_description.addClass("pg-short-caption");}else{photo_description.removeClass("pg-short-caption");}var rendered_content=cap_start+cap_end;caption_head.html(current_data.ititle);caption.html(rendered_content);caption.find(".pg-show-caption").click(function(){caption.find(".pg-cap-elipse").hide();caption.hide();caption.find(".pg-full-caption").css({display:"inline"});caption.slideDown(175,function(){photo_description.removeClass("pg-short-caption");caption.html(current_data.icap);});});if(current_data.rlinks&&current_data.rlinks.length>0){ymal.show();if(current_data.rtxt){ymal.find("h4").text(current_data.rtxt);}var rlinkTxt="";for(var x=0;x<current_data.rlinks.length;x++){rlinkTxt+='<li><a href="'+current_data.rlinks[x].rurl+'">'+current_data.rlinks[x].rtitle+"</a></li> ";}ymal_list.html(rlinkTxt);}else{ymal.hide();}if(current_data.creator){mdManager.setParameter("Source",current_data.creator);photo_author.children(".pg-author-name").html(current_data.creator);photo_author.show();}else{mdManager.setParameter("Source","");photo_author.hide();}}else{$meta_description.attr("content",page_title_text);document.title=page_title_text;print_link.hide();photo_description.hide();photo_author.hide();endframe_info.show();ymal.hide();}$(thumbnails_frame.find(".pg-thumbnails li")[index]).addClass("pg-selected-thumbnail");if(!current_data.image_wrapper){createImageWrapper(current_data);}else{gallery_element.removeClass("pg-loading");current_data.image_wrapper.fadeIn("fast");}gallery_element.trigger("load-photo-complete",{gallery:gallery,photo:current_data});}gallery.title=config.gallery_title;gallery.previousPhoto=function(e){var new_index;if(!previous_button.hasClass("pg-disabled")){if(gallery_element.hasClass("pg-errored")){gallery_element.removeClass("pg-errored");}dyn_load_origin="Previous";inter_next=false;new_index=current_index-1;gallery.goToPhoto(new_index);gallery_element.trigger("previous-photo",{gallery:gallery,index:new_index,element:previous_button});}e.preventDefault();};gallery.nextPhoto=function(e){var new_index;if(!next_button.hasClass("pg-disabled")){if(gallery_element.hasClass("pg-errored")){gallery_element.removeClass("pg-errored");}dyn_load_origin="Next";inter_next=true;new_index=((current_index+1)%config.images.length);gallery.goToPhoto(new_index);gallery_element.trigger("next-photo",{gallery:gallery,index:new_index,element:next_button});}e.preventDefault();};_load_once=function(){thumbnails_frame.find(".hd span.pg-close-btn").click(function(e){gallery.hideThumbnails(e);});thumbnails_frame.find(".pg-thumbnail").each(function(){var thumb_container=$(this);var thumb=$(thumb_container.children("img"));thumb.attr("src",loader_img.src);var img=new Image();$(img).load(function(){thumb_container.removeClass("pg-thumbnails-loading");thumb.attr("src",img.src);});thumb_container.addClass("pg-thumbnails-loading");img.src=thumb.attr("data-src");});_load_once=function(){return;};};gallery.showThumbnails=function(e){if(!gallery_element.hasClass("pg-loading")){gallery.toggleThumbnails(e);gallery_element.trigger("show-thumbnails",{gallery:gallery,element:thumbnails_button});}e.stopPropagation();};gallery.hideThumbnails=function(e){if($(thumbnails_frame).is(":visible")){thumbnails_button.removeClass("selected");thumbnails_frame.fadeOut("fast");gallery_element.trigger("hide-thumbnails",{gallery:gallery,element:thumbnails_button});}e.stopPropagation();};gallery.toggleThumbnails=function(e){if(!gallery_element.hasClass("pg-loading")){_load_once();if(thumbnails_button.hasClass("selected")){thumbnails_button.removeClass("selected");}else{thumbnails_button.addClass("selected");}thumbnails_frame.animate({opacity:"toggle"},function(){if($(this).is(":hidden")){gallery_element.trigger("hide-thumbnails",{gallery:gallery,element:thumbnails_button});}else{gallery_element.trigger("show-thumbnails",{gallery:gallery,element:thumbnails_button});}});gallery_element.trigger("toggle-thumbnail",{gallery:gallery,element:thumbnails_button});}e.stopPropagation();};gallery.goToPhoto=function(index,skip_interstitial){SNI.TC.Toolbar.closeModule(".email",$("#email-a-friend"));SNI.TC.Toolbar.closeModule(".print",$("#print-select"));if(gallery_element.hasClass("pg-errored")){gallery_element.removeClass("pg-errored");}if(!gallery_element.hasClass("pg-loading")){gallery_element.addClass("pg-loading");gallery_element.removeClass("interstitial-show");if(inter_refreshed===true&&!skip_interstitial&&SNI.TC.DynamicAds.refresh(inter_wrap)){gallery_element.removeClass("pg-loading");gallery_element.addClass("interstitial-show");inter_refreshed=false;setTimeout(function(){inter_refreshed=true;},config.interstitial_refresh_rate);return;}hsproduct_wrapper.hide();if(current_index>=0){var previous_data=config.images[current_index];if(previous_data.image_wrapper){previous_data.image_wrapper.hide();if(previous_data.image_wrapper.product_panel){previous_data.image_wrapper.product_panel.hide();previous_data.image_wrapper.removeClass("pg-hide-hotspots");}thumbnails_frame.find(".pg-thumbnails li.pg-selected-thumbnail").removeClass("pg-selected-thumbnail");previous_button.attr("href",previous_data.pgUrl);}}current_index=index;if(current_index<=0){current_index=0;previous_button.addClass("pg-disabled");}else{if(current_index>0&&previous_button.hasClass("pg-disabled")){previous_button.removeClass("pg-disabled");}}loadPhotoInfo(current_index);}};$meta_description=$("meta[name=description]");$page_title=$("title");page_title_text=document.title;gallery_element=$(element);photo_display=gallery_element.find(".pg-viewport .pg-photo-display-wrapper");count_label=gallery_element.find(".pg-navigation .pg-photo-count .count");thumbnails_button=gallery_element.find(".pg-navigation a.pg-thumbnails-button");thumbnails_frame=gallery_element.find(".pg-navigation .pg-thumbnails-frame");next_button=gallery_element.find(".pg-navigation .pg-next");previous_button=gallery_element.find(".pg-navigation .pg-previous");template_element=photo_display.children(".pg-photo-wrapper");photo_description=$(".pg-viewport .pg-photo-description");photo_author=$(".pg-author");caption_head=photo_description.children("h2");caption=photo_description.children("p");endframe_info=$(".pg-viewport .pg-endframe-info");hsproduct_wrapper=$('<div class="pg-photo-hsproduct-wrapper"></div>').appendTo(photo_display);ymal=gallery_element.find(".pg-you-might-like");ymal_list=ymal.find("ul");inter_wrap=$('<div class="interwrap"></div>').appendTo(photo_display);print_link=$("#print-select a.this");current_index=config.current_index;gallery.element=gallery_element;config.images.push({iid:"endframe",image_wrapper:$(photo_display).children(".pg-endframe")});if(!config.images[current_index]){current_index=0;}if(config.images[current_index].iid!="endframe"){if(current_index==0){previous_button.addClass("pg-disabled");}config.images[current_index].image_wrapper=template_element;toggler=template_element.children(".pg-toggler");if(config.images[current_index].bvert==1){setupToggler(toggler,current_index);toggler.show();}else{toggler.hide();template_element.removeClass("pg-fitted");}config.images[current_index].image_wrapper.find("a.photo").click(function(e){if(config.images[current_index].bhs!=-1){gallery.nextPhoto(e);}return false;});}thumbnails_button.click(gallery.toggleThumbnails);thumbnails_frame.find(".pg-thumbnails li").each(function(index){var thumb=$(this);thumb.click(function(e){dyn_load_origin="Thumbnail";gallery.goToPhoto(index,false,true);gallery.hideThumbnails(e);$(gallery_element).trigger("click-thumbnail",{gallery:gallery,thumb:thumb});e.stopPropagation();});});thumbnails_frame.click(function(e){e.stopPropagation();});$(document).click(function(e){gallery.hideThumbnails(e);SNI.TC.Toolbar.closeModule(".email",$("#email-a-friend"));SNI.TC.Toolbar.closeModule(".print",$("#print-select"));});previous_button.click(gallery.previousPhoto);gallery_element.find(".pg-error button").click(function(e){gallery.goToPhoto(current_index);e.preventDefault();});next_button.click(gallery.nextPhoto);$("#toolbar .font-resize").find("li").click(function(){var defaultSize="100%";$(element).find("li.active").removeClass("active");$(this).addClass("active");if($(this).hasClass("med")){photo_description.css("font-size",defaultSize);}else{if($(this).hasClass("sm")){photo_description.css("font-size","85%");}else{photo_description.css("font-size","116%");}}});var share_url=SNI.Util.Url.setParameter(document.location.href,"soc","share");var page_title=jQuery("<div>"+mdManager.getPageTitle()+"</div>").text();var facebook_shared_object=SHARETHIS.addEntry({title:page_title,url:share_url});var twitter_shared_object=SHARETHIS.addEntry({title:page_title+" #TC ",url:share_url});facebook_shared_object.attachChicklet("facebook",endframe_info.find(".pg-share .facebook a")[0]);twitter_shared_object.attachChicklet("twitter",endframe_info.find(".pg-share .twitter a")[0]);endframe_info.find(".pg-share li a").click(function(){return false;});SNI.TC.DynamicAds.init(null,null,function(){var hRet="";with(SNI.TC.DynamicAds){hRet+='<div class="pg-inter-wrap">';hRet+='<a href="#" class="close"><span></span>Continue to Next Photo</a>';hRet+='<h6 class="mrec">Advertisement</h6>';hRet+='<div class="pg-inter-container">';if(iparm.iFmt.toLowerCase()=="swf"){hRet+='<div id="interad">'+'<a class="no-flash-message" href="http://www.adobe.com/go/getflashplayer">'+'<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />'+"</a>"+"</div>";}else{if(iparm.iHREF!=""){hRet+='<a href="'+iparm.iHREF+'">';}hRet+='<img src ="'+iparm.iURL+'" />';if(iparm.iHREF!=""){hRet+="</a>";}}hRet+='<iframe class="tracker" width="0" height="0" frameborder="0"></iframe>';hRet+="</div>";hRet+="</div>";inter_wrap=$(hRet).appendTo(photo_display);$(inter_wrap).find(".close").click(function(e){gallery_element.removeClass("interstitial-show");if(inter_next){gallery.nextPhoto(e);}else{gallery.previousPhoto(e);}return false;});if(iparm.iFmt.toLowerCase()=="swf"){swfobject.embedSWF(iparm.iURL,"interad",iparm.iWidth,iparm.iHeight,"9","http://common.scrippsnetworks.com/common/flash-express-install/expressInstall.swf",null,{wmode:"transparent",allowScriptAccess:"always",quality:"high"});}setDartEnterpriseBanner("BIGBOX",iparm.bURL);$(inter_wrap).find(".tracker").attr("src",iparm.iTrackURL);}return;});loadPhotoInfo(current_index);return gallery;};SNI.TC.PhotoGallery4=PhotoGallery;})(jQuery);(function(a){a.tools=a.tools||{version:"v1.2.6"},a.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,fadeIE:!1,position:["top","center"],offset:[0,0],relative:!1,cancelDefault:!0,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip"},addEffect:function(a,c,d){b[a]=[c,d];}};var b={toggle:[function(a){var b=this.getConf(),c=this.getTip(),d=b.opacity;d<1&&c.css({opacity:d}),c.show(),a.call();},function(a){this.getTip().hide(),a.call();}],fade:[function(b){var c=this.getConf();!a.browser.msie||c.fadeIE?this.getTip().fadeTo(c.fadeInSpeed,c.opacity,b):(this.getTip().show(),b());},function(b){var c=this.getConf();!a.browser.msie||c.fadeIE?this.getTip().fadeOut(c.fadeOutSpeed,b):(this.getTip().hide(),b());}]};function c(b,c,d){var e=d.relative?b.position().top:b.offset().top,f=d.relative?b.position().left:b.offset().left,g=d.position[0];e-=c.outerHeight()-d.offset[0],f+=b.outerWidth()+d.offset[1],/iPad/i.test(navigator.userAgent)&&(e-=a(window).scrollTop());var h=c.outerHeight()+b.outerHeight();g=="center"&&(e+=h/2),g=="bottom"&&(e+=h),g=d.position[1];var i=c.outerWidth()+b.outerWidth();g=="center"&&(f-=i/2),g=="left"&&(f-=i);return{top:e,left:f};}function d(d,e){var f=this,g=d.add(f),h,i=0,j=0,k=d.attr("title"),l=d.attr("data-tooltip"),m=b[e.effect],n,o=d.is(":input"),p=o&&d.is(":checkbox, :radio, select, :button, :submit"),q=d.attr("type"),r=e.events[q]||e.events[o?p?"widget":"input":"def"];if(!m){throw'Nonexistent effect "'+e.effect+'"';}r=r.split(/,\s*/);if(r.length!=2){throw"Tooltip: bad events configuration for "+q;}d.bind(r[0],function(a){clearTimeout(i),e.predelay?j=setTimeout(function(){f.show(a);},e.predelay):f.show(a);}).bind(r[1],function(a){clearTimeout(j),e.delay?i=setTimeout(function(){f.hide(a);},e.delay):f.hide(a);}),k&&e.cancelDefault&&(d.removeAttr("title"),d.data("title",k)),a.extend(f,{show:function(b){if(!h){l?h=a(l):e.tip?h=a(e.tip).eq(0):k?h=a(e.layout).addClass(e.tipClass).appendTo(document.body).hide().append(k):(h=d.next(),h.length||(h=d.parent().next()));if(!h.length){throw"Cannot find tooltip for "+d;}}if(f.isShown()){return f;}h.stop(!0,!0);var o=c(d,h,e);e.tip&&h.html(d.data("title")),b=a.Event(),b.type="onBeforeShow",g.trigger(b,[o]);if(b.isDefaultPrevented()){return f;}o=c(d,h,e),h.css({position:"absolute",top:o.top,left:o.left}),n=!0,m[0].call(f,function(){b.type="onShow",n="full",g.trigger(b);});var p=e.events.tooltip.split(/,\s*/);h.data("__set")||(h.unbind(p[0]).bind(p[0],function(){clearTimeout(i),clearTimeout(j);}),p[1]&&!d.is("input:not(:checkbox, :radio), textarea")&&h.unbind(p[1]).bind(p[1],function(a){a.relatedTarget!=d[0]&&d.trigger(r[1].split(" ")[0]);}),e.tip||h.data("__set",!0));return f;},hide:function(c){if(!h||!f.isShown()){return f;}c=a.Event(),c.type="onBeforeHide",g.trigger(c);if(!c.isDefaultPrevented()){n=!1,b[e.effect][1].call(f,function(){c.type="onHide",g.trigger(c);});return f;}},isShown:function(a){return a?n=="full":n;},getConf:function(){return e;},getTip:function(){return h;},getTrigger:function(){return d;}}),a.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(b,c){a.isFunction(e[c])&&a(f).bind(c,e[c]),f[c]=function(b){b&&a(f).bind(c,b);return f;};});}a.fn.tooltip=function(b){var c=this.data("tooltip");if(c){return c;}b=a.extend(!0,{},a.tools.tooltip.conf,b),typeof b.position=="string"&&(b.position=b.position.split(/,?\s/)),this.each(function(){c=new d(a(this),b),a(this).data("tooltip",c);});return b.api?c:this;};})(jQuery);$(function(){if($("#snd-sites").length!=0){$("#snd-sites").tooltip({position:"top center",relative:true});}});if(typeof SNI==="undefined"){SNI={};}if(SNI.Community===undefined){SNI.Community={};}if(SNI.Community.UR===undefined){SNI.Community.UR={};}SNI.TC.GlobalHeader=(function($){var GlobalHeader=function(){var GlobalHeader=this;GlobalHeader.myTC=function(){$("#my-tc .not-signed-in #ur-login").attr("href","http://"+SNI.Community.UR.Core.getLoginLink());$("#my-tc .not-signed-in #ur-register").attr("href","http://"+SNI.Community.UR.Core.getRegisterLink());if(SNI.Community.UR.logged_in){$("#my-tc #username").text(SNI.Community.UR.ViewingUserDisplayName);$("#my-tc #username").append("<span />");if(typeof SNI.Community.UR.ViewingUserAvatar==="string"&&SNI.Community.UR.ViewingUserAvatar.length>0){$("#my-tc .signed-in .hello").before('<div class="avatar"><img width="20" height="20" src="'+SNI.Community.UR.ViewingUserAvatar+'" /></div>');}$("#my-tc .signed-in a").not(".logout").each(function(){$(this).attr("href","http://"+SNI.Community.ur3Domain+$(this).attr("href").match(/^(http:\/\/[^\/]*)?(.*)/)[2]);});$("#my-tc .not-signed-in").hide();$("#my-tc .signed-in").show();$(".hello").tooltip({position:"bottom center",offset:[-2,-10],relative:true});}};GlobalHeader.init=function(){GlobalHeader.myTC();};};return new GlobalHeader();})(jQuery);SNI.Community.UR.init=function(){if(typeof SNI.Community.siteName=="string"){if(typeof this.ViewingUserName=="string"){this.logged_in=true;}}else{var user=new SNI.UR.UrUser(new SNI.UR.ApplicationConfig());if(user.isLoggedIn==true){this.ViewingUserId=user.getUserId();this.ViewingUserName=user.getEmail();this.ViewingUserDisplayName=user.getUserName();this.logged_in=true;}}};SNI.Community.UR.logout=function(){var destURL=window.location;window.location=SNI.Community.ur3Domain+"/redirectors/logout_redirector.jsp?DEST_URL="+escape(destURL);};SNI.Community.UR.extendedInit=function(){if(typeof SNI.Community.siteName=="string"){if(typeof this.ViewingUserName=="string"){this.logged_in=true;}}else{var user=new SNI.UR.UrUser(new SNI.UR.ApplicationConfig());if(user.isLoggedIn==true){this.ViewingUserId=user.getUserId();this.ViewingUserName=user.getEmail();this.ViewingUserDisplayName=user.getUserName();this.ViewingUserAvatar=user.getAvatar();this.logged_in=true;}}};SNI.Community.UR.Core.extendedInit();SNI.Community.UR.extendedInit();$(document).ready(function(){SNI.TC.GlobalHeader.init();});

(function($){$.fn.jCarouselLite=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,displayPage:false,btnNavigation:false,miniNav:false,container:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var running=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var div=$(this),ul=$("ul:first",div),tLi=$("li",ul),tl=tLi.size(),v=o.visible,container=$(o.container);if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v;}var oli=$(">li",ul);var olength=oli.size();var grps=Math.ceil(olength/o.scroll);var fullSet=o.scroll*grps;if(olength<fullSet){var html="";for(var i=1;i<=(fullSet-olength);i++){html+='<li class="filler"></li>';}ul.append(html);}var li=$(">li",ul),itemLength=li.size(),curr=o.start;li.addClass("crsl-item");div.css("visibility","visible");li.css({"overflow":"hidden","float":o.vertical?"none":"left"});ul.css({"margin":"0","padding":"0","position":"relative","list-style-type":"none","z-index":"1"}).addClass("clrfix");div.css({"overflow":"hidden","position":"relative","z-index":"2",left:"0px"});var liSize=o.vertical?height(li):width(li);var ulSize=liSize*itemLength;var divSize=liSize*v;var singlePage=(itemLength<=o.visible);li.css({width:li.outerWidth(),height:li.outerHeight()});ul.css(sizeCss,ulSize+"px").css(animCss,-(curr*liSize));div.css(sizeCss,divSize+"px");if(o.miniNav){container.addClass("mini-nav");var miniNavHtml='<div class="nav clrfix">';miniNavHtml+='    <div class="prev-btn">previous</div>';miniNavHtml+='    <div class="controls"></div>';miniNavHtml+='    <div class="next-btn">next</div>';miniNavHtml+="</div>";container.find(".hd").append(miniNavHtml);$(o.btnNext).addClass("disabled");}else{container.addClass("default-nav");container.find(".hd").after('<div class="nav clrfix"><div class="controls"></div></div>');container.find(".hd").before('<div class="prev-btn">previous</div>');container.append('<div class="next-btn">next</div>');$(o.btnNext).addClass("disabled");container.find(".nav").css("width",divSize+"px");}if(singlePage){$(o.btnPrev).addClass("disabled");}var ctrl=container.find(".controls");if(!singlePage){if(o.displayPage){container.find(".controls").html("1 of "+grps);}else{var btns,imgPos;for(var i=1;i<=grps;i++){if(i==1){btns+='<span data-load-img="0" class="active">'+i+"</span>";}else{imgPos=((i-1)*o.scroll);btns+="<span data-load-img="+imgPos+">"+i+"</span>";}}btns=$(btns);$.each(btns,function(){var loadImg=parseInt($(this).attr("data-load-img"));$(this).click(function(){ctrl.find("span").removeClass("active");$(this).addClass("active");return go(loadImg);});});ctrl.addClass("btn-nav clrfix");ctrl.html(btns);}}if(!o.miniNav){var offset=parseInt(divSize/2)-parseInt(width(ctrl)/2);ctrl.css("left",offset+"px");}ul.find(">li:lt("+o.scroll+")").each(function(){var img=$(this).find("img");SNI.Util.LazyLoad(img);});if(o.btnPrev){$(o.btnPrev).click(function(){return go(curr-o.scroll);});}if(o.btnNext){$(o.btnNext).click(function(){return go(curr+o.scroll);});}if(o.btnGo){$.each(o.btnGo,function(i,val){$(val).click(function(){return go(o.circular?o.visible+i:i);});});}if(o.mouseWheel&&div.mousewheel){div.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll);});}if(o.auto){setInterval(function(){go(curr+o.scroll);},o.auto+o.speed);}function vis(){return li.slice(curr).slice(0,v);}function visImgs(){var list=li.slice(curr).slice(0,v);list.each(function(){var img=$(this).find("img");SNI.Util.LazyLoad(img);});}function pageIndex(){var cp=Math.ceil(curr/o.scroll)+1;container.find(".controls").html(cp+" of "+grps);}function go(to){if(!running){if(o.beforeStart){o.beforeStart.call(this,vis());}if(o.circular){if(to<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*liSize)+"px");curr=to==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll;}else{if(to>=itemLength-v+1){ul.css(animCss,-((v)*liSize)+"px");curr=to==itemLength-v+1?v+1:v+o.scroll;}else{curr=to;}}}else{if(to<0||to>itemLength-v){return;}else{curr=to;}}running=true;if(o.displayPage){pageIndex();}if(o.btnNavigation){container.find(".controls span").removeClass("active");container.find(".controls span[data-load-img="+curr+"]").addClass("active");}visImgs();ul.animate(animCss=="left"?{left:-(curr*liSize)}:{top:-(curr*liSize)},o.speed,o.easing,function(){if(o.afterEnd){o.afterEnd.call(this,vis());}running=false;});if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled");}}return false;}});};function css(el,prop){return parseInt($.css(el[0],prop))||0;}function width(el){return el[0].offsetWidth+css(el,"marginLeft")+css(el,"marginRight")+css(el,"borderLeftWidth")+css(el,"borderRightWidth");}function height(el){return el[0].offsetHeight+css(el,"marginTop")+css(el,"marginBottom");}})(jQuery);
