// ColorBox v1.3.9 - a full featured, light-weight, customizable lightbox based on jQuery 1.3
// c) 2009 Jack Moore - www.colorpowered.com - jack@colorpowered.com
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
(function(z,L){var A={transition:"elastic",speed:300,width:false,initialWidth:"600",innerWidth:false,maxWidth:false,height:false,initialHeight:"450",innerHeight:false,maxHeight:false,scalePhotos:true,scrolling:true,inline:false,html:false,iframe:false,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:true,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,loop:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,overlayClose:true,escKey:true,arrowKey:true},t="colorbox",I="cbox",K=I+"_open",e=I+"_load",J=I+"_complete",q=I+"_cleanup",Q=I+"_closed",r=z.browser.msie&&!z.support.opacity,T=r&&z.browser.version<7,P=I+"_IE6",G,U,V,d,x,m,b,F,c,O,C,i,g,l,p,M,o,H,u,W,k,h,a,s,j,y,R,w,N,B,n=I+"Element";function E(Y,X){Y=Y?' id="'+I+Y+'"':"";X=X?' style="'+X+'"':"";return z("<div"+Y+X+"/>")}function D(X,Y){Y=Y==="x"?O.width():O.height();return(typeof X==="string")?Math.round((X.match(/%/)?(Y/100)*parseInt(X,10):parseInt(X,10))):X}function v(X){X=z.isFunction(X)?X.call(s):X;return R.photo||X.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function S(){for(var X in R){if(z.isFunction(R[X])&&X.substring(0,2)!=="on"){R[X]=R[X].call(s)}}R.rel=R.rel||s.rel||"nofollow";R.href=R.href||z(s).attr("href");R.title=R.title||s.title}function f(X){s=X;R=z.extend({},z(s).data(t));S();if(R.rel!=="nofollow"){c=z("."+n).filter(function(){var Z=z(this).data(t).rel||this.rel;return(Z===R.rel)});y=c.index(s);if(y===-1){c=c.add(s);y=c.length-1}}else{c=z(s);y=0}if(!w){w=N=true;j=s;try{j.blur()}catch(Y){}z.event.trigger(K);if(R.onOpen){R.onOpen.call(s)}G.css({opacity:+R.opacity,cursor:R.overlayClose?"pointer":"auto"}).show();R.w=D(R.initialWidth,"x");R.h=D(R.initialHeight,"y");B.position(0);if(T){O.bind("resize."+P+" scroll."+P,function(){G.css({width:O.width(),height:O.height(),top:O.scrollTop(),left:O.scrollLeft()})}).trigger("scroll."+P)}}p.add(H).add(o).add(M).add(l).hide();u.html(R.close).show();B.slideshow();B.load()}B=z.fn[t]=z[t]=function(X,Z){var Y=this;if(!Y[0]&&Y.selector){return Y}X=X||{};if(Z){X.onComplete=Z}if(!Y[0]||Y.selector===undefined){Y=z("<a/>");X.open=true}Y.each(function(){z(this).data(t,z.extend({},z(this).data(t)||A,X)).addClass(n)});if(X.open){f(Y[0])}return Y};B.init=function(){O=z(L);U=E().attr({id:t,"class":r?I+"IE":""});G=E("Overlay",T?"position:absolute":"").hide();V=E("Wrapper");d=E("Content").append(C=E("LoadedContent","width:0; height:0"),g=E("LoadingOverlay").add(E("LoadingGraphic")),l=E("Title"),p=E("Current"),o=E("Next"),H=E("Previous"),M=E("Slideshow"),u=E("Close"));V.append(E().append(E("TopLeft"),x=E("TopCenter"),E("TopRight")),E().append(m=E("MiddleLeft"),d,b=E("MiddleRight")),E().append(E("BottomLeft"),F=E("BottomCenter"),E("BottomRight"))).children().children().css({"float":"left"});i=E(false,"position:absolute; width:9999px; visibility:hidden; display:none");z("body").prepend(G,U.append(V,i));d.children().hover(function(){z(this).addClass("hover")},function(){z(this).removeClass("hover")}).addClass("hover");W=x.height()+F.height()+d.outerHeight(true)-d.height();k=m.width()+b.width()+d.outerWidth(true)-d.width();h=C.outerHeight(true);a=C.outerWidth(true);U.css({"padding-bottom":W,"padding-right":k}).hide();o.click(B.next);H.click(B.prev);u.click(B.close);d.children().removeClass("hover");z("."+n).live("click",function(X){if((X.button!==0&&typeof X.button!=="undefined")||X.ctrlKey||X.shiftKey||X.altKey){return true}else{f(this);return false}});G.click(function(){if(R.overlayClose){B.close()}});z(document).bind("keydown",function(X){if(w&&R.escKey&&X.keyCode===27){X.preventDefault();B.close()}if(w&&R.arrowKey&&!N&&c[1]){if(X.keyCode===37&&(y||R.loop)){X.preventDefault();H.click()}else{if(X.keyCode===39&&(y<c.length-1||R.loop)){X.preventDefault();o.click()}}}})};B.remove=function(){U.add(G).remove();z("."+n).die("click").removeData(t).removeClass(n)};B.position=function(ab,Y){var aa,Z=Math.max(O.height()-R.h-h-W,0)/2+O.scrollTop(),X=Math.max(O.width()-R.w-a-k,0)/2+O.scrollLeft();aa=(U.width()===R.w+a&&U.height()===R.h+h)?0:ab;V[0].style.width=V[0].style.height="9999px";function ac(ad){x[0].style.width=F[0].style.width=d[0].style.width=ad.style.width;g[0].style.height=g[1].style.height=d[0].style.height=m[0].style.height=b[0].style.height=ad.style.height}U.dequeue().animate({width:R.w+a,height:R.h+h,top:Z,left:X},{duration:aa,complete:function(){ac(this);N=false;V[0].style.width=(R.w+a+k)+"px";V[0].style.height=(R.h+h+W)+"px";if(Y){Y()}},step:function(){ac(this)}})};B.resize=function(X){if(w){X=X||{};if(X.width){R.w=D(X.width,"x")-a-k}if(X.innerWidth){R.w=D(X.innerWidth,"x")}C.css({width:R.w});if(X.height){R.h=D(X.height,"y")-h-W}if(X.innerHeight){R.h=D(X.innerHeight,"y")}if(!X.innerHeight&&!X.height){var Y=C.wrapInner("<div style='overflow:auto'></div>").children();R.h=Y.height();Y.replaceWith(Y.children())}C.css({height:R.h});B.position(R.transition==="none"?0:R.speed)}};B.prep=function(aa){if(!w){return}var Z,ab=R.transition==="none"?0:R.speed;O.unbind("resize."+I);C.remove();C=E("LoadedContent").html(aa);function X(){R.w=R.w||C.width();R.w=R.mw&&R.mw<R.w?R.mw:R.w;return R.w}function ac(){R.h=R.h||C.height();R.h=R.mh&&R.mh<R.h?R.mh:R.h;return R.h}C.hide().appendTo(i.show()).css({width:X(),overflow:"visible"}).css({height:ac()}).prependTo(d);i.hide();z("#"+I+"Photo").css({cssFloat:"none"});if(T){z("select").not(U.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(q,function(){this.style.visibility="inherit"})}function Y(ag){var ai,aj,af,ae,ah=c.length,ad=R.loop;B.position(ag,function(){function ak(){if(r){U[0].style.removeAttribute("filter")}}if(!w){return}if(r){if(Z){C.fadeIn(100)}}if(R.iframe){z("<iframe frameborder=0"+(R.scrolling?"":" scrolling='no'")+(r?" allowtransparency='true'":"")+"/>").attr({src:R.href,name:new Date().getTime()}).appendTo(C)}C.show();l.show().html(R.title);if(ah>1){p.html(R.current.replace(/\{current\}/,y+1).replace(/\{total\}/,ah)).show();o[(ad||y<ah-1)?"show":"hide"]().html(R.next);H[(ad||y)?"show":"hide"]().html(R.previous);ai=y?c[y-1]:c[ah-1];af=y<ah-1?c[y+1]:c[0];if(R.slideshow){M.show();if(y===ah-1&&!ad&&U.is("."+I+"Slideshow_on")){M.click()}}if(R.preloading){ae=z(af).data(t).href||af.href;aj=z(ai).data(t).href||ai.href;if(v(ae)){z("<img/>")[0].src=ae}if(v(aj)){z("<img/>")[0].src=aj}}}g.hide();if(R.transition==="fade"){U.fadeTo(ab,1,function(){ak()})}else{ak()}O.bind("resize."+I,function(){B.position(0)});z.event.trigger(J);if(R.onComplete){R.onComplete.call(s)}})}if(R.transition==="fade"){U.fadeTo(ab,0,function(){Y(0)})}else{Y(ab)}};B.load=function(){var Z,Y,aa,X=B.prep;N=true;s=c[y];R=z.extend({},z(s).data(t));S();z.event.trigger(e);if(R.onLoad){R.onLoad.call(s)}R.h=R.height?D(R.height,"y")-h-W:R.innerHeight&&D(R.innerHeight,"y");R.w=R.width?D(R.width,"x")-a-k:R.innerWidth&&D(R.innerWidth,"x");R.mw=R.w;R.mh=R.h;if(R.maxWidth){R.mw=D(R.maxWidth,"x")-a-k;R.mw=R.w&&R.w<R.mw?R.w:R.mw}if(R.maxHeight){R.mh=D(R.maxHeight,"y")-h-W;R.mh=R.h&&R.h<R.mh?R.h:R.mh}Z=R.href;g.show();if(R.inline){E("InlineTemp").hide().insertBefore(z(Z)[0]).bind(e+" "+q,function(){z(this).replaceWith(C.children())});X(z(Z))}else{if(R.iframe){X(" ")}else{if(R.html){X(R.html)}else{if(v(Z)){Y=new Image();Y.onload=function(){var ab;Y.onload=null;Y.id=I+"Photo";z(Y).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(R.scalePhotos){aa=function(){Y.height-=Y.height*ab;Y.width-=Y.width*ab};if(R.mw&&Y.width>R.mw){ab=(Y.width-R.mw)/Y.width;aa()}if(R.mh&&Y.height>R.mh){ab=(Y.height-R.mh)/Y.height;aa()}}if(R.h){Y.style.marginTop=Math.max(R.h-Y.height,0)/2+"px"}setTimeout(function(){X(Y)},1);if(c[1]&&(y<c.length-1||R.loop)){z(Y).css({cursor:"pointer"}).click(B.next)}if(r){Y.style.msInterpolationMode="bicubic"}};Y.src=Z}else{E().appendTo(i).load(Z,function(ac,ab,ad){X(ab==="error"?"Request unsuccessful: "+ad.statusText:this)})}}}}};B.next=function(){if(!N){y=y<c.length-1?y+1:0;B.load()}};B.prev=function(){if(!N){y=y?y-1:c.length-1;B.load()}};B.slideshow=function(){var Y,X,Z=I+"Slideshow_";M.bind(Q,function(){M.unbind();clearTimeout(X);U.removeClass(Z+"off "+Z+"on")});function aa(){M.text(R.slideshowStop).bind(J,function(){X=setTimeout(B.next,R.slideshowSpeed)}).bind(e,function(){clearTimeout(X)}).one("click",function(){Y()});U.removeClass(Z+"off").addClass(Z+"on")}Y=function(){clearTimeout(X);M.text(R.slideshowStart).unbind(J+" "+e).one("click",function(){aa();X=setTimeout(B.next,R.slideshowSpeed)});U.removeClass(Z+"on").addClass(Z+"off")};if(R.slideshow&&c[1]){if(R.slideshowAuto){aa()}else{Y()}}};B.close=function(){if(w){w=false;z.event.trigger(q);if(R.onCleanup){R.onCleanup.call(s)}O.unbind("."+I+" ."+P);G.fadeTo("fast",0);U.stop().fadeTo("fast",0,function(){U.find("iframe").attr("src","about:blank");C.remove();U.add(G).css({opacity:1,cursor:"auto"}).hide();try{j.focus()}catch(X){}setTimeout(function(){z.event.trigger(Q);if(R.onClosed){R.onClosed.call(s)}},1)})}};B.element=function(){return z(s)};B.settings=A;z(B.init)}(jQuery,this));


/*
* Copyright (C) 2009 Joel Sutherland.
* Liscenced under the MIT liscense
*/
(function($){$.fn.filterable=function(settings){settings=$.extend({useHash:true,animationSpeed:1000,show:{width:'show',opacity:'show'},hide:{width:'hide',opacity:'hide'},useTags:true,tagSelector:'#portfolio-filter a',selectedTagClass:'current',allTag:'all'},settings);return $(this).each(function(){$(this).bind("filter",function(e,tagToShow){if(settings.useTags){$(settings.tagSelector).removeClass(settings.selectedTagClass);$(settings.tagSelector+'[href='+tagToShow+']').addClass(settings.selectedTagClass)}$(this).trigger("filterportfolio",[tagToShow.substr(1)])});$(this).bind("filterportfolio",function(e,classToShow){if(classToShow==settings.allTag){$(this).trigger("show")}else{$(this).trigger("show",['.'+classToShow]);$(this).trigger("hide",[':not(.'+classToShow+')'])}if(settings.useHash){location.hash='#'+classToShow}});$(this).bind("show",function(e,selectorToShow){$(this).children(selectorToShow).animate(settings.show,settings.animationSpeed)});$(this).bind("hide",function(e,selectorToHide){$(this).children(selectorToHide).animate(settings.hide,settings.animationSpeed)});if(settings.useHash){if(location.hash!='')$(this).trigger("filter",[location.hash]);else $(this).trigger("filter",['#'+settings.allTag])}if(settings.useTags){$(settings.tagSelector).click(function(){$('#portfolio-list').trigger("filter",[$(this).attr('href')]);$(settings.tagSelector).removeClass('current');$(this).addClass('current')})}})}})(jQuery);$(document).ready(function(){$('#portfolio-list').filterable()});

/* Created by jankoatwarpspeed.com Form wizard (with step links)*/
(function(a){a.fn.formToWizard=function(j){j=a.extend({submitButton:""},j);var f=this;var h=a(f).find("fieldset");var i=0;var g=h.size();var b="#"+j.submitButton;a(b).hide();a(f).before("<ul id='steps'></ul>");h.each(function(l){a(this).wrap("<div id='step"+l+"'></div>");a(this).append("<p id='step"+l+"commands'></p>");var k=a(this).find("legend").html();a("#steps").append("<li id='stepDesc"+l+"'><a href='#' id='goto"+l+"'>Step "+(l+1)+"<span>"+k+"</span></a></li>");a("#goto"+l).bind("click",function(m){a("#step"+i).hide();a("#step"+(l)).show();a(b).hide();d(l);i=l});if(l==0){e(l);d(l)}else{if(l==g-1){a("#step"+l).hide();c(l)}else{a("#step"+l).hide();c(l);e(l)}}});function c(k){var l="step"+k;a("#"+l+"commands").append("<a href='#' id='"+l+"Prev' class='prev'>< Back</a>");a("#"+l+"Prev").bind("click",function(m){a("#"+l).hide();a("#step"+(k-1)).show();a(b).hide();d(k-1);i=k-1})}function e(k){var l="step"+k;a("#"+l+"commands").append("<a href='#' id='"+l+"Next' class='next'>Next ></a>");a("#"+l+"Next").bind("click",function(m){a("#"+l).hide();a("#step"+(k+1)).show();if(k+2==g){a(b).show()}d(k+1);i=k+1})}function d(k){a("#steps li").removeClass("current");a("#stepDesc"+k).addClass("current")}}})(jQuery);

/**
 * @license 
 * jQuery Tools @VERSION / Tooltip Slide Effect
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/tooltip/slide.html
 *
 * Since: September 2009
 * Date: @DATE 
 */
(function(b){var a=b.tools.tooltip;b.extend(a.conf,{direction:"up",bounce:false,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!b.browser.msie});var c={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};a.addEffect("slide",function(d){var f=this.getConf(),g=this.getTip(),h=f.slideFade?{opacity:f.opacity}:{},e=c[f.direction]||c.up;h[e[1]]=e[0]+"="+f.slideOffset;if(f.slideFade){g.css({opacity:0})}g.show().animate(h,f.slideInSpeed,d)},function(e){var g=this.getConf(),i=g.slideOffset,h=g.slideFade?{opacity:0}:{},f=c[g.direction]||c.up;var d=""+f[0];if(g.bounce){d=d=="+"?"-":"+"}h[f[1]]=d+"="+i;this.getTip().animate(h,g.slideOutSpeed,function(){b(this).hide();e.call()})})})(jQuery);

/*
* In-Field Label jQuery Plugin
* http://fuelyourcoding.com/scripts/infield.html
*
* Copyright (c) 2009 Doug Neiner
* Dual licensed under the MIT and GPL licenses.
* Uses the same license as jQuery, see:
* http://docs.jquery.com/License
*
* @version 0.1
*/
(function($){$.InFieldLabels=function(label,field,options){var base=this;base.$label=$(label);base.$field=$(field);base.$label.data("InFieldLabels",base);base.showing=true;base.init=function(){base.options=$.extend({},$.InFieldLabels.defaultOptions,options);base.$label.css('position','absolute');var fieldPosition=base.$field.position();base.$label.css({'left':fieldPosition.left,'top':fieldPosition.top}).addClass(base.options.labelClass);if(base.$field.val()!=""){base.$label.hide();base.showing=false;};base.$field.focus(function(){base.fadeOnFocus();}).blur(function(){base.checkForEmpty(true);}).bind('keydown.infieldlabel',function(e){base.hideOnChange(e);}).change(function(e){base.checkForEmpty();}).bind('onPropertyChange',function(){base.checkForEmpty();});};base.fadeOnFocus=function(){if(base.showing){base.setOpacity(base.options.fadeOpacity);};};base.setOpacity=function(opacity){base.$label.stop().animate({opacity:opacity},base.options.fadeDuration);base.showing=(opacity>0.0);};base.checkForEmpty=function(blur){if(base.$field.val()==""){base.prepForShow();base.setOpacity(blur?1.0:base.options.fadeOpacity);}else{base.setOpacity(0.0);};};base.prepForShow=function(e){if(!base.showing){base.$label.css({opacity:0.0}).show();base.$field.bind('keydown.infieldlabel',function(e){base.hideOnChange(e);});};};base.hideOnChange=function(e){if((e.keyCode==16)||(e.keyCode==9))return;if(base.showing){base.$label.hide();base.showing=false;};base.$field.unbind('keydown.infieldlabel');};base.init();};$.InFieldLabels.defaultOptions={fadeOpacity:0.0,fadeDuration:600,labelClass:'infield'};$.fn.inFieldLabels=function(options){return this.each(function(){var for_attr=$(this).attr('for');if(!for_attr)return;var $field=$("input#"+for_attr+"[type='text'],"+"input#"+for_attr+"[type='password'],"+"textarea#"+for_attr);if($field.length==0)return;(new $.InFieldLabels(this,$field[0],options));});};})(jQuery);



/**
 * Set all passed elements to the same height as the highest element.
 * 
 * Copyright (c) 2010 Ewen Elder
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * @author: Ewen Elder <glomainn at yahoo dot co dot uk> <ewen at jainaewen dot com>
 * @version: 1.0
**/ 
(function($){$.fn.equalHeightColumns=function(e){var J,a;e=$.extend({},$.equalHeightColumns.defaults,e);a=$(this);J=e.height;$(this).each(function(){if(e.children)a=$(this).children(e.children);if(!e.height){if(e.children){a.each(function(){if($(this).height()>J)J=$(this).height()})}else{if($(this).height()>J)J=$(this).height()}}});if(e.minHeight&&J<e.minHeight)J=e.minHeight;if(e.maxHeight&&J>e.maxHeight)J=e.maxHeight;a.animate({height:J},e.speed);return $(this)};$.equalHeightColumns={version:1.0,defaults:{children:false,height:0,minHeight:0,maxHeight:0,speed:0}}})(jQuery);



//Calls
$(document).ready(function () {
    // Color box calls
    //home page forms
    $(".accent_051 a#newsit,#order").colorbox({
        transition: "elastic",
        inline: true,
        href: ".simple_overlay"
    });
    $("#cont-designer").colorbox({
        transition: "elastic",
        inline: true,
        href: ".simple_overlay_01"
    });

    //Tooltip
    $("a.tip_show[title]").tooltip({
        effect: 'slide'
    });

    //product page slides
    $("a[rel='product']").colorbox();
	
/*    //form onclick
    $('.cat_textbox_small_custom').each(function () {
        var default_value = this.value;
        $(this).focus(function () {
            if (this.value == default_value) {
                this.value = '';
            }
        });
        $(this).blur(function () {
            if (this.value == '') {
                this.value = default_value;
            }
        });
    });*/
	//form wizard
    $("#SignupForm").formToWizard({
        submitButton: 'SaveAccount'
    })
	//3 columns
    $('#column_01, #column_02, #column_03').equalHeightColumns();


    //Stop autocomplete and stay xhtml valid
    if (document.getElementsByTagName) {
        var inputElements = document.getElementsByTagName("input");
        for (i = 0; inputElements[i]; i++) {
            if (inputElements[i].className && (inputElements[i].className.indexOf("auto") != -1)) {
                inputElements[i].setAttribute("autocomplete", "off");
            } //if current input element has the disableAutoComplete class set.
        } //loop thru input elements
    } //basic DOM-happiness-check
    //form labels						
    $("#catemaillistform37205 label").inFieldLabels();


//End of doc ready
});

function jqsub() {
	$('l#enter').slideDown(200);
    $('label#name_error').fadeOut(200);
    var name = $("input#CLFullName").val();
    if (name == "") {
        $("#enter").slideDown(450);
		$("label#name_error").fadeIn(850);
        $("input#CLFullName").focus();
        return false;
    }

    var $head = $('#newsletter');
    var $fields = $('#form_holdit');
    var $form = $('#catemaillistform37205'); // set your form ID
    var $messagebox = $('#message'); // set your message box ID
    var $successmessage = "&nbsp;"; // replace with your own success message in HTML format
    var $errormessage = "<h3>Error - Please Try Again</h3>"; // replace with your own error message in HTML format
    $.ajax({
        type: 'POST',
        url: $form.attr('action'),
        data: $form.serialize(),
        success: function (msg) {
            $messagebox.append($successmessage);
            $head.fadeOut(150);
            $messagebox.delay(1600).slideDown(1200).fadeIn(1250);
            $fields.fadeOut(150);
            $form.slideUp(1500);
        }

    });
}

