/*!
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var k=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,done=0,toString=Object.prototype.toString,hasDuplicate=false,baseHasDuplicate=true;[0,0].sort(function(){baseHasDuplicate=false;return 0});var n=function(a,b,c,d){c=c||[];b=b||document;var e=b;if(b.nodeType!==1&&b.nodeType!==9){return[]}if(!a||typeof a!=="string"){return c}var f=[],m,set,checkSet,extra,prune=true,contextXML=n.isXML(b),soFar=a,ret,cur,pop,i;do{k.exec("");m=k.exec(soFar);if(m){soFar=m[3];f.push(m[1]);if(m[2]){extra=m[3];break}}}while(m);if(f.length>1&&p.exec(a)){if(f.length===2&&o.relative[f[0]]){set=t(f[0]+f[1],b)}else{set=o.relative[f[0]]?[b]:n(f.shift(),b);while(f.length){a=f.shift();if(o.relative[a]){a+=f.shift()}set=t(a,set)}}}else{if(!d&&f.length>1&&b.nodeType===9&&!contextXML&&o.match.ID.test(f[0])&&!o.match.ID.test(f[f.length-1])){ret=n.find(f.shift(),b,contextXML);b=ret.expr?n.filter(ret.expr,ret.set)[0]:ret.set[0]}if(b){ret=d?{expr:f.pop(),set:r(d)}:n.find(f.pop(),f.length===1&&(f[0]==="~"||f[0]==="+")&&b.parentNode?b.parentNode:b,contextXML);set=ret.expr?n.filter(ret.expr,ret.set):ret.set;if(f.length>0){checkSet=r(set)}else{prune=false}while(f.length){cur=f.pop();pop=cur;if(!o.relative[cur]){cur=""}else{pop=f.pop()}if(pop==null){pop=b}o.relative[cur](checkSet,pop,contextXML)}}else{checkSet=f=[]}}if(!checkSet){checkSet=set}if(!checkSet){n.error(cur||a)}if(toString.call(checkSet)==="[object Array]"){if(!prune){c.push.apply(c,checkSet)}else if(b&&b.nodeType===1){for(i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&n.contains(b,checkSet[i]))){c.push(set[i])}}}else{for(i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){c.push(set[i])}}}}else{r(checkSet,c)}if(extra){n(extra,e,c,d);n.uniqueSort(c)}return c};n.uniqueSort=function(a){if(s){hasDuplicate=baseHasDuplicate;a.sort(s);if(hasDuplicate){for(var i=1;i<a.length;i++){if(a[i]===a[i-1]){a.splice(i--,1)}}}}return a};n.matches=function(a,b){return n(a,null,null,b)};n.find=function(a,b,c){var d;if(!a){return[]}for(var i=0,l=o.order.length;i<l;i++){var e=o.order[i],match;if((match=o.leftMatch[e].exec(a))){var f=match[1];match.splice(1,1);if(f.substr(f.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");d=o.find[e](match,b,c);if(d!=null){a=a.replace(o.match[e],"");break}}}}if(!d){d=b.getElementsByTagName("*")}return{set:d,expr:a}};n.filter=function(a,b,c,d){var e=a,result=[],curLoop=b,match,anyFound,isXMLFilter=b&&b[0]&&n.isXML(b[0]);while(a&&b.length){for(var f in o.filter){if((match=o.leftMatch[f].exec(a))!=null&&match[2]){var g=o.filter[f],found,item,left=match[1];anyFound=false;match.splice(1,1);if(left.substr(left.length-1)==="\\"){continue}if(curLoop===result){result=[]}if(o.preFilter[f]){match=o.preFilter[f](match,curLoop,c,result,d,isXMLFilter);if(!match){anyFound=found=true}else if(match===true){continue}}if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=g(item,match,i,curLoop);var h=d^!!found;if(c&&found!=null){if(h){anyFound=true}else{curLoop[i]=false}}else if(h){result.push(item);anyFound=true}}}}if(found!==undefined){if(!c){curLoop=result}a=a.replace(o.match[f],"");if(!anyFound){return[]}break}}}if(a===e){if(anyFound==null){n.error(a)}else{break}}e=a}return curLoop};n.error=function(a){throw"Syntax error, unrecognized expression: "+a;};var o=n.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")}},relative:{"+":function(a,b){var c=typeof b==="string",isTag=c&&!/\W/.test(b),isPartStrNotTag=c&&!isTag;if(isTag){b=b.toLowerCase()}for(var i=0,l=a.length,elem;i<l;i++){if((elem=a[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}a[i]=isPartStrNotTag||elem&&elem.nodeName.toLowerCase()===b?elem||false:elem===b}}if(isPartStrNotTag){n.filter(b,a,true)}},">":function(a,b){var c=typeof b==="string",elem,i=0,l=a.length;if(c&&!/\W/.test(b)){b=b.toLowerCase();for(;i<l;i++){elem=a[i];if(elem){var d=elem.parentNode;a[i]=d.nodeName.toLowerCase()===b?d:false}}}else{for(;i<l;i++){elem=a[i];if(elem){a[i]=c?elem.parentNode:elem.parentNode===b}}if(c){n.filter(b,a,true)}}},"":function(a,b,c){var d=done++,checkFn=dirCheck,nodeCheck;if(typeof b==="string"&&!/\W/.test(b)){b=b.toLowerCase();nodeCheck=b;checkFn=dirNodeCheck}checkFn("parentNode",b,d,a,nodeCheck,c)},"~":function(a,b,c){var d=done++,checkFn=dirCheck,nodeCheck;if(typeof b==="string"&&!/\W/.test(b)){b=b.toLowerCase();nodeCheck=b;checkFn=dirNodeCheck}checkFn("previousSibling",b,d,a,nodeCheck,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var m=b.getElementById(a[1]);return m&&m.parentNode?[m]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!=="undefined"){var c=[],results=b.getElementsByName(a[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===a[1]){c.push(results[i])}}return c.length===0?null:c}},TAG:function(a,b){return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(/\\/g,"")+" ";if(f){return a}for(var i=0,elem;(elem=b[i])!=null;i++){if(elem){if(e^(elem.className&&(" "+elem.className+" ").replace(/[\t\n]/g," ").indexOf(a)>=0)){if(!c){d.push(elem)}}else if(c){b[i]=false}}}return false},ID:function(a){return a[1].replace(/\\/g,"")},TAG:function(a,b){return a[1].toLowerCase()},CHILD:function(a){if(a[1]==="nth"){var b=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=(b[1]+(b[2]||1))-0;a[3]=b[3]-0}a[0]=done++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1].replace(/\\/g,"");if(!f&&o.attrMap[g]){a[1]=o.attrMap[g]}if(a[2]==="~="){a[4]=" "+a[4]+" "}return a},PSEUDO:function(a,b,c,d,e){if(a[1]==="not"){if((k.exec(a[3])||"").length>1||/^\w/.test(a[3])){a[3]=n(a[3],null,null,b)}else{var f=n.filter(a[3],b,c,true^e);if(!c){d.push.apply(d,f)}return false}}else if(o.match.POS.test(a[0])||o.match.CHILD.test(a[0])){return true}return a},POS:function(a){a.unshift(true);return a}},filters:{enabled:function(a){return a.disabled===false&&a.type!=="hidden"},disabled:function(a){return a.disabled===true},checked:function(a){return a.checked===true},selected:function(a){a.parentNode.selectedIndex;return a.selected===true},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,i,b){return!!n(b[3],a).length},header:function(a){return(/h\d/i).test(a.nodeName)},text:function(a){return"text"===a.type},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return(/input|select|textarea|button/i).test(a.nodeName)}},setFilters:{first:function(a,i){return i===0},last:function(a,i,b,c){return i===c.length-1},even:function(a,i){return i%2===0},odd:function(a,i){return i%2===1},lt:function(a,i,b){return i<b[3]-0},gt:function(a,i,b){return i>b[3]-0},nth:function(a,i,b){return b[3]-0===i},eq:function(a,i,b){return b[3]-0===i}},filter:{PSEUDO:function(a,b,i,c){var d=b[1],filter=o.filters[d];if(filter){return filter(a,i,b,c)}else if(d==="contains"){return(a.textContent||a.innerText||n.getText([a])||"").indexOf(b[3])>=0}else if(d==="not"){var e=b[3];for(var j=0,l=e.length;j<l;j++){if(e[j]===a){return false}}return true}else{n.error("Syntax error, unrecognized expression: "+d)}},CHILD:function(a,b){var c=b[1],node=a;switch(c){case'only':case'first':while((node=node.previousSibling)){if(node.nodeType===1){return false}}if(c==="first"){return true}node=a;case'last':while((node=node.nextSibling)){if(node.nodeType===1){return false}}return true;case'nth':var d=b[2],last=b[3];if(d===1&&last===0){return true}var e=b[0],parent=a.parentNode;if(parent&&(parent.sizcache!==e||!a.nodeIndex)){var f=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++f}}parent.sizcache=e}var g=a.nodeIndex-last;if(d===0){return g===0}else{return(g%d===0&&g/d>=0)}}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return(b==="*"&&a.nodeType===1)||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],result=o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),value=result+"",q=b[2],check=b[4];return result==null?q==="!=":q==="="?value===check:q==="*="?value.indexOf(check)>=0:q==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:q==="!="?value!==check:q==="^="?value.indexOf(check)===0:q==="$="?value.substr(value.length-check.length)===check:q==="|="?value===check||value.substr(0,check.length+1)===check+"-":false},POS:function(a,b,i,c){var d=b[2],filter=o.setFilters[d];if(filter){return filter(a,i,b,c)}}}};var p=o.match.POS,fescape=function(a,b){return"\\"+(b-0+1)};for(var q in o.match){o.match[q]=new RegExp(o.match[q].source+(/(?![^\[]*\])(?![^\(]*\))/.source));o.leftMatch[q]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[q].source.replace(/\\(\d+)/g,fescape))}var r=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(e){r=function(a,b){var c=b||[],i=0;if(toString.call(a)==="[object Array]"){Array.prototype.push.apply(c,a)}else{if(typeof a.length==="number"){for(var l=a.length;i<l;i++){c.push(a[i])}}else{for(;a[i];i++){c.push(a[i])}}}return c}}var s,siblingCheck;if(document.documentElement.compareDocumentPosition){s=function(a,b){if(a===b){hasDuplicate=true;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition){return a.compareDocumentPosition?-1:1}return a.compareDocumentPosition(b)&4?-1:1}}else{s=function(a,b){var c=[],bp=[],aup=a.parentNode,bup=b.parentNode,cur=aup,al,bl;if(a===b){hasDuplicate=true;return 0}else if(aup===bup){return siblingCheck(a,b)}else if(!aup){return-1}else if(!bup){return 1}while(cur){c.unshift(cur);cur=cur.parentNode}cur=bup;while(cur){bp.unshift(cur);cur=cur.parentNode}al=c.length;bl=bp.length;for(var i=0;i<al&&i<bl;i++){if(c[i]!==bp[i]){return siblingCheck(c[i],bp[i])}}return i===al?siblingCheck(a,bp[i],-1):siblingCheck(c[i],b,1)};siblingCheck=function(a,b,c){if(a===b){return c}var d=a.nextSibling;while(d){if(d===b){return-1}d=d.nextSibling}return 1}}n.getText=function(a){var b="",elem;for(var i=0;a[i];i++){elem=a[i];if(elem.nodeType===3||elem.nodeType===4){b+=elem.nodeValue}else if(elem.nodeType!==8){b+=n.getText(elem.childNodes)}}return b};(function(){var d=document.createElement("div"),id="script"+(new Date()).getTime();d.innerHTML="<a name='"+id+"'/>";var e=document.documentElement;e.insertBefore(d,e.firstChild);if(document.getElementById(id)){o.find.ID=function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var m=b.getElementById(a[1]);return m?m.id===a[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===a[1]?[m]:undefined:[]}};o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}}e.removeChild(d);e=d=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var i=0;c[i];i++){if(c[i].nodeType===1){d.push(c[i])}}c=d}return c}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){o.attrHandle.href=function(a){return a.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var f=n,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return}n=function(a,b,c,d){b=b||document;if(!d&&b.nodeType===9&&!n.isXML(b)){try{return r(b.querySelectorAll(a),c)}catch(e){}}return f(a,b,c,d)};for(var g in f){n[g]=f[g]}div=null})()}(function(){var d=document.createElement("div");d.innerHTML="<div class='test e'></div><div class='test'></div>";if(!d.getElementsByClassName||d.getElementsByClassName("e").length===0){return}d.lastChild.className="e";if(d.getElementsByClassName("e").length===1){return}o.order.splice(1,0,"CLASS");o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c){return b.getElementsByClassName(a[1])}};d=null})();function dirNodeCheck(a,b,c,d,e,f){for(var i=0,l=d.length;i<l;i++){var g=d[i];if(g){g=g[a];var h=false;while(g){if(g.sizcache===c){h=d[g.sizset];break}if(g.nodeType===1&&!f){g.sizcache=c;g.sizset=i}if(g.nodeName.toLowerCase()===b){h=g;break}g=g[a]}d[i]=h}}}function dirCheck(a,b,c,d,e,f){for(var i=0,l=d.length;i<l;i++){var g=d[i];if(g){g=g[a];var h=false;while(g){if(g.sizcache===c){h=d[g.sizset];break}if(g.nodeType===1){if(!f){g.sizcache=c;g.sizset=i}if(typeof b!=="string"){if(g===b){h=true;break}}else if(n.filter(b,[g]).length>0){h=g;break}}g=g[a]}d[i]=h}}}n.contains=document.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:function(a,b){return a!==b&&(a.contains?a.contains(b):true)};n.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":false};var t=function(a,b){var c=[],later="",match,root=b.nodeType?[b]:b;while((match=o.match.PSEUDO.exec(a))){later+=match[0];a=a.replace(o.match.PSEUDO,"")}a=o.relative[a]?a+"*":a;for(var i=0,l=root.length;i<l;i++){n(a,root[i],c)}return n.filter(later,c)};window.Sizzle=n})();


// cookie functions - Peter-Paul Koch: http://www.quirksmode.org/js/cookies.html
function makeCookie(a,b,c){if(c){var d=new Date();d.setTime(d.getTime()+(c*24*60*60*1000));var e="; expires="+d.toGMTString()}else var e="";document.cookie=a+"="+b+e+"; path=/"}
function readCookie(a){var b=a+"=";var d=document.cookie.split(';');for(var i=0;i<d.length;i++){var c=d[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(b)==0)return c.substring(b.length,c.length)}return null}
function killCookie(a){makeCookie(a,"",-1)}

/*
 * jQuery.BiggerLink v2.0.1
 * http://www.ollicle.com/eg/jquery/biggerlink/
 * Copyright (c) 2009 Oliver Boermans
 * http://creativecommons.org/licenses/MIT/
 * 2009-11-22 (22 Nov 2009)
 */
