/* sni-core - Tue, 27 Jan 2009 18:23:17 -0500 */

/*! SWFObject v2.1 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	This software 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",win=window,doc=document,nav=navigator,domLoadFnArr=[],regObjArr=[],objIdArr=[],listenersArr=[],script,timer=null,storedAltContent=null,storedAltContentId=null,isDomLoaded=false,isExpressInstallActive=false,noPlayerMessage='For the best website experience please <a href="http://www.adobe.com/go/getflashplayer">install Adobe Flash Player</a> version 9 or higher.';var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF,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)){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]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0;}}
else if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7");}
catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always";}
catch(e){if(playerVersion[0]==6){fp6Crash=true;}}
if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX);}
catch(e){}}}
if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)];}}
catch(e){}}}
var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=/msie/.test(u)&&!/opera/.test(u),windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac};}();var onDomLoad=function(){if(!ua.w3cdom){return;}
addDomLoadEvent(main);if(ua.ie&&ua.win){try{doc.write("<scr"+"ipt id=__ie_ondomload defer=true src=//:></scr"+"ipt>");script=getElementById("__ie_ondomload");if(script){addListener(script,"onreadystatechange",checkReadyState);}}
catch(e){}}
if(ua.webkit&&typeof doc.readyState!=UNDEF){timer=setInterval(function(){if(/loaded|complete/.test(doc.readyState)){callDomLoadFunctions();}},10);}
if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("DOMContentLoaded",callDomLoadFunctions,null);}
addLoadEvent(callDomLoadFunctions);}();function checkReadyState(){if(script.readyState=="complete"){script.parentNode.removeChild(script);callDomLoadFunctions();}}
function callDomLoadFunctions(){if(isDomLoaded){return;}
if(ua.ie&&ua.win){var s=createElement("span");try{var t=doc.getElementsByTagName("body")[0].appendChild(s);t.parentNode.removeChild(t);}
catch(e){return;}}
isDomLoaded=true;if(timer){clearInterval(timer);timer=null;}
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(){var rl=regObjArr.length;for(var i=0;i<rl;i++){var id=regObjArr[i].id;if(ua.pv[0]>0){var obj=getElementById(id);if(obj){regObjArr[i].width=obj.getAttribute("width")?obj.getAttribute("width"):"0";regObjArr[i].height=obj.getAttribute("height")?obj.getAttribute("height"):"0";if(hasPlayerVersion(regObjArr[i].swfVersion)){if(ua.webkit&&ua.webkit<312){fixParams(obj);}
setVisibility(id,true);}
else if(regObjArr[i].expressInstall&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){showExpressInstall(regObjArr[i]);}
else{displayAltContent(obj);}}}
else{setVisibility(id,true);}}}
function fixParams(obj){var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var e=createElement("embed"),a=nestedObj.attributes;if(a){var al=a.length;for(var i=0;i<al;i++){if(a[i].nodeName=="DATA"){e.setAttribute("src",a[i].nodeValue);}
else{e.setAttribute(a[i].nodeName,a[i].nodeValue);}}}
var c=nestedObj.childNodes;if(c){var cl=c.length;for(var j=0;j<cl;j++){if(c[j].nodeType==1&&c[j].nodeName=="PARAM"){e.setAttribute(c[j].getAttribute("name"),c[j].getAttribute("value"));}}}
obj.parentNode.replaceChild(e,obj);}}
function showExpressInstall(regObj){isExpressInstallActive=true;var obj=getElementById(regObj.id);if(obj){if(regObj.altContentId){var ac=getElementById(regObj.altContentId);if(ac){storedAltContent=ac;storedAltContentId=regObj.altContentId;}}
else{storedAltContent=abstractAltContent(obj);}
if(!(/%$/.test(regObj.width))&&parseInt(regObj.width,10)<310){regObj.width="310";}
if(!(/%$/.test(regObj.height))&&parseInt(regObj.height,10)<137){regObj.height="137";}
doc.title=doc.title.slice(0,47)+" - Flash Player Installation";var pt=ua.ie&&ua.win?"ActiveX":"PlugIn",dt=doc.title,fv="MMredirectURL="+win.location+"&MMplayerType="+pt+"&MMdoctitle="+dt,replaceId=regObj.id;if(ua.ie&&ua.win&&obj.readyState!=4){var newObj=createElement("div");replaceId+="SWFObjectNew";newObj.setAttribute("id",replaceId);obj.parentNode.insertBefore(newObj,obj);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj);};addListener(win,"onload",fn);}
createSWF({data:regObj.expressInstall,id:EXPRESS_INSTALL_ID,width:regObj.width,height:regObj.height},{flashvars:fv},replaceId);}}
function showNoPlayerMessage(regObj){var obj=getElementById(regObj.id);if(obj){obj.style.width=regObj.width+"px";obj.style.height=regObj.height+"px";var newObj=createElement("div");newObj.className="no-player-installed";newObj.innerHTML=noPlayerMessage;obj.appendChild(newObj);}}
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";var fn=function(){obj.parentNode.removeChild(obj);};addListener(win,"onload",fn);}
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(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 if(ua.webkit&&ua.webkit<312){var e=createElement("embed");e.setAttribute("type",FLASH_MIME_TYPE);for(var k in attObj){if(attObj[k]!=Object.prototype[k]){if(k.toLowerCase()=="data"){e.setAttribute("src",attObj[k]);}
else if(k.toLowerCase()=="styleclass"){e.setAttribute("class",attObj[k]);}
else if(k.toLowerCase()!="classid"){e.setAttribute(k,attObj[k]);}}}
for(var l in parObj){if(parObj[l]!=Object.prototype[l]){if(l.toLowerCase()!="movie"){e.setAttribute(l,parObj[l]);}}}
el.parentNode.replaceChild(e,el);r=e;}
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"||obj.nodeName=="EMBED")){if(ua.ie&&ua.win){if(obj.readyState==4){removeObjectInIE(id);}
else{win.attachEvent("onload",function(){removeObjectInIE(id);});}}
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){if(ua.ie&&ua.mac){return;}
var h=doc.getElementsByTagName("head")[0],s=createElement("style");s.setAttribute("type","text/css");s.setAttribute("media","screen");if(!(ua.ie&&ua.win)&&typeof doc.createTextNode!=UNDEF){s.appendChild(doc.createTextNode(sel+" {"+decl+"}"));}
h.appendChild(s);if(ua.ie&&ua.win&&typeof doc.styleSheets!=UNDEF&&doc.styleSheets.length>0){var ls=doc.styleSheets[doc.styleSheets.length-1];if(typeof ls.addRule==OBJECT){ls.addRule(sel,decl);}}}
function setVisibility(id,isVisible){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?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){if(!ua.w3cdom||!objectIdStr||!swfVersionStr){return;}
var regObj={};regObj.id=objectIdStr;regObj.swfVersion=swfVersionStr;regObj.expressInstall=xiSwfUrlStr?xiSwfUrlStr:false;regObjArr[regObjArr.length]=regObj;setVisibility(objectIdStr,false);},getObjectById:function(objectIdStr){var r=null;if(ua.w3cdom){var o=getElementById(objectIdStr);if(o){var n=o.getElementsByTagName(OBJECT)[0];if(!n||(n&&typeof o.SetVariable!=UNDEF)){r=o;}
else if(typeof n.SetVariable!=UNDEF){r=n;}}}
return r;},embedSWF:function(swfUrlStr,replaceElemIdStr,widthStr,heightStr,swfVersionStr,xiSwfUrlStr,flashvarsObj,parObj,attObj){if(!ua.w3cdom||!swfUrlStr||!replaceElemIdStr||!widthStr||!heightStr||!swfVersionStr){return;}
widthStr+="";heightStr+="";if(hasPlayerVersion(swfVersionStr)){setVisibility(replaceElemIdStr,false);var att={};if(attObj&&typeof attObj===OBJECT){for(var i in attObj){if(attObj[i]!=Object.prototype[i]){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){if(parObj[j]!=Object.prototype[j]){par[j]=parObj[j];}}}
if(flashvarsObj&&typeof flashvarsObj===OBJECT){for(var k in flashvarsObj){if(flashvarsObj[k]!=Object.prototype[k]){if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+k+"="+flashvarsObj[k];}
else{par.flashvars=k+"="+flashvarsObj[k];}}}}
addDomLoadEvent(function(){createSWF(att,par,replaceElemIdStr);if(att.id==replaceElemIdStr){setVisibility(replaceElemIdStr,true);}});}
else if(xiSwfUrlStr&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){isExpressInstallActive=true;setVisibility(replaceElemIdStr,false);addDomLoadEvent(function(){var regObj={};regObj.id=regObj.altContentId=replaceElemIdStr;regObj.width=widthStr;regObj.height=heightStr;regObj.expressInstall=xiSwfUrlStr;showExpressInstall(regObj);});}else{addDomLoadEvent(function(){var regObj={};regObj.id=regObj.altContentId=replaceElemIdStr;regObj.width=widthStr;regObj.height=heightStr;showNoPlayerMessage(regObj);});}},getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]};},hasFlashPlayerVersion:hasPlayerVersion,createSWF:function(attObj,parObj,replaceElemIdStr){if(ua.w3cdom){return createSWF(attObj,parObj,replaceElemIdStr);}
else{return undefined;}},removeSWF:function(objElemIdStr){if(ua.w3cdom){removeSWF(objElemIdStr);}},createCSS:function(sel,decl){if(ua.w3cdom){createCSS(sel,decl);}},addDomLoadEvent:addDomLoadEvent,addLoadEvent:addLoadEvent,getQueryParamValue:function(param){var q=doc.location.search||doc.location.hash;if(param==null){return urlEncodeIfNecessary(q);}
if(q){var pairs=q.substring(1).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&&storedAltContent){var obj=getElementById(EXPRESS_INSTALL_ID);if(obj){obj.parentNode.replaceChild(storedAltContent,obj);if(storedAltContentId){setVisibility(storedAltContentId,true);if(ua.ie&&ua.win){storedAltContent.style.display="block";}}
storedAltContent=null;storedAltContentId=null;isExpressInstallActive=false;}}}};}();/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * SuperSleight PNG transparency hack: packed version
 * run on IE6 detection
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
var supersleight=function(){var root=false;
	var applyPositioning=true;
	var shim='../fn20/imgs/x.gif';
	var shim_pattern=/x\.gif$/i;
var fnLoadPngs=function(){if(root){root=document.getElementById(root);}else{root=document;}
for(var i=root.all.length-1,obj=null;(obj=root.all[i]);i--){if(obj.currentStyle.backgroundImage.match(/\.png/i)!==null){bg_fnFixPng(obj);}
if(obj.tagName=='IMG'&&obj.src.match(/\.png$/i)!==null){el_fnFixPng(obj);}
if(applyPositioning&&(obj.tagName=='A'||obj.tagName=='INPUT')&&obj.style.position===''){obj.style.position='relative';}}};var bg_fnFixPng=function(obj){var mode='scale';var bg=obj.currentStyle.backgroundImage;var src=bg.substring(5,bg.length-2);if(obj.currentStyle.backgroundRepeat=='no-repeat'){mode='crop';}
obj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='"+mode+"')";obj.style.backgroundImage='url('+shim+')';};var el_fnFixPng=function(img){var src=img.src;img.style.width=img.width+"px";img.style.height=img.height+"px";img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='scale')";img.src=shim;};var addLoadEvent=function(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){if(oldonload){oldonload();}
func();};}};return{init:function(){addLoadEvent(fnLoadPngs);},limitTo:function(el){root=el;},run:function(){fnLoadPngs();}};}();
if ($.browser.msie && (parseInt($.browser.version) < 7)) {
//	supersleight.init();
}
/**
 * jQuery.query - Query String Modification and Creation for jQuery
 * Written in 2007 by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
 * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
 * Date: 2008/02/08
 *
 * @author Blair Mitchelmore
 * @version 1.2
 * @url http://plugins.jquery.com/project/query-object
 **/

new function(settings){var $separator=settings.separator||'&';var $spaces=settings.spaces===false?false:true;var $suffix=settings.suffix===false?'':'[]';jQuery.query=new function(){var queryObject=function(a){var self=this;self.keys={};if(a.queryObject){jQuery.each(a.keys,function(key,val){self.destructiveSet(key,val);});}else{var q=""+a;q=q.replace(/^\?/,'');q=q.replace(/[;&]$/,'');if($spaces)q=q.replace('+',' ');jQuery.each(q.split(/[&;]/),function(){var key=this.split('=')[0];var val=this.split('=')[1];var temp,hashKey=null,type=null;if(/^-?[0-9]+\.[0-9]+$/.test(val))
val=parseFloat(val);else if(/^-?[0-9]+$/.test(val))
val=parseInt(val);if(/\[([^\] ]+)\]$/.test(key))
type=Object,hashkey=key.replace(/^.+\[([^\] ]+)\]$/,"$1"),key=key.replace(/\[([^\] ]+)\]$/,"");else if(/\[\]$/.test(key))
type=Array,key=key.replace(/\[\]$/,"");val=val||true;if(!type&&self.has(key))
type=Array,self.destructiveSet(key,self.has(key,Array)?self.keys[key]:[self.keys[key]]);if(!type)
self.destructiveSet(key,val);else
if(type==Object)
temp=self.keys[key]||{},temp[hashkey]=val,self.destructiveSet(key,temp);else if(type==Array)
temp=self.keys[key]||[],temp.push(val),self.destructiveSet(key,temp);});}
return self;};queryObject.prototype={queryObject:true,has:function(key,type){var keys=this.keys;return!!type?keys[key]!=undefined&&keys[key]!==null&&keys[key].constructor==type:keys[key]!=undefined&&keys[key]!==null;},get:function(key){var value=(key==undefined)?this.keys:this.keys[key];if(value.constructor==Array)
return value.slice(0);else if(value.constructor==Object)
return jQuery.extend({},value);else
return value;},destructiveSet:function(key,val){if(val==undefined||val===null)
this.destructiveRemove(key);else
this.keys[key]=val;return this;},set:function(key,val){return this.copy().destructiveSet(key,val);},destructiveRemove:function(key){if(typeof this.keys[key]!='undefined')
delete this.keys[key];return this;},remove:function(key){return this.copy().destructiveRemove(key);},destructiveEmpty:function(){var self=this;jQuery.each(self.keys,function(key,value){delete self.keys[key];});return self;},copy:function(){return new queryObject(this);},empty:function(destructive){return this.copy().destructiveEmpty();},toString:function(){var i=0,queryString=[],self=this,addFields=function(o,key,value){o.push(key);if(value!==true){o.push("=");o.push(encodeURIComponent(value));}};jQuery.each(this.keys,function(key,value){var o=[];if(value!==false){if(i++==0)
o.push("?");if(self.has(key,Object)){var _o=[]
jQuery.each(value,function(_key,_value){var __o=[];addFields(__o,key+"["+_key+"]",_value);_o.push(__o.join(""));});o.push(_o.join($separator));}else if(self.has(key,Array)){var _o=[]
jQuery.each(value,function(_key,_value){var __o=[];addFields(__o,key+$suffix,_value);_o.push(__o.join(""));});o.push(_o.join($separator));}else{addFields(o,key,value);}}
queryString.push(o.join(""));});return queryString.join($separator);}};return new queryObject(location.search);};}(jQuery.query||{});
/* Dimensions plugin - helps to get the height/width of a container element
 * 
 * Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-12-20 08:46:55 -0600 (Thu, 20 Dec 2007) $
 * $Rev: 4259 $
 *
 * Version: 1.2
 *
 * Requires: jQuery 1.2+
 */

(function($){$.dimensions={version:'1.2'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr);};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.is(':visible')?this[0]['offset'+name]:num(this,name.toLowerCase())
+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')
+num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0);};});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val;}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name];};});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}
return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static'))
offsetParent=offsetParent.offsetParent;return $(offsetParent);}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;};})(jQuery);
/* jQuery onReady plugin (allows non-id selectors)
 */

