/////////////////////////////////////////////////////////////////////////////

/*  Scripts/plugins in here in this order
 *   1. jQuery Color Animations
 *   2. Example plugin (Search example)
 *   3. ifixpng
 *   4. Thickbox - If you need to edit it's: thickbox-compressed same dir
 *   5. Our custom from alm_jquery
 *   6. Background animations plugin
 *   7. Create Cookie
 *   8. Open/Manage Gallery
 *   9. HoverIntent
 *   10. Superfish Menu Widget
 */
 
/////////////////////////////////////////////////////////////////////////////

/* 
    Make changes to file alm_jquery_unpk.js
    Then minimize the codewith YUI compressor online: http://www.refresh-sf.com/yui/
    and paste below:
	
	a la mode jQuery code
*/
var removeTbOpenDrawer = function() { 
	tb_remove(); 
	jQuery('.open_drawer').click(); 
}
function openWin(URL) {awindow = window.open(URL,"thewindow", "width = 490, height = 404, scrollbars = no, status = no, resizable = no, menubar = no, location = no");}; $(document).ready(function(){$('select#relatedProducts').change(function(){window.location = $(this).val();});$('.chatBtn a').click(function(){ openWin( $(this).attr('href') ); return false;  });$('#rightLinks div:eq(1)').css({ width: 180+'px'});$("#freeform input").focus(function(){$(this).parent("label").addClass("highlight")}).blur(function(){$(this).parent("label").removeClass("highlight")});$("img[src$=.png").ifixpng();jQuery.fn.fadeToggle=function(a,c,b){return this.animate({opacity:"toggle"},a,c,b)};$("#phoneNum").css({cursor:"pointer"});$("#phoneNum").hover(function(){$(this).text("252-6633")},function(){$(this).text("ALAMODE")});$(".open_drawer").removeAttr("href");$(".open_drawer_body").removeAttr("href");$(".open_drawer_questions").attr({href: '#'});$(".open_drawer").click(function(){$(this).parent("li.boxParent").find(".box").fadeIn("slow");$(".open_drawer img").animate({opacity:1},1)});$(".open_drawer_body").click(function(){$(".box:not(.questions)").fadeIn("slow")});$(".open_drawer_questions").click(function(){$(".questions").fadeIn("slow")});$(".box-inner h2 a").click(function(){$(".box").fadeOut("slow")});$(".box ul").hover(function(){$(this).css({backgroundColor:"#F6F6F6"})},function(){$(this).css({backgroundColor:"#fff"})});$("img.rollover").hover(function(){var a=$(this).attr("src").replace(/^(.*?)(\.(?:gif|jpg|png))$/,"$1Ovr$2");$(this).attr("src",a)},function(){var a=$(this).attr("src").replace("Ovr","");$(this).attr("src",a)});$("#cta li img").hover(function(){$(this).animate({opacity:0.7},250)},function(){$(this).animate({opacity:1},100)})});$(function(){if($.browser.msie&&parseInt($.browser.version)<7){$("#buttons li").hover(function(){$(this).addClass("sf")},function(){$(this).not("#productSuite").removeClass("sf")})}$("ul.children").hover(function(){$(this).parent("li").find("a:first").css({backgroundColor:"#E7E7E7",color:"#444",textDecoration:"underline"}).end()},function(){$(this).parent("li").find("a:first").attr("style","")});now=new Date();hour=now.getHours();if(hour>8&&hour<18){$(".chat").show()}else{$(".chat").hide()}});


/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);


/*
 * jQuery ifixpng plugin
 * (previously known as pngfix)
 * Version 2.1  (23/04/2008)
 * @requires jQuery v1.1.3 or above
 *
 * Examples at: http://jquery.khurshid.com
 * Copyright (c) 2007 Kush M.
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
 (function(b){b.ifixpng=function(c){b.ifixpng.pixel=c};b.ifixpng.getPixel=function(){return b.ifixpng.pixel||"/images/template_support/pixel.gif"};var a={ltie7:b.browser.msie&&b.browser.version<7,filter:function(c){return"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+c+"')"}};b.fn.ifixpng=a.ltie7?function(){return this.each(function(){var c=b(this);var e=b("base").attr("href");if(e){e=e.replace(/\/[^\/]+$/,"/")}if(c.is("img")||c.is("input")){if(c.attr("src")){if(c.attr("src").match(/.*\.png([?].*)?$/i)){var d=(e&&c.attr("src").search(/^(\/|http:)/i))?e+c.attr("src"):c.attr("src");c.css({filter:a.filter(d),width:c.width(),height:c.height()}).attr({src:b.ifixpng.getPixel()}).positionFix()}}}else{var f=c.css("backgroundImage");if(f.match(/^url\(["']?(.*\.png([?].*)?)["']?\)$/i)){f=RegExp.$1;f=(e&&f.substring(0,1)!="/")?e+f:f;c.css({backgroundImage:"none",filter:a.filter(f)}).children().children().positionFix()}}})}:function(){return this};b.fn.iunfixpng=a.ltie7?function(){return this.each(function(){var c=b(this);var d=c.css("filter");if(d.match(/src=["']?(.*\.png([?].*)?)["']?/i)){d=RegExp.$1;if(c.is("img")||c.is("input")){c.attr({src:d}).css({filter:""})}else{c.css({filter:"",background:"url("+d+")"})}}})}:function(){return this};b.fn.positionFix=function(){return this.each(function(){var d=b(this);var c=d.css("position");if(c!="absolute"&&c!="relative"){d.css({position:"relative"})}})}})(jQuery);


/**
 * Cookie plugin
 *
 * 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
 *
 */


// $.cookie = function(name, value, options) { if (typeof value != 'undefined' || (name && typeof name != 'string')) { // name and value given, set cookie if (typeof name == 'string') { options = options || {}; if (value === null) { value = ''; options.expires = -1; } var expires = ''; if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { var date; if (typeof options.expires == 'number') { date = new Date(); date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); } else { date = options.expires; } expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE } // CAUTION: Needed to parenthesize options.path and options.domain // in the following expressions, otherwise they evaluate to undefined // in the packed version for some reason... var path = options.path ? '; path=' + (options.path) : ''; var domain = options.domain ? '; domain=' + (options.domain) : ''; var secure = options.secure ? '; secure' : ''; document.cookie = name + '=' + encodeURIComponent(value) + expires + path + domain + secure; } else { // `name` is really an object of multiple cookies to be set. for (var n in name) { jQuery.cookie(n, name[n], value||options); } } } else { // get cookie (or all cookies if name is not provided) var returnValue = {}; if (document.cookie) { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = jQuery.trim(cookies[i]); // Does this cookie string begin with the name we want? if (!name) { var nameLength = cookie.indexOf('='); returnValue[ cookie.substr(0, nameLength)] = decodeURIComponent(cookie.substr(nameLength+1)); } else if (cookie.substr(0, name.length + 1) == (name + '=')) { returnValue = decodeURIComponent(cookie.substr(name.length + 1)); break; } } } return returnValue; } }; 