(function(a){a.fn.biggerlink=function(b){var c={biggerclass:"bl-bigger",hoverclass:"bl-hover",hoverclass2:"bl-hover2",clickableclass:"bl-hot",otherstriggermaster:true,follow:"auto"};if(b){a.extend(c,b)}a(this).filter(function(){return a("a",this).length>0}).addClass(c.clickableclass).css("cursor","pointer").each(function(g){var d=a(this).data("biggerlink",{hovered:false,focused:false,hovered2:false,focused2:false});var e={all:a("a",this),big:a(this),master:a("a:first",this).data("biggerlink",{status:"master"}).addClass(c.biggerclass),other:a("a",this).not(a("a:first",this)).data("biggerlink",{status:"other"})};a("a",this).andSelf().each(function(){var i=a.extend(a(this).data("biggerlink"),e);a(this).data("biggerlink",i)});var h=d.attr("title");var f=d.data("biggerlink").master.attr("title");if(f&&!h){d.attr("title",f)}d.mouseover(function(i){window.status=a(this).data("biggerlink").master.get(0).href;a(this).addClass(c.hoverclass);a(this).data("biggerlink").hovered=true}).mouseout(function(i){window.status="";if(!a(this).data("biggerlink").focused){a(this).removeClass(c.hoverclass)}a(this).data("biggerlink").hovered=false}).bind("click",function(i){if(!a(i.target).closest("a").length){a(this).data("biggerlink").master.trigger({type:"click",source:"biggerlink"});i.stopPropagation()}});e.all.bind("focus",function(){a(this).data("biggerlink").big.addClass(c.hoverclass);a(this).data("biggerlink").big.data("biggerlink").focused=true}).bind("blur",function(){if(!a(this).data("biggerlink").big.data("biggerlink").hovered){a(this).data("biggerlink").big.removeClass(c.hoverclass)}a(this).data("biggerlink").big.data("biggerlink").focused=false});e.master.bind("click",function(i){if(i.source=="biggerlink"){if(c.follow===true||c.follow=="auto"&&i.result!==false){window.location=a(this).attr("href")}else{i.stopPropagation()}}});if(c.otherstriggermaster){e.other.addClass(c.biggerclass).bind("click",function(i){a(this).data("biggerlink").master.trigger({type:"click",source:"biggerlink"});i.preventDefault();i.stopPropagation()})}else{e.other.bind("focus",function(){a(this).data("biggerlink").big.addClass(c.hoverclass2);a(this).data("biggerlink").big.data("biggerlink").focused2=true}).bind("blur",function(){if(!a(this).data("biggerlink").big.data("biggerlink").hovered2){a(this).data("biggerlink").big.removeClass(c.hoverclass2)}a(this).data("biggerlink").big.data("biggerlink").focused2=false}).bind("mouseover",function(i){a(this).data("biggerlink").big.addClass(c.hoverclass2);a(this).data("biggerlink").big.data("biggerlink").hovered2=true;i.stopPropagation()}).bind("mouseout",function(i){if(!a(this).data("biggerlink").big.data("biggerlink").focused2){a(this).data("biggerlink").big.removeClass(c.hoverclass2)}a(this).data("biggerlink").big.data("biggerlink").hovered2=false;i.stopPropagation()});if(!e.other.attr("title")){e.other.attr("title","")}}});return this}})(jQuery);