jQuery.extend({onElementReady:function(query,callBack,timeoutValue,pollInterval){var _pollInterval=pollInterval||100;var _timeoutValue=timeoutValue||8500;var elementPoll=null;var elementTimeout=null;var endPolling=function(condition,element,callback){if(condition&&($(element).siblings().length>0||$(element).text().length>0)){clearInterval(elementPoll);clearTimeout(elementTimeout);elementPoll=null;elementTimeout=null;if(callBack)callBack();}}
elementPoll=setInterval(function(){var element=$(query)[0];endPolling(element!==undefined,element,callBack);},_pollInterval);elementTimeout=setTimeout(function(){var element=$(query)[0];endPolling(element===undefined,element);},_timeoutValue);}});
/*
 * jQuery validation plug-in 1.4
 *
 * http://bassistance.de/jquery-plugins/jquery-plugin-validation/
 * http://docs.jquery.com/Plugins/Validation
 *
 * Copyright (c) 2006 - 2008 JÃ¶rn Zaefferer
 *
 * $Id: jquery.validate.js 5788 2008-07-13 15:04:50Z joern.zaefferer $
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}var validator=$.data(this[0],'validator');if(validator){return validator;}validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});this.submit(function(event){if(validator.settings.debug)event.preventDefault();function handle(){if(validator.settings.submitHandler){validator.settings.submitHandler.call(validator,validator.currentForm);return false;}return true;}if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}return handle();}else{validator.focusInvalid();return false;}});}return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=false;var validator=$(this[0].form).validate();this.each(function(){valid|=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(){result[this]=$element.attr(this);$element.removeAttr(this);});return result;},rules:function(command,argument){var element=this[0];if(command){var staticRules=$.data(element.form,'validator').settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}return data;},push:function(t){return this.setArray(this.add(t).get());}});$.extend($.expr[":"],{blank:function(a){return!$.trim(a.value);},filled:function(a){return!!$.trim(a.value);},unchecked:function(a){return!a.checked;}});$.format=function(source,params){if(arguments.length==1)return function(){var args=$.makeArray(arguments);args.unshift(source);return $.format.apply(this,args);};if(arguments.length>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1);}if(params.constructor!=Array){params=[params];}$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.validator=function(options,form){this.settings=$.extend({},$.validator.defaults,options);this.currentForm=form;this.init();};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)this.element(element);},highlight:function(element,errorClass){$(element).addClass(errorClass);},unhighlight:function(element,errorClass){$(element).removeClass(errorClass);}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",dateDE:"Bitte geben Sie ein gÃ¼ltiges Datum ein.",number:"Please enter a valid number.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Please enter only digits",creditcard:"Please enter a valid credit card.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.format("Please enter no more than {0} characters."),minlength:$.format("Please enter at least {0} characters."),rangelength:$.format("Please enter a value between {0} and {1} characters long."),range:$.format("Please enter a value between {0} and {1}."),max:$.format("Please enter a value less than or equal to {0}."),min:$.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator");validator.settings["on"+event.type]&&validator.settings["on"+event.type].call(validator,this[0]);}$(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).delegate("click",":radio, :checkbox",delegate);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())$(this.currentForm).triggerHandler("invalid-form.validate",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}if(!this.numberOfInvalids()){this.toHide.push(this.containers);}this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm)$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus();}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.formSubmitted=false;this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().push(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];}var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,$.trim(element.value),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id
+", check the '"+rule.method+"' method");throw e;}}if(dependencyMismatch)return;if(this.objectLength(rules))this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata)return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined)return arguments[i];}return undefined;},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customMetaMessage(element,method),element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method);if(typeof message=="function")message=message.call(this,rule.parameters,element);this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)toToggle.push(toToggle.parents(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass);this.showLabel(error.element,error.message);}if(this.errorList.length){this.toShow.push(this.containers);}if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass);}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+">").parent();}if(!this.labelContainer.append(label).length)this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);}if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}this.toShow.push(label);},errorsFor:function(element){return this.errors().filter("[@for='"+this.idOrName(element)+"']");},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return/radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))return this.findByName(element.name).filter(':checked').length;}return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}}if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}if(rules.messages){delete rules.messages}return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message;if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var options=$("option:selected",element);return options.length>0&&(element.type=="select-multiple"||($.browser.msie&&!(options[0].attributes['value'].specified)?options[0].text:options[0].value).length>0);case'input':if(this.checkable(element))return this.getLength(value,element)>0;default:return value.length>0;}},remote:function(value,element,param){if(this.optional(element))return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])this.settings.messages[element.name]={};this.settings.messages[element.name].remote=typeof previous.message=="function"?previous.message(value):previous.message;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax({url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){if(!response){var errors={};errors[element.name]=response||validator.defaultMessage(element,"remote");validator.showErrors(errors);}else{var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}previous.valid=response;validator.stopRequest(element,response);}});return"pending";}else if(this.pending[element.name]){return"pending";}return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength(value,element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength(value,element)<=param;},rangelength:function(value,element,param){var length=this.getLength(value,element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(element.value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(element.value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},dateDE:function(value,element){return this.optional(element)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},numberDE:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))return"dependency-mismatch";if(/[^0-9-]+/.test(value))return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)nDigit-=9;}nCheck+=nDigit;bEven=!bEven;}return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param:"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){return value==$(param).val();}}});})(jQuery);;(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}return(pendingRequests[port]=ajax.apply(this,arguments));}return ajax.apply(this,arguments);};})(jQuery);;(function($){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){if($.browser.msie)return false;this.addEventListener(original,$.event.special[fix].handler,true);},teardown:function(){if($.browser.msie)return false;this.removeEventListener(original,$.event.special[fix].handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};});$.extend($.fn,{delegate:function(type,delegate,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});},triggerEvent:function(type,target){return this.triggerHandler(type,[$.event.fix({type:type,target:target})]);}})})(jQuery);
 
/*
 * Autocomplete - jQuery plugin 1.0.2
 *
 * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, JÃ¶rn Zaefferer
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z joern.zaefferer $
 *
 */

jQuery.autocomplete=function(input,options){var me=this;var $input=$(input).attr("autocomplete","off");if(options.inputClass)$input.addClass(options.inputClass);var results=document.createElement("div");var $results=$(results);$results.hide().addClass(options.resultsClass).css("position","absolute");$results.attr({id:"asug"});if(options.width>0)$results.css("width",options.width);$("#hd-wrap").append(results);input.autocompleter=me;var timeout=null;var prev="";var active=-1;var cache={};var keyb=false;var hasFocus=false;var lastKeyPressCode=null;function flushCache(){cache={};cache.data={};cache.length=0;};flushCache();if(options.data!=null){var sFirstChar="",stMatchSets={},row=[];if(typeof options.url!="string")options.cacheLength=1;for(var i=0;i<options.data.length;i++){row=((typeof options.data[i]=="string")?[options.data[i]]:options.data[i]);if(row[0].length>0){sFirstChar=row[0].substring(0,1).toLowerCase();if(!stMatchSets[sFirstChar])stMatchSets[sFirstChar]=[];stMatchSets[sFirstChar].push(row);}}
for(var k in stMatchSets){options.cacheLength++;addToCache(k,stMatchSets[k]);}}
$input.keydown(function(e){lastKeyPressCode=e.keyCode;switch(e.keyCode){case 38:e.preventDefault();moveSelect(-1);break;case 40:e.preventDefault();moveSelect(1);break;case 9:case 13:if(selectCurrent()){$input.get(0).blur();e.preventDefault();}
break;default:active=-1;if(timeout)clearTimeout(timeout);timeout=setTimeout(function(){onChange();},options.delay);break;}}).focus(function(){hasFocus=true;}).blur(function(){hasFocus=false;hideResults();});hideResultsNow();function onChange(){if(lastKeyPressCode==46||(lastKeyPressCode>8&&lastKeyPressCode<32))return $results.hide();var v=$input.val();if(v==prev)return;prev=v;if(v.length>=options.minChars){$input.addClass(options.loadingClass);requestData(v);}else{$input.removeClass(options.loadingClass);$results.hide();}};function moveSelect(step){var lis=$("li",results);if(!lis)return;active+=step;if(active<0){active=0;}else if(active>=lis.size()){active=lis.size()-1;}
lis.removeClass("ac_over");$(lis[active]).addClass("ac_over");};function selectCurrent(){var li=$("li.ac_over",results)[0];if(!li){var $li=$("li",results);if(options.selectOnly){if($li.length==1)li=$li[0];}else if(options.selectFirst){li=$li[0];}}
if(li){selectItem(li);return true;}else{return false;}};function selectItem(li){if(!li){li=document.createElement("li");li.extra=[];li.selectValue="";}
var v=$.trim(li.selectValue?li.selectValue:li.innerHTML);input.lastSelected=v;prev=v;$results.html("");$input.val(v);hideResultsNow();if(options.onItemSelect)setTimeout(function(){options.onItemSelect(li)},1);};function createSelection(start,end){var field=$input.get(0);if(field.createTextRange){var selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}else if(field.setSelectionRange){field.setSelectionRange(start,end);}else{if(field.selectionStart){field.selectionStart=start;field.selectionEnd=end;}}
field.focus();};function autoFill(sValue){if(lastKeyPressCode!=8){$input.val($input.val()+sValue.substring(prev.length));createSelection(prev.length,sValue.length);}};function showResults(){var pos=findPos(input);var iWidth=(options.width>0)?options.width:$input.width();$results.css({width:parseInt(iWidth)+"px",top:(pos.y+input.offsetHeight)+"px",left:pos.x+"px"}).show();$results.append("<div class='ft'> </div>");$results.prepend("<div class='hd'> </div>");};function hideResults(){if(timeout)clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){if(timeout)clearTimeout(timeout);$input.removeClass(options.loadingClass);if($results.is(":visible")){$results.hide();}
if(options.mustMatch){var v=$input.val();if(v!=input.lastSelected){selectItem(null);}}};function receiveData(q,data){if(data){$input.removeClass(options.loadingClass);results.innerHTML="";if(!hasFocus||data.length==0)return hideResultsNow();if($.browser.msie){$results.append(document.createElement('iframe'));}
results.appendChild(dataToDom(data));if(options.autoFill&&($input.val().toLowerCase()==q.toLowerCase()))autoFill(data[0][0]);showResults();}else{hideResultsNow();}};function parseData(data){if(!data)return null;var parsed=[];var rows=data.split(options.lineSeparator);for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){parsed[parsed.length]=row.split(options.cellSeparator);}}
return parsed;};function dataToDom(data){var div=document.createElement("div");$(div).addClass("bd");var ul=document.createElement("ul");var num=data.length;if((options.maxItemsToShow>0)&&(options.maxItemsToShow<num))num=options.maxItemsToShow;for(var i=0;i<num;i++){var row=data[i];if(!row)continue;var li=document.createElement("li");if(options.formatItem){li.innerHTML=options.formatItem(row,i,num);li.selectValue=row[0];}else{li.innerHTML=row[0];li.selectValue=row[0];}
var extra=null;if(row.length>1){extra=[];for(var j=1;j<row.length;j++){extra[extra.length]=row[j];}}
li.extra=extra;ul.appendChild(li);$(li).hover(function(){$("li",ul).removeClass("ac_over");$(this).addClass("ac_over");active=$("li",ul).indexOf($(this).get(0));},function(){$(this).removeClass("ac_over");}).click(function(e){e.preventDefault();e.stopPropagation();selectItem(this)});}
div.appendChild(ul)
return div;};function requestData(q){if(!options.matchCase)q=q.toLowerCase();var data=options.cacheLength?loadFromCache(q):null;if(data){receiveData(q,data);}else if((typeof options.url=="string")&&(options.url.length>0)){$.get(makeUrl(q),function(data){data=parseData(data);addToCache(q,data);receiveData(q,data);});}else{$input.removeClass(options.loadingClass);}};function makeUrl(q){var url=options.url+"?key="+encodeURI(q);for(var i in options.extraParams){url+="&"+i+"="+encodeURI(options.extraParams[i]);}
return url;};function loadFromCache(q){if(!q)return null;if(cache.data[q])return cache.data[q];if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var qs=q.substr(0,i);var c=cache.data[qs];if(c){var csub=[];for(var j=0;j<c.length;j++){var x=c[j];var x0=x[0];if(matchSubset(x0,q)){csub[csub.length]=x;}}
return csub;}}}
return null;};function matchSubset(s,sub){if(!options.matchCase)s=s.toLowerCase();var i=s.indexOf(sub);if(i==-1)return false;return i==0||options.matchContains;};this.flushCache=function(){flushCache();};this.setExtraParams=function(p){options.extraParams=p;};this.findValue=function(){var q=$input.val();if(!options.matchCase)q=q.toLowerCase();var data=options.cacheLength?loadFromCache(q):null;if(data){findValueCallback(q,data);}else if((typeof options.url=="string")&&(options.url.length>0)){$.get(makeUrl(q),function(data){data=parseData(data)
addToCache(q,data);findValueCallback(q,data);});}else{findValueCallback(q,null);}}
function findValueCallback(q,data){if(data)$input.removeClass(options.loadingClass);var num=(data)?data.length:0;var li=null;for(var i=0;i<num;i++){var row=data[i];if(row[0].toLowerCase()==q.toLowerCase()){li=document.createElement("li");if(options.formatItem){li.innerHTML=options.formatItem(row,i,num);li.selectValue=row[0];}else{li.innerHTML=row[0];li.selectValue=row[0];}
var extra=null;if(row.length>1){extra=[];for(var j=1;j<row.length;j++){extra[extra.length]=row[j];}}
li.extra=extra;}}
if(options.onFindValue)setTimeout(function(){options.onFindValue(li)},1);}
function addToCache(q,data){if(!data||!q||!options.cacheLength)return;if(!cache.length||cache.length>options.cacheLength){flushCache();cache.length++;}else if(!cache[q]){cache.length++;}
cache.data[q]=data;};function findPos(obj){var curleft=obj.offsetLeft||0;var curtop=obj.offsetTop||0;while(obj=obj.offsetParent){curleft+=obj.offsetLeft
curtop+=obj.offsetTop}
return{x:curleft,y:curtop};}}
jQuery.fn.autocomplete=function(url,options,data){options=options||{};options.url=url;options.data=((typeof data=="object")&&(data.constructor==Array))?data:null;options.inputClass=options.inputClass||"ac_input";options.resultsClass=options.resultsClass||"drop";options.lineSeparator=options.lineSeparator||",";options.cellSeparator=options.cellSeparator||"|";options.minChars=options.minChars||1;options.delay=options.delay||400;options.matchCase=options.matchCase||0;options.matchSubset=options.matchSubset||1;options.matchContains=options.matchContains||0;options.cacheLength=options.cacheLength||1;options.mustMatch=options.mustMatch||0;options.extraParams=options.extraParams||{};options.loadingClass=options.loadingClass||"ac_loading";options.selectFirst=options.selectFirst||false;options.selectOnly=options.selectOnly||false;options.maxItemsToShow=options.maxItemsToShow||10;options.autoFill=options.autoFill||false;options.width=parseInt(options.width,10)||0;this.each(function(){var input=this;new jQuery.autocomplete(input,options);});return this;}
jQuery.fn.autocompleteArray=function(data,options){return this.autocomplete(null,options,data);}
jQuery.fn.indexOf=function(e){for(var i=0;i<this.length;i++){if(this[i]==e)return i;}
return-1;};
/**
 * 
 * FEB 21, 2008
 * PLUGIN UPPDATE WITH CUSTOM CODE FOR GALLERY MODULE
 * 
 * jCarousel - Riding carousels with jQuery
 *   http://sorgalla.com/jcarousel/
 *
 * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * Built on top of the jQuery library
 *   http://jquery.com
 *
 * Inspired by the "Carousel Component" by Bill Scott
 *   http://billwscott.com/carousel/
 */

