/* navigation.js */ function initMenu() { var nodes = document.getElementById("menu-navigation").getElementsByTagName("li"); for (var i = 0; i < nodes.length; i++) { nodes[i].onmouseover = function() { this.className += " hover"; } nodes[i].onmouseout = function() { this.className = this.className.replace(" hover", ""); } } } if (document.all && !window.opera) attachEvent("onload", initMenu); /*Accordion*/ function accordion() { var _holdName = '.subnav' var _hold = $(_holdName); var _animSpeed = 500; var _actClass = 'active'; var _collapsible = true; _hold.each(function() { var _this = $(this); _this.find('li').each(function() { if (!$(this).hasClass(_actClass)) { $(this).find('ul:eq(0)').hide(); } }) var _link = $('a', _this); _link.click(function() { var _thisParent = $(this).parents('li:eq(0)'); var _ul = _thisParent.children('ul:eq(0)'); var _ind = _link.index($(this)); if (_ul.length) { if (_ul.is(':hidden')) { collapse(_this, _ind, function() { _this.find('a:eq(' + _ind + ')').parents('li:eq(0)').children('ul:eq(0)').slideDown(_animSpeed, function() { _this.find('a:eq(' + _ind + ')').parents('li:eq(0)').addClass(_actClass); }); }) } else { if (_collapsible) { _ul.slideUp(_animSpeed, function() { _thisParent.removeClass(_actClass); }); } else { return false; } } return false; } }) }) function collapse(obj, _index, func) { var _thislink = obj.find('a:eq(' + _index + ')'); var _li = obj.find('>li'); _thislink.Parent = _thislink.parents('li:eq(0)'); _thislink.Parent.ul = _thislink.Parent.children('ul:eq(0)'); _thislink.actIndex = _li.index(_thislink.parents(_holdName + '>li')); if (_li.index(_li.filter('.' + _actClass)) != _thislink.actIndex) { _li.eq(_li.index(_li.filter('.' + _actClass))).find('ul:eq(0)').slideUp(_animSpeed, function() { _li.eq(_li.index(_li.filter('.' + _actClass))).find('ul').hide(); _li.eq(_li.index(_li.filter('.' + _actClass))).find('li').removeClass(_actClass); _li.eq(_li.index(_li.filter('.' + _actClass))).removeClass(_actClass); }); } function applyThis(func, obj) { if (typeof func == "function") { func.apply(obj); } } return applyThis(func, obj); } } $(document).ready(function() { accordion(); }) /* swfobject_modified.js */ /*! SWFObject v2.0 Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis This software is released under the MIT License */ 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 = [], timer = null, storedAltContent = null, storedAltContentId = null, isDomLoaded = false, isExpressInstallActive = true; /* Centralized function for browser feature detection - Proprietary feature detection (conditional compiling) is used to detect Internet Explorer's features - User agent string detection is only used when no alternative is possible - Is executed directly for optimal performance */ var ua = function() { var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF && typeof doc.appendChild != UNDEF && typeof doc.replaceChild != UNDEF && typeof doc.removeChild != UNDEF && typeof doc.cloneNode != 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) { 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"; // Introduced in fp6.0.47 } catch(e) { if (playerVersion[0] == 6) { fp6Crash = true; } } if (!fp6Crash) { try { a = new ActiveXObject(SHOCKWAVE_FLASH_AX); } catch(e) {} } } if (!fp6Crash && a) { // a will return null when ActiveX is disabled try { d = a.GetVariable("$version"); // Will crash fp6.0.21/23/29 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, // returns either the webkit version or false if not webkit ie = false, windows = p ? /win/.test(p) : /win/.test(u), mac = p ? /mac/.test(p) : /mac/.test(u); /*@cc_on ie = true; @if (@_win32) windows = true; @elif (@_mac) mac = true; @end @*/ return { w3cdom:w3cdom, pv:playerVersion, webkit:webkit, ie:ie, win:windows, mac:mac }; }(); /* Cross-browser onDomLoad - Based on Dean Edwards' solution: http://dean.edwards.name/weblog/2006/06/again/ - Will fire an event as soon as the DOM of a page is loaded (supported by Gecko based browsers - like Firefox -, IE, Opera9+, Safari) */ var onDomLoad = function() { if (!ua.w3cdom) { return; } addDomLoadEvent(main); if (ua.ie && ua.win) { try { // Avoid a possible Operation Aborted error doc.write(""); // String is split into pieces to avoid Norton AV to add code that can cause errors var s = getElementById("__ie_ondomload"); if (s) { s.onreadystatechange = function() { if (this.readyState == "complete") { this.parentNode.removeChild(this); callDomLoadFunctions(); } }; } } 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 callDomLoadFunctions() { if (isDomLoaded) { return; } if (ua.ie && ua.win) { // Test if we can really add elements to the DOM; we don't want to fire it too early var s = createElement("span"); try { // Avoid a possible Operation Aborted error 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; // Array.push() is only available in IE5.5+ } } /* Cross-browser onload - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/ - Will fire an event as soon as a web page including all of its assets are loaded */ 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) { win.attachEvent("onload", fn); } else if (typeof win.onload == "function") { var fnOld = win.onload; win.onload = function() { fnOld(); fn(); }; } else { win.onload = fn; } } /* Main function - Will preferably execute onDomLoad, otherwise onload (as a fallback) */ function main() { // Static publishing only var rl = regObjArr.length; for (var i = 0; i < rl; i++) { // For each registered object element 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)) { // Flash plug-in version >= Flash content version: Houston, we have a match! if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements fixParams(obj); } setVisibility(id, true); } else if (regObjArr[i].expressInstall && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) { // Show the Adobe Express Install dialog if set by the web page author and if supported (fp6.0.65+ on Win/Mac OS only) showExpressInstall(regObjArr[i]); } else { // Flash plug-in and Flash content version mismatch: display alternative content instead of Flash content displayAltContent(obj); } } } else { // If no fp is installed, we let the object element do its job (show alternative content) setVisibility(id, true); } } } /* Fix nested param elements, which are ignored by older webkit engines - This includes Safari up to and including version 1.2.2 on Mac OS 10.3 - Fall back to the proprietary embed element */ 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.toLowerCase() == "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.toLowerCase() == "param") { e.setAttribute(c[j].getAttribute("name"), c[j].getAttribute("value")); } } } obj.parentNode.replaceChild(e, obj); } } /* Fix hanging audio/video threads and force open sockets and NetConnections to disconnect - Occurs when unloading a web page in IE using fp8+ and innerHTML/outerHTML - Dynamic publishing only */ function fixObjectLeaks(id) { if (ua.ie && ua.win && hasPlayerVersion("8.0.0")) { win.attachEvent("onunload", function () { var obj = getElementById(id); if (obj) { for (var i in obj) { if (typeof obj[i] == "function") { obj[i] = function() {}; } } obj.parentNode.removeChild(obj); } }); } } /* Show the Adobe Express Install dialog - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 */ 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); // Insert placeholder div that will be replaced by the object element that loads expressinstall.swf obj.style.display = "none"; win.attachEvent("onload", function() { obj.parentNode.removeChild(obj); }); } createSWF({ data:regObj.expressInstall, id:EXPRESS_INSTALL_ID, width:regObj.width, height:regObj.height }, { flashvars:fv }, replaceId); } } /* Functions to abstract and display alternative content */ function displayAltContent(obj) { if (ua.ie && ua.win && obj.readyState != 4) { var el = createElement("div"); obj.parentNode.insertBefore(el, obj); // Insert placeholder div that will be replaced by the alternative content el.parentNode.replaceChild(abstractAltContent(obj), el); obj.style.display = "none"; win.attachEvent("onload", function() { obj.parentNode.removeChild(obj); }); } 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.toLowerCase() == "param") && !(c[i].nodeType == 8)) { ac.appendChild(c[i].cloneNode(true)); } } } } } return ac; } /* Cross-browser dynamic SWF creation */ function createSWF(attObj, parObj, id) { var r, el = getElementById(id); if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content attObj.id = id; } if (ua.ie && ua.win) { // IE, the object element and W3C DOM methods do not combine: fall back to outerHTML var att = ""; for (var i in attObj) { if (attObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries, like Object.prototype.toJSONString = function() {} if (i == "data") { parObj.movie = attObj[i]; } else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword att += ' class="' + attObj[i] + '"'; } else if (i != "classid") { att += ' ' + i + '="' + attObj[i] + '"'; } } } var par = ""; for (var j in parObj) { if (parObj[j] != Object.prototype[j]) { // Filter out prototype additions from other potential libraries par += ''; } } el.outerHTML = '' + par + ''; fixObjectLeaks(attObj.id); // This bug affects dynamic publishing only r = getElementById(attObj.id); } else if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements: fall back to the proprietary embed element var e = createElement("embed"); e.setAttribute("type", FLASH_MIME_TYPE); for (var k in attObj) { if (attObj[k] != Object.prototype[k]) { // Filter out prototype additions from other potential libraries if (k == "data") { e.setAttribute("src", attObj[k]); } else if (k.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword e.setAttribute("class", attObj[k]); } else if (k != "classid") { // Filter out IE specific attribute e.setAttribute(k, attObj[k]); } } } for (var l in parObj) { if (parObj[l] != Object.prototype[l]) { // Filter out prototype additions from other potential libraries if (l != "movie") { // Filter out IE specific param element e.setAttribute(l, parObj[l]); } } } el.parentNode.replaceChild(e, el); r = e; } else { // Well-behaving browsers var o = createElement(OBJECT); o.setAttribute("type", FLASH_MIME_TYPE); for (var m in attObj) { if (attObj[m] != Object.prototype[m]) { // Filter out prototype additions from other potential libraries if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword o.setAttribute("class", attObj[m]); } else if (m != "classid") { // Filter out IE specific attribute o.setAttribute(m, attObj[m]); } } } for (var n in parObj) { if (parObj[n] != Object.prototype[n] && n != "movie") { // Filter out prototype additions from other potential libraries and IE specific param element 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 getElementById(id) { return doc.getElementById(id); } function createElement(el) { return doc.createElement(el); } function hasPlayerVersion(rv) { var pv = ua.pv, v = rv.split("."); v[0] = parseInt(v[0], 10); v[1] = parseInt(v[1], 10); v[2] = parseInt(v[2], 10); 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; } /* Cross-browser dynamic CSS creation - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php */ 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).style.visibility = v; } else { createCSS("#" + id, "visibility:" + v); } } function getTargetVersion(obj) { if (!obj) return 0; var c = obj.childNodes; var cl = c.length; for (var i = 0; i < cl; i++) { if (c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "object") { c = c[i].childNodes; cl = c.length; i = 0; } if (c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "param" && c[i].getAttribute("name") == "swfversion") { return c[i].getAttribute("value"); } } return 0; } function getExpressInstall(obj) { if (!obj) return ""; var c = obj.childNodes; var cl = c.length; for (var i = 0; i < cl; i++) { if (c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "object") { c = c[i].childNodes; cl = c.length; i = 0; } if (c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "param" && c[i].getAttribute("name") == "expressinstall") { return c[i].getAttribute("value"); } } return ""; } return { /* Public API - Reference: http://code.google.com/p/swfobject/wiki/SWFObject_2_0_documentation */ registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr) { if (!ua.w3cdom || !objectIdStr) { return; } var obj = document.getElementById(objectIdStr); var xi = getExpressInstall(obj); var regObj = {}; regObj.id = objectIdStr; regObj.swfVersion = swfVersionStr ? swfVersionStr : getTargetVersion(obj); regObj.expressInstall = xiSwfUrlStr ? xiSwfUrlStr : ((xi != "") ? xi : false); regObjArr[regObjArr.length] = regObj; setVisibility(objectIdStr, false); }, getObjectById: function(objectIdStr) { var r = null; if (ua.w3cdom && isDomLoaded) { 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 += ""; // Auto-convert to string to make it idiot proof heightStr += ""; if (hasPlayerVersion(swfVersionStr)) { setVisibility(replaceElemIdStr, false); var att = (typeof attObj == OBJECT) ? attObj : {}; att.data = swfUrlStr; att.width = widthStr; att.height = heightStr; var par = (typeof parObj == OBJECT) ? parObj : {}; if (typeof flashvarsObj == OBJECT) { for (var i in flashvarsObj) { if (flashvarsObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries if (typeof par.flashvars != UNDEF) { par.flashvars += "&" + i + "=" + flashvarsObj[i]; } else { par.flashvars = i + "=" + flashvarsObj[i]; } } } } 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)) { setVisibility(replaceElemIdStr, false); addDomLoadEvent(function() { var regObj = {}; regObj.id = regObj.altContentId = replaceElemIdStr; regObj.width = widthStr; regObj.height = heightStr; regObj.expressInstall = xiSwfUrlStr; showExpressInstall(regObj); }); } else { divContent = document.getElementById(replaceElemIdStr); divContent.innerHTML = "we have detected that you do not have the latest Adobe Flash Player installed. Please Click here to download the Flash plugin."; } }, 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 && isDomLoaded) { return createSWF(attObj, parObj, replaceElemIdStr); } else { return undefined; } }, 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 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 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; } } } }; }(); /* TargetSelector.js */ function SetContextTarget(selectedTarget, reload) { $.ajax({ type: "POST", url: "http://www.generalpaint.com/Services/TargetSelector", data: "action=TargetSelection&value=" + selectedTarget, success: function(data) { createCookie('target', selectedTarget, 365) if (reload==1) { window.location = "/"; } } }); } function getCurrentTarget() { var c = readCookie('target'); if (c) return c; else return ''; return null; } function createCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else var expires = ""; document.cookie = name + "=" + value + expires + "; path=/"; } function readCookie(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; } function eraseCookie(name) { createCookie(name, "", -1); } /* gallery */ $(document).ready(function() { var auto_slide = 0; var hover_pause = 1; var key_slide = 0; var auto_slide_seconds = 6000; /* IMPORTANT: i know the variable is called ...seconds but it's in milliseconds ( multiplied with 1000) '*/ if ($('#wp_ul').children().size() > 4) { $('#arrow_back').css({ 'display': 'inline' }); $('#arrow_forward').css({ 'display': 'inline' }); auto_slide = 1; /*move he last list item before the first item. The purpose of this is if the user clicks to slide left he will be able to see the last item.*/ $('#wp_ul li:first').before($('#wp_ul li:last')); if (auto_slide == 1) { /*set the interval (loop) to call function slide with option 'right' and set the interval time to the variable we declared previously */ var timer = setInterval('slide("right")', auto_slide_seconds); /*and change the value of our hidden field that hold info about the interval, setting it to the number of milliseconds we declared previously*/ $('#hidden_auto_slide_seconds').val(auto_slide_seconds); } if (hover_pause == 1) { $('#wp_ul').hover(function() { clearInterval(timer) }, function() { timer = setInterval('slide("right")', auto_slide_seconds); }); $('.wp_back').hover(function() { clearInterval(timer) }, function() { timer = setInterval('slide("right")', auto_slide_seconds); }); $('.wp_forward').hover(function() { clearInterval(); }, function() { timer = setInterval('slide("right")', auto_slide_seconds); }); } if (key_slide == 1) { $(document).bind('keypress', function(e) { if (e.keyCode == 37) { slide('left'); } else if (e.keyCode == 39) { slide('right'); } }); } } }); function slide(where) { var item_width = $('#wp_ul li').outerWidth(); /* using a if statement and the where variable check we will check where the user wants to slide (left or right)*/ if (where == 'left') { var left_indent = parseInt($('#wp_ul').css('left')) + item_width; } else { var left_indent = parseInt($('#wp_ul').css('left')) - item_width; } $('#wp_ul:not(:animated)').animate({ 'left': left_indent }, 800, function() { /* when the animation finishes use the if statement again, and make an ilussion of infinity by changing place of last or first item*/ if (where == 'left') { $('#wp_ul li:first').before($('#wp_ul li:last')); } else { $('#wp_ul li:last').after($('#wp_ul li:first')); } $('#wp_ul').css({ 'left': '0px' }); }); } /* ready.js */ $(document).ready(function() { $(".box").each( function(i) { var box = this; $("a:first", this).bind("click", function() { if (jQuery(box).attr("class") == "box") { var height = jQuery(box).height(); jQuery(box).attr("size", height); jQuery(box).removeClass("box"); jQuery(box).addClass("box"); jQuery(box).addClass("toggle"); size = "28px"; $(box).animate({ height: size }, { queue: false, duration: "normal" }); $("h3", box).css({ 'background': '#e0e0e0 url(http://www.generalpaint.com/Content/Common/Html/Images/sep-sidebar.gif) no-repeat 220px 50%' }); } else { size = jQuery(box).attr("size"); $(box).animate({ height: size }, { queue: false, duration: "normal" }); jQuery(box).removeClass("toggle"); $("h3", box).css({ 'background': '#e0e0e0 url(http://www.generalpaint.com/Content/Common/Html/Images/sep-sidebar-down.gif) no-repeat 220px 50%' }); } return false; } ); } ) $("#txtSearch").focus(function() { this.value = ''; }); $('#RegisterStep2').css({ 'display': 'none' }); $('#ProfileStep2').css({ 'display': 'none' }); if ($('#showerror').val() == '1') ShowLogInError(); }); $(window).load(function() { $('.storelocator-drop').css({ 'display': 'block' }); jQuery("#mainCarousel").jcarousel({ scroll: 1, initCallback: mycarousel_initCallback, buttonNextHTML: null, buttonPrevHTML: null }); closeTab("storelocator"); }) function mycarousel_initCallback(carousel) { $('.storeList img').bind('click', function() { carousel.scroll(jQuery.jcarousel.intval(jQuery(this).attr("name"))); }); }; function openurl(url, windowname, popH, popW) { var w = 800, h = 600; if (document.all || document.layers) { w = screen.availWidth; h = screen.availHeight; } if (popH == 0 && popW == 0) { popW = screen.availWidth; popH = screen.availHeight; } var leftPos = (w - popW) / 2, topPos = (h - popH) / 2; wOpen = window.open(url, windowname, 'location=no,resizable=no,alwaysraised,width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos); } function openexternallink(url) { var w = 800, h = 600, popH = 0, popW = 0; if (document.all || document.layers) { w = screen.availWidth; h = screen.availHeight; } if (popH == 0 && popW == 0) { popW = screen.availWidth; popH = screen.availHeight; } var leftPos = (w - popW) / 2, topPos = (h - popH) / 2; window.open(url, 'link', 'width='+popW+',height='+popH+',top='+topPos+',left='+leftPos); } function ShowLogInError() { ensure({ js: 'http://www.generalpaint.com/Content/GeneralPaint/Html/Scripts/tabs.js' }, function() { openTab('membership'); }); } function LogOut() { $.getJSON("http://www.generalpaint.com/Services/Membership", { action: "LogOut" }, function(data) { var result = eval(data); if (result.logout == 'ok') { window.location.href = '/home'; } }); } /* ContentSearcher.js */ function SearchContent() { var word = document.getElementById("txtSearch").value; if (word != "Search: " && word != "") { $('#SearcherFound').html(""); openTab("searcher"); $('#loading').css({ 'display': 'block' }); $.ajax({ url: "http://www.generalpaint.com/Services/ContentService", data: "action=searchContent&word=" + word, type: "GET", dataType: "json", success: function(data) { var result = eval(data); $('#SearcherFound').html(data.content); $('.divScrollSearcher > div:odd').addClass('searcher-found'); $('.divScrollSearcher > div:odd').removeClass('even'); $('.divScrollSearcher > div:even').addClass('searcher-foundGrey'); $('#loading').hide('slow'); }, error: function() { $('#SearcherFound').html(""); $('.divScrollSearcher > div:odd').addClass('searcher-found'); $('.divScrollSearcher > div:odd').removeClass('even'); $('.divScrollSearcher > div:even').addClass('searcher-foundGrey'); $('#loading').hide('slow'); } }); } } function wipeTextbox() { $('#txtSearch').val(""); } function initializeTextbox() { var a = document.getElementById("txtSearch").value; if (a == "") { $('#txtSearch').val("Search: "); } } function openTab(tab) { closeTab('contactus'); closeTab('membership'); closeTab('storelocator'); closeTab('searcher'); $('.' + tab + '-drop').css({ 'display': 'block' }); } function closeTab(tab) { $('.' + tab + '-drop').css({ 'display': 'none' }); } /* tools.js */ function OpenTool(name) { var caracteristicas = "height=750,width=950,scrollTo,top=0,left=0,resizable=1,scrollbars=0,location=0"; switch (name) { case "VD": window.open("http://www.colorlifesystem.com/ColorLife/default.aspx?CompanyName=PPI&tool=vd", 'Popup', caracteristicas); break; case "CF": window.open("/Tools/Cenefas/default.aspx", 'Popup', caracteristicas); break; case "CS": window.open("/Tools/ColorDay/ColorCatalogue.aspx", 'Popup', caracteristicas); break; case "MC": window.open("/Tools/MaterialCalculator/default.aspx", 'Popup', caracteristicas); break; case "PL": window.open("/Tools/Plugins/default.aspx", 'Popup', caracteristicas); break; case "IR": window.open("/files/flash/InteractiveRack/default.aspx", 'Popup', caracteristicas); break; } } function openToolPage(name) { var caracteristicas = "height=700,width=800,scrollTo,resizable=1,scrollbars=0,location=0"; window.open(this.href, 'Popup', caracteristicas); window.location.replace("/Tools/VirtualDecorator/default.aspx") } function getParameterByName(name) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regexS = "[\\?&]" + name + "=([^&#]*)"; var regex = new RegExp(regexS); var results = regex.exec(window.location.href); if (results == null) return ""; else return results[1]; } /* Ensure.js */ /* Script: Ensure.js Ensure library A tiny javascript library that provides a handy function "ensure" which allows you to load Javascript, HTML, CSS on-demand and then execute your code. Ensure ensures that relevent Javascript and HTML snippets are already in the browser DOM before executing your code that uses them. To download last version of this script use this link: Version: 1.0 - Initial release Compatibility: FireFox - Version 2 and 3 Internet Explorer - Version 6 and 7 Opera - 9 (probably 8 too) Safari - Version 2 and 3 Konqueror - Version 3 or greater Dependencies: Credits: - Global Javascript execution - Author: Omar AL Zabir - http://msmvps.com/blogs/omar License: >Copyright (C) 2008 Omar AL Zabir - http://msmvps.com/blogs/omar > >Permission is hereby granted, free of charge, >to any person obtaining a copy of this software and associated >documentation files (the "Software"), >to deal in the Software without restriction, >including without limitation the rights to use, copy, modify, merge, >publish, distribute, sublicense, and/or sell copies of the Software, >and to permit persons to whom the Software is furnished to do so, >subject to the following conditions: > >The above copyright notice and this permission notice shall be included >in all copies or substantial portions of the Software. > >THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, >INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, >FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. >IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, >DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, >ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE >OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ (function(){ window.ensure = function( data, callback, scope ) { if( typeof jQuery == "undefined" && typeof Sys == "undefined" && typeof Prototype == "undefined" ) return alert("jQuery, Microsoft ASP.NET AJAX or Prototype library not found. One must be present for ensure to work"); if( typeof data.test != "undefined" ) { var test = function() { return data.test }; if( typeof data.test == "string" ) { test = function() { return !(eval( "typeof " + data.test ) == "undefined" && document.getElementById(data.test) == null); } } else if( typeof data.test == "function" ) { test = data.test; } if( test() === false || typeof test() == "undefined" || test() == null ) new ensureExecutor(data, callback, scope); else callback(); } else { new ensureExecutor(data, callback, scope); } } window.ensureExecutor = function(data, callback, scope) { this.data = this.clone(data); this.callback = (typeof scope == "undefined" || null == scope ? callback : this.delegate(callback, scope)); this.loadStack = []; if( data.js && data.js.constructor != Array ) this.data.js = [data.js]; if( data.html && data.html.constructor != Array ) this.data.html = [data.html]; if( data.css && data.css.constructor != Array ) this.data.css = [data.css]; if( typeof data.js == "undefined" ) this.data.js = []; if( typeof data.html == "undefined" ) this.data.html = []; if( typeof data.css == "undefined" ) this.data.css = []; this.init(); this.load(); } window.ensureExecutor.prototype = { init : function() { if( typeof jQuery != "undefined" ) { this.getJS = HttpLibrary.loadJavascript_jQuery; this.httpGet = HttpLibrary.httpGet_jQuery; } else if( typeof Prototype != "undefined" ) { this.getJS = HttpLibrary.loadJavascript_Prototype; this.httpGet = HttpLibrary.httpGet_Prototype; } else if( typeof Sys != "undefined" ) { this.getJS = HttpLibrary.loadJavascript_MSAJAX; this.httpGet = HttpLibrary.httpGet_MSAJAX; } else { throw "jQuery, Prototype or MS AJAX framework not found"; } }, getJS : function(data) { }, httpGet : function(url, callback) { }, load : function() { this.loadJavascripts( this.delegate( function() { this.loadCSS( this.delegate( function() { this.loadHtml( this.delegate( function() { this.callback() } ) ) } ) ) } ) ); }, loadJavascripts : function(complete) { var scriptsToLoad = this.data.js.length; if( 0 === scriptsToLoad ) return complete(); this.forEach(this.data.js, function(href) { if( HttpLibrary.isUrlLoaded(href) || this.isTagLoaded('script', 'src', href) ) { scriptsToLoad --; } else { this.getJS({ url: href, success: this.delegate(function(content) { scriptsToLoad --; HttpLibrary.registerUrl(href); }), error: this.delegate(function(msg) { scriptsToLoad --; if(typeof this.data.error == "function") this.data.error(href, msg); }) }); } }); this.until({ test: function() { return scriptsToLoad === 0; }, delay: 50, callback: this.delegate(function() { complete(); }) }); }, loadCSS : function(complete) { if( 0 === this.data.css.length ) return complete(); var head = HttpLibrary.getHead(); this.forEach(this.data.css, function(href) { if( HttpLibrary.isUrlLoaded(href) || this.isTagLoaded('link', 'href', href) ) { } else { var self = this; try { (function(href, head) { var link = document.createElement('link'); link.setAttribute("href", href); link.setAttribute("rel", "Stylesheet"); link.setAttribute("type", "text/css"); head.appendChild(link); HttpLibrary.registerUrl(href); }).apply(window, [href, head]); } catch(e) { if(typeof self.data.error == "function") self.data.error(href, e.message); } } }); complete(); }, loadHtml : function(complete) { var htmlToDownload = this.data.html.length; if( 0 === htmlToDownload ) return complete(); this.forEach(this.data.html, function(href) { if( HttpLibrary.isUrlLoaded(href) ) { htmlToDownload --; } else { this.httpGet({ url: href, success: this.delegate(function(content) { htmlToDownload --; HttpLibrary.registerUrl(href); var parent = (this.data.parent || document.body.appendChild(document.createElement("div"))); if( typeof parent == "string" ) parent = document.getElementById(parent); parent.innerHTML = content; }), error: this.delegate(function(msg) { htmlToDownload --; if(typeof this.data.error == "function") this.data.error(href, msg); }) }); } }); this.until({ test: function() { return htmlToDownload === 0; }, delay: 50, callback: this.delegate(function() { complete(); }) }); }, clone : function(obj) { var cloned = {}; for( var p in obj ) { var x = obj[p]; if( typeof x == "object" ) { if( x.constructor == Array ) { var a = []; for( var i = 0; i < x.length; i ++ ) a.push(x[i]); cloned[p] = a; } else { cloned[p] = this.clone(x); } } else cloned[p] = x; } return cloned; }, forEach : function(arr, callback) { var self = this; for( var i = 0; i < arr.length; i ++ ) callback.apply(self, [arr[i]]); }, delegate : function( func, obj ) { var context = obj || this; return function() { func.apply(context, arguments); } }, until : function(o /* o = { test: function(){...}, delay:100, callback: function(){...} } */) { if( o.test() === true ) o.callback(); else window.setTimeout( this.delegate( function() { this.until(o); } ), o.delay || 50); }, isTagLoaded : function(tagName, attName, value) { var tag = document.createElement(tagName); tag[attName] = value; var tagFound = false; var tags = document.getElementsByTagName(tagName); this.forEach(tags, function(t) { if( tag[attName] === t[attName] ) { tagFound = true; return false } }); return tagFound; } } var userAgent = navigator.userAgent.toLowerCase(); var HttpLibrary = { browser : { version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1], safari: /webkit/.test( userAgent ), opera: /opera/.test( userAgent ), msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) }, loadedUrls : {}, isUrlLoaded : function(url) { return HttpLibrary.loadedUrls[url] === true; }, unregisterUrl : function(url) { HttpLibrary.loadedUrls[url] = false; }, registerUrl : function(url) { HttpLibrary.loadedUrls[url] = true; }, createScriptTag : function(url, success, error) { var scriptTag = document.createElement("script"); scriptTag.setAttribute("type", "text/javascript"); scriptTag.setAttribute("src", url); scriptTag.onload = scriptTag.onreadystatechange = function() { if ( (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") ) { success(); } }; scriptTag.onerror = function() { error(data.url + " failed to load"); }; var head = HttpLibrary.getHead(); head.appendChild(scriptTag); }, getHead : function() { return document.getElementsByTagName("head")[0] || document.documentElement }, globalEval : function(data) { var script = document.createElement("script"); script.type = "text/javascript"; if ( HttpLibrary.browser.msie ) script.text = data; else script.appendChild( document.createTextNode( data ) ); var head = HttpLibrary.getHead(); head.appendChild( script ); }, loadJavascript_jQuery : function(data) { if( HttpLibrary.browser.safari ) { return jQuery.ajax({ type: "GET", url: data.url, data: null, success: function(content) { HttpLibrary.globalEval(content); data.success(); }, error: function(xml, status, e) { if( xml && xml.responseText ) data.error(xml.responseText); else data.error(url +'\n' + e.message); }, dataType: "html" }); } else { HttpLibrary.createScriptTag(data.url, data.success, data.error); } }, loadJavascript_MSAJAX : function(data) { if( HttpLibrary.browser.safari ) { var params = { url: data.url, success: function(content) { HttpLibrary.globalEval(content); data.success(content); }, error : data.error }; HttpLibrary.httpGet_MSAJAX(params); } else { HttpLibrary.createScriptTag(data.url, data.success, data.error); } }, loadJavascript_Prototype : function(data) { if( HttpLibrary.browser.safari ) { var params = { url: data.url, success: function(content) { HttpLibrary.globalEval(content); data.success(content); }, error : data.error }; HttpLibrary.httpGet_Prototype(params); } else { HttpLibrary.createScriptTag(data.url, data.success, data.error); } }, httpGet_jQuery : function(data) { return jQuery.ajax({ type: "GET", url: data.url, data: null, success: data.success, error: function(xml, status, e) { if( xml && xml.responseText ) data.error(xml.responseText); else data.error("Error occured while loading: " + url +'\n' + e.message); }, dataType: data.type || "html" }); }, httpGet_MSAJAX : function(data) { var _wRequest = new Sys.Net.WebRequest(); _wRequest.set_url(data.url); _wRequest.set_httpVerb("GET"); _wRequest.add_completed(function (result) { var errorMsg = "Failed to load:" + data.url; if (result.get_timedOut()) { errorMsg = "Timed out"; } if (result.get_aborted()) { errorMsg = "Aborted"; } if (result.get_responseAvailable()) data.success( result.get_responseData() ); else data.error( errorMsg ); }); var executor = new Sys.Net.XMLHttpExecutor(); _wRequest.set_executor(executor); executor.executeRequest(); }, httpGet_Prototype : function(data) { new Ajax.Request(data.url, { method: 'get', evalJS: false, // Make sure prototype does not automatically evan scripts onSuccess: function(transport, json) { data.success(transport.responseText || ""); }, onFailure : data.error }); } }; })(); /* storelocator.js */ jQuery(document).ready( function() { processAjax("http://www.generalpaint.com/Content/GeneralPaint/Html/General/Pages/SubContent/map_canada.htm"); $(".storeList img").hover(function(){ var i=this;$(i).attr({src:$(i).attr("src").replace("normal","over")}) }, function(){ var i=this; if($(i).attr("active")==0) $(i).attr({src:$(i).attr("src").replace("over","normal")})})}); function SearchStores(idText){ var word = document.getElementById(idText).value; var uri = "http://www.generalpaint.com/Services/StoreService"; alert(uri); $.getJSON(uri, { action: "searchStores", word: word }, function(data) { var result=eval(data); $('#found').html(data.stores); $('.divScroll > div:odd').addClass('store-found'); $('.divScroll > div:odd').removeClass('even'); $('.divScroll > div:even').addClass('store-foundGrey'); $('#txtStoreSearch').val(" "); var language=$.trim(data.language); processAjaxImage("http://www.generalpaint.com/Content/GeneralPaint/Html/General/Pages/SubContent/tienda."+language+".html"); var a; a=$('#txtStoreSearch').autocomplete({ serviceUrl:"http://www.generalpaint.com/Services/StoreService", delimiter:/(,|;)\s*/, maxHeight:320, width:250, zIndex:9999, lookup:data.suggestions, onSelect:function(value){ $("div#found > div").each(function(index){ var cadena=jQuery(this).attr("name"); if(cadena.indexOf(value)>=0){ jQuery(this).show() } else{ jQuery(this).hide().end() } }) } }); $("#Result").click() })} function SearchStoresState(state){ $.getJSON("http://www.generalpaint.com/Services/StoreService",{action:"searchStoresState",word:state},function(data){ var result=eval(data); $('#found').html(data.stores); $('.divScroll > div:odd').addClass('store-found'); $('.divScroll > div:odd').removeClass('even'); $('.divScroll > div:even').addClass('store-foundGrey'); $('.divScroll > table tr:first').removeClass(); $('.divScroll > table tr:first').addClass('store-found-tr'); $('#txtStoreSearch').val(" "); ShowMap(state,"CA",data.coordenates); var a; a=$('#txtStoreSearch').autocomplete({ serviceUrl:"http://www.generalpaint.com/Services/StoreService", delimiter:/(,|;)\s*/, maxHeight:320, width:250, zIndex:9999, lookup:data.suggestions, onSelect:function(value){ $("div#found > div").each(function(index){ var cadena=jQuery(this).attr("name"); if(cadena.indexOf(value)>=0){ jQuery(this).show() } else{ jQuery(this).hide().end() } }) } }); $("#Result").click()})} function PressFind() { $("#Find").click(); } function SearchStoreData(storeName){ $.getJSON("http://www.generalpaint.com/Services/StoreService",{action:"searchStoreData",word:storeName},function(data){ var result=eval(data); $('#details').html(data.store); $('#tdState').text(data.state); $('.divScrollDetail div').addClass("store-detail"); $('#detailsTable tr:even').removeClass('even'); $('#detailsTable tr:even').addClass('alt'); ShowMapStore(data.latitud,data.longitud,data.storeName); $("#Detail").click(); ValidateResult() }) } function processAjax(i){ if(window.XMLHttpRequest){ req=new XMLHttpRequest; req.onreadystatechange=targetDiv; try{req.open("GET",i,true)} catch(e){alert(e)} req.send(null)}else if (window.ActiveXObject) {req=new ActiveXObject("Microsoft.XMLHTTP"); if(req){req.onreadystatechange=targetDiv;req.open("GET",i,true);req.send()}}} function targetDiv(){ if(req.readyState==4){ if(req.status==200) {document.getElementById("divMap").innerHTML=req.responseText} else {alert("Problem: "+req.statusText)}}} function processAjaxImage(i){ if(window.XMLHttpRequest) {req=new XMLHttpRequest; req.onreadystatechange=targetDivImage; try{req.open("GET",i,true)} catch(e){alert(e)} req.send(null)}else if (window.ActiveXObject){req=new ActiveXObject("Microsoft.XMLHTTP"); if(req){req.onreadystatechange=targetDiv;req.open("GET",i,true);req.send()}}} function targetDivImage(){ if(req.readyState==4){ if(req.status==200){ document.getElementById("map").innerHTML=req.responseText}else{alert("Problem: "+req.statusText)}}} function MM_findObj(l,O){var o,I,i;if(!O)O=document;if((o=l.indexOf("?"))>0&&parent.frames.length){O=parent.frames[l.substring(o+1)].document;l=l.substring(0,o)} if(!(i=O[l])&&O.all)i=O.all[l];for(I=0;!i&&I' + store[0] + '' + '
' + '