// Navigation Folding - mike foskett - http://websemantics.co.uk
function fold(obj){
  obj.parent()
	.next().slideToggle()
	.toggleClass("closed").toggleClass("open")
	.parent().toggleClass("closedP").toggleClass("openP");
  makeCookie(obj.text().replace(/ /g,"_"),obj.parent().next().attr("class"),14);
  obj.attr("title",(obj.attr("title").match("Show"))?obj.attr("title").replace("Show","Hide"):obj.attr("title").replace("Hide","Show"));
}

function initialiseFold(objRef){
  $(objRef)
    .each(function(){
	  //killCookie($(this).text().replace(/ /g,"_"))
        // get cookie name from content text
        var x=readCookie($(this).text().replace(/ /g,"_"));
        if (x){
			$(this).next().addClass(x);
			// class added to parent to allow for + or - graphics on the link
			$(this).parent().addClass(x+"P");
		}else{
			if ($(this).next().hasClass("closed")){
				$(this).parent().addClass("closedP");
			}else{
				$(this).next().addClass("open");
				$(this).parent().addClass("openP");
			}
		}
        var t=($(this).next().hasClass("closed"))?"Show":"Hide";
        $(this).wrapInner('<a onclick="fold($(this));return false;" title="'+t+' '+$(this).text().toLowerCase()+' options" href="#"></a>');
    });
}

// function to equalise column heights
function equalHeight(group){
	var tallest=0;
	group.each(function(){
		var thisHeight=$(this).height();
		if(thisHeight>tallest){tallest=thisHeight;}	});
	group.height(tallest);
}

/* Recipe carousel component */
(function($){$.fn.infiniteCarousel=function(){$('ul#videoCarouselList li:first').before($('ul#videoCarouselList li:last'));$('#rightScroll img').click(function(){var item_width=$('ul#videoCarouselList li').outerWidth()+10;var left_indent=parseInt($('ul#videoCarouselList').css('left'))-item_width;$('ul#videoCarouselList:not(:animated)').animate({'left':left_indent},500,function(){$('ul#videoCarouselList li:last').after($('ul#videoCarouselList li:first'));$('ul#videoCarouselList').css({'left':'-38px'});});});$('#leftScroll img').click(function(){var item_width=$('ul#videoCarouselList li').outerWidth()+10;var left_indent=parseInt($('ul#videoCarouselList').css('left'))+item_width;$('ul#videoCarouselList:not(:animated)').animate({'left':left_indent},500,function(){$('ul#videoCarouselList li:first').before($('ul#videoCarouselList li:last'));$('ul#videoCarouselList').css({'left':'-38px'});});});};})(jQuery);
(function($){$.fn.infiniteCarouselVert=function(panel){$(panel+' ul.h2vCarouselList li:first').before($(panel+' ul.h2vCarouselList li:last'));$('#downScroll img').click(function(){var item_height=$(panel+' ul.h2vCarouselList li').outerHeight()+10;var top_indent=parseInt($(panel+' ul.h2vCarouselList').css('top'))-item_height;$(panel+' ul.h2vCarouselList:not(:animated)').animate({'top':top_indent},500,'linear',function(){$(panel+' ul.h2vCarouselList li:last').after($(panel+' ul.h2vCarouselList li:first'));$(panel+' ul.h2vCarouselList').css({'top':'-66px'});});});$('#upScroll img').click(function(){var item_height=$(panel+' ul.h2vCarouselList li').outerHeight()+10;var top_indent=parseInt($(panel+' ul.h2vCarouselList').css('top'))+item_height;$(panel+' ul.h2vCarouselList:not(:animated)').animate({'top':top_indent},500,function(){$(panel+' ul.h2vCarouselList li:first').before($(panel+' ul.h2vCarouselList li:last'));$(panel+' ul.h2vCarouselList').css({'top':'-66px'});});});};})(jQuery);

$('html').addClass('hasJS');
$('html').addClass('FOUC');
$('#waiting').css('display','block');