(
function($){$.fn.jcarousel=function(o){return this.each(function(){new $jc(this,o);});};var defaults={vertical:false,start:1,offset:1,size:null,scroll:3,visible:null,animation:'normal',easing:'swing',auto:0,wrap:null,initCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,buttonNextHTML:'<div></div>',buttonPrevHTML:'<div></div>',buttonNextEvent:'click',buttonPrevEvent:'click',buttonNextCallback:null,buttonPrevCallback:null};$.jcarousel=function(e,o){this.options=$.extend({},defaults,o||{});this.locked=false;this.container=null;this.clip=null;this.list=null;this.buttonNext=null;this.buttonPrev=null;this.wh=!this.options.vertical?'width':'height';this.lt=!this.options.vertical?'left':'top';if(e.nodeName=='UL'||e.nodeName=='OL'){this.list=$(e);this.container=this.list.parent();if($.className.has(this.container[0].className,'jcarousel-clip')){if(!$.className.has(this.container[0].parentNode.className,'jcarousel-container'))this.container=this.container.wrap('<div></div>');this.container=this.container.parent();}else if(!$.className.has(this.container[0].className,'jcarousel-container'))this.container=this.list.wrap('<div></div>').parent();var split=e.className.split(' ');for(var i=0;i<split.length;i++){if(split[i].indexOf('jcarousel-skin')!=-1){this.list.removeClass(split[i]);this.container.addClass(split[i]);break;}}}else{this.container=$(e);this.list=$(e).children('ul,ol');}this.clip=this.list.parent();if(!this.clip.length||!$.className.has(this.clip[0].className,'jcarousel-clip'))this.clip=this.list.wrap('<div></div>').parent();this.buttonPrev=$('.jcarousel-prev',this.container);if(this.buttonPrev.size()==0&&this.options.buttonPrevHTML!=null)this.buttonPrev=this.clip.before(this.options.buttonPrevHTML).prev();this.buttonPrev.addClass(this.className('jcarousel-prev'));this.buttonNext=$('.jcarousel-next',this.container);if(this.buttonNext.size()==0&&this.options.buttonNextHTML!=null)this.buttonNext=this.clip.before(this.options.buttonNextHTML).prev();this.buttonNext.addClass(this.className('jcarousel-next'));this.clip.addClass(this.className('jcarousel-clip'));this.list.addClass(this.className('jcarousel-list'));this.container.addClass(this.className('jcarousel-container'));var di=this.options.visible!=null?Math.ceil(this.clipping()/this.options.visible):null;var li=this.list.children('li');var self=this;if(li.size()>0){var wh=0,i=this.options.offset;li.each(function(){self.format(this,i++);wh+=self.dimension(this,di);});this.list.css(this.wh,wh+'px');if(!o||o.size==undefined)this.options.size=li.size();}this.container.css('display','block');this.buttonNext.css('display','block');this.buttonPrev.css('display','block');this.funcNext=function(){self.next();};this.funcPrev=function(){self.prev();};$(window).bind('resize',function(){self.reload();});if(this.options.initCallback!=null)this.options.initCallback(this,'init');this.setup();};var $jc=$.jcarousel;$jc.fn=$jc.prototype={jcarousel:'0.2.2'};$jc.fn.extend=$jc.extend=$.extend;$jc.fn.extend({setup:function(){this.first=null;this.last=null;this.prevFirst=null;this.prevLast=null;this.animating=false;this.timer=null;this.tail=null;this.inTail=false;if(this.locked)return;this.list.css(this.lt,this.pos(this.options.offset)+'px');var p=this.pos(this.options.start);this.prevFirst=this.prevLast=null;this.animate(p,false);},reset:function(){this.list.empty();this.list.css(this.lt,'0px');this.list.css(this.wh,'0px');if(this.options.initCallback!=null)this.options.initCallback(this,'reset');this.setup();},reload:function(){if(this.tail!=null&&this.inTail)this.list.css(this.lt,$jc.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=false;if(this.options.reloadCallback!=null)this.options.reloadCallback(this);if(this.options.visible!=null){var self=this;var di=Math.ceil(this.clipping()/this.options.visible),wh=0,lt=0;$('li',this.list).each(function(i){wh+=self.dimension(this,di);if(i+1<self.first)lt=wh;});this.list.css(this.wh,wh+'px');this.list.css(this.lt,-lt+'px');}this.scroll(this.first,false);},lock:function(){this.locked=true;this.buttons();},unlock:function(){this.locked=false;this.buttons();},size:function(s){if(s!=undefined){this.options.size=s;if(!this.locked)this.buttons();}return this.options.size;},has:function(i,i2){if(i2==undefined||!i2)i2=i;for(var j=i;j<=i2;j++){var e=this.get(j).get(0);if(!e||$.className.has(e,'jcarousel-item-placeholder'))return false;}return true;},get:function(i){return $('.jcarousel-item-'+i,this.list);},add:function(i,s){var e=this.get(i),old=0;if(e.length==0){var c,e=this.create(i),j=$jc.intval(i);while(c=this.get(--j)){if(j<=0||c.length){j<=0?this.list.prepend(e):c.after(e);break;}}}else old=this.dimension(e);e.removeClass(this.className('jcarousel-item-placeholder'));typeof s=='string'?e.html(s):e.empty().append(s);var di=this.options.visible!=null?Math.ceil(this.clipping()/this.options.visible):null;var wh=this.dimension(e,di)-old;if(i>0&&i<this.first)this.list.css(this.lt,$jc.intval(this.list.css(this.lt))+wh+'px');this.list.css(this.wh,$jc.intval(this.list.css(this.wh))+wh+'px');return e;},remove:function(i){var e=this.get(i);if(!e.length||(i>=this.first&&i<=this.last))return;var d=this.dimension(e);if(i<this.first)this.list.css(this.lt,$jc.intval(this.list.css(this.lt))+d+'px');e.remove();this.list.css(this.wh,$jc.intval(this.list.css(this.wh))-d+'px');},next:function(){this.stopAuto();if(this.tail!=null&&!this.inTail)this.scrollTail(false);else this.scroll(((this.options.wrap=='both'||this.options.wrap=='last')&&this.options.size!=null&&this.last==this.options.size)?1:this.first+this.options.scroll);},prev:function(){this.stopAuto();if(this.tail!=null&&this.inTail)this.scrollTail(true);else this.scroll(((this.options.wrap=='both'||this.options.wrap=='first')&&this.options.size!=null&&this.first==1)?this.options.size:this.first-this.options.scroll);},scrollTail:function(b){if(this.locked||this.animating||!this.tail)return;var pos=$jc.intval(this.list.css(this.lt));!b?pos-=this.tail:pos+=this.tail;this.inTail=!b;this.prevFirst=this.first;this.prevLast=this.last;this.animate(pos);},currentSelectedIndex:1,currentSelectedIndex_callback:"",scroll:function(i,a,externallyCalled){if(this.locked||this.animating)return;this.animate(this.pos(i),a);this.currentSelectedIndex=i;if(!externallyCalled){eval(this.currentSelectedIndex_callback+"("+this.currentSelectedIndex+")");}},pos:function(i){if(this.locked||this.animating)return;if(this.options.wrap!='circular')i=i<1?1:(this.options.size&&i>this.options.size?this.options.size:i);var back=this.first>i;var pos=$jc.intval(this.list.css(this.lt));var f=this.options.wrap!='circular'&&this.first<=1?1:this.first;var c=back?this.get(f):this.get(this.last);var j=back?f:f-1;var e=null,l=0,p=false,d=0;while(back?--j>=i:++j<i){e=this.get(j);p=!e.length;if(e.length==0){e=this.create(j).addClass(this.className('jcarousel-item-placeholder'));c[back?'before':'after'](e);}c=e;d=this.dimension(e);if(p)l+=d;if(this.first!=null&&(this.options.wrap=='circular'||(j>=1&&(this.options.size==null||j<=this.options.size))))pos=back?pos+d:pos-d;}var clipping=this.clipping();var cache=[];var visible=0,j=i,v=0;var c=this.get(i-1);while(++visible){e=this.get(j);p=!e.length;if(e.length==0){e=this.create(j).addClass(this.className('jcarousel-item-placeholder'));c.length==0?this.list.prepend(e):c[back?'before':'after'](e);}c=e;var d=this.dimension(e);if(d==0){/*alert('jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...');*/return 0;}if(this.options.wrap!='circular'&&this.options.size!==null&&j>this.options.size)cache.push(e);else if(p)l+=d;v+=d;if(v>=clipping)break;j++;}for(var x=0;x<cache.length;x++)cache[x].remove();if(l>0){this.list.css(this.wh,this.dimension(this.list)+l+'px');if(back){pos-=l;this.list.css(this.lt,$jc.intval(this.list.css(this.lt))-l+'px');}}var last=i+visible-1;if(this.options.wrap!='circular'&&this.options.size&&last>this.options.size)last=this.options.size;if(j>last){visible=0,j=last,v=0;while(++visible){var e=this.get(j--);if(!e.length)break;v+=this.dimension(e);if(v>=clipping)break;}}var first=last-visible+1;if(this.options.wrap!='circular'&&first<1)first=1;if(this.inTail&&back){pos+=this.tail;this.inTail=false;}this.tail=null;if(this.options.wrap!='circular'&&last==this.options.size&&(last-visible+1)>=1){var m=$jc.margin(this.get(last),!this.options.vertical?'marginRight':'marginBottom');if((v-m)>clipping)this.tail=v-clipping-m;}while(i-->first)pos+=this.dimension(this.get(i));this.prevFirst=this.first;this.prevLast=this.last;this.first=first;this.last=last;return pos;},animate:function(p,a){if(this.locked||this.animating)return;this.animating=true;var self=this;var scrolled=function(){self.animating=false;if(p==0)self.list.css(self.lt,0);if(self.options.wrap=='both'||self.options.wrap=='last'||self.options.size==null||self.last<self.options.size)self.startAuto();self.buttons();self.notify('onAfterAnimation');};this.notify('onBeforeAnimation');if(!this.options.animation||a==false){this.list.css(this.lt,p+'px');scrolled();}else{var o=!this.options.vertical?{'left':p}:{'top':p};this.list.animate(o,this.options.animation,this.options.easing,scrolled);}},startAuto:function(s){if(s!=undefined)this.options.auto=s;if(this.options.auto==0)return this.stopAuto();if(this.timer!=null)return;var self=this;this.timer=setTimeout(function(){self.next();},this.options.auto*1000);},stopAuto:function(){if(this.timer==null)return;clearTimeout(this.timer);this.timer=null;},buttons:function(n,p){if(n==undefined||n==null){var n=!this.locked&&this.options.size!==0&&((this.options.wrap&&this.options.wrap!='first')||this.options.size==null||this.last<this.options.size);if(!this.locked&&(!this.options.wrap||this.options.wrap=='first')&&this.options.size!=null&&this.last>=this.options.size)n=this.tail!=null&&!this.inTail;}if(p==undefined||p==null){var p=!this.locked&&this.options.size!==0&&((this.options.wrap&&this.options.wrap!='last')||this.first>1);if(!this.locked&&(!this.options.wrap||this.options.wrap=='last')&&this.options.size!=null&&this.first==1)p=this.tail!=null&&this.inTail;}var self=this;this.buttonNext[n?'bind':'unbind'](this.options.buttonNextEvent,this.funcNext)[n?'removeClass':'addClass'](this.className('jcarousel-next-disabled')).attr('disabled',n?false:true);this.buttonPrev[p?'bind':'unbind'](this.options.buttonPrevEvent,this.funcPrev)[p?'removeClass':'addClass'](this.className('jcarousel-prev-disabled')).attr('disabled',p?false:true);if(this.buttonNext.length>0&&(this.buttonNext[0].jcarouselstate==undefined||this.buttonNext[0].jcarouselstate!=n)&&this.options.buttonNextCallback!=null){this.buttonNext.each(function(){self.options.buttonNextCallback(self,this,n);});this.buttonNext[0].jcarouselstate=n;}if(this.buttonPrev.length>0&&(this.buttonPrev[0].jcarouselstate==undefined||this.buttonPrev[0].jcarouselstate!=p)&&this.options.buttonPrevCallback!=null){this.buttonPrev.each(function(){self.options.buttonPrevCallback(self,this,p);});this.buttonPrev[0].jcarouselstate=p;}},notify:function(evt){var state=this.prevFirst==null?'init':(this.prevFirst<this.first?'next':'prev');this.callback('itemLoadCallback',evt,state);if(this.prevFirst!=this.first){this.callback('itemFirstInCallback',evt,state,this.first);this.callback('itemFirstOutCallback',evt,state,this.prevFirst);}if(this.prevLast!=this.last){this.callback('itemLastInCallback',evt,state,this.last);this.callback('itemLastOutCallback',evt,state,this.prevLast);}this.callback('itemVisibleInCallback',evt,state,this.first,this.last,this.prevFirst,this.prevLast);this.callback('itemVisibleOutCallback',evt,state,this.prevFirst,this.prevLast,this.first,this.last);},callback:function(cb,evt,state,i1,i2,i3,i4){if(this.options[cb]==undefined||(typeof this.options[cb]!='object'&&evt!='onAfterAnimation'))return;var callback=typeof this.options[cb]=='object'?this.options[cb][evt]:this.options[cb];if(!$.isFunction(callback))return;var self=this;if(i1===undefined)callback(self,state,evt);else if(i2===undefined)this.get(i1).each(function(){callback(self,this,i1,state,evt);});else{for(var i=i1;i<=i2;i++)if(!(i>=i3&&i<=i4))this.get(i).each(function(){callback(self,this,i,state,evt);});}},create:function(i){return this.format('<li></li>',i);},format:function(e,i){var $e=$(e).addClass(this.className('jcarousel-item')).addClass(this.className('jcarousel-item-'+i));$e.attr('jcarouselindex',i);return $e;},className:function(c){return c+' '+c+(!this.options.vertical?'-horizontal':'-vertical');},dimension:function(e,d){var el=e.jquery!=undefined?e[0]:e;var old=!this.options.vertical?el.offsetWidth+$jc.margin(el,'marginLeft')+$jc.margin(el,'marginRight'):el.offsetHeight+$jc.margin(el,'marginTop')+$jc.margin(el,'marginBottom');if(d==undefined||old==d)return old;var w=!this.options.vertical?d-$jc.margin(el,'marginLeft')-$jc.margin(el,'marginRight'):d-$jc.margin(el,'marginTop')-$jc.margin(el,'marginBottom');$(el).css(this.wh,w+'px');return this.dimension(el);},clipping:function(){return!this.options.vertical?this.clip[0].offsetWidth-$jc.intval(this.clip.css('borderLeftWidth'))-$jc.intval(this.clip.css('borderRightWidth')):this.clip[0].offsetHeight-$jc.intval(this.clip.css('borderTopWidth'))-$jc.intval(this.clip.css('borderBottomWidth'));},index:function(i,s){if(s==undefined)s=this.options.size;return Math.round((((i-1)/s)-Math.floor((i-1)/s))*s)+1;}});$jc.extend({defaults:function(d){$.extend(defaults,d);},margin:function(e,p){if(!e)return 0;var el=e.jquery!=undefined?e[0]:e;if(p=='marginRight'&&$.browser.safari){var old={'display':'block','float':'none','width':'auto'},oWidth,oWidth2;$.swap(el,old,function(){oWidth=el.offsetWidth;});old['marginRight']=0;$.swap(el,old,function(){oWidth2=el.offsetWidth;});return oWidth2-oWidth;}return $jc.intval($.css(el,p));},intval:function(v){v=parseInt(v);return isNaN(v)?0:v;}});})(jQuery);

/*
 * jQuery UI Accordion
 * 
 * Copyright (c) 2007 Joern Zaefferer
 *
 * http://docs.jquery.com/UI/Accordion
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.accordion.js 5048 2008-03-17 09:23:12Z joern.zaefferer $
 *
 */
;(function($){$.ui=$.ui||{};$.fn.extend({accordion:function(options,data){var args=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof options=="string"){var accordion=$.data(this,"accordion");if(accordion){accordion[options].apply(accordion,args);}}else if(!$(this).is(".ui-accordion")){$.data(this,"accordion",new $.ui.accordion(this,options));}});},activate:function(index){return this.accordion("activate",index);},direction:function(direction){return direction=='prev'?this.prev():this.next();}});$.ui.accordion=function(container,options){this.options=options=$.extend({},$.ui.accordion.defaults,options);this.element=container;$(container).addClass("ui-accordion");if(options.navigation){var current=$(container).find("a").filter(options.navigationFilter);if(current.length){if(current.filter(options.header).length){options.active=current;}else{options.active=current.parent().parent().prev();current.addClass("current");}}}
options.headers=$(container).find(options.header);options.active=findActive(options.headers,options.active);if(options.fillSpace){var maxHeight=$(container).parent().height();options.headers.each(function(){maxHeight-=$(this).outerHeight();});var maxPadding=0;options.headers.direction(options.direction).each(function(){maxPadding=Math.max(maxPadding,$(this).innerHeight()-$(this).height());}).height(maxHeight-maxPadding);}else if(options.autoHeight){var maxHeight=0;options.headers.direction(options.direction).each(function(){maxHeight=Math.max(maxHeight,$(this).outerHeight());}).height(maxHeight);}
options.headers.not(options.active||"").direction(options.direction).hide();options.active.parent().andSelf().addClass(options.selectedClass);if(options.event){$(container).bind((options.event)+".accordion",clickHandler);}};$.ui.accordion.prototype={activate:function(index){clickHandler.call(this.element,{target:findActive(this.options.headers,index)[0]});},enable:function(){this.options.disabled=false;},disable:function(){this.options.disabled=true;},destroy:function(){this.options.headers.direction(this.options.direction).css("display","");if(this.options.fillSpace||this.options.autoHeight){this.options.headers.direction(this.options.direction).css("height","");}
$.removeData(this.element,"accordion");$(this.element).removeClass("ui-accordion").unbind(".accordion");}};function scopeCallback(callback,scope){return function(){return callback.apply(scope,arguments);};}
function completed(cancel){if(!$.data(this,"accordion")){return;}
var instance=$.data(this,"accordion");var options=instance.options;options.running=cancel?0:--options.running;if(options.running){return;}
if(options.clearStyle){options.toShow.add(options.toHide).css({height:"",overflow:""});}
$(this).triggerHandler("accordionchange",[options.data],options.change);}
function toggle(toShow,toHide,data,clickedActive,down){var options=$.data(this,"accordion").options;options.toShow=toShow;options.toHide=toHide;options.data=data;var complete=scopeCallback(completed,this);options.running=toHide.size()==0?toShow.size():toHide.size();if(options.animated){if(!options.alwaysOpen&&clickedActive){$.ui.accordion.animations[options.animated]({toShow:jQuery([]),toHide:toHide,complete:complete,down:down,autoHeight:options.autoHeight});}else{$.ui.accordion.animations[options.animated]({toShow:toShow,toHide:toHide,complete:complete,down:down,autoHeight:options.autoHeight});}}else{if(!options.alwaysOpen&&clickedActive){toShow.toggle();}else{toHide.hide();toShow.show();}
complete(true);}}
function clickHandler(event){var options=$.data(this,"accordion").options;if(options.disabled){return false;}
if(!event.target&&!options.alwaysOpen){options.active.parent().andSelf().toggleClass(options.selectedClass);var toHide=options.active.direction(this.options.direction),data={instance:this,options:options,newHeader:jQuery([]),oldHeader:options.active,newContent:jQuery([]),oldContent:toHide},toShow=options.active=$([]);toggle.call(this,toShow,toHide,data);return false;}
var clicked=$(event.target);if(clicked.parents(options.header).length)
while(!clicked.is(options.header))
clicked=clicked.parent();var clickedActive=clicked[0]==options.active[0];if(options.running||(options.alwaysOpen&&clickedActive))
return false;if(!clicked.is(options.header))
return;options.active.parent().andSelf().toggleClass(options.selectedClass);if(!clickedActive){clicked.parent().andSelf().addClass(options.selectedClass);}
var toShow=clicked.direction(options.direction),toHide=options.active.direction(options.direction),data={instance:this,options:options,newHeader:clicked,oldHeader:options.active,newContent:toShow,oldContent:toHide},down=options.headers.index(options.active[0])>options.headers.index(clicked[0]);options.active=clickedActive?$([]):clicked;toggle.call(this,toShow,toHide,data,clickedActive,down);return false;};function findActive(headers,selector){return selector!=undefined?typeof selector=="number"?headers.filter(":eq("+selector+")"):headers.not(headers.not(selector)):selector===false?$([]):headers.filter(":eq(0)");}
$.extend($.ui.accordion,{defaults:{selectedClass:"selected",alwaysOpen:true,animated:'slide',event:"click",header:"a",autoHeight:true,running:0,direction:'next',navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase();}},animations:{slide:function(options,additions){options=$.extend({easing:"swing",duration:300},options,additions);if(!options.toHide.size()){options.toShow.animate({height:"show"},options);return;}
var hideHeight=options.toHide.height(),showHeight=options.toShow.height(),difference=showHeight/hideHeight;options.toShow.css({height:0,overflow:'hidden'}).show();options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{step:function(now){var current=(hideHeight-now)*difference;if($.browser.msie||$.browser.opera){current=Math.ceil(current);}
options.toShow.height(current);},duration:options.duration,easing:options.easing,complete:function(){if(!options.autoHeight){options.toShow.css("height","auto");}
options.complete();}});},bounceslide:function(options){this.slide(options,{easing:options.down?"bounceout":"swing",duration:options.down?1000:200});},easeslide:function(options){this.slide(options,{easing:"easeinout",duration:700});}}});})(jQuery);
/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright Â© 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});