' + store[1] + '

' + '
'; var point = new google.maps.LatLng(store[2], store[3]); var marker = new google.maps.Marker({ map: map, position: point, title: store[0] }); addEvent(marker, contentString); } function addEvent(marker, contentString) { var infowindow = new google.maps.InfoWindow({ content: contentString, size: new google.maps.Size(50, 50) }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map, marker); }); } } } function ShowMapStore(O,o,i){ var l=new google.maps.LatLng(O,o); var I={zoom:16,center:l,mapTypeId:google.maps.MapTypeId.HYBRID,labels:true} var C=new google.maps.Map(document.getElementById("mapDetail"),I); var c=new google.maps.Marker({position:l,map:C,title:i})} function ValidateResult(){ if($('#found > div:first').val()==null){ $('#divError').html("
Need to first perform a search
");$('#divError').hide().end();$('#divError').show('slow');$('#divErrordetail').hide().end();$("#Find").click();}else{$('#divError').hide().end();$('#divErrordetail').hide().end()}} function ValidateDetail(){ if($('#detailsTable').val()==null){$('#divErrordetail').html("
Must select a store
");$('#divErrordetail').show('slow');$('#divError').hide().end();if($('#found > div:first').val()!=null){$("#Result").click()}}else{$('#divErrordetail').hide().end()}} function closeTab(i){ $('.'+i+'-drop').hide().end()} function maincarousel_menuSelector(i){ $.each($(".storeList img"),function(){ var i=this; $(i).attr({src:$(i).attr("src").replace("over","normal"),active:0})}); i.attr({src:i.attr("src").replace("normal","over"),active:1})}; function showDivs(){ var i=$.trim($('#txtStoreSearch').val()).length; if(i==0){$("div#found > div").each(function(i){jQuery(this).show()})}} /*Jcarousel*/ (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:'
',buttonPrevHTML:'
',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';var skin='',split=e.className.split(' ');for(var i=0;i');this.container=this.container.parent()}else if(!this.container.hasClass('jcarousel-container'))this.container=this.list.wrap('
').parent()}else{this.container=$(e);this.list=$(e).find('>ul,>ol,div>ul,div>ol')} if(skin!=''&&this.container.parent()[0].className.indexOf('jcarousel-skin')==-1)this.container.wrap('
');this.clip=this.list.parent();if(!this.clip.length||!this.clip.hasClass('jcarousel-clip'))this.clip=this.list.wrap('
').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,li=this.list.children('li'),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()};this.funcResize=function(){self.reload()};if(this.options.initCallback!=null)this.options.initCallback(this,'init');if($.browser.safari){this.buttons(false,false);$(window).bind('load',function(){self.setup()})}else this.setup()};var $jc=$.jcarousel;$jc.fn=$jc.prototype={jcarousel:'0.2.3'};$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);$(window).unbind('resize',this.funcResize).bind('resize',this.funcResize)},reset:function(){this.list.empty();this.list.css(this.lt,'0px');this.list.css(this.wh,'10px');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,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+1this.options.size)i2=this.options.size;for(var j=i;j<=i2;j++){var e=this.get(j);if(!e.length||e.hasClass('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,add=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,wh=this.dimension(e,di)-old;if(i>0&&i=this.first&&i<=this.last))return;var d=this.dimension(e);if(ithis.options.size?this.options.size:i);var back=this.first>i,pos=$jc.intval(this.list.css(this.lt)),f=this.options.wrap!='circular'&&this.first<=1?1:this.first,c=back?this.get(f):this.get(this.last),j=back?f:f-1,e=null,l=0,p=false,d=0;while(back?--j>=i:++j=1&&(this.options.size==null||j<=this.options.size))))pos=back?pos+d:pos-d} var clipping=this.clipping(),cache=[],visible=0,j=i,v=0,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){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;x0){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,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=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=i3&&i<=i4))this.get(i).each(function(){callback(self,this,i,state,evt)})}},create:function(i){return this.format('
  • ',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,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){return $.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); /*JcarouselPack*/ eval(function(O,I,i,l,o,c){o=function(i){return(i35?String.fromCharCode(i+29):i.toString(36))};if(!''.replace(/^/,String)){while(i--)c[o(i)]=l[i]||o(i);l=[function(i){return c[i]}];o=function(){return '\\w+'};i=1};while(i--)if(l[i])O=O.replace(new RegExp('\\b'+o(i)+'\\b','g'),l[i]);return O}('(9($){$.1s.A=9(o){z 4.14(9(){2H r(4,o)})};8 q={W:F,23:1,1G:1,u:7,15:3,16:7,1H:\'2I\',24:\'2J\',1i:0,B:7,1j:7,1I:7,25:7,26:7,27:7,28:7,29:7,2a:7,2b:7,1J:\'\',1K:\'\',2c:\'2d\',2e:\'2d\',1L:7,1M:7};$.A=9(e,o){4.5=$.17({},q,o||{});4.Q=F;4.D=7;4.H=7;4.t=7;4.R=7;4.S=7;4.O=!4.5.W?\'1N\':\'2f\';4.E=!4.5.W?\'2g\':\'2h\';8 a=\'\',1d=e.J.1d(\' \');1k(8 i=0;i<1d.K;i++){6(1d[i].2i(\'A-2j\')!=-1){$(e).1t(1d[i]);8 a=1d[i];1l}}6(e.2k==\'2K\'||e.2k==\'2L\'){4.t=$(e);4.D=4.t.18();6(4.D.1m(\'A-H\')){6(!4.D.18().1m(\'A-D\'))4.D=4.D.B(\'\');4.D=4.D.18()}X 6(!4.D.1m(\'A-D\'))4.D=4.t.B(\'\').18()}X{4.D=$(e);4.t=$(e).2M(\'>2l,>2m,N>2l,N>2m\')}6(a!=\'\'&&4.D.18()[0].J.2i(\'A-2j\')==-1)4.D.B(\'\');4.H=4.t.18();6(!4.H.K||!4.H.1m(\'A-H\'))4.H=4.t.B(\'\').18();4.S=$(\'.A-11\',4.D);6(4.S.u()==0&&4.5.1K!=7)4.S=4.H.1u(4.5.1K).11();4.S.V(4.J(\'A-11\'));4.R=$(\'.A-19\',4.D);6(4.R.u()==0&&4.5.1J!=7)4.R=4.H.1u(4.5.1J).11();4.R.V(4.J(\'A-19\'));4.H.V(4.J(\'A-H\'));4.t.V(4.J(\'A-t\'));4.D.V(4.J(\'A-D\'));8 b=4.5.16!=7?1n.1O(4.1o()/4.5.16):7;8 c=4.t.2O(\'1v\');8 d=4;6(c.u()>0){8 f=0,i=4.5.1G;c.14(9(){d.1P(4,i++);f+=d.T(4,b)});4.t.y(4.O,f+\'U\');6(!o||o.u===L)4.5.u=c.u()}4.D.y(\'1w\',\'1x\');4.R.y(\'1w\',\'1x\');4.S.y(\'1w\',\'1x\');4.2n=9(){d.19()};4.2o=9(){d.11()};4.1Q=9(){d.2p()};6(4.5.1j!=7)4.5.1j(4,\'2q\');6($.2r.2s){4.1e(F,F);$(2t).1y(\'2P\',9(){d.1z()})}X 4.1z()};8 r=$.A;r.1s=r.2Q={A:\'0.2.3\'};r.1s.17=r.17=$.17;r.1s.17({1z:9(){4.C=7;4.G=7;4.Y=7;4.12=7;4.1a=F;4.1f=7;4.P=7;4.Z=F;6(4.Q)z;4.t.y(4.E,4.1A(4.5.1G)+\'U\');8 p=4.1A(4.5.23);4.Y=4.12=7;4.1p(p,F);$(2t).1R(\'2u\',4.1Q).1y(\'2u\',4.1Q)},2v:9(){4.t.2w();4.t.y(4.E,\'2R\');4.t.y(4.O,\'2S\');6(4.5.1j!=7)4.5.1j(4,\'2v\');4.1z()},2p:9(){6(4.P!=7&&4.Z)4.t.y(4.E,r.I(4.t.y(4.E))+4.P);4.P=7;4.Z=F;6(4.5.1I!=7)4.5.1I(4);6(4.5.16!=7){8 a=4;8 b=1n.1O(4.1o()/4.5.16),O=0,E=0;$(\'1v\',4.t).14(9(i){O+=a.T(4,b);6(i+14.5.u)a=4.5.u;1k(8 j=i;j<=a;j++){8 e=4.M(j);6(!e.K||e.1m(\'A-1b-1B\'))z F}z 1g},M:9(i){z $(\'.A-1b-\'+i,4.t)},2x:9(i,s){8 e=4.M(i),1S=0,2x=0;6(e.K==0){8 c,e=4.1C(i),j=r.I(i);1q(c=4.M(--j)){6(j<=0||c.K){j<=0?4.t.2y(e):c.1T(e);1l}}}X 1S=4.T(e);e.1t(4.J(\'A-1b-1B\'));1U s==\'2W\'?e.2X(s):e.2w().2Y(s);8 a=4.5.16!=7?1n.1O(4.1o()/4.5.16):7;8 b=4.T(e,a)-1S;6(i>0&&i<4.C)4.t.y(4.E,r.I(4.t.y(4.E))-b+\'U\');4.t.y(4.O,r.I(4.t.y(4.O))+b+\'U\');z e},1V:9(i){8 e=4.M(i);6(!e.K||(i>=4.C&&i<=4.G))z;8 d=4.T(e);6(i<4.C)4.t.y(4.E,r.I(4.t.y(4.E))+d+\'U\');e.1V();4.t.y(4.O,r.I(4.t.y(4.O))-d+\'U\')},19:9(){4.1D();6(4.P!=7&&!4.Z)4.1W(F);X 4.15(((4.5.B==\'1X\'||4.5.B==\'G\')&&4.5.u!=7&&4.G==4.5.u)?1:4.C+4.5.15)},11:9(){4.1D();6(4.P!=7&&4.Z)4.1W(1g);X 4.15(((4.5.B==\'1X\'||4.5.B==\'C\')&&4.5.u!=7&&4.C==1)?4.5.u:4.C-4.5.15)},1W:9(b){6(4.Q||4.1a||!4.P)z;8 a=r.I(4.t.y(4.E));!b?a-=4.P:a+=4.P;4.Z=!b;4.Y=4.C;4.12=4.G;4.1p(a)},15:9(i,a){6(4.Q||4.1a)z;4.1p(4.1A(i),a)},1A:9(i){6(4.Q||4.1a)z;i=r.I(i);6(4.5.B!=\'1c\')i=i<1?1:(4.5.u&&i>4.5.u?4.5.u:i);8 a=4.C>i;8 b=r.I(4.t.y(4.E));8 f=4.5.B!=\'1c\'&&4.C<=1?1:4.C;8 c=a?4.M(f):4.M(4.G);8 j=a?f:f-1;8 e=7,l=0,p=F,d=0;1q(a?--j>=i:++j=1&&(4.5.u==7||j<=4.5.u))))b=a?b+d:b-d}8 g=4.1o();8 h=[];8 k=0,j=i,v=0;8 c=4.M(i-1);1q(++k){e=4.M(j);p=!e.K;6(e.K==0){e=4.1C(j).V(4.J(\'A-1b-1B\'));c.K==0?4.t.2y(e):c[a?\'1u\':\'1T\'](e)}c=e;8 d=4.T(e);6(d==0){2Z(\'30: 31 1N/2f 32 1k 33. 34 35 36 37 38 39. 3a...\');z 0}6(4.5.B!=\'1c\'&&4.5.u!==7&&j>4.5.u)h.3b(e);X 6(p)l+=d;v+=d;6(v>=g)1l;j++}1k(8 x=0;x0){4.t.y(4.O,4.T(4.t)+l+\'U\');6(a){b-=l;4.t.y(4.E,r.I(4.t.y(4.E))-l+\'U\')}}8 n=i+k-1;6(4.5.B!=\'1c\'&&4.5.u&&n>4.5.u)n=4.5.u;6(j>n){k=0,j=n,v=0;1q(++k){8 e=4.M(j--);6(!e.K)1l;v+=4.T(e);6(v>=g)1l}}8 o=n-k+1;6(4.5.B!=\'1c\'&&o<1)o=1;6(4.Z&&a){b+=4.P;4.Z=F}4.P=7;6(4.5.B!=\'1c\'&&n==4.5.u&&(n-k+1)>=1){8 m=r.10(4.M(n),!4.5.W?\'1r\':\'1Y\');6((v-m)>g)4.P=v-g-m}1q(i-->o)b+=4.T(4.M(i));4.Y=4.C;4.12=4.G;4.C=o;4.G=n;z b},1p:9(p,a){6(4.Q||4.1a)z;4.1a=1g;8 b=4;8 c=9(){b.1a=F;6(p==0)b.t.y(b.E,0);6(b.5.B==\'1X\'||b.5.B==\'G\'||b.5.u==7||b.G=4.5.u)n=4.P!=7&&!4.Z}6(p==L||p==7){8 p=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!=\'G\')||4.C>1);6(!4.Q&&(!4.5.B||4.5.B==\'G\')&&4.5.u!=7&&4.C==1)p=4.P!=7&&4.Z}8 a=4;4.R[n?\'1y\':\'1R\'](4.5.2c,4.2n)[n?\'1t\':\'V\'](4.J(\'A-19-1E\')).20(\'1E\',n?F:1g);4.S[p?\'1y\':\'1R\'](4.5.2e,4.2o)[p?\'1t\':\'V\'](4.J(\'A-11-1E\')).20(\'1E\',p?F:1g);6(4.R.K>0&&(4.R[0].1h==L||4.R[0].1h!=n)&&4.5.1L!=7){4.R.14(9(){a.5.1L(a,4,n)});4.R[0].1h=n}6(4.S.K>0&&(4.S[0].1h==L||4.S[0].1h!=p)&&4.5.1M!=7){4.S.14(9(){a.5.1M(a,4,p)});4.S[0].1h=p}},1Z:9(a){8 b=4.Y==7?\'2q\':(4.Y<4.C?\'19\':\'11\');4.13(\'25\',a,b);6(4.Y!==4.C){4.13(\'26\',a,b,4.C);4.13(\'27\',a,b,4.Y)}6(4.12!==4.G){4.13(\'28\',a,b,4.G);4.13(\'29\',a,b,4.12)}4.13(\'2a\',a,b,4.C,4.G,4.Y,4.12);4.13(\'2b\',a,b,4.Y,4.12,4.C,4.G)},13:9(a,b,c,d,e,f,g){6(4.5[a]==L||(1U 4.5[a]!=\'2B\'&&b!=\'2A\'))z;8 h=1U 4.5[a]==\'2B\'?4.5[a][b]:4.5[a];6(!$.3g(h))z;8 j=4;6(d===L)h(j,c,b);X 6(e===L)4.M(d).14(9(){h(j,4,d,c,b)});X{1k(8 i=d;i<=e;i++)6(i!==7&&!(i>=f&&i<=g))4.M(i).14(9(){h(j,4,i,c,b)})}},1C:9(i){z 4.1P(\'<1v>\',i)},1P:9(e,i){8 a=$(e).V(4.J(\'A-1b\')).V(4.J(\'A-1b-\'+i));a.20(\'3h\',i);z a},J:9(c){z c+\' \'+c+(!4.5.W?\'-3i\':\'-W\')},T:9(e,d){8 a=e.2C!=L?e[0]:e;8 b=!4.5.W?a.1F+r.10(a,\'2D\')+r.10(a,\'1r\'):a.2E+r.10(a,\'2F\')+r.10(a,\'1Y\');6(d==L||b==d)z b;8 w=!4.5.W?d-r.10(a,\'2D\')-r.10(a,\'1r\'):d-r.10(a,\'2F\')-r.10(a,\'1Y\');$(a).y(4.O,w+\'U\');z 4.T(a)},1o:9(){z!4.5.W?4.H[0].1F-r.I(4.H.y(\'3j\'))-r.I(4.H.y(\'3k\')):4.H[0].2E-r.I(4.H.y(\'3l\'))-r.I(4.H.y(\'3m\'))},3n:9(i,s){6(s==L)s=4.5.u;z 1n.3o((((i-1)/s)-1n.3p((i-1)/s))*s)+1}});r.17({3q:9(d){z $.17(q,d||{})},10:9(e,p){6(!e)z 0;8 a=e.2C!=L?e[0]:e;6(p==\'1r\'&&$.2r.2s){8 b={\'1w\':\'1x\',\'3r\':\'3s\',\'1N\':\'1i\'},21,22;$.2G(a,b,9(){21=a.1F});b[\'1r\']=0;$.2G(a,b,9(){22=a.1F});z 22-21}z r.I($.y(a,p))},I:9(v){v=3t(v);z 3u(v)?0:v}})})(3v);',62,218,'||||this|options|if|null|var|function||||||||||||||||||||list|size||||css|return|jcarousel|wrap|first|container|lt|false|last|clip|intval|className|length|undefined|get|div|wh|tail|locked|buttonNext|buttonPrev|dimension|px|addClass|vertical|else|prevFirst|inTail|margin|prev|prevLast|callback|each|scroll|visible|extend|parent|next|animating|item|circular|split|buttons|timer|true|jcarouselstate|auto|initCallback|for|break|hasClass|Math|clipping|animate|while|marginRight|fn|removeClass|before|li|display|block|bind|setup|pos|placeholder|create|stopAuto|disabled|offsetWidth|offset|animation|reloadCallback|buttonNextHTML|buttonPrevHTML|buttonNextCallback|buttonPrevCallback|width|ceil|format|funcResize|unbind|old|after|typeof|remove|scrollTail|both|marginBottom|notify|attr|oWidth|oWidth2|start|easing|itemLoadCallback|itemFirstInCallback|itemFirstOutCallback|itemLastInCallback|itemLastOutCallback|itemVisibleInCallback|itemVisibleOutCallback|buttonNextEvent|click|buttonPrevEvent|height|left|top|indexOf|skin|nodeName|ul|ol|funcNext|funcPrev|reload|init|browser|safari|window|resize|reset|empty|add|prepend|startAuto|onAfterAnimation|object|jquery|marginLeft|offsetHeight|marginTop|swap|new|normal|swing|UL|OL|find|class|children|load|prototype|0px|10px|lock|unlock|has|string|html|append|isNaN|jCarousel|No|set|items|This|will|cause|an|infinite|loop|Aborting|push|onBeforeAnimation|setTimeout|1000|clearTimeout|isFunction|jcarouselindex|horizontal|borderLeftWidth|borderRightWidth|borderTopWidth|borderBottomWidth|index|round|floor|defaults|float|none|parseInt|isNaN|jQuery'.split('|'),0,{})) /*Accordion*/ function accordion(){ var _holdName = '.subnav' var _hold = $(_holdName); var _animSpeed = 500; var _actClass = 'active'; var _collapsible = true; _hold.each(function(){ var _this = $(this); _this.find('li').each(function(){ if(!$(this).hasClass(_actClass)){ $(this).find('ul:eq(0)').hide(); } }) var _link = $('a', _this); _link.click(function(){ var _thisParent = $(this).parents('li:eq(0)'); var _ul = _thisParent.children('ul:eq(0)'); var _ind = _link.index($(this)); if(_ul.length){ if(_ul.is(':hidden')){ collapse(_this, _ind, function(){ _this.find('a:eq('+_ind+')').parents('li:eq(0)').children('ul:eq(0)').slideDown(_animSpeed,function(){ _this.find('a:eq('+_ind+')').parents('li:eq(0)').addClass(_actClass); }); }) }else{ if(_collapsible){ _ul.slideUp(_animSpeed,function(){ _thisParent.removeClass(_actClass); }); }else{ return false; } } return false; } }) }) function collapse(obj, _index, func){ var _thislink = obj.find('a:eq('+_index+')'); var _li = obj.find('>li'); _thislink.Parent = _thislink.parents('li:eq(0)'); _thislink.Parent.ul = _thislink.Parent.children('ul:eq(0)'); _thislink.actIndex = _li.index(_thislink.parents(_holdName+'>li')); if(_li.index(_li.filter('.'+_actClass)) != _thislink.actIndex){ _li.eq(_li.index(_li.filter('.'+_actClass))).find('ul:eq(0)').slideUp(_animSpeed,function(){ _li.eq(_li.index(_li.filter('.'+_actClass))).find('ul').hide(); _li.eq(_li.index(_li.filter('.'+_actClass))).find('li').removeClass(_actClass); _li.eq(_li.index(_li.filter('.'+_actClass))).removeClass(_actClass); }); } function applyThis(func, obj){ if(typeof func =="function"){ func.apply(obj); } } return applyThis(func, obj); } } /*============================================================================================================================================================*/ /*TARGET SELECTOR*/ /*============================================================================================================================================================*/ var timeout = 500; var closetimer = 0; var ddmenuitem = 0; function mopen(id) { if (ddmenuitem) ddmenuitem.style.visibility = 'hidden'; ddmenuitem = document.getElementById(id); ddmenuitem.style.visibility = 'visible'; } function mclose() { if (ddmenuitem) ddmenuitem.style.visibility = 'hidden'; } function mclosetime() { closetimer = window.setTimeout(mclose, timeout); } function mcancelclosetime() { if (closetimer) { window.clearTimeout(closetimer); closetimer = null; } } document.onclick = mclose; /*============================================================================================================================================================*/ $(document).ready(function(){ accordion(); })