$(document).ready(function(){

	//alert("DOM ready");
  $('#waiting').fadeOut('fast');
  $('html').removeClass('FOUC');

	// Pass in the cascade to the object(s) acting as fold link(s) (in this case a strong element)
	// The object to fold must be the next sibling.
	// To fold the object on load give it a class="closed" and use .hasJS .closed {display:none} in CSS to prevent content flashing.
	// The fold object itself should avoid using vertical padding or margin otherwise it may bounce a little.
	initialiseFold("#searchrecipe .blockNav strong");


	/* Links with rel="external" get launched into new window */
	if (document.getElementsByTagName){
		var anchors=document.getElementsByTagName("a");
		for (var i=0;i<anchors.length;i++){
			var anchor=anchors[i];
			if (anchor.getAttribute("href") && anchor.getAttribute("rel")=="external"){
				anchor.target="_blank";
				anchor.title="Launches in new window";
	}	}	}


  $('#ggTabs, #vidTabs').tabs({cache:false, spinner:'Retrieving data...', selected:0, fx:{opacity:'toggle', duration:'slow'}});

  $('ul.h2vCarouselList').infiniteCarouselVert('#glh2vTab-1');

  $(".glh2vButtons li a").bind("click", function() {
    var clicked = $(this).attr('hash');
    $("ul.h2vCarouselList").infiniteCarouselVert(clicked);
    return false;
  });


  /* fix :hover for IE6 */
  if(jQuery.browser.msie && jQuery.browser.version.substr(0,3)<"7.0"){$('ul.ggContent li, ul.gContent li, .pList ul, #prodOffersContainer li, #headerSignUp span, #monthHighlightsContainer li, .footerLinks li, ul.followus li, .goGreenerTopContent li').hover(function(){$(this).addClass("iehover");},function(){$(this).removeClass("iehover");});}

  if(jQuery.browser.msie && jQuery.browser.version.substr(0,3)<"7.0"){
    // add an onhover classname to navigation elements for IEv6
    // and hide search form for < IE 7
    var links=document.getElementById("navigation").getElementsByTagName("li");
    for (var i=0;i<links.length;i++){
      links[i].onmouseover=function(){
        this.className+=" iehover";
        document.getElementById("search").className+=" hide";
      }
      links[i].onmouseout=function(){this.className=this.className.replace(new RegExp(" iehover\\b"), ""); document.getElementById("search").className=document.getElementById("search").className.replace(' hide','').replace('hide','');}
      links[i].onfocus=function(){this.className+=" iehover"; document.getElementById("search").className+=" hide";}
      links[i].onblur=function(){this.className=this.className.replace(new RegExp(" iehover\\b"), ""); document.getElementById("search").className=document.getElementById("search").className.replace(' hide','').replace('hide','');}
    }
  }


  if(jQuery.browser.msie && jQuery.browser.version.substr(0,3)=="7.0"){
    // add an onhover hide search form for IE 7
    var links=document.getElementById("navigation").getElementsByTagName("li");
    for (var i=0;i<links.length;i++){
      links[i].onmouseover=function(){
        if (this.getElementsByTagName("ul")[0]){
          document.getElementById("search").className+=" hide";
          document.getElementById("contentWrapper").style.zIndex="-1";
        }
      }
      links[i].onmouseout=function(){
        document.getElementById("search").className=document.getElementById("search").className.replace(' hide','').replace('hide','');
        document.getElementById("contentWrapper").style.zIndex="0";
      }
      links[i].onfocus=function(){
        if (this.getElementsByTagName("ul")[0]){
          document.getElementById("search").className+=" hide";
        }
      }
      links[i].onblur=function(){document.getElementById("search").className=document.getElementById("search").className.replace(' hide','').replace('hide','');}
    }
  }


  $('#glCarouselContainer').tabs({selected:0, fx:{opacity: 'toggle', duration:'slow'}}).tabs('rotate', 5000, 'true');

  //$('#gTabs').tabs({cache:false, selected:0, fx:{opacity:'toggle', duration:'slow'}});
  $('#gTabs').tabs({cache:false, fx:{opacity:'toggle', duration:'slow'}, select: function(event, ui) { var url = $.data(ui.tab, 'load.tabs'); if( url ) { location.href = url; return false; } return true;}});
  $('.gSubNavContainer').tabs({spinner:'Retrieving data...', selected:0, fx:{opacity: 'toggle'}});


  $('.pList, .ggContent li, .gContent li, #prodOffersContainer li, #headerSignUp, #monthHighlightsContainer li, #leftScroll, #rightScroll, ul.followus li').biggerlink();
	$('ul#videoCarouselList').infiniteCarousel();

  $('#waiting').bind('ajaxSend', function(){$(this).fadeIn('fast');}).bind('ajaxComplete', function(){$(this).fadeOut('fast');});

}); // end document ready function