/*
 * Tabs 3 - New Wave Tabs
 *
 * Copyright (c) 2007 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 */

(function($){$.ui=$.ui||{};$.fn.tabs=function(initial,options){if(initial&&initial.constructor==Object){options=initial;initial=null;}
options=options||{};initial=initial&&initial.constructor==Number&&--initial||0;return this.each(function(){new $.ui.tabs(this,$.extend(options,{initial:initial}));});};$.each(['Add','Remove','Enable','Disable','Click','Load','Href'],function(i,method){$.fn['tabs'+method]=function(){var args=arguments;return this.each(function(){var instance=$.ui.tabs.getInstance(this);instance[method.toLowerCase()].apply(instance,args);});};});$.fn.tabsSelected=function(){var selected=-1;if(this[0]){var instance=$.ui.tabs.getInstance(this[0]),$lis=$('li',this);selected=$lis.index($lis.filter('.'+instance.options.selectedClass)[0]);}
return selected>=0?++selected:-1;};$.ui.tabs=function(el,options){this.source=el;this.options=$.extend({initial:0,event:'click',disabled:[],cookie:null,unselected:false,unselect:options.unselected?true:false,spinner:'Loading&#8230;',cache:false,idPrefix:'ui-tabs-',ajaxOptions:{},fxSpeed:'normal',add:function(){},remove:function(){},enable:function(){},disable:function(){},click:function(){},hide:function(){},show:function(){},load:function(){},tabTemplate:'<li><a href="#{href}"><span>#{text}</span></a></li>',panelTemplate:'<div></div>',navClass:'ui-tabs-nav',selectedClass:'ui-tabs-selected',unselectClass:'ui-tabs-unselect',disabledClass:'ui-tabs-disabled',panelClass:'ui-tabs-panel',hideClass:'ui-tabs-hide',loadingClass:'ui-tabs-loading',forcePositionCenter:false},options);this.options.event+='.ui-tabs';this.options.cookie=$.cookie&&$.cookie.constructor==Function&&this.options.cookie;$.data(el,$.ui.tabs.INSTANCE_KEY,this);this.tabify(true);};$.ui.tabs.INSTANCE_KEY='ui_tabs_instance';$.ui.tabs.getInstance=function(el){return $.data(el,$.ui.tabs.INSTANCE_KEY);};$.extend($.ui.tabs.prototype,{tabId:function(a){return a.title?a.title.replace(/\s/g,'_'):this.options.idPrefix+$.data(a);},tabify:function(init){this.$lis=$('li:has(a[href])',this.source);this.$tabs=this.$lis.map(function(){return $('a',this)[0]});this.$panels=$([]);var self=this,o=this.options;this.$tabs.each(function(i,a){if(a.hash&&a.hash.replace('#','')){self.$panels=self.$panels.add(a.hash);}
else if($(a).attr('href')!='#'){$.data(a,'href',a.href);var id=self.tabId(a);a.href='#'+id;self.$panels=self.$panels.add($('#'+id)[0]||$(o.panelTemplate).attr('id',id).addClass(o.panelClass).insertAfter(self.$panels[i-1]||self.source));}
else{o.disabled.push(i+1);}});if(init){$(this.source).hasClass(o.navClass)||$(this.source).addClass(o.navClass);this.$panels.each(function(){var $this=$(this);$this.hasClass(o.panelClass)||$this.addClass(o.panelClass);});if(o.forcePositionCenter&&$(this.source).hasClass(o.navClass)){nav=$(this.source);navWidth=1;nav.children().each(function(){navWidth+=$(this).outerWidth({margin:true});});if($.browser.msie&&(parseInt($.browser.version)<7)){navWidth+=3;}
nav.css({width:navWidth,position:'absolute',left:'50%'});nav.css('margin-left',-1*Math.ceil(navWidth/2.0));}
for(var i=0,position;position=o.disabled[i];i++){this.disable(position);}
this.$tabs.each(function(i,a){if(location.hash){if(a.hash==location.hash){o.initial=i;if($.browser.msie||$.browser.opera){var $toShow=$(location.hash),toShowId=$toShow.attr('id');$toShow.attr('id','');setTimeout(function(){$toShow.attr('id',toShowId);},500);}
scrollTo(0,0);return false;}}else if(o.cookie){o.initial=parseInt($.cookie($.ui.tabs.INSTANCE_KEY+$.data(self.source)))||0;return false;}else if(self.$lis.eq(i).hasClass(o.selectedClass)){o.initial=i;return false;}});var n=this.$lis.length;while(this.$lis.eq(o.initial).hasClass(o.disabledClass)&&n){o.initial=++o.initial<this.$lis.length?o.initial:0;n--;}
if(!n){o.unselected=o.unselect=true;}
this.$panels.addClass(o.hideClass);this.$lis.removeClass(o.selectedClass);if(!o.unselected){this.$panels.eq(o.initial).show().removeClass(o.hideClass);this.$lis.eq(o.initial).addClass(o.selectedClass);}
var href=!o.unselected&&$.data(this.$tabs[o.initial],'href');if(href){this.load(o.initial+1,href);}
if(!/^click/.test(o.event)){this.$tabs.bind('click',function(e){e.preventDefault();});}}
var showAnim={},showSpeed=o.fxShowSpeed||o.fxSpeed,hideAnim={},hideSpeed=o.fxHideSpeed||o.fxSpeed;if(o.fxSlide||o.fxFade){if(o.fxSlide){showAnim['height']='show';hideAnim['height']='hide';}
if(o.fxFade){showAnim['opacity']='show';hideAnim['opacity']='hide';}}else{if(o.fxShow){showAnim=o.fxShow;}else{showAnim['min-width']=0;showSpeed=1;}
if(o.fxHide){hideAnim=o.fxHide;}else{hideAnim['min-width']=0;hideSpeed=1;}}
var resetCSS={display:'',overflow:'',height:''};if(!$.browser.msie){resetCSS['opacity']='';}
function hideTab(clicked,$hide,$show){$hide.animate(hideAnim,hideSpeed,function(){$hide.addClass(o.hideClass).css(resetCSS);if($.browser.msie&&hideAnim['opacity']){$hide[0].style.filter='';}
o.hide(clicked,$hide[0],$show&&$show[0]||null);if($show){showTab(clicked,$show,$hide);}});}
function showTab(clicked,$show,$hide){if(!(o.fxSlide||o.fxFade||o.fxShow)){$show.css('display','block');}
$show.animate(showAnim,showSpeed,function(){$show.removeClass(o.hideClass).css(resetCSS);if($.browser.msie&&showAnim['opacity']){$show[0].style.filter='';}
o.show(clicked,$show[0],$hide&&$hide[0]||null);});}
function switchTab(clicked,$li,$hide,$show){$li.addClass(o.selectedClass).siblings().removeClass(o.selectedClass);hideTab(clicked,$hide,$show);}
this.$tabs.unbind(o.event).bind(o.event,function(){var $li=$(this).parents('li:eq(0)'),$hide=self.$panels.filter(':visible'),$show=$(this.hash);if(($li.hasClass(o.selectedClass)&&!o.unselect)||$li.hasClass(o.disabledClass)||o.click(this,$show[0],$hide[0])===false){this.blur();return false;}
if(o.cookie){$.cookie($.ui.tabs.INSTANCE_KEY+$.data(self.source),self.$tabs.index(this),o.cookie);}
if(o.unselect){if($li.hasClass(o.selectedClass)){$li.removeClass(o.selectedClass);self.$panels.stop();hideTab(this,$hide);this.blur();return false;}else if(!$hide.length){self.$panels.stop();if($.data(this,'href')){var a=this;self.load(self.$tabs.index(this)+1,$.data(this,'href'),function(){$li.addClass(o.selectedClass).addClass(o.unselectClass);showTab(a,$show);});}else{$li.addClass(o.selectedClass).addClass(o.unselectClass);showTab(this,$show);}
this.blur();return false;}}
self.$panels.stop();if($show.length){if($.data(this,'href')){var a=this;self.load(self.$tabs.index(this)+1,$.data(this,'href'),function(){switchTab(a,$li,$hide,$show);});}else{switchTab(this,$li,$hide,$show);}}else{throw'jQuery UI Tabs: Mismatching fragment identifier.';}
if($.browser.msie){this.blur();}
return false;});},add:function(url,text,position){if(url&&text){position=position||this.$tabs.length;var o=this.options,$li=$(o.tabTemplate.replace(/#\{href\}/,url).replace(/#\{text\}/,text));var id=url.indexOf('#')==0?url.replace('#',''):this.tabId($('a:first-child',$li)[0]);var $panel=$('#'+id);$panel=$panel.length&&$panel||$(o.panelTemplate).attr('id',id).addClass(o.panelClass).addClass(o.hideClass);if(position>=this.$lis.length){$li.appendTo(this.source);$panel.appendTo(this.source.parentNode);}else{$li.insertBefore(this.$lis[position-1]);$panel.insertBefore(this.$panels[position-1]);}
this.tabify();if(this.$tabs.length==1){$li.addClass(o.selectedClass);$panel.removeClass(o.hideClass);var href=$.data(this.$tabs[0],'href');if(href){this.load(position+1,href);}}
o.add(this.$tabs[position],this.$panels[position]);}else{throw'jQuery UI Tabs: Not enough arguments to add tab.';}},remove:function(position){if(position&&position.constructor==Number){var o=this.options,$li=this.$lis.eq(position-1).remove(),$panel=this.$panels.eq(position-1).remove();if($li.hasClass(o.selectedClass)&&this.$tabs.length>1){this.click(position+(position<this.$tabs.length?1:-1));}
this.tabify();o.remove($li.end()[0],$panel[0]);}},enable:function(position){var o=this.options,$li=this.$lis.eq(position-1);$li.removeClass(o.disabledClass);if($.browser.safari){$li.css('display','inline-block');setTimeout(function(){$li.css('display','block')},0)}
o.enable(this.$tabs[position-1],this.$panels[position-1]);},disable:function(position){var o=this.options;this.$lis.eq(position-1).addClass(o.disabledClass);o.disable(this.$tabs[position-1],this.$panels[position-1]);},click:function(position){this.$tabs.eq(position-1).trigger(this.options.event);},load:function(position,url,callback){var self=this,o=this.options,$a=this.$tabs.eq(position-1),a=$a[0],$span=$('span',a);if(url&&url.constructor==Function){callback=url;url=null;}
if(url){$.data(a,'href',url);}else{url=$.data(a,'href');}
if(o.spinner){$.data(a,'title',$span.html());$span.html('<em>'+o.spinner+'</em>');}
var finish=function(){self.$tabs.filter('.'+o.loadingClass).each(function(){$(this).removeClass(o.loadingClass);if(o.spinner){$('span',this).html($.data(this,'title'));}});self.xhr=null;};var ajaxOptions=$.extend(o.ajaxOptions,{url:url,success:function(r){$(a.hash).html(r);finish();if(callback&&callback.constructor==Function){callback();}
if(o.cache){$.removeData(a,'href');}
o.load(self.$tabs[position-1],self.$panels[position-1]);}});if(this.xhr){this.xhr.abort();finish();}
$a.addClass(o.loadingClass);setTimeout(function(){self.xhr=$.ajax(ajaxOptions);},0);},href:function(position,href){$.data(this.$tabs.eq(position-1)[0],'href',href);}});})(jQuery);
if( typeof(SNI) == "undefined" ) {
	var SNI = {};
}


if(typeof(SNI.Player)=='undefined'){SNI.Player={};}
SNI.Player.buildDefaultChannelFeedUrl=function(chId){return'http://'+window.location.hostname+'/hgtv/channel/xml/0,,'+chId+',00.xml';};SNI.Player.SNAP=function(divId,cfg,channelId,videoId,fcnBuildChannelUrl){if(!divId||!cfg){alert("Error loading video player");return null;}
if(channelId==undefined){channelId='';}
if(videoId==undefined){videoId='';}
if(fcnBuildChannelUrl==undefined){this.buildChannelFeedUrl=SNI.Player.buildDefaultChannelFeedUrl;}else{this.buildChannelFeedUrl=fcnBuildChannelUrl;}
this.playerContainerId=divId;this.playerId=divId+'-instance';var swfUrl="http://common.scrippsnetworks.com/common/snap/snap.swf";var attributes={id:this.playerId,name:this.playerId};this.getPlayerId=function(){return this.playerId;};this.getPlayerContainerId=function(){return this.playerContainerId;};this.loadPlaylist=function(chId,vidId){if(chId==undefined){chId='';}
if(vidId==undefined){vidId='';}
var url=this.buildChannelFeedUrl(chId);var fl=document.getElementById(this.playerId);if(fl!=undefined){fl.setPlaylist(chId,url,vidId);}};var tmpChanUrl='';if(channelId!=''){tmpChanUrl=this.buildChannelFeedUrl(channelId);}
var flashvars={config:cfg.flashvars.config,channel:channelId,channelurl:tmpChanUrl,videoid:videoId};swfobject.embedSWF(swfUrl,this.playerContainerId,cfg.dimensions.width,cfg.dimensions.height,"9","http://common.scrippsnetworks.com/common/flash-express-install/expressInstall.swf",flashvars,cfg.params,attributes);};
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.getKeys=function(){return parameters;};};SNI.MetaData.Manager=function(){var m=new SNI.MetaData.Parameter();this.addParameter=m.addParameter;this.getParameter=m.getParameter;this.getKeys=m.getKeys;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.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;
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.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'];};}
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.Ads)=='undefined'){SNI.Ads={_adServerHostname:"adsremote.scrippsnetworks.com"};}
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";}
return this.getUrl()+this.buildExpandedQueryStringValuePairs()+sJitterbug;}};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("cuisine");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("cuisine");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.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("cuisine",mdm.getParameterString("Cuisine"));admAppendParam("ingredient",mdm.getParameterString("MainIngredient"));admAppendParam("occasion",mdm.getParameterString("Occasion"));admAppendParam("mealpart",mdm.getParameterString("MealPart"));admAppendParam("technique",mdm.getParameterString("Technique"));}
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.tagName.toLowerCase()=='input'&&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);};
if(typeof(SNI.Util.Cookie)=="undefined"){SNI.Util.Cookie={};}
SNI.Util.Cookie={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);}};

if( typeof(SNI.HGTV) == "undefined" ) {
	SNI.HGTV = {};
}

SNI.HGTV.ANIMATION_SPEED = 150;


HGTVApplicationConfig.prototype=new SNI.UR.ApplicationConfig();function HGTVApplicationConfig(){HGTVApplicationConfig.prototype=new SNI.UR.ApplicationConfig();this.loginServer["DEV"]="http://vdev2.scrippsnetworks.com/";this.loginServer["STAGE"]="http://swwd.scrippsweb.com/";this.loginServer["PROD"]="http://web.hgtv.com/";this.urVersion=urVersion;function urVersion(){return 1;}}
if(typeof SNI.Community=='undefined'){SNI.Community={};}
SNI.Community.UR={init:function(){if((SNI.Community.siteName==undefined)||(SNI.Community.siteName==null)){SNI.Community.UR.urUser=new SNI.UR.UrUser(new HGTVApplicationConfig());if(SNI.Community.UR.urUser.isLoggedIn==true){SNI.Community.UR.ViewingUserId=SNI.Community.UR.urUser.getUserId();SNI.Community.UR.ViewingUserName=SNI.Community.UR.urUser.getEmail();SNI.Community.UR.ViewingUserDisplayName=SNI.Community.UR.urUser.getUserName();if((SNI.Community.UR.ViewingUserDisplayName==undefined)||(SNI.Community.UR.ViewingUserDisplayName==null)||(SNI.Community.UR.ViewingUserDisplayName=='')){if((SNI.Community.UR.ViewingUserName!=null)){if(SNI.Community.UR.ViewingUserName.indexOf("@")==-1){SNI.Community.UR.ViewingUserDisplayName=SNI.Community.UR.ViewingUserName;}else{SNI.Community.UR.ViewingUserDisplayName=SNI.Community.UR.ViewingUserName.substring(0,SNI.Community.UR.ViewingUserName.indexOf("@"));}}}
SNI.Community.UR.ViewingUserPostalCode=SNI.Community.UR.urUser.getPostalCode();SNI.Community.UR.logged_in='true';}else{}}
else if((SNI.Community.UR.ViewingUserName!=undefined)&&(SNI.Community.UR.ViewingUserName!=null)){if((SNI.Community.UR.ViewingUserDisplayName==undefined)||(SNI.Community.UR.ViewingUserDisplayName==null)||(SNI.Community.UR.ViewingUserDisplayName=='')){if(SNI.Community.UR.ViewingUserName!=null){if(SNI.Community.UR.ViewingUserName.indexOf("@")==-1){SNI.Community.UR.ViewingUserDisplayName=SNI.Community.UR.ViewingUserName;}else{SNI.Community.UR.ViewingUserDisplayName=SNI.Community.UR.ViewingUserName.substring(0,SNI.Community.UR.ViewingUserName.indexOf("@"));}}}
SNI.Community.UR.logged_in='true';}},logout:function(){var destURL=document.location;document.location="http://my.hgtv.com/redirectors/logout_redirector.jsp?DEST_URL="+escape(destURL);}};
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("li:first-child").addClass("active");pageLinks.find("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("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){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;}};
$.validator.setDefaults({errorElement:'span',onfocusout:false,onkeyup:false,onclick:false,highlight:function(element,errorClass){$(element).addClass(errorClass);$(element.form).find("label[for="+element.id+"]").addClass(errorClass);},unhighlight:function(element,errorClass){$(element).removeClass(errorClass);$(element.form).find("label[for="+element.id+"]").removeClass(errorClass);}});$.validator.addMethod("spaces",function(value,element){return this.optional(element)||value.indexOf(' ')==-1;},"Spaces are not allowed");$.validator.addMethod("multipleEmails",function(value,element){if(this.optional(element)){return true;}
var friendsEmails=value.split(",");var isEmail=true;$.each(friendsEmails,function(){var patternTest=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($.trim(this));if(patternTest==false){isEmail=false;};});return isEmail;},"One of these is not a valid e-mail address");
SNI.HGTV.GlobalHeader={globalNav:function(){var navTimer=null;var initializeMenu="#hd-sub-nav li";hideAll();initMenu(initializeMenu);function initMenu(initializeMenu){var menu=initializeMenu;$(menu).find('h3:first span').click(function(){hideAll();});$(menu+"[@class ^= 'nav-']").each(function(i){menuItem=$(this);var leftOffset=menuItem.position().left;var dropdownWidth=345;if(menuItem.hasClass("nav-e")){offsetVal=leftOffset-dropdownWidth+menuItem.outerWidth()+3;}else{offsetVal=leftOffset-1;}
menuItem.find('div.drop').css({left:offsetVal});menuItem.hover(function(e){hideAll();var $this=$(this);$this.addClass("dd-on");$this.find('div.drop').show();},function(e){clearTimeout(navTimer);navTimer=null;var closeDiv=$(this);navTimer=setTimeout(function(){closeDiv.removeClass("dd-on");closeDiv.find('div.drop').hide();navTimer=null;},100);});});if($.browser.msie&&(parseInt($.browser.version)<7)){var win=$(window);win.resize(function(){$('#hg-hd').width(($(this).width()<1002?1002:'auto'));});$('#hg-hd').width((win.width()<1002?1002:'auto'));}}
function hideAll(){clearTimeout(navTimer);navTimer=null;$("#hd-sub-nav li[@class ^= 'nav-']").each(function(){var navItem=$(this);navItem.removeClass("dd-on");navItem.find('div.drop').hide();});}},globalSearch:function(element,autosuggest){SNI.Util.inputField(element+' input','Search');if(autosuggest===true){function findValue(li){if(li==null){return alert("No match!");}else{return li.selectValue;}}
function selectItem(li){findValue(li);}
function formatItem(row){return row[0];}
if(document.domain=="www.hgtv.com"){$(element+" input").autocomplete("/search/autosuggest.do",{delay:10,width:345,minChars:3,matchSubset:1,matchContains:0,cacheLength:10,onItemSelect:selectItem,onFindValue:findValue,formatItem:formatItem,autoFill:true});}}
$(element+" select").dropdown({title:'Search In:'});$(element+' form').submit(function(){var form=$(this);var searchText=$.trim(form.find('input').val());var searchIn=$(form).find('option[@selected]').attr('id');var searchAction=$(form).find('select').val();if(searchText==''||searchText.toLowerCase()=='search'){return false;}else if(searchIn=='tv-shows'){$(this).attr('action',searchAction);}else if(searchIn=='rate-my-space'){window.location.href=searchAction+searchText;return false;}else if(searchIn=='designers-portfolio'){$(this).attr('action',searchAction);}else if(searchIn=='products'){searchText=searchText.replace(/\s+/,'+').toLowerCase();window.location.href=searchAction+searchText+'_keyword';return false;}
return true;});},myHGTV:function(){if((SNI.Community.UR.logged_in!=null)&&(SNI.Community.UR.logged_in=="true")){var dd=$('#my-hgtv .dd-list dd');$('#my-hgtv .dd-list').hover(function(){dd.show();},function(){var timer=setTimeout(function(){dd.hide();clearTimeout(timer);timer=null;},100);});dd.find('.dd-bd h3 a').click(function(){dd.hide();return false;});$('#my-hgtv .signed-in .hello a').text(SNI.Community.UR.ViewingUserDisplayName);$('#my-hgtv .not-signed-in').hide();$('#my-hgtv .signed-in').show();}},init:function(){SNI.HGTV.GlobalHeader.globalNav();SNI.HGTV.GlobalHeader.globalSearch('#hg-hd .search',true);SNI.HGTV.GlobalHeader.myHGTV();}};
SNI.HGTV.GlobalFooter={init:function(){SNI.HGTV.GlobalHeader.globalSearch('#hg-ft .search');}};
SNI.HGTV.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");});}};
SNI.HGTV.GetInspired={colorPicker:function(colorList,typeList,hrefList){var swfUrl='http://web.hgtv.com/webhgtv/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.HGTV.ZoneFinder={init:function(){$("#zone-finder form").submit(function(){zip=$.trim($("#zone-zip").val());if(zip==''){return false;}
var url="/cf/com/hgtv/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.HGTV.Util)=="undefined"){SNI.HGTV.Util={};}
SNI.HGTV.Util.liHover=function(el){if($.browser.msie&&parseInt($.browser.version)==6){$(el).find('li').hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');});}};$.extend($.ui.accordion.animations,{easeOutSine:function(options){this.slide(options,{easing:'easeOutSine',duration:600});}});jQuery.fn.sort=Array.prototype.sort;SNI.HGTV.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.HGTV.Util.flyOuts.getPosition(settings.object,true);var pc=SNI.HGTV.Util.flyOuts.getPosition(settings.anchorObj,true);var viewportHeight=$(window).height();var scrollTop=SNI.HGTV.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;}};
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();});});}
(function($){$.fn.countDown=function(options){var options=$.extend({date:'January 1, 2099 00:00:00',updateInterval:1,wraps:null,onExpire:function(){}},options);return this.each(function(i){var obj=this;var today=new Date();var endDate=new Date(options.date);var ms=Math.floor(endDate.getTime()-today.getTime())
function two(x){return((x>9)?"":"0")+x}
function three(x){return((x>99)?"":"0")+((x>9)?"":"0")+x}
function MS2DHMSMS(ms){var nt={};var sec=Math.floor(ms/1000);ms=ms%1000;nt.ms=three(ms).toString();var min=Math.floor(sec/60);sec=sec%60;nt.ss=two(sec).toString();var hr=Math.floor(min/60);min=min%60;nt.mm=two(min).toString();var day=Math.floor(hr/24);hr=hr%24;nt.hh=two(hr).toString();nt.dd=day.toString();return nt;}
function getTimeLeft(){var today=new Date();var ms=Math.floor(endDate.getTime()-today.getTime())
sLeft=MS2DHMSMS(ms).ss;mLeft=MS2DHMSMS(ms).mm;hLeft=MS2DHMSMS(ms).hh;dLeft=MS2DHMSMS(ms).dd;if(options.wraps==null)
$(obj).html('<span class="jcdDays">'+dLeft+'</span>&nbsp;<span class="jcdDaysText">day'+s+'</span>&nbsp;<span class="jcdHours">'+hLeft+'</span>:<span class="jcdMinutes">'+mLeft+'</span>:<span class="jcdSeconds">'+sLeft+'</span>');else{for(x in options.wraps){if(x=='days')$(options.wraps[x]).html(dLeft);if(x=='hours')$(options.wraps[x]).html(hLeft);if(x=='minutes')$(options.wraps[x]).html(mLeft);if(x=='seconds')$(options.wraps[x]).html(sLeft);}}};if(parseInt(MS2DHMSMS(ms).dd)<0)
options.onExpire.call(this,obj);else
if(options.updateInterval)setInterval(function(){getTimeLeft();},options.updateInterval*500);else getTimeLeft();});};})(jQuery);
if(typeof(SNI.HGTV.Player)=='undefined'){SNI.HGTV.Player={};}
SNI.HGTV.Player.Configs={FullSize:{dimensions:{width:'576',height:'638'},flashvars:{config:"http://web.hgtv.com/webhgtv/hg20/snap-configs/hgtv-player-fullsize.xml",channel:'',channelurl:'',videoid:''},params:{menu:"false",scale:"noscale",allowFullScreen:"true",allowScriptAccess:"always",wmode:"transparent"}},FullSizeNoPlaylist:{dimensions:{width:'576',height:'460'},flashvars:{config:"http://web.hgtv.com/webhgtv/hg20/snap-configs/hgtv-player-fullsize-noplaylist.xml",channel:'',channelurl:'',videoid:''},params:{menu:"false",scale:"noscale",allowFullScreen:"true",allowScriptAccess:"always",wmode:"transparent"}},RightRail:{dimensions:{width:'320',height:'360'},flashvars:{config:"http://web.hgtv.com/webhgtv/hg20/snap-configs/hgtv-player-rightrail.xml",channel:'',channelurl:'',videoid:''},params:{menu:"false",scale:"noscale",allowFullScreen:"true",allowScriptAccess:"always",wmode:"transparent"}},Blog:{dimensions:{width:'320',height:'263'},flashvars:{config:"http://web.hgtv.com/webhgtv/hg20/snap-configs/hgtv-player-blog.xml",channel:'',channelurl:'',videoid:''},params:{menu:"false",scale:"noscale",allowFullScreen:"true",allowScriptAccess:"always",wmode:"transparent"}},Lead:{dimensions:{width:'400',height:'300'},flashvars:{config:"http://web.hgtv.com/webhgtv/hg20/snap-configs/hgtv-player-lead.xml",channel:'',channelurl:'',videoid:''},params:{menu:"false",scale:"noscale",allowFullScreen:"true",allowScriptAccess:"always",wmode:"transparent"}}};SNI.HGTV.Player.FullSize=function(divId,channelId,videoId){return new SNI.Player.SNAP(divId,SNI.HGTV.Player.Configs.FullSize,channelId,videoId);};SNI.HGTV.Player.Big=SNI.HGTV.Player.FullSize;SNI.HGTV.Player.VideoLibrary=SNI.HGTV.Player.FullSize;SNI.HGTV.Player.FullSizeNoPlaylist=function(divId,channelId,videoId){return new SNI.Player.SNAP(divId,SNI.HGTV.Player.Configs.FullSizeNoPlaylist,channelId,videoId);};SNI.HGTV.Player.VideoAsset=SNI.HGTV.Player.FullSizeNoPlaylist;SNI.HGTV.Player.RightRail=function(divId,channelId,videoId){return new SNI.Player.SNAP(divId,SNI.HGTV.Player.Configs.RightRail,channelId,videoId);};SNI.HGTV.Player.RightRailMyHGTV=function(divId,channelId,videoId){buildChannelFeedUrlForPickle=function(chId){return'http://www.hgtv.com/hgtv/channel/xml/0,,'+chId+',00.xml';};return new SNI.Player.SNAP(divId,SNI.HGTV.Player.Configs.RightRail,channelId,videoId,buildChannelFeedUrlForPickle);};SNI.HGTV.Player.Blog=function(divId,channelId,videoId){buildChannelFeedUrlForBlogs=function(chId){return'http://www.hgtv.com/hgtv/channel/xml/0,,'+chId+',00.xml';};return new SNI.Player.SNAP(divId,SNI.HGTV.Player.Configs.Blog,channelId,videoId,buildChannelFeedUrlForBlogs);};SNI.HGTV.Player.Lead=function(divId,channelId,videoId){return new SNI.Player.SNAP(divId,SNI.HGTV.Player.Configs.Lead,channelId,videoId);};
SNI.HGTV.EpisodeFinder={init:function(){$('#episode-finder .acco-round').dpl('accordion');$("#episode-finder .button-nav").dpl('tabs');$("#episode-finder .date-box input").attr('readonly','readonly');$("#episode-finder-w .date-box input").attr('readonly','readonly');SNI.Util.inputField('#ef-topic','Topic');$(document).ready(function(){$("#episode-finder .date").attachDatepicker();$("#episode-finder-w .date").attachDatepicker();});}};
function HgtvAd(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){case"GOOGLE_BIGBOX":case"GOOGLE_LEADERBOARD":if(mdManager.getParameterString("Sponsorship")==""){writeAd(ad);}else{$(".google-text-ads").hide();}
break;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{adManager.createAd(ad);}}
function LeaderboardAd(pos){if(pos<0||pos==undefined||pos==''){pos=1;}
HgtvAd('LEADERBOARD','468x60',pos);}
function PushdownAd(pos){if(pos<0||pos==undefined){pos=1;}
HgtvAd('PUSHDOWN','',pos);}
function GoogleBigboxAd(pos){if(pos<0||pos==undefined){pos=1;}
HgtvAd('GOOGLE_BIGBOX','',pos);}
function GoogleLeaderboardAd(pos){if(pos<0||pos==undefined){pos=1;}
HgtvAd('GOOGLE_LEADERBOARD','',pos);}
function BigboxAd(pos,keywords){if(pos<0||pos==undefined){pos=1;}
HgtvAd('BIGBOX','',pos,keywords);}
function BigboxAd300x150(pos,keywords){if(pos<0||pos==undefined){pos=1;}
HgtvAd('SPONSORSHIP_CONTENT','',pos,keywords);}
function SuperstitialAd(pos){if(pos<0||pos==undefined){pos=1;}
HgtvAd('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 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){$(".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+"/snd_dp_links"+linkNum+".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.HGTV.Search)=="undefined"){SNI.HGTV.Search={};}
SNI.HGTV.Search={statusMessage:function(){$(".status-message .close a").each(function(e){$(this).bind("click",function(){var obj=$(this).parents(".status-message");obj.css("height",obj.height());obj.find(".wrap").fadeOut("slow",function(){obj.slideUp("slow");});return false;});});}};
if(typeof(SNI.HGTV.Toolbar)=="undefined"){SNI.HGTV.Toolbar={};}
SNI.HGTV.Toolbar={toolbar:"#toolbar",revealModule:function(trigger,module){$(SNI.HGTV.Toolbar.toolbar).find(trigger).click(function(){module.fadeIn(SNI.HGTV.ANIMATION_SPEED);$(this).addClass("active");return false;})},closeModule:function(trigger,module,speed){if(speed==null){speed=SNI.HGTV.ANIMATION_SPEED;};module.fadeOut(speed);if($(trigger).hasClass("active")){$(trigger).removeClass("active");};},fontResize:function(element){$(element).find("li").click(function(){var defaultSize="100%";$(element).find("li").removeClass("active");$(this).addClass("active");if($(this).hasClass("med")){$("#hg-art-we").css("font-size",defaultSize);}else if($(this).hasClass("sm")){$("#hg-art-we").css("font-size","85%");}else{$("#hg-art-we").css("font-size","116%");}});},printPage:function(){var module=$("#print-select");SNI.HGTV.Toolbar.revealModule(".print",module);$("em.close").click(function(){SNI.HGTV.Toolbar.closeModule(".print",module);});$(".email").click(function(){SNI.HGTV.Toolbar.closeModule(".print",module);});},emailAFriend:function(){var module=$("#email-a-friend");var form=module.find("form");var null_value="";var initMessage=form.find("textarea").val();$(".print").click(function(){SNI.HGTV.Toolbar.closeModule(".email",module);});SNI.HGTV.Toolbar.revealModule(".email",module);$(".close").click(function(){SNI.HGTV.Toolbar.closeModule(".email",module);});$(".form-submit a").click(function(){SNI.HGTV.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@hgtv.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@hgtv.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  HGTV 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@HGTV.com).").show();}else{var success=module.find('.success');var page_title="this page"
form.hide();success.show();var timeout=setTimeout(function(){SNI.HGTV.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.HGTV.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();}});}});},init:function(){SNI.HGTV.Toolbar.fontResize(".font-resize");SNI.HGTV.Toolbar.printPage();SNI.HGTV.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.HGTV.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 HGTV 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@hgtv.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@hgtv.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@hgtv.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 HGTV 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@hgtv.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");}});}};
SNI.HGTV.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@hgtv.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@hgtv.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();}}});}};
SNI.HGTV.SearchFilter={srchLeftNavFilter:function(){var flyout_container=$("<div id='search-flyouts'></div>");$("body").prepend(flyout_container);$("#hg-filters .bd ul").each(function(i){var count=$(this).children().size();var title=$(this).prev().text();var count_diff=parseInt(count-4);if(count>5){$(this).attr("id","srf-list"+i);var results=document.createElement("div");var $results=$(results);$results.addClass("drops").addClass("small").attr("id","flyout"+i);$results.html('<div class="hd"> </div><div class="bd"><h3>More '+title+' <a class="close">Close</a></h3><ul id="alpha'+i+'"></ul></div><div class="ft"> </div>');$(this).children("li").each(function(i){$(this).find("a").click(function(){$(this).parents().filter(".drops").hide();return true;});if(i<=3){$(this).clone(true).appendTo($results.find(".bd ul"));}else{$results.find(".bd ul").append($(this));}});$("#srf-list"+i).after('<div id="srf-drop'+i+'"><a class="cta" href="#flyout'+i+'">More '+title+'</a> <span>('+count+')</span></div>');flyout_container.append(results);function alphaList($it){$('#alpha'+i).html(($it.map(function(){return'<li><a href="'+this.href+'">'+this.innerHTML+'</a></li>';}).get().join('\n')));}
alphaList($('#alpha'+i+' li a').sort(function(a,b){return SNI.HGTV.Util.flyOuts.alphaCompare(a.innerHTML,b.innerHTML);}));$("#srf-drop"+i).find(".cta").click(function(e){var $fDiv=$("#search-flyouts").find("#flyout"+i);var $aDiv=$("#srf-drop"+i).find("a");hideAll();if(jQuery.browser.msie){$fDiv.css({background:""});}
SNI.HGTV.Util.flyOuts.moveToView({object:$fDiv,anchorObj:$aDiv,pAlign:"right",useLftOffset:32,useTopOffset:-13,overRideDflt:true});$fDiv.fadeIn("fast");$('body').bind("click",function(e){bodyClick(e);});return false;}).css({cursor:"pointer"});$("#search-flyouts .drops").find('.close').click(function(){hideAll();}).css({cursor:"pointer"});}});function bodyClick(e){var $clicked=$(e.target);if($clicked.is('.cta')||$clicked.parents().is('.drops')){return false;}else{hideAll();$('body').unbind();}}
function hideAll(){$("#search-flyouts .drops").each(function(){if(jQuery.browser.msie){$(this).css({background:"B1B1B1"});}
$(this).fadeOut("fast");});}},init:function(){SNI.HGTV.SearchFilter.srchLeftNavFilter();}};
SNI.HGTV.Hosts={init:function(){$('#hgtv-hosts select').dropdown();$('#hgtv-hosts select').change(function(){location.href=$(this).val();});}};
SNI.HGTV.Topics={topicNav:function(){$("#topicNav .nav li").each(function(i){$(this).click(function(){$("#topicNav .active").removeClass("active");$(this).addClass("active");$("#topicNav .bbsctnt:eq("+i+")").addClass("active");});if($(this).hasClass("active")){$("#topicNav .bbsctnt:eq("+i+")").addClass("active");}});$("#topicNav .nav li a").click(function(){return false;});}};
if(typeof(SNI.HGTV.DesignPortfolio)=="undefined"){SNI.HGTV.DesignPortfolio={};}
SNI.HGTV.DesignPortfolio={spacesNav:function(){$("#dp-expanded-nav .wrap").dpl('carousel',{pagelink:"image"});$("#dp-nav-spaces, #dp-expanded-nav .hd span").click(function(){$("#dp-nav-spaces").toggleClass("open");if($("#dp-nav-spaces").hasClass("open")){var h=$("#dp-expanded-nav .wrap").outerHeight()+"px";$("#dp-expanded-nav").animate({height:h},800,"easeOutBack",function(){});$("#dp-nav-rule").css({marginLeft:0,marginRight:0});}else{$("#dp-expanded-nav").animate({height:0},500,"easeOutCubic",function(){$("#dp-nav-rule").animate({marginLeft:"14px",marginRight:"14px"},300,"easeOutSine",function(){});});}});},browseByStyle:function(){$("#browse-by-style .nav li").each(function(i){$(this).click(function(){$("#browse-by-style .active").removeClass("active");$(this).addClass("active");$("#browse-by-style .bbsctnt:eq("+i+")").addClass("active");});if($(this).hasClass("active")){$("#browse-by-style .bbsctnt:eq("+i+")").addClass("active");}});},gridHeight:function(){var itemHeight=0;$(".grid li").each(function(e){var thisHeight=$(this).height();if(thisHeight>itemHeight){itemHeight=thisHeight;}});$(".grid li").css("height",itemHeight);},browseByStylePods:{node:function(id,length){this.id=id;this.lock=false;this.length=length;this.current=-1;this.duration=400;this.easing="easeOutQuad";},advance:function(id,direction){var n=SNI.HGTV.DesignPortfolio.browseByStylePods[id];var next=n.current+direction;if(next<0){next=0;}
if(next>=n.length){next=n.length-1;}
return next;},set:function(id,next){var n=SNI.HGTV.DesignPortfolio.browseByStylePods[id];if(n.current!=next&!n.lock){n.lock=true;n.current=next;var obj=$("#"+id);var newx=-1*next*obj.find(".bd li:first").width();obj.find(".bd ul").animate({left:newx},n.duration,n.easing,function(){n.lock=false;});if(n.current<1){obj.find(".previous a").addClass("disabled");}
else{obj.find(".previous a").removeClass("disabled");}
if(n.current>=n.length-1){obj.find(".next a").addClass("disabled");}
else{obj.find(".next a").removeClass("disabled");}}},init:function(){$('#dp-space-more select').dropdown({title:"Browse More Spaces"});$('#dp-designer-more select').dropdown({title:"Browse More Designers"});$('#dp-sponsor-more select').dropdown({title:"Browse More Showrooms"});$('#dp-style-more select').dropdown({title:"Browse More Styles"});$('#dp-browse .more-pod').each(function(){var select=$(this);select.change(function(){window.location.href=$(this).val();return false;});});$("#dp-browse-designer .bd ul").each(function(i){var list=$(this);var length=list.find("li").length;if(length>1){list.width(list.find("li:first").width()*length);var obj=list.parents("li");var id=obj.attr('id');SNI.HGTV.DesignPortfolio.browseByStylePods[id]=new SNI.HGTV.DesignPortfolio.browseByStylePods.node(id,length);obj.find(".pod").addClass("multiple");obj.find(".wrap").before('<p class="previous"><a href="#">Previous</a></p>\n');obj.find(".wrap").before('<p class="next"><a href="#">Next</a></p>\n');obj.find(".previous a").bind("click",function(){var n=SNI.HGTV.DesignPortfolio.browseByStylePods.advance(id,-1);SNI.HGTV.DesignPortfolio.browseByStylePods.set(id,n);return false;});obj.find(".next a").bind("click",function(){var n=SNI.HGTV.DesignPortfolio.browseByStylePods.advance(id,1);SNI.HGTV.DesignPortfolio.browseByStylePods.set(id,n);return false;});SNI.HGTV.DesignPortfolio.browseByStylePods.set(id,0);}});}}};
SNI.HGTV.MessageBoard={init:function(url){messageList=$('#messageboard .mb-bd ul');$.ajax({type:"GET",url:url,dataType:"xml",success:function(xml){var data=$(SNI.HGTV.MessageBoard.parseData(xml,'item'));data.each(function(){var item='<li><div class="bubble">';item+='<q><a href="'+this.link+'">'+this.title+'</a></q>';item+='<cite><span>'+this.author+'</span></cite>';item+='</div></li>';messageList.append(item);});},error:function(data,status,e){messageList.append("<li>Sorry, we're having trouble loading the message board information...</li>");}});},parseData:function(xml,nodeName){var data=[];$(nodeName,xml).each(function(){var item={};$(this).children().each(function(){item[this.nodeName]=$(this).text();});data.push(item);});return data;}};
if(typeof(SNI.HGTV.ImageEnlarge)=="undefined"){SNI.HGTV.ImageEnlarge={};}
SNI.HGTV.ImageEnlarge={clickCtrl:".img-enlarge",insertPoint:"#hg-art-we",imgFrame:"#blow-up",closeCtrl:"#blow-up a.close",init:function(){$(SNI.HGTV.ImageEnlarge.clickCtrl).bind("click",SNI.HGTV.ImageEnlarge.clickExpand);},clickExpand:function(e){$(this).parents().filter(".thumb-wrap").before(SNI.HGTV.ImageEnlarge.htmlImage(this.href));$(SNI.HGTV.ImageEnlarge.closeCtrl).bind("click",SNI.HGTV.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.HGTV.ImageEnlarge.imgFrame).remove();return false;}};
if(typeof(SNI.HGTV.Sweepstakes)==="undefined"){SNI.HGTV.Sweepstakes={};}
SNI.HGTV.Sweepstakes={init:function(){var validator=$("#sweepsEntryForm").validate({debug:false,rules:{fvFirstName:"required",fvLastName:"required",fvAddress1:"required",fvCity:"required",fvState:"required",fvZip:{required:true,digits:true},fvAreaCode:"required",fvPhone:"required",fvEmail:"email",fvEmail:{required:true,email:true},fvConfirmEmail:{required:true,equalTo:"#fvEmail"},fvGender:"required"},messages:{fvFirstName:"Please enter your first name",fvLastName:"Please enter your last name",fvAddress1:"Please enter your address",fvCity:"Please enter your city",fvState:"Please select your state",fvZip:"Please enter your 5 digit ZIP code",fvAreaCode:"Please enter an area code",fvPhone:"Please enter a phone number",fvEmail:"Please enter an e-mail address",fvConfirmEmail:"Please make sure your e-mails match",fvGender:"Please enter your gender"},errorContainer:".form-errors",errorLabelContainer:$(".list-alt",".form-errors"),wrapper:"li",showErrors:function(errorMap,errorList){if(errorList.length){$('html, body').fadeIn().animate({scrollTop:0},'slow');this.defaultShowErrors();}}});$("fieldset.nl-optional").find("#optionalall").click(function(){var $this=$(this);var checkValue=$this.find('span').html();if(checkValue==='Check All'){$(".nl-optional input[@type=checkbox]").each(function(){$(".nl-optional input[@type='checkbox']").attr('checked',true);});$this.find('span').html('Uncheck All');}else{$(".nl-optional input[@type=checkbox]").each(function(){$(".nl-optional input[@type='checkbox']").attr('checked',false);});$this.find('span').html('Check All');}
return false;});}};SNI.HGTV.Sweepstakes.Thanks={stf:function(){var validator=$("#sweepsStfForm").validate({debug:false,rules:{senderName:"required",senderEmail:"email",senderEmail:{required:true,email:true},recipientemail1:"email",recipientemail1:{required:true,email:true}},messages:{senderName:"Please enter your name",senderEmail:"Please enter an e-mail address",recipientemail1:"Please enter at least one Friend's e-mail address"},errorContainer:".form-errors",errorLabelContainer:$(".list-alt",".form-errors"),wrapper:"li",showErrors:function(errorMap,errorList){if(errorList.length){$('html, body').fadeIn().animate({scrollTop:0},'slow');this.defaultShowErrors();}}});}};
if(typeof(SNI.HGTV.QuickVote)=="undefined"){SNI.HGTV.QuickVote={};}
SNI.HGTV.QuickVote={inputLink:"#poll-input-link",resultLink:"#poll-result-link",submitLink:"#poll-submit-link",inputPanel:"#inputPanel",inputForm:"#quick-vote-poll",resultsPanel:"#resultsPanel",submittingPanel:".qv-ww .submitting",loadingPanel:".qv-ww .loading",validateOptions:{errorElement:"",highlight:"",rules:{Rating:"required"},messages:{Rating:""},errorContainer:"#quick-vote-poll .errormsg"},voteURL:'',resURL:'',POLL_Cookie:'',oValidator:'',init:function(pollnum,voteURL,resURL){SNI.HGTV.QuickVote.voteURL=voteURL;SNI.HGTV.QuickVote.resURL=resURL;SNI.HGTV.QuickVote.POLL_Cookie="HGTV_poll_"+pollnum;SNI.HGTV.QuickVote.oValidator=$(SNI.HGTV.QuickVote.inputForm).validate(SNI.HGTV.QuickVote.validateOptions);SNI.HGTV.QuickVote.oValidator.resetForm();$(SNI.HGTV.QuickVote.inputForm).get(0).reset();$(SNI.HGTV.QuickVote.resultLink).click(function(){$(SNI.HGTV.QuickVote.inputPanel).hide();SNI.HGTV.QuickVote.showResults(resURL);return false;});$(SNI.HGTV.QuickVote.inputPanel).submit(SNI.HGTV.QuickVote.submitVote);if(SNI.Util.Cookie.get(SNI.HGTV.QuickVote.POLL_Cookie)=="yes"){$(SNI.HGTV.QuickVote.inputPanel).hide();SNI.HGTV.QuickVote.showResults(resURL);}
else
{$(SNI.HGTV.QuickVote.inputPanel).show();}},submitVote:function(){$(SNI.HGTV.QuickVote.inputPanel).hide();$(SNI.HGTV.QuickVote.submittingPanel).show();$.post(SNI.HGTV.QuickVote.voteURL,$(SNI.HGTV.QuickVote.inputForm).serialize(),SNI.HGTV.QuickVote.afterSubmit);return false;},afterSubmit:function(){SNI.Util.Cookie.set(SNI.HGTV.QuickVote.POLL_Cookie,"yes");$(SNI.HGTV.QuickVote.submittingPanel).hide();SNI.HGTV.QuickVote.showResults();},showResults:function(){$(SNI.HGTV.QuickVote.loadingPanel).show();$(SNI.HGTV.QuickVote.resultsPanel).load(SNI.HGTV.QuickVote.resURL,'',SNI.HGTV.QuickVote.resInit);return false;},resInit:function(){$(SNI.HGTV.QuickVote.loadingPanel).hide();$(SNI.HGTV.QuickVote.resultsPanel).show();$(SNI.HGTV.QuickVote.inputLink).click(function(){SNI.HGTV.QuickVote.showInputForm();return false;});return;},showInputForm:function(){$(SNI.HGTV.QuickVote.resultsPanel).empty();$(SNI.HGTV.QuickVote.resultsPanel).hide();SNI.HGTV.QuickVote.oValidator.resetForm();$(SNI.HGTV.QuickVote.inputForm).get(0).reset();$(SNI.HGTV.QuickVote.inputPanel).show();return false;}};
SNI.HGTV.OnHGTV={init:function(){$(".tvschedule").dpl("accordion");$('.tvschedule .acco-link a').click(function(){if($(this).parents().is('li.selected')){window.location.href=this.href;return true;}});}};
/* jQuery UI Date Picker v3.3 - previously jQuery Calendar
   Written by Marc Grabanski (m@marcgrabanski.com) and Keith Wood (kbwood@virginbroadband.com.au).

   Copyright (c) 2007 Marc Grabanski (http://marcgrabanski.com/code/ui-datepicker)
   Dual licensed under the MIT (MIT-LICENSE.txt)
   and GPL (GPL-LICENSE.txt) licenses.
   Date: 09-03-2007  */