/**
 * Tabs - jQuery plugin for accessible, unobtrusive tabs
 * @requires jQuery v1.1.1
 *
 * http://stilbuero.de/tabs/
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Version: 2.7.4
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(4($){$.2l({z:{2k:0}});$.1P.z=4(x,w){3(O x==\'2Y\')w=x;w=$.2l({K:(x&&O x==\'1Z\'&&x>0)?--x:0,12:C,J:$.1f?2h:T,18:T,1r:\'2X&#2Q;\',21:\'18-2F-\',1m:C,1u:C,1l:C,1F:C,1x:\'2u\',2r:C,2p:C,2m:T,2i:C,1d:C,1c:C,1j:\'z-1M\',H:\'z-2b\',14:\'z-12\',16:\'z-26\',1q:\'z-1H\',1L:\'z-2L\',2j:\'10\'},w||{});$.8.1D=$.8.U&&($.8.1Y&&$.8.1Y<7||/2A 6.0/.2y(2x.2w));4 1w(){1V(0,0)}F 5.Y(4(){2 p=5;2 r=$(\'13.\'+w.1j,p);r=r.V()&&r||$(\'>13:9(0)\',p);2 j=$(\'a\',r);3(w.18){j.Y(4(){2 c=w.21+(++$.z.2k),B=\'#\'+c,2f=5.1O;5.1O=B;$(\'<10 S="\'+c+\'" 34="\'+w.16+\'"></10>\').2c(p);$(5).19(\'1B\',4(e,a){2 b=$(5).I(w.1L),X=$(\'X\',5)[0],27=X.1J;3(w.1r){X.1J=\'<24>\'+w.1r+\'</24>\'}1p(4(){$(B).2T(2f,4(){3(w.1r){X.1J=27}b.17(w.1L);a&&a()})},0)})})}2 n=$(\'10.\'+w.16,p);n=n.V()&&n||$(\'>\'+w.2j,p);r.P(\'.\'+w.1j)||r.I(w.1j);n.Y(4(){2 a=$(5);a.P(\'.\'+w.16)||a.I(w.16)});2 s=$(\'A\',r).20($(\'A.\'+w.H,r)[0]);3(s>=0){w.K=s}3(1e.B){j.Y(4(i){3(5.B==1e.B){w.K=i;3(($.8.U||$.8.2E)&&!w.18){2 a=$(1e.B);2 b=a.15(\'S\');a.15(\'S\',\'\');1p(4(){a.15(\'S\',b)},2D)}1w();F T}})}3($.8.U){1w()}n.1a(\':9(\'+w.K+\')\').1C().1n().2C(\':9(\'+w.K+\')\').I(w.1q);$(\'A\',r).17(w.H).9(w.K).I(w.H);j.9(w.K).N(\'1B\').1n();3(w.2m){2 l=4(d){2 c=$.2B(n.1t(),4(a){2 h,1A=$(a);3(d){3($.8.1D){a.Z.2z(\'1X\');a.Z.G=\'\';a.1k=C}h=1A.L({\'1h-G\':\'\'}).G()}E{h=1A.G()}F h}).2v(4(a,b){F b-a});3($.8.1D){n.Y(4(){5.1k=c[0]+\'1W\';5.Z.2t(\'1X\',\'5.Z.G = 5.1k ? 5.1k : "2s"\')})}E{n.L({\'1h-G\':c[0]+\'1W\'})}};l();2 q=p.1U;2 m=p.1v;2 v=$(\'#z-2q-2o-V\').1t(0)||$(\'<X S="z-2q-2o-V">M</X>\').L({1T:\'2n\',3a:\'39\',38:\'37\'}).2c(Q.1S).1t(0);2 o=v.1v;36(4(){2 b=p.1U;2 a=p.1v;2 c=v.1v;3(a>m||b!=q||c!=o){l((b>q||c<o));q=b;m=a;o=c}},35)}2 u={},11={},1R=w.2r||w.1x,1Q=w.2p||w.1x;3(w.1u||w.1m){3(w.1u){u[\'G\']=\'1C\';11[\'G\']=\'1H\'}3(w.1m){u[\'W\']=\'1C\';11[\'W\']=\'1H\'}}E{3(w.1l){u=w.1l}E{u[\'1h-2g\']=0;1R=1}3(w.1F){11=w.1F}E{11[\'1h-2g\']=0;1Q=1}}2 t=w.2i,1d=w.1d,1c=w.1c;j.19(\'2e\',4(){2 c=$(5).1g(\'A:9(0)\');3(p.1i||c.P(\'.\'+w.H)||c.P(\'.\'+w.14)){F T}2 a=5.B;3($.8.U){$(5).N(\'1b\');3(w.J){$.1f.1N(a);1e.B=a.1z(\'#\',\'\')}}E 3($.8.1y){2 b=$(\'<2d 33="\'+a+\'"><10><32 31="2a" 30="h" /></10></2d>\').1t(0);b.2a();$(5).N(\'1b\');3(w.J){$.1f.1N(a)}}E{3(w.J){1e.B=a.1z(\'#\',\'\')}E{$(5).N(\'1b\')}}});j.19(\'1E\',4(){2 a=$(5).1g(\'A:9(0)\');3($.8.1y){a.1o({W:0},1,4(){a.L({W:\'\'})})}a.I(w.14)});3(w.12&&w.12.1K){29(2 i=0,k=w.12.1K;i<k;i++){j.9(--w.12[i]).N(\'1E\').1n()}};j.19(\'28\',4(){2 a=$(5).1g(\'A:9(0)\');a.17(w.14);3($.8.1y){a.1o({W:1},1,4(){a.L({W:\'\'})})}});j.19(\'1b\',4(e){2 g=e.2Z;2 d=5,A=$(5).1g(\'A:9(0)\'),D=$(5.B),R=n.1a(\':2W\');3(p[\'1i\']||A.P(\'.\'+w.H)||A.P(\'.\'+w.14)||O t==\'4\'&&t(5,D[0],R[0])===T){5.25();F T}p[\'1i\']=2h;3(D.V()){3($.8.U&&w.J){2 c=5.B.1z(\'#\',\'\');D.15(\'S\',\'\');1p(4(){D.15(\'S\',c)},0)}2 f={1T:\'\',2V:\'\',G:\'\'};3(!$.8.U){f[\'W\']=\'\'}4 1I(){3(w.J&&g){$.1f.1N(d.B)}R.1o(11,1Q,4(){$(d).1g(\'A:9(0)\').I(w.H).2U().17(w.H);R.I(w.1q).L(f);3(O 1d==\'4\'){1d(d,D[0],R[0])}3(!(w.1u||w.1m||w.1l)){D.L(\'1T\',\'2n\')}D.1o(u,1R,4(){D.17(w.1q).L(f);3($.8.U){R[0].Z.1a=\'\';D[0].Z.1a=\'\'}3(O 1c==\'4\'){1c(d,D[0],R[0])}p[\'1i\']=C})})}3(!w.18){1I()}E{$(d).N(\'1B\',[1I])}}E{2S(\'2R P 2P 2O 26.\')}2 a=1G.2N||Q.1s&&Q.1s.23||Q.1S.23||0;2 b=1G.2M||Q.1s&&Q.1s.22||Q.1S.22||0;1p(4(){1G.1V(a,b)},0);5.25();F w.J&&!!g});3(w.J){$.1f.2K(4(){j.9(w.K).N(\'1b\').1n()})}})};2 y=[\'2e\',\'1E\',\'28\'];29(2 i=0;i<y.1K;i++){$.1P[y[i]]=(4(d){F 4(c){F 5.Y(4(){2 b=$(\'13.z-1M\',5);b=b.V()&&b||$(\'>13:9(0)\',5);2 a;3(!c||O c==\'1Z\'){a=$(\'A a\',b).9((c&&c>0&&c-1||0))}E 3(O c==\'2J\'){a=$(\'A a[@1O$="#\'+c+\'"]\',b)}a.N(d)})}})(y[i])}$.1P.2I=4(){2 c=[];5.Y(4(){2 a=$(\'13.z-1M\',5);a=a.V()&&a||$(\'>13:9(0)\',5);2 b=$(\'A\',a);c.2H(b.20(b.1a(\'.z-2b\')[0])+1)});F c[0]}})(2G);',62,197,'||var|if|function|this|||browser|eq||||||||||||||||||||||||||tabs|li|hash|null|toShow|else|return|height|selectedClass|addClass|bookmarkable|initial|css||trigger|typeof|is|document|toHide|id|false|msie|size|opacity|span|each|style|div|hideAnim|disabled|ul|disabledClass|attr|containerClass|removeClass|remote|bind|filter|click|onShow|onHide|location|ajaxHistory|parents|min|locked|navClass|minHeight|fxShow|fxFade|end|animate|setTimeout|hideClass|spinner|documentElement|get|fxSlide|offsetHeight|unFocus|fxSpeed|safari|replace|jq|loadRemoteTab|show|msie6|disableTab|fxHide|window|hide|switchTab|innerHTML|length|loadingClass|nav|update|href|fn|hideSpeed|showSpeed|body|display|offsetWidth|scrollTo|px|behaviour|version|number|index|hashPrefix|scrollTop|scrollLeft|em|blur|container|tabTitle|enableTab|for|submit|selected|appendTo|form|triggerTab|url|width|true|onClick|tabStruct|remoteCount|extend|fxAutoHeight|block|font|fxHideSpeed|watch|fxShowSpeed|1px|setExpression|normal|sort|userAgent|navigator|test|removeExpression|MSIE|map|not|500|opera|tab|jQuery|push|activeTab|string|initialize|loading|pageYOffset|pageXOffset|such|no|8230|There|alert|load|siblings|overflow|visible|Loading|object|clientX|value|type|input|action|class|50|setInterval|hidden|visibility|absolute|position'.split('|'),0,{}))

/**
 * History/Remote - jQuery plugin for enabling history support and bookmarking
 * @requires jQuery v1.0.3
 *
 * http://stilbuero.de/jquery/history/
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Version: 0.2.3
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(2($){$.D=16 2(){4 c=\'15\';4 k=7.6;4 d=z;4 g;5.o=2(){};4 h=2(){$(\'.x-R\').1i()};$(8).K(c,h);3($.v.19){4 e,p=q;$(2(){e=$(\'<H 13="12: Z;"></H>\').E(8.U).1o(0);4 a=e.C.8;a.P();a.M();3(k&&k!=\'#\'){a.7.6=k.B(\'#\',\'\')}});5.o=2(a){k=a;4 b=e.C.8;b.P();b.M();b.7.6=a.B(\'#\',\'\')};g=2(){4 a=e.C.8;4 b=a.7.6;3(b!=k){k=b;3(b&&b!=\'#\'){$(\'a[@l$="\'+b+\'"]\').m();7.6=b}n 3(p){7.6=\'\';$(8).u(c)}}p=A}}n 3($.v.18||$.v.17){5.o=2(a){k=a};g=2(){3(7.6){3(k!=7.6){k=7.6;$(\'a[@l$="\'+k+\'"]\').m()}}n 3(k){k=\'\';$(8).u(c)}}}n 3($.v.14){4 f,r,t;$(2(){f=[];f.9=y.9;r=[]});4 j=q,p=q;t=2(a){f.G(a);r.9=0;j=q};5.o=2(a){k=a;t(k)};g=2(){4 b=y.9-f.9;3(b){j=q;3(b<0){F(4 i=0;i<11.10(b);i++)r.Y(f.X())}n{F(4 i=0;i<b;i++)f.G(r.W())}4 a=f[f.9-1];$(\'a[@l$="\'+a+\'"]\').m();k=7.6}n 3(f[f.9-1]==T&&!j){3(8.S.1n(\'#\')>=0){$(\'a[@l$="\'+\'#\'+8.S.1m(\'#\')[1]+\'"]\').m()}n 3(p){$(8).u(c)}j=A}p=A}}5.1l=2(a){3(w a==\'2\'){$(8).1k(c,h).K(c,a)}3(7.6&&w t==\'T\'){$(\'a[@l$="\'+7.6+\'"]\').u(\'m\')}3(g&&d==z){d=1j(g,1h)}}};$.Q.x=2(g,f,c){c=c||2(){};3(w f==\'2\'){c=f}f=$.1g({O:\'x-\'},f||{});4 d=$(g).1f()&&$(g)||$(\'<I></I>\').E(\'U\');d.1e(\'x-R\');L 5.1d(2(i){4 a=5.l;4 b=\'#\'+(5.N&&5.N.B(/\\s/g,\'1c\')||f.O+(i+1));5.l=b;$(5).m(2(e){3(!d[\'J\']){3(e.V){$.D.o(b)}d.1b(a,2(){d[\'J\']=z;c()})}})})};$.Q.y=2(a){L 5.m(2(e){3(e.V){$.D.o(5.6)}w a==\'2\'&&a()})}})(1a);',62,87,'||function|if|var|this|hash|location|document|length||||||||||||href|click|else|update|initialized|false|_forwardStack||_addHistory|trigger|browser|typeof|remote|history|null|true|replace|contentWindow|ajaxHistory|appendTo|for|push|iframe|div|locked|bind|return|close|title|hashPrefix|open|fn|output|URL|undefined|body|clientX|shift|pop|unshift|none|abs|Math|display|style|safari|historyReset|new|opera|mozilla|msie|jQuery|load|_|each|addClass|size|extend|200|empty|setInterval|unbind|initialize|split|indexOf|get'.split('|'),0,{}))

/* curvy corners */
var isIE=navigator.userAgent.toLowerCase().indexOf("msie")>-1;var isMoz=document.implementation&&document.implementation.createDocument;var isSafari=((navigator.userAgent.toLowerCase().indexOf("safari")!=-1)&&(navigator.userAgent.toLowerCase().indexOf("mac")!=-1))?true:false;function curvyCorners(){if(typeof(arguments[0])!="object"){throw newCurvyError("First parameter of curvyCorners() must be an object.")}if(typeof(arguments[1])!="object"&&typeof(arguments[1])!="string"){throw newCurvyError("Second parameter of curvyCorners() must be an object or a class name.")}if(typeof(arguments[1])=="string"){var G=0;var A=getElementsByClass(arguments[1])}else{var G=1;var A=arguments}var D=new Array();if(arguments[0].validTags){var F=arguments[0].validTags}else{var F=["div"]}for(var C=G,B=A.length;C<B;C++){var E=A[C].tagName.toLowerCase();if(inArray(F,E)!==false){D[D.length]=new curvyObject(arguments[0],A[C])}}this.objects=D;this.applyCornersToAll=function(){for(var H=0,I=this.objects.length;H<I;H++){this.objects[H].applyCorners()}}}function curvyObject(){this.box=arguments[1];this.settings=arguments[0];this.topContainer=null;this.bottomContainer=null;this.masterCorners=new Array();this.contentDIV=null;var G=get_style(this.box,"height","height");var D=get_style(this.box,"width","width");var A=get_style(this.box,"borderTopWidth","border-top-width");var H=get_style(this.box,"borderTopColor","border-top-color");var C=get_style(this.box,"backgroundColor","background-color");var E=get_style(this.box,"backgroundImage","background-image");var B=get_style(this.box,"position","position");var F=get_style(this.box,"paddingTop","padding-top");this.boxHeight=parseInt(((G!=""&&G!="auto"&&G.indexOf("%")==-1)?G.substring(0,G.indexOf("px")):this.box.scrollHeight));this.boxWidth=parseInt(((D!=""&&D!="auto"&&D.indexOf("%")==-1)?D.substring(0,D.indexOf("px")):this.box.scrollWidth));this.borderWidth=parseInt(((A!=""&&A.indexOf("px")!==-1)?A.slice(0,A.indexOf("px")):0));this.boxColour=format_colour(C);this.boxPadding=parseInt(((F!=""&&F.indexOf("px")!==-1)?F.slice(0,F.indexOf("px")):0));this.borderColour=format_colour(H);this.borderString=this.borderWidth+"px solid "+this.borderColour;this.backgroundImage=((E!="none")?E:"");this.boxContent=this.box.innerHTML;if(B!="absolute"){this.box.style.position="relative"}this.box.style.padding="0px";if(isIE&&D=="auto"&&G=="auto"){this.box.style.width="100%"}if(this.settings.autoPad==true&&this.boxPadding>0){this.box.innerHTML=""}this.applyCorners=function(){for(var Z=0;Z<2;Z++){switch(Z){case 0:if(this.settings.tl||this.settings.tr){var W=document.createElement("DIV");W.style.width="100%";W.style.fontSize="1px";W.style.overflow="hidden";W.style.position="absolute";W.style.paddingLeft=this.borderWidth+"px";W.style.paddingRight=this.borderWidth+"px";var R=Math.max(this.settings.tl?this.settings.tl.radius:0,this.settings.tr?this.settings.tr.radius:0);W.style.height=R+"px";W.style.top=0-R+"px";W.style.left=0-this.borderWidth+"px";this.topContainer=this.box.appendChild(W)}break;case 1:if(this.settings.bl||this.settings.br){var W=document.createElement("DIV");W.style.width="100%";W.style.fontSize="1px";W.style.overflow="hidden";W.style.position="absolute";W.style.paddingLeft=this.borderWidth+"px";W.style.paddingRight=this.borderWidth+"px";var X=Math.max(this.settings.bl?this.settings.bl.radius:0,this.settings.br?this.settings.br.radius:0);W.style.height=X+"px";W.style.bottom=0-X+"px";W.style.left=0-this.borderWidth+"px";this.bottomContainer=this.box.appendChild(W)}break}}if(this.topContainer){this.box.style.borderTopWidth="0px"}if(this.bottomContainer){this.box.style.borderBottomWidth="0px"}var d=["tr","tl","br","bl"];for(var h in d){if(h>-1<4){var c=d[h];if(!this.settings[c]){if(((c=="tr"||c=="tl")&&this.topContainer!=null)||((c=="br"||c=="bl")&&this.bottomContainer!=null)){var V=document.createElement("DIV");V.style.position="relative";V.style.fontSize="1px";V.style.overflow="hidden";if(this.backgroundImage==""){V.style.backgroundColor=this.boxColour}else{V.style.backgroundImage=this.backgroundImage}switch(c){case"tl":V.style.height=R-this.borderWidth+"px";V.style.marginRight=this.settings.tr.radius-(this.borderWidth*2)+"px";V.style.borderLeft=this.borderString;V.style.borderTop=this.borderString;V.style.left=-this.borderWidth+"px";break;case"tr":V.style.height=R-this.borderWidth+"px";V.style.marginLeft=this.settings.tl.radius-(this.borderWidth*2)+"px";V.style.borderRight=this.borderString;V.style.borderTop=this.borderString;V.style.backgroundPosition="-"+(R+this.borderWidth)+"px 0px";V.style.left=this.borderWidth+"px";break;case"bl":V.style.height=X-this.borderWidth+"px";V.style.marginRight=this.settings.br.radius-(this.borderWidth*2)+"px";V.style.borderLeft=this.borderString;V.style.borderBottom=this.borderString;V.style.left=-this.borderWidth+"px";V.style.backgroundPosition="-"+(this.borderWidth)+"px -"+(this.boxHeight+(X+this.borderWidth))+"px";break;case"br":V.style.height=X-this.borderWidth+"px";V.style.marginLeft=this.settings.bl.radius-(this.borderWidth*2)+"px";V.style.borderRight=this.borderString;V.style.borderBottom=this.borderString;V.style.left=this.borderWidth+"px";V.style.backgroundPosition="-"+(X+this.borderWidth)+"px -"+(this.boxHeight+(X+this.borderWidth))+"px";break}}}else{if(this.masterCorners[this.settings[c].radius]){var V=this.masterCorners[this.settings[c].radius].cloneNode(true)}else{var V=document.createElement("DIV");V.style.height=this.settings[c].radius+"px";V.style.width=this.settings[c].radius+"px";V.style.position="absolute";V.style.fontSize="1px";V.style.overflow="hidden";var M=parseInt(this.settings[c].radius-this.borderWidth);for(var T=0,g=this.settings[c].radius;T<g;T++){if((T+1)>=M){var O=-1}else{var O=(Math.floor(Math.sqrt(Math.pow(M,2)-Math.pow((T+1),2)))-1)}if(M!=g){if((T)>=M){var L=-1}else{var L=Math.ceil(Math.sqrt(Math.pow(M,2)-Math.pow(T,2)))}if((T+1)>=g){var J=-1}else{var J=(Math.floor(Math.sqrt(Math.pow(g,2)-Math.pow((T+1),2)))-1)}}if((T)>=g){var I=-1}else{var I=Math.ceil(Math.sqrt(Math.pow(g,2)-Math.pow(T,2)))}if(O>-1){this.drawPixel(T,0,this.boxColour,100,(O+1),V,-1,this.settings[c].radius)}if(M!=g){for(var S=(O+1);S<L;S++){if(this.settings.antiAlias){if(this.backgroundImage!=""){var K=(pixelFraction(T,S,M)*100);if(K<30){this.drawPixel(T,S,this.borderColour,100,1,V,0,this.settings[c].radius)}else{this.drawPixel(T,S,this.borderColour,100,1,V,-1,this.settings[c].radius)}}else{var b=BlendColour(this.boxColour,this.borderColour,pixelFraction(T,S,M));this.drawPixel(T,S,b,100,1,V,0,this.settings[c].radius,c)}}}if(this.settings.antiAlias){if(J>=L){if(L==-1){L=0}this.drawPixel(T,L,this.borderColour,100,(J-L+1),V,0,0)}}else{if(J>=O){this.drawPixel(T,(O+1),this.borderColour,100,(J-O),V,0,0)}}var Q=this.borderColour}else{var Q=this.boxColour;var J=O}if(this.settings.antiAlias){for(var S=(J+1);S<I;S++){this.drawPixel(T,S,Q,(pixelFraction(T,S,g)*100),1,V,((this.borderWidth>0)?0:-1),this.settings[c].radius)}}}this.masterCorners[this.settings[c].radius]=V.cloneNode(true)}if(c!="br"){for(var Z=0,f=V.childNodes.length;Z<f;Z++){var U=V.childNodes[Z];var e=parseInt(U.style.top.substring(0,U.style.top.indexOf("px")));var m=parseInt(U.style.left.substring(0,U.style.left.indexOf("px")));var o=parseInt(U.style.height.substring(0,U.style.height.indexOf("px")));if(c=="tl"||c=="bl"){U.style.left=this.settings[c].radius-m-1+"px"}if(c=="tr"||c=="tl"){U.style.top=this.settings[c].radius-o-e+"px"}switch(c){case"tr":U.style.backgroundPosition="-"+Math.abs((this.boxWidth-this.settings[c].radius+this.borderWidth)+m)+"px -"+Math.abs(this.settings[c].radius-o-e-this.borderWidth)+"px";break;case"tl":U.style.backgroundPosition="-"+Math.abs((this.settings[c].radius-m-1)-this.borderWidth)+"px -"+Math.abs(this.settings[c].radius-o-e-this.borderWidth)+"px";break;case"bl":U.style.backgroundPosition="-"+Math.abs((this.settings[c].radius-m-1)-this.borderWidth)+"px -"+Math.abs((this.boxHeight+this.settings[c].radius+e)-this.borderWidth)+"px";break}}}}if(V){switch(c){case"tl":if(V.style.position=="absolute"){V.style.top="0px"}if(V.style.position=="absolute"){V.style.left="0px"}if(this.topContainer){this.topContainer.appendChild(V)}break;case"tr":if(V.style.position=="absolute"){V.style.top="0px"}if(V.style.position=="absolute"){V.style.right="0px"}if(this.topContainer){this.topContainer.appendChild(V)}break;case"bl":if(V.style.position=="absolute"){V.style.bottom="0px"}if(V.style.position=="absolute"){V.style.left="0px"}if(this.bottomContainer){this.bottomContainer.appendChild(V)}break;case"br":if(V.style.position=="absolute"){V.style.bottom="0px"}if(V.style.position=="absolute"){V.style.right="0px"}if(this.bottomContainer){this.bottomContainer.appendChild(V)}break}}}}var Y=new Array();Y.t=Math.abs(this.settings.tl.radius-this.settings.tr.radius);Y.b=Math.abs(this.settings.bl.radius-this.settings.br.radius);for(z in Y){if(z=="t"||z=="b"){if(Y[z]){var l=((this.settings[z+"l"].radius<this.settings[z+"r"].radius)?z+"l":z+"r");var N=document.createElement("DIV");N.style.height=Y[z]+"px";N.style.width=this.settings[l].radius+"px";N.style.position="absolute";N.style.fontSize="1px";N.style.overflow="hidden";N.style.backgroundColor=this.boxColour;switch(l){case"tl":N.style.bottom="0px";N.style.left="0px";N.style.borderLeft=this.borderString;this.topContainer.appendChild(N);break;case"tr":N.style.bottom="0px";N.style.right="0px";N.style.borderRight=this.borderString;this.topContainer.appendChild(N);break;case"bl":N.style.top="0px";N.style.left="0px";N.style.borderLeft=this.borderString;this.bottomContainer.appendChild(N);break;case"br":N.style.top="0px";N.style.right="0px";N.style.borderRight=this.borderString;this.bottomContainer.appendChild(N);break}}var P=document.createElement("DIV");P.style.position="relative";P.style.fontSize="1px";P.style.overflow="hidden";P.style.backgroundColor=this.boxColour;P.style.backgroundImage=this.backgroundImage;switch(z){case"t":if(this.topContainer){if(this.settings.tl.radius&&this.settings.tr.radius){P.style.height=R-this.borderWidth+"px";P.style.marginLeft=this.settings.tl.radius-this.borderWidth+"px";P.style.marginRight=this.settings.tr.radius-this.borderWidth+"px";P.style.borderTop=this.borderString;if(this.backgroundImage!=""){P.style.backgroundPosition="-"+(R-this.borderWidth)+"px 0px"}this.topContainer.appendChild(P)}this.box.style.backgroundPosition="0px -"+(R-this.borderWidth)+"px"}break;case"b":if(this.bottomContainer){if(this.settings.bl.radius&&this.settings.br.radius){P.style.height=X-this.borderWidth+"px";P.style.marginLeft=this.settings.bl.radius-this.borderWidth+"px";P.style.marginRight=this.settings.br.radius-this.borderWidth+"px";P.style.borderBottom=this.borderString;if(this.backgroundImage!=""){P.style.backgroundPosition="-"+(X-this.borderWidth)+"px -"+(this.boxHeight+(R-this.borderWidth))+"px"}this.bottomContainer.appendChild(P)}}break}}}if(this.settings.autoPad==true&&this.boxPadding>0){var a=document.createElement("DIV");a.style.position="relative";a.innerHTML=this.boxContent;a.className="autoPadDiv";var n=Math.abs(R-this.boxPadding);var p=Math.abs(X-this.boxPadding);if(R<this.boxPadding){a.style.paddingTop=n+"px"}if(X<this.boxPadding){a.style.paddingBottom=X+"px"}a.style.paddingLeft=this.boxPadding+"px";a.style.paddingRight=this.boxPadding+"px";this.contentDIV=this.box.appendChild(a)}};this.drawPixel=function(R,O,I,N,P,Q,K,M){var J=document.createElement("DIV");J.style.height=P+"px";J.style.width="1px";J.style.position="absolute";J.style.fontSize="1px";J.style.overflow="hidden";var L=Math.max(this.settings.tr.radius,this.settings.tl.radius);if(K==-1&&this.backgroundImage!=""){J.style.backgroundImage=this.backgroundImage;J.style.backgroundPosition="-"+(this.boxWidth-(M-R)+this.borderWidth)+"px -"+((this.boxHeight+L+O)-this.borderWidth)+"px"}else{J.style.backgroundColor=I}if(N!=100){setOpacity(J,N)}J.style.top=O+"px";J.style.left=R+"px";Q.appendChild(J)}}function insertAfter(B,C,A){B.insertBefore(C,A.nextSibling)}function BlendColour(L,J,G){var D=parseInt(L.substr(1,2),16);var K=parseInt(L.substr(3,2),16);var F=parseInt(L.substr(5,2),16);var C=parseInt(J.substr(1,2),16);var I=parseInt(J.substr(3,2),16);var E=parseInt(J.substr(5,2),16);if(G>1||G<0){G=1}var H=Math.round((D*G)+(C*(1-G)));if(H>255){H=255}if(H<0){H=0}var B=Math.round((K*G)+(I*(1-G)));if(B>255){B=255}if(B<0){B=0}var A=Math.round((F*G)+(E*(1-G)));if(A>255){A=255}if(A<0){A=0}return"#"+IntToHex(H)+IntToHex(B)+IntToHex(A)}function IntToHex(A){base=A/16;rem=A%16;base=base-(rem/16);baseS=MakeHex(base);remS=MakeHex(rem);return baseS+""+remS}function MakeHex(A){if((A>=0)&&(A<=9)){return A}else{switch(A){case 10:return"A";case 11:return"B";case 12:return"C";case 13:return"D";case 14:return"E";case 15:return"F"}}}function pixelFraction(H,G,A){var C=0;var B=new Array(1);var F=new Array(1);var I=0;var D="";var E=Math.sqrt((Math.pow(A,2)-Math.pow(H,2)));if((E>=G)&&(E<(G+1))){D="Left";B[I]=0;F[I]=E-G;I=I+1}var E=Math.sqrt((Math.pow(A,2)-Math.pow(G+1,2)));if((E>=H)&&(E<(H+1))){D=D+"Top";B[I]=E-H;F[I]=1;I=I+1}var E=Math.sqrt((Math.pow(A,2)-Math.pow(H+1,2)));if((E>=G)&&(E<(G+1))){D=D+"Right";B[I]=1;F[I]=E-G;I=I+1}var E=Math.sqrt((Math.pow(A,2)-Math.pow(G,2)));if((E>=H)&&(E<(H+1))){D=D+"Bottom";B[I]=E-H;F[I]=0}switch(D){case"LeftRight":C=Math.min(F[0],F[1])+((Math.max(F[0],F[1])-Math.min(F[0],F[1]))/2);break;case"TopRight":C=1-(((1-B[0])*(1-F[1]))/2);break;case"TopBottom":C=Math.min(B[0],B[1])+((Math.max(B[0],B[1])-Math.min(B[0],B[1]))/2);break;case"LeftBottom":C=(F[0]*B[1])/2;break;default:C=1}return C}function rgb2Hex(B){try{var C=rgb2Array(B);var G=parseInt(C[0]);var E=parseInt(C[1]);var A=parseInt(C[2]);var D="#"+IntToHex(G)+IntToHex(E)+IntToHex(A)}catch(F){alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex")}return D}function rgb2Array(A){var C=A.substring(4,A.indexOf(")"));var B=C.split(", ");return B}function setOpacity(F,C){C=(C==100)?99.999:C;if(isSafari&&F.tagName!="IFRAME"){var B=rgb2Array(F.style.backgroundColor);var E=parseInt(B[0]);var D=parseInt(B[1]);var A=parseInt(B[2]);F.style.backgroundColor="rgba("+E+", "+D+", "+A+", "+C/100+")"}else{if(typeof(F.style.opacity)!="undefined"){F.style.opacity=C/100}else{if(typeof(F.style.MozOpacity)!="undefined"){F.style.MozOpacity=C/100}else{if(typeof(F.style.filter)!="undefined"){F.style.filter="alpha(opacity:"+C+")"}else{if(typeof(F.style.KHTMLOpacity)!="undefined"){F.style.KHTMLOpacity=C/100}}}}}}function inArray(C,B){for(var A=0;A<C.length;A++){if(C[A]===B){return A}}return false}function inArrayKey(B,A){for(key in B){if(key===A){return true}}return false}function addEvent(E,D,B,A){if(E.addEventListener){E.addEventListener(D,B,A);return true}else{if(E.attachEvent){var C=E.attachEvent("on"+D,B);return C}else{E["on"+D]=B}}}function removeEvent(E,D,B,A){if(E.removeEventListener){E.removeEventListener(D,B,A);return true}else{if(E.detachEvent){var C=E.detachEvent("on"+D,B);return C}else{alert("Handler could not be removed")}}}function format_colour(B){var A="#ffffff";if(B!=""&&B!="transparent"){if(B.substr(0,3)=="rgb"){A=rgb2Hex(B)}else{if(B.length==4){A="#"+B.substring(1,2)+B.substring(1,2)+B.substring(2,3)+B.substring(2,3)+B.substring(3,4)+B.substring(3,4)}else{A=B}}}return A}function get_style(obj,property,propertyNS){try{if(obj.currentStyle){var returnVal=eval("obj.currentStyle."+property)}else{if(isSafari&&obj.style.display=="none"){obj.style.display="";var wasHidden=true}var returnVal=document.defaultView.getComputedStyle(obj,"").getPropertyValue(propertyNS);if(isSafari&&wasHidden){obj.style.display="none"}}}catch(e){}return returnVal}function getElementsByClass(G,E,A){var D=new Array();if(E==null){E=document}if(A==null){A="*"}var C=E.getElementsByTagName(A);var B=C.length;var F=new RegExp("(^|s)"+G+"(s|$)");for(i=0,j=0;i<B;i++){if(F.test(C[i].className)){D[j]=C[i];j++}}return D}function newCurvyError(A){return new Error("curvyCorners Error:\n"+A)};

window.onload = function()
  {
      // var mainBoxsettingsObj = { tl: {radius: 14 }, tr: {radius: 14 }, bl: {radius: 14 }, br: {radius: 14 }, antiAlias: true, autoPad: false, validTags: ["div"] }
      var mainBoxsettingsObj = { tl: {radius: 12 }, tr: {radius: 12 }, bl: {radius: 12 }, br: {radius: 12 }, antiAlias: true, autoPad: false, validTags: ["div"] }
      var blogPicCaptionObj = { tl: {radius: 1 }, tr: {radius: 1 }, bl: {radius: 12 }, br: {radius: 12 }, antiAlias: true, autoPad: false, validTags: ["div"] }
			var videoWallObj = { tl: {radius: 1 }, tr: {radius: 15 }, bl: {radius: 15 }, br: {radius: 15 }, antiAlias: true, autoPad: false, validTags: ["div"] }
      var menuObj = { tl: {radius: 2 }, tr: {radius: 3 }, bl: {radius: 1 }, br: {radius: 1 }, antiAlias: true, autoPad: false, validTags: ["div"] }
      var egCorners = { tl: {radius: 0 }, tr: {radius: 0 }, bl: {radius: 12 }, br: {radius: 12 }, antiAlias: true, autoPad: false, validTags: ["div"] }

			var myBoxObject = new curvyCorners(mainBoxsettingsObj, "glBox");
			myBoxObject.applyCornersToAll();

			myBoxObject = new curvyCorners(mainBoxsettingsObj, "recycling");
			myBoxObject.applyCornersToAll();

			myBoxObject = new curvyCorners(mainBoxsettingsObj, "videoBox");
			myBoxObject.applyCornersToAll();

			myBoxObject = new curvyCorners(blogPicCaptionObj, "bpcBox");
			myBoxObject.applyCornersToAll();

			myBoxObject = new curvyCorners(videoWallObj, "vwBox");
			myBoxObject.applyCornersToAll();

			myBoxObject = new curvyCorners(videoWallObj, "smrHead");
			myBoxObject.applyCornersToAll();

			myBoxObject = new curvyCorners(egCorners, "egCorners");
			myBoxObject.applyCornersToAll();

			myBoxObject = new curvyCorners(mainBoxsettingsObj, "floatboxContainer");
			myBoxObject.applyCornersToAll();

// if we want to use the unique id's
// var divObj = document.getElementById("myDiv");
// var cornersObj = new curvyCorners(settings, divObj);
// var newCornersObj = new curvyCorners(settingsObj, divObj1[, divObj2[, divObj3[, . . . [, divObjN]]]]);

}

/*
** http://stackoverflow.com/users/36590/tyndall
** http://stackoverflow.com/questions/454875/how-to-do-browser-detection-with-jquery-1-3-with-browser-msie-deprecated
*/
function IsThisBrowserIE6() {
  return ((window.XMLHttpRequest == undefined) && (ActiveXObject != undefined));
}
var clear="/assets/greenerliving/layout/img/clear.gif" //path to clear.gif
if(IsThisBrowserIE6()){
  // IEv6 png fix - http://unitinteractive.com/labs/unitpngfix.php
  pngfix=function(){var els=document.getElementsByTagName('*');var ip=/\.png/i;var i=els.length;while(i-- >0){var el=els[i];var es=el.style;if(el.src&&el.src.match(ip)&&!es.filter){es.height=el.height;es.width=el.width;es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+el.src+"',sizingMethod='crop')";el.src=clear;}else{var elb=el.currentStyle.backgroundImage;if(elb.match(ip)){var path=elb.split('"');var rep=(el.currentStyle.backgroundRepeat=='no-repeat')?'crop':'scale';es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+path[1]+"',sizingMethod='"+rep+"')";es.height=el.clientHeight+'px';es.backgroundImage='none';var elkids=el.getElementsByTagName('*');if (elkids){var j=elkids.length;if(el.currentStyle.position!="absolute")es.position='static';while (j-- >0)if(!elkids[j].style.position)elkids[j].style.position="relative";}}}}}
  window.attachEvent('onload',pngfix);
}