/* Date picker manager.
   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
   Settings for (groups of) date pickers are maintained in an instance object
   (DatepickerInstance), allowing multiple different settings on the same page. */

function Datepicker(){this.debug=false;this._nextId=0;this._inst=[];this._curInst=null;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this.regional=[];this.regional['']={clearText:'Clear',clearStatus:'Erase the current date',closeText:'Close',closeStatus:'Close without change',prevText:'&#x3c;Prev',prevStatus:'Show the previous month',nextText:'Next&#x3e;',nextStatus:'Show the next month',currentText:'Today',currentStatus:'Show the current month',monthNames:['January','February','March','April','May','June','July','August','September','October','November','December'],monthNamesShort:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],monthStatus:'Show a different month',yearStatus:'Show a different year',weekHeader:'Wk',weekStatus:'Week of the year',dayNames:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],dayNamesShort:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],dayNamesMin:['Su','M','Tu','W','Th','F','Sa'],dayStatus:'Set DD as first week day',dateStatus:'Select DD, M d',dateFormat:'mm/dd/y',firstDay:0,initStatus:'Select a date',isRTL:false};this._defaults={showOn:'focus',showAnim:'',hideAnim:'',defaultDate:null,appendText:'',buttonText:'...',buttonImage:'',buttonImageOnly:false,closeAtTop:true,mandatory:true,hideIfNoPrevNext:false,changeMonth:true,changeYear:true,yearRange:'-10:+10',changeFirstDay:false,showOtherMonths:false,showWeeks:false,calculateWeek:this.iso8601Week,shortYearCutoff:'+10',showStatus:false,statusForDate:this.dateStatus,minDate:null,maxDate:null,speed:'medium',beforeShowDay:null,beforeShow:null,onSelect:null,numberOfMonths:1,stepMonths:1,stepYears:1,rangeSelect:false,rangeSeparator:' - ',title:'Select a Day',selectionType:'day',highlightWeek:false,otherMonthsActive:false,printRange:false};$.extend(this._defaults,this.regional['']);this._datepickerDiv=$('<div id="datepicker"><div class="hd"></div><div class="bd"></div><div class="ft"></div></div>');}
$.extend(Datepicker.prototype,{markerClassName:'hasDatepicker',log:function(){if(this.debug){console.log.apply('',arguments);}},_register:function(inst){var id=this._nextId++;this._inst[id]=inst;return id;},_getInst:function(id){return this._inst[id]||id;},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this;},_doKeyDown:function(e){var inst=$.datepicker._getInst(this._calId);if($.datepicker._datepickerShowing){switch(e.keyCode){case 9:$.datepicker.hideDatepicker('');break;case 13:$.datepicker._selectDay(inst,inst._selectedMonth,inst._selectedYear,$('td.datepicker_daysCellOver',inst._datepickerDiv)[0]);return false;case 27:$.datepicker.hideDatepicker(inst._get('speed'));break;case 33:$.datepicker._adjustDate(inst,(e.ctrlKey?-1:-inst._get('stepMonths')),(e.ctrlKey?'Y':'M'));break;case 34:$.datepicker._adjustDate(inst,(e.ctrlKey?+1:+inst._get('stepMonths')),(e.ctrlKey?'Y':'M'));break;case 35:if(e.ctrlKey){$.datepicker._clearDate(inst);}
break;case 36:if(e.ctrlKey){$.datepicker._gotoToday(inst);}
break;case 37:if(e.ctrlKey){$.datepicker._adjustDate(inst,-1,'D');}
break;case 38:if(e.ctrlKey){$.datepicker._adjustDate(inst,-7,'D');}
break;case 39:if(e.ctrlKey){$.datepicker._adjustDate(inst,+1,'D');}
break;case 40:if(e.ctrlKey){$.datepicker._adjustDate(inst,+7,'D');}
break;}}
else if(e.keyCode==36&&e.ctrlKey){$.datepicker.showFor(this);}},_doKeyPress:function(e){var inst=$.datepicker._getInst(this._calId);var chars=$.datepicker._possibleChars(inst._get('dateFormat'));var chr=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return(chr<' '||!chars||chars.indexOf(chr)>-1);},_connectDatepicker:function(target,inst){var input=$(target);if(this._hasClass(input,this.markerClassName)){return;}
var appendText=inst._get('appendText');var isRTL=inst._get('isRTL');if(appendText){if(isRTL){input.before('<span class="datepicker_append">'+appendText+'</span>');}
else{input.after('<span class="datepicker_append">'+appendText+'</span>');}}
var showOn=inst._get('showOn');if(showOn=='focus'||showOn=='both'){input.focus(this.showFor);}
if(showOn=='button'||showOn=='both'){var buttonText=inst._get('buttonText');var buttonImage=inst._get('buttonImage');var buttonImageOnly=inst._get('buttonImageOnly');var trigger=$(buttonImageOnly?'<img class="datepicker_trigger" src="'+
buttonImage+'" alt="'+buttonText+'" title="'+buttonText+'"/>':'<button type="button" class="datepicker_trigger">'+(buttonImage!=''?'<img src="'+buttonImage+'" alt="'+buttonText+'" title="'+buttonText+'"/>':buttonText)+'</button>');input.wrap('<span class="datepicker_wrap"></span>');if(isRTL){input.before(trigger);}
else{input.after(trigger);}
trigger.click(this.showFor);}
input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress);input[0]._calId=inst._id;},_inlineDatepicker:function(target,inst){var input=$(target);if(this._hasClass(input,this.markerClassName)){return;}
input.addClass(this.markerClassName).append(inst._datepickerDiv);input[0]._calId=inst._id;this._updateDatepicker(inst);},_inlineShow:function(inst){var numMonths=inst._getNumberOfMonths();inst._datepickerDiv.width(numMonths[1]*$('.datepicker',inst._datepickerDiv[0]).width());},_hasClass:function(element,className){var classes=element.attr('class');return(classes&&classes.indexOf(className)>-1);},dialogDatepicker:function(dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){inst=this._dialogInst=new DatepickerInstance({},false);this._dialogInput=$('<input type="text" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$('body').append(this._dialogInput);this._dialogInput[0]._calId=inst._id;}
extendRemove(inst._settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY];}
this._dialogInput.css('left',this._pos[0]+'px').css('top',this._pos[1]+'px');inst._settings.onSelect=onSelect;this._inDialog=true;this._datepickerDiv.addClass('datepicker_dialog');this.showFor(this._dialogInput[0]);if($.blockUI){$.blockUI(this._datepickerDiv);}
return this;},showFor:function(control){control=(control.jquery?control[0]:(typeof control=='string'?$(control)[0]:control));var input=(control.nodeName&&control.nodeName.toLowerCase()=='input'?control:this);if(input.nodeName.toLowerCase()!='input'){input=$('input',input.parentNode)[0];}
if($.datepicker._lastInput==input){return;}
if($(input).isDisabledDatepicker()){return;}
var inst=$.datepicker._getInst(input._calId);var beforeShow=inst._get('beforeShow');extendRemove(inst._settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker.hideDatepicker('');$.datepicker._lastInput=input;inst._setDateFromField(input);if($.datepicker._inDialog){input.value='';}
if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight;}
var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css('position')=='fixed';});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop;}
if(!$.datepicker._inDialog){var iconOffset=7;var horizontalOffset=$(inst._input).outerWidth()-$.datepicker._datepickerDiv.outerWidth()-iconOffset;$.datepicker._pos[0]=$.datepicker._pos[0]+horizontalOffset;}
inst._datepickerDiv.css('position',($.datepicker._inDialog&&$.blockUI?'static':(isFixed?'fixed':'absolute'))).css('left',$.datepicker._pos[0]+'px').css('top',$.datepicker._pos[1]+'px');$.datepicker._pos=null;$.datepicker._showDatepicker(inst);return this;},_showDatepicker:function(id){var inst=this._getInst(id);inst._rangeStart=null;this._updateDatepicker(inst);if(!inst._inline){var speed=inst._get('speed');var postProcess=function(){$.datepicker._datepickerShowing=true;$.datepicker._afterShow(inst);};inst._input.addClass('datepicker_open');var showAnim=inst._get('showAnim');if(showAnim){inst._datepickerDiv[showAnim](speed,postProcess);}else{inst._datepickerDiv.show();speed='';}
if(speed==''){postProcess();}
if(inst._input[0].type!='hidden'){inst._input[0].focus();}
this._curInst=inst;}},_updateDatepicker:function(inst){inst._datepickerBody.empty().append(inst._generateDatepicker());var numMonths=inst._getNumberOfMonths();if(numMonths[0]!=1||numMonths[1]!=1){inst._datepickerBody.addClass('datepicker_multi');}
else{inst._datepickerBody.removeClass('datepicker_multi');}
if(inst._get('isRTL')){inst._datepickerBody.addClass('datepicker_rtl');}
else{inst._datepickerBody.removeClass('datepicker_rtl');}
if(inst._input&&inst._input[0].type!='hidden'){inst._input[0].focus();}},_afterShow:function(inst){var numMonths=inst._getNumberOfMonths();var isFixed=inst._datepickerDiv.css('position')=='fixed';var pos=inst._input?$.datepicker._findPos(inst._input[0]):null;var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=(isFixed?0:document.documentElement.scrollLeft||document.body.scrollLeft);var scrollY=(isFixed?0:document.documentElement.scrollTop||document.body.scrollTop);if(inst._datepickerDiv.offset().left<0){inst._datepickerDiv.css('left','5px');}
if((inst._datepickerDiv.offset().top+inst._datepickerDiv.height()-
(isFixed&&$.browser.msie?document.documentElement.scrollTop:0))>(browserHeight+scrollY)){inst._datepickerDiv.css('top',Math.max(scrollY,pos[1]-(this._inDialog?0:inst._datepickerDiv.height())-
(isFixed&&$.browser.opera?document.documentElement.scrollTop:0))+'px');}},_findPos:function(obj){while(obj&&(obj.type=='hidden'||obj.nodeType!=1)){obj=obj.nextSibling;}
var curleft=0;var curtop=0;if(obj&&obj.offsetParent){curleft=obj.offsetLeft;curtop=obj.offsetTop;while(obj=obj.offsetParent){var origcurleft=curleft;curleft+=obj.offsetLeft;if(curleft<0){curleft=origcurleft;}
curtop+=obj.offsetTop;}}
return[curleft,curtop];},hideDatepicker:function(speed){var inst=this._curInst;if(!inst){return;}
var rangeSelect=inst._get('rangeSelect');if(rangeSelect&&this._stayOpen){this._selectDate(inst,inst._formatDate(inst._currentDay,inst._currentMonth,inst._currentYear));}
this._stayOpen=false;if(this._datepickerShowing){speed=(speed!=null?speed:inst._get('speed'));inst._input.removeClass('datepicker_open');hideAnim=inst._get('hideAnim');if(hideAnim){inst._datepickerDiv[hideAnim](speed,function(){$.datepicker._tidyDialog(inst);});}else{inst._datepickerDiv.hide();speed='';}
if(speed===''){this._tidyDialog(inst);}
this._datepickerShowing=false;this._lastInput=null;inst._settings.prompt=null;if(this._inDialog){this._dialogInput.css('position','absolute').css('left','0px').css('top','-100px');if($.blockUI){$.unblockUI();$('body').append(this._datepickerDiv);}}
this._inDialog=false;}
this._curInst=null;},_tidyDialog:function(inst){inst._datepickerDiv.removeClass('datepicker_dialog');$('.datepicker_prompt',inst._datepickerDiv).remove();},_checkExternalClick:function(event){if(!$.datepicker._curInst){return;}
var target=$(event.target);if((target.parents("#datepicker").length==0)&&(target.attr('class')!='datepicker_trigger')&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker.hideDatepicker('');}},_adjustDate:function(id,offset,period){var inst=this._getInst(id);inst._adjustDate(offset,period);this._updateDatepicker(inst);},_gotoToday:function(id){var date=new Date();var inst=this._getInst(id);inst._selectedDay=date.getDate();inst._selectedMonth=date.getMonth();inst._selectedYear=date.getFullYear();this._adjustDate(inst);},_selectMonthYear:function(id,select,period){var inst=this._getInst(id);inst._selectingMonthYear=false;inst[period=='M'?'_selectedMonth':'_selectedYear']=select.options[select.selectedIndex].value-0;this._adjustDate(inst);},_clickMonthYear:function(id){var inst=this._getInst(id);if(inst._input&&inst._selectingMonthYear&&!$.browser.msie){inst._input[0].focus();}
inst._selectingMonthYear=!inst._selectingMonthYear;},_changeFirstDay:function(id,day){var inst=this._getInst(id);inst._settings.firstDay=day;this._updateDatepicker(inst);},_selectDay:function(id,month,year,td){if(this._hasClass($(td),'datepicker_unselectable')){return;}
var inst=this._getInst(id);var weekSelect=inst._get('selectionType')=='week';var rangeSelect=inst._get('rangeSelect');var printRange=inst._get('printRange');if(rangeSelect){if(!this._stayOpen){$('.datepicker_table td').removeClass('datepicker_currentDay');$(td).addClass('datepicker_currentDay');}
this._stayOpen=!this._stayOpen;}
inst._currentDay=$('a',td).html();inst._currentMonth=month;inst._currentYear=year;this._selectDate(id,inst._formatDate(inst._currentDay,inst._currentMonth,inst._currentYear));if(printRange){selectedDate=$.datepicker.parseDate(inst._get('dateFormat'),inst._formatDate(inst._currentDay,inst._currentMonth,inst._currentYear));selectedDate.setDate(selectedDate.getDate()-selectedDate.getDay());inst._currentDay=selectedDate.getDate();inst._currentMonth=selectedDate.getMonth();inst._currentYear=selectedDate.getFullYear();inst._rangeStart=new Date(inst._currentYear,inst._currentMonth,inst._currentDay);endDate=new Date(inst._currentYear,inst._currentMonth,inst._currentDay);endDate.setDate(endDate.getDate()+6);this._selectDate(id,inst._formatDate(endDate.getDate(),endDate.getMonth(),endDate.getFullYear()));inst._rangeStart=null;}
else if(this._stayOpen){inst._endDay=inst._endMonth=inst._endYear=null;inst._rangeStart=new Date(inst._currentYear,inst._currentMonth,inst._currentDay);this._updateDatepicker(inst);}
else if(rangeSelect){inst._endDay=inst._currentDay;inst._endMonth=inst._currentMonth;inst._endYear=inst._currentYear;inst._selectedDay=inst._currentDay=inst._rangeStart.getDate();inst._selectedMonth=inst._currentMonth=inst._rangeStart.getMonth();inst._selectedYear=inst._currentYear=inst._rangeStart.getFullYear();inst._rangeStart=null;if(inst._inline){this._updateDatepicker(inst);}}},_clearDate:function(id){var inst=this._getInst(id);this._stayOpen=false;inst._endDay=inst._endMonth=inst._endYear=inst._rangeStart=null;this._selectDate(inst,'');},_selectDate:function(id,dateStr){var inst=this._getInst(id);dateStr=(dateStr!=null?dateStr:inst._formatDate());if(inst._rangeStart){dateStr=inst._formatDate(inst._rangeStart)+inst._get('rangeSeparator')+dateStr;}
if(inst._input){inst._input.val(dateStr);}
var onSelect=inst._get('onSelect');if(onSelect){onSelect.apply((inst._input?inst._input[0]:null),[dateStr,inst]);}
else{if(inst._input){inst._input.trigger('change');}}
if(inst._inline){this._updateDatepicker(inst);}
else{if(!this._stayOpen){this.hideDatepicker(inst._get('speed'));this._lastInput=inst._input[0];if(typeof(inst._input[0])!='object'){inst._input[0].focus();}
this._lastInput=null;}}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),''];},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate);}
else if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){checkDate.setDate(checkDate.getDate()+3);return $.datepicker.iso8601Week(checkDate);}}
return Math.floor(((checkDate-firstMon)/86400000)/7)+1;},dateStatus:function(date,inst){return $.datepicker.formatDate(inst._get('dateStatus'),date,inst._getFormatConfig());},parseDate:function(format,value,settings){if(format==null||value==null){throw'Invalid arguments';}
value=(typeof value=='object'?value.toString():value+'');if(value==''){return null;}
var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++;}
return matches;};var getNumber=function(match){lookAhead(match);var size=(match=='y'?4:2);var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>='0'&&value.charAt(iValue)<='9'){num=num*10+(value.charAt(iValue++)-0);size--;}
if(size==(match=='y'?4:2)){throw'Missing number at position '+iValue;}
return num;};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length);}
var name='';var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1;}}
size--;}
throw'Unknown name at position '+iInit;};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw'Unexpected literal at position '+iValue;}
iValue++;};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=='\''&&!lookAhead('\'')){literal=false;}
else{checkLiteral();}}
else{switch(format.charAt(iFormat)){case'd':day=getNumber('d');break;case'D':getName('D',dayNamesShort,dayNames);break;case'm':month=getNumber('m');break;case'M':month=getName('M',monthNamesShort,monthNames);break;case'y':year=getNumber('y');break;case'\'':if(lookAhead('\'')){checkLiteral();}
else{literal=true;}
break;default:checkLiteral();}}}
if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+
(year<=shortYearCutoff?0:-100);}
var date=new Date(year,month-1,day);if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw'Invalid date';}
return date;},formatDate:function(format,date,settings){if(!date){return'';}
var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++;}
return matches;};var formatNumber=function(match,value){return(lookAhead(match)&&value<10?'0':'')+value;};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value]);};var output='';var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=='\''&&!lookAhead('\'')){literal=false;}
else{output+=format.charAt(iFormat);}}
else{switch(format.charAt(iFormat)){case'd':output+=formatNumber('d',date.getDate());break;case'D':output+=formatName('D',date.getDay(),dayNamesShort,dayNames);break;case'm':output+=formatNumber('m',date.getMonth()+1);break;case'M':output+=formatName('M',date.getMonth(),monthNamesShort,monthNames);break;case'y':output+=(lookAhead('y')?date.getFullYear():(date.getYear()%100<10?'0':'')+date.getYear()%100);break;case'\'':if(lookAhead('\'')){output+='\'';}
else{literal=true;}
break;default:output+=format.charAt(iFormat);}}}}
return output;},_possibleChars:function(format){var chars='';var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=='\''&&!lookAhead('\'')){literal=false;}
else{chars+=format.charAt(iFormat);}}
else{switch(format.charAt(iFormat)){case'd':case'm':case'y':chars+='0123456789';break;case'D':case'M':return null;case'\'':if(lookAhead('\'')){chars+='\'';}
else{literal=true;}
break;default:chars+=format.charAt(iFormat);}}}
return chars;}});function DatepickerInstance(settings,inline){this._id=$.datepicker._register(this);this._selectedDay=0;this._selectedMonth=0;this._selectedYear=0;this._input=null;this._inline=inline;this._datepickerDiv=(!inline?$.datepicker._datepickerDiv:$('<div id="datepicker_'+this._id+'" class="datepicker_inline"></div>'));this._datepickerBody=this._datepickerDiv.find('.bd:first');this._settings=extendRemove({},settings||{});if(inline){this._setDate(this._getDefaultDate());}}
$.extend(DatepickerInstance.prototype,{_get:function(name){return(this._settings[name]!=null?this._settings[name]:$.datepicker._defaults[name]);},_setDateFromField:function(input){this._input=$(input);var dateFormat=this._get('dateFormat');var dates=this._input?this._input.val().split(this._get('rangeSeparator')):null;this._endDay=this._endMonth=this._endYear=null;var date=defaultDate=this._getDefaultDate();if(dates.length>0){var settings=this._getFormatConfig();if(dates.length>1){date=$.datepicker.parseDate(dateFormat,dates[1],settings)||defaultDate;this._endDay=date.getDate();this._endMonth=date.getMonth();this._endYear=date.getFullYear();}
try{date=$.datepicker.parseDate(dateFormat,dates[0],settings)||defaultDate;}
catch(e){$.datepicker.log(e);date=defaultDate;}}
this._selectedDay=this._currentDay=date.getDate();this._selectedMonth=this._currentMonth=date.getMonth();this._selectedYear=this._currentYear=date.getFullYear();this._adjustDate();},_getDefaultDate:function(){return this._determineDate('defaultDate',new Date());},_determineDate:function(name,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date;};var offsetString=function(offset,getDaysInMonth){var date=new Date();var matches=/^([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?$/.exec(offset);if(matches){var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();switch(matches[2]||'d'){case'd':case'D':day+=(matches[1]-0);break;case'w':case'W':day+=(matches[1]*7);break;case'm':case'M':month+=(matches[1]-0);day=Math.min(day,getDaysInMonth(year,month));break;case'y':case'Y':year+=(matches[1]-0);day=Math.min(day,getDaysInMonth(year,month));break;}
date=new Date(year,month,day);}
return date;};var date=this._get(name);return(date==null?defaultDate:(typeof date=='string'?offsetString(date,this._getDaysInMonth):(typeof date=='number'?offsetNumeric(date):date)));},_setDate:function(date,endDate){this._selectedDay=this._currentDay=date.getDate();this._selectedMonth=this._currentMonth=date.getMonth();this._selectedYear=this._currentYear=date.getFullYear();if(this._get('rangeSelect')||this._get('selectionType')=='week'){if(endDate){this._endDay=endDate.getDate();this._endMonth=endDate.getMonth();this._endYear=endDate.getFullYear();}
else{this._endDay=this._currentDay;this._endMonth=this._currentMonth;this._endYear=this._currentYear;}}
this._adjustDate();},_getDate:function(){var startDate=(!this._currentYear||(this._input&&this._input.val()=='')?null:new Date(this._currentYear,this._currentMonth,this._currentDay));if(this._get('rangeSelect')||this._get('selectionType')=='week'){return[startDate,(!this._endYear?null:new Date(this._endYear,this._endMonth,this._endDay))];}
else{return startDate;}},_generateDatepicker:function(){var today=new Date();today=new Date(today.getFullYear(),today.getMonth(),today.getDate());var showStatus=this._get('showStatus');var isRTL=this._get('isRTL');var clear=(this._get('mandatory')?'':'<div class="datepicker_clear"><a href="javascript:void(0);" onclick="jQuery.datepicker._clearDate('+this._id+');"'+
(showStatus?this._addStatus(this._get('clearStatus')||'&#xa0;'):'')+'>'+
this._get('clearText')+'</a></div>');var title=this._get('title');var controls='<div class="datepicker_control">'+(isRTL?'':clear)+
(title?'<div class="datepicker_title">'+title+'</div>':'')+'<div class="datepicker_close"><a href="javascript:void(0);" onclick="jQuery.datepicker.hideDatepicker();"'+
(showStatus?this._addStatus(this._get('closeStatus')||'&#xa0;'):'')+'>'+
this._get('closeText')+'</a></div>'+(isRTL?clear:'')+'</div>';var prompt=this._get('prompt');var closeAtTop=this._get('closeAtTop');var hideIfNoPrevNext=this._get('hideIfNoPrevNext');var numMonths=this._getNumberOfMonths();var stepMonths=this._get('stepMonths');var stepYears=this._get('stepYears');var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var minDate=this._getMinMaxDate('min',true);var maxDate=this._getMinMaxDate('max');var drawMonth=this._selectedMonth;var drawYear=this._selectedYear;if(maxDate){var maxDraw=new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate());maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(new Date(drawYear,drawMonth,1)>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--;}}}
var html=(closeAtTop&&!this._inline?controls:'');var showWeeks=this._get('showWeeks');var highlightWeek=this._get('highlightWeek');for(var row=0;row<numMonths[0];row++){for(var col=0;col<numMonths[1];col++){var selectedDate=new Date(drawYear,drawMonth,this._selectedDay);html+='<div class="datepicker_oneMonth'+(col==0?' datepicker_newRow':'')+'">'+
this._generateMonthYearHeader(drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0)+'<table class="datepicker_table" cellpadding="0" cellspacing="0"><thead>'+'<tr class="datepicker_titleRow">'+
(showWeeks?'<td>'+this._get('weekHeader')+'</td>':'');var firstDay=this._get('firstDay');var changeFirstDay=this._get('changeFirstDay');var dayNames=this._get('dayNames');var dayNamesShort=this._get('dayNamesShort');var dayNamesMin=this._get('dayNamesMin');for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;var status=this._get('dayStatus')||'&#xa0;';status=(status.indexOf('DD')>-1?status.replace(/DD/,dayNames[day]):status.replace(/D/,dayNamesShort[day]));html+='<td'+((dow+firstDay+6)%7>=5?' class="datepicker_weekEndCell"':'')+'>'+
(!changeFirstDay?'<span':'<a onclick="jQuery.datepicker._changeFirstDay('+this._id+', '+day+');"')+
(showStatus?this._addStatus(status):'')+' title="'+dayNames[day]+'">'+
dayNamesMin[day]+(changeFirstDay?'</a>':'</span>')+'</td>';}
html+='</tr></thead><tbody>';var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==this._selectedYear&&drawMonth==this._selectedMonth){this._selectedDay=Math.min(this._selectedDay,daysInMonth);}
var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var currentDate=new Date(this._currentYear,this._currentMonth,this._currentDay);var endDate=this._endDay?new Date(this._endYear,this._endMonth,this._endDay):currentDate;var defaultDate=this._get('defaultDate');if(currentDate!=endDate&&defaultDate){currentDate=defaultDate;}
if(!highlightWeek){endDate=currentDate;}
var printDate=new Date(drawYear,drawMonth,1-leadDays);var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var beforeShowDay=this._get('beforeShowDay');var showOtherMonths=this._get('showOtherMonths');var calculateWeek=this._get('calculateWeek')||$.datepicker.iso8601Week;var dateStatus=this._get('statusForDate')||$.datepicker.dateStatus;var weekSelect=this._get('selectionType')=='week';var otherMonthsActive=this._get('otherMonthsActive');for(var dRow=0;dRow<numRows;dRow++){html+='<tr class="datepicker_daysRow"';if(weekSelect){html+=' onmouseover="jQuery(this).addClass(\'datepicker_daysRowOver\');" '+'onmouseout="jQuery(this).removeClass(\'datepicker_daysRowOver\');" ';}
html+='>'+
(showWeeks?'<td class="datepicker_weekCol">'+calculateWeek(printDate)+'</td>':'');for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((this._input?this._input[0]:null),[printDate]):[true,'']);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonthsActive?false:(otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate));html+='<td class="datepicker_daysCell'+
((dow+firstDay+6)%7>=5?' datepicker_weekEndCell':'')+
(otherMonth?' datepicker_otherMonth':'')+
(unselectable?' datepicker_unselectable':'')+
(otherMonth&&!showOtherMonths?'':' '+daySettings[1]+
(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?' datepicker_currentDay':'')+
(printDate.getTime()==today.getTime()?' datepicker_today':''))+'"'+
(unselectable?'':' onmouseover="jQuery(this).addClass(\'datepicker_daysCellOver\');'+
(!showStatus||(otherMonth&&!showOtherMonths)?'':'jQuery(\'#datepicker_status_'+
this._id+'\').html(\''+(dateStatus.apply((this._input?this._input[0]:null),[printDate,this])||'&#xa0;')+'\');')+'"'+' onmouseout="jQuery(this).removeClass(\'datepicker_daysCellOver\');'+
(!showStatus||(otherMonth&&!showOtherMonths)?'':'jQuery(\'#datepicker_status_'+
this._id+'\').html(\'&#xa0;\');')+'" onclick="jQuery.datepicker._selectDay('+
this._id+','+printDate.getMonth()+','+printDate.getFullYear()+', this);"')+'>'+
(otherMonth&&!otherMonthsActive?(showOtherMonths?printDate.getDate():'&#xa0;'):(unselectable?printDate.getDate():'<a href="javascript:void(0);">'+printDate.getDate()+'</a>'))+'</td>';printDate.setDate(printDate.getDate()+1);}
html+='</tr>';}
drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++;}
html+='</tbody></table></div>';}}
html+=(showStatus?'<div id="datepicker_status_'+this._id+'" class="datepicker_status">'+(this._get('initStatus')||'&#xa0;')+'</div>':'')+
(!closeAtTop&&!this._inline?controls:'')
return html;},_generateMonthYearHeader:function(drawMonth,drawYear,minDate,maxDate,selectedDate,secondary){minDate=(this._rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var showStatus=this._get('showStatus');var hideIfNoPrevNext=this._get('hideIfNoPrevNext');var html='<div class="datepicker_header">';var monthNames=this._get('monthNames');if(secondary||!this._get('changeMonth')){html+=monthNames[drawMonth]+'&#xa0;';}
else{var monthName=monthNames[drawMonth];var stepMonths=this._get('stepMonths');var prevMonth='<div class="datepicker_newMonth_prev">'+
(this._canAdjustMonth(-1,drawYear,drawMonth)?'<a href="javascript:void(0);" onclick="jQuery.datepicker._adjustDate('+this._id+', -'+stepMonths+', \'M\');"'+
(showStatus?this._addStatus(this._get('prevStatus')||'&#xa0;'):'')+'>'+
this._get('prevText')+'</a>':(hideIfNoPrevNext?'':'<a href="javascript:void(0);" onclick="void(0);" class="disabled">'+this._get('prevText')+'</a>'))+'</div>';var nextMonth='<div class="datepicker_newMonth_next">'+(this._canAdjustMonth(+1,drawYear,drawMonth)?'<a href="javascript:void(0);" onclick="jQuery.datepicker._adjustDate('+this._id+', +'+stepMonths+', \'M\');"'+
(showStatus?this._addStatus(this._get('nextStatus')||'&#xa0;'):'')+'>'+
this._get('nextText')+'</a>':(hideIfNoPrevNext?'>':'<a href="javascript:void(0);" onclick="void(0);" class="disabled">'+this._get('nextText')+'</a>'))+'</div>';html+='<div class="datepicker_newMonth">'+
prevMonth+'<span class="datepicker_month_title">'+monthName+'</span>'+
nextMonth+'</div>';}
if(secondary||!this._get('changeYear')){html+=drawYear;}
else{var stepYears=this._get('stepYears');var prevYear='<div class="datepicker_newYear_prev">'+(this._canAdjustMonth(-1,drawYear,drawMonth)?'<a href="javascript:void(0);" onclick="jQuery.datepicker._adjustDate('+this._id+', -'+stepYears+', \'Y\');"'+
(showStatus?this._addStatus(this._get('prevStatus')||'&#xa0;'):'')+'>'+
this._get('prevText')+'</a>':(hideIfNoPrevNext?'':'<a href="javascript:void(0);" onclick="void(0);" class="disabled">'+this._get('prevText')+'</a>'))+'</div>';var nextYear='<div class="datepicker_newYear_next">'+(this._canAdjustMonth(+1,drawYear,drawMonth)?'<a href="javascript:void(0);" onclick="jQuery.datepicker._adjustDate('+this._id+', +'+stepYears+', \'Y\');"'+
(showStatus?this._addStatus(this._get('nextStatus')||'&#xa0;'):'')+'>'+
this._get('nextText')+'</a>':(hideIfNoPrevNext?'>':'<a href="javascript:void(0);" onclick="void(0);" class="disabled">'+this._get('nextText')+'</a>'))+'</div>';html+='<div class="datepicker_newYear">'+
prevYear+'<span class="datepicker_year_title">'+drawYear+'</span>'+
nextYear+'</div>';}
html+='</div>';return html;},_addStatus:function(text){return' onmouseover="jQuery(\'#datepicker_status_'+this._id+'\').html(\''+text+'\');" '+'onmouseout="jQuery(\'#datepicker_status_'+this._id+'\').html(\'&#xa0;\');"';},_adjustDate:function(offset,period){var year=this._selectedYear+(period=='Y'?offset:0);var month=this._selectedMonth+(period=='M'?offset:0);var day=Math.min(this._selectedDay,this._getDaysInMonth(year,month))+
(period=='D'?offset:0);var date=new Date(year,month,day);var minDate=this._getMinMaxDate('min',true);var maxDate=this._getMinMaxDate('max');date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);this._selectedDay=date.getDate();this._selectedMonth=date.getMonth();this._selectedYear=date.getFullYear();},_getNumberOfMonths:function(){var numMonths=this._get('numberOfMonths');return(numMonths==null?[1,1]:(typeof numMonths=='number'?[1,numMonths]:numMonths));},_getMinMaxDate:function(minMax,checkRange){var date=this._determineDate(minMax+'Date',null);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0);}
return date||(checkRange?this._rangeStart:null);},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate();},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay();},_canAdjustMonth:function(offset,curYear,curMonth){var numMonths=this._getNumberOfMonths();var date=new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1);if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()));}
return this._isInRange(date);},_isInRange:function(date){var newMinDate=(!this._rangeStart?null:new Date(this._selectedYear,this._selectedMonth,this._selectedDay));newMinDate=(newMinDate&&this._rangeStart<newMinDate?this._rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate('min');var maxDate=this._getMinMaxDate('max');return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate));},_getFormatConfig:function(){var shortYearCutoff=this._get('shortYearCutoff');shortYearCutoff=(typeof shortYearCutoff!='string'?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get('dayNamesShort'),dayNames:this._get('dayNames'),monthNamesShort:this._get('monthNamesShort'),monthNames:this._get('monthNames')};},_formatDate:function(day,month,year){if(!day){this._currentDay=this._selectedDay;this._currentMonth=this._selectedMonth;this._currentYear=this._selectedYear;}
var date=(day?(typeof day=='object'?day:new Date(year,month,day)):new Date(this._currentYear,this._currentMonth,this._currentDay));return $.datepicker.formatDate(this._get('dateFormat'),date,this._getFormatConfig());}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null){target[name]=null;}}
return target;};$.fn.attachDatepicker=function(settings){return this.each(function(){var inlineSettings=null;for(attrName in $.datepicker._defaults){var attrValue=this.getAttribute('date:'+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue);}
catch(err){inlineSettings[attrName]=attrValue;}}}
var nodeName=this.nodeName.toLowerCase();if(nodeName=='input'){var instSettings=(inlineSettings?$.extend($.extend({},settings||{}),inlineSettings||{}):settings);var inst=(inst&&!inlineSettings?inst:new DatepickerInstance(instSettings,false));$.datepicker._connectDatepicker(this,inst);}
else if(nodeName=='div'||nodeName=='span'){var instSettings=$.extend($.extend({},settings||{}),inlineSettings||{});var inst=new DatepickerInstance(instSettings,true);$.datepicker._inlineDatepicker(this,inst);}});};$.fn.removeDatepicker=function(){var jq=this.each(function(){var $this=$(this);var nodeName=this.nodeName.toLowerCase();var calId=this._calId;this._calId=null;if(nodeName=='input'){$this.siblings('.datepicker_append').replaceWith('');$this.siblings('.datepicker_trigger').replaceWith('');$this.removeClass($.datepicker.markerClassName).unbind('focus',$.datepicker.showFor).unbind('keydown',$.datepicker._doKeyDown).unbind('keypress',$.datepicker._doKeyPress);var wrapper=$this.parents('.datepicker_wrap');if(wrapper){wrapper.replaceWith(wrapper.html());}}
else if(nodeName=='div'||nodeName=='span'){$this.removeClass($.datepicker.markerClassName).empty();}
if($('input[_calId='+calId+']').length==0){$.datepicker._inst[calId]=null;}});if($('input.hasDatepicker').length==0){$.datepicker._datepickerDiv.replaceWith('');}
return jq;};$.fn.enableDatepicker=function(){return this.each(function(){this.disabled=false;$(this).siblings('button.datepicker_trigger').each(function(){this.disabled=false;});$(this).siblings('img.datepicker_trigger').css({opacity:'1.0',cursor:''});var $this=this;$.datepicker._disabledInputs=$.map($.datepicker._disabledInputs,function(value){return(value==$this?null:value);});});};$.fn.disableDatepicker=function(){return this.each(function(){this.disabled=true;$(this).siblings('button.datepicker_trigger').each(function(){this.disabled=true;});$(this).siblings('img.datepicker_trigger').css({opacity:'0.5',cursor:'default'});var $this=this;$.datepicker._disabledInputs=$.map($.datepicker._disabledInputs,function(value){return(value==$this?null:value);});$.datepicker._disabledInputs[$.datepicker._disabledInputs.length]=this;});};$.fn.isDisabledDatepicker=function(){if(this.length==0){return false;}
for(var i=0;i<$.datepicker._disabledInputs.length;i++){if($.datepicker._disabledInputs[i]==this[0]){return true;}}
return false;};$.fn.changeDatepicker=function(name,value){var settings=name||{};if(typeof name=='string'){settings={};settings[name]=value;}
return this.each(function(){var inst=$.datepicker._getInst(this._calId);if(inst){extendRemove(inst._settings,settings);$.datepicker._updateDatepicker(inst);}});};$.fn.showDatepicker=function(){$.datepicker.showFor(this);return this;};$.fn.setDatepickerDate=function(date,endDate){return this.each(function(){var inst=$.datepicker._getInst(this._calId);if(inst){inst._setDate(date,endDate);$.datepicker._updateDatepicker(inst);}});};$.fn.getDatepickerDate=function(){var inst=(this.length>0?$.datepicker._getInst(this[0]._calId):null);return(inst?inst._getDate():null);};$(document).ready(function(){$.datepicker=new Datepicker();$(document.body).append($.datepicker._datepickerDiv).mousedown($.datepicker._checkExternalClick);});

if(typeof(SNI.HGTV.Quiz)=='undefined'){SNI.HGTV.Quiz={};}
var total_a;var total_b;var total_c;var total_d;var aQuizAnswers;SNI.HGTV.Quiz.popupQuiz=function(url){total_a=0;total_b=0;total_c=0;total_d=0;aQuizAnswers=[];SNI.Util.popup(url,775,525);return false;};
if(typeof(SNI.HGTV.Omniture)=='undefined'){SNI.HGTV.Omniture={};}
SNI.HGTV.Omniture.ClickTrack=function(jsel,module,searchKey){var $el=$(jsel);if($el.length==0){return;}
$el.click(function(e){var $clicked=$(e.target);if($clicked.is("a")&&(($clicked.parents().filter('form').attr("id")=="hgSearchForm")||($clicked.parents().filter('form').attr("id")=="hgFtSearchForm"))){return;}
if($clicked.is("a")||$clicked.parent().is("a")||($clicked.attr("type")=="submit")){if($clicked.attr("type")=="submit"){site="HGTV: "+$clicked.parents().filter('form').attr("name")+" ";}else{site="HGTV: "+module+" ";}
var s=s_gi(s_account);s.linkTrackVars='prop14,eVar16,prop15,eVar18,prop16,eVar17,prop17,eVar19,prop18,prop19,eVar20,prop20';s.prop14=site;s.eVar16=s.prop14;var linkText=$clicked.html();var thumbnail=false;if((linkText=="")&&($clicked.is("img"))){linkText=$clicked.attr("alt");thumbnail=true;}
s.prop15=site+linkText;s.eVar18=s.prop15;relid="relid?";var linkUrl=$clicked.attr("href");if($clicked.is("a")){relid=$clicked.attr("rel");}
else if($clicked.parent().is("a")){relid=$clicked.parent().attr("rel");linkUrl=$clicked.parent().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.tl(this,'o','Link Name');e.stopPropagation();}});};SNI.HGTV.Omniture.ClickTrackSingle=function(jsel,module,section){var $el=$(jsel);if($el.length==0){return;}
$el.click(function(e){var $clicked=$(e.target);if($clicked.is("a")||$clicked.parent().is("a")){var linkText=$clicked.html();if((linkText=="")&&($clicked.is("img"))){linkText=$clicked.attr("alt");}
var s=s_gi(s_account);s.linkTrackVars='prop26';s.prop26=section+": "+module+": "+linkText;s.tl(this,'o','Link Name');e.stopPropagation();}});};