eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('12 9={8:{s:10,d:0,e:0,i:0,m:c(){$(\'#o x.y\').A(\'16\',9.8.u);$(\'#o x.y\').A(\'14\',9.8.r);h.13=9.8.f},r:c(){9.8.d=z.15(9.8.f,9.8.s)},u:c(){9.8.v();9.8.f();9.8.e=t;$(t).11("w");q=/17|1g 6/.1h(1j.1i);g(q&&9.8.i==0){9.8.i=1}},v:c(){g(9.8.d){z.1f(9.8.d);9.8.d=1a}},f:c(){g(9.8.e)$(9.8.e).19("w")}}};$(h).18(c(){9.8.m()});g(h.1b){k=5 4();n=5 4();p=5 4();l=5 4();j=5 4();B=5 4();R=5 4();S=5 4();T=5 4();k.3="/2/7/P.a";n.3="/2/7/Y.a";p.3="/2/7/X.a";l.3="/2/7/U.a";j.3="/2/7/F.a";B.3="/2/7/H.a";R.3="/2/7/D.a";S.3="/2/7/L.a";T.3="/2/7/N.a";O=5 4();Q=5 4();Z=5 4();V=5 4();W=5 4();G=5 4();C=5 4();E=5 4();M=5 4();O.3="/2/7/P.b";Q.3="/2/7/Y.b";Z.3="/2/7/X.b";V.3="/2/7/U.b";W.3="/2/7/F.b";G.3="/2/7/H.b";C.3="/2/7/D.b";E.3="/2/7/L.b";M.3="/2/7/N.b";I=5 4();J=5 4();K=5 4();I.3="/2/7/1e.a";J.3="/2/7/1d.a";K.3="/2/7/1c.a"};',62,82,'||GLOBAL|src|Image|new||Images|Topnav|BoseTopnav|png|gif|function|closetimer|navmenuitem|jsddm_close|if|document|pngFixed|imageObj5|imageObj1|imageObj4|load|imageObj2|topnav|imageObj3|isIE6|jsddm_timer|timeout|this|jsddm_open|jsddm_canceltimer|active|li|upperLevel|window|bind|imageObj6|imageObj17|topnav_onecontainer_top|imageObj18|topnav_twocontainer_divider|imageObj16|topnav_twocontainer_bottom|imageObj20|imageObj21|imageObj22|topnav_onecontainer_divider|imageObj19|topnav_onecontainer_bottom|imageObj11|topnav_threecontainer_top|imageObj12|imageObj7|imageObj8|imageObj9|topnav_twocontainer_top|imageObj14|imageObj15|topnav_threecontainer_bottom|topnav_threecontainer_divider|imageObj13|500|addClass|var|onclick|mouseleave|setTimeout|mouseenter|msie|ready|removeClass|null|images|showcase_rollover_bot|showcase_rollover_mid|showcase_rollover_top|clearTimeout|MSIE|test|userAgent|navigator'.split('|'),0,{}))
// ***
// PopupLayer Plug-in function
// ***
$.fn.OpenPopup = function(title, link) {
	//read settings or take defaults
	var w = 610;
	var h = 500;
	var modal = true;
	var drag = true;
	var linkText = '';
	var linkUrl = '#';

	//Check if popup already exists (and reopen)
	var uniqueId = escape(link);
	var dialog = $("[rel='" + uniqueId  + "']");
	if (dialog.size() > 0) {

		dialog.find('.pagination > a').each(function() {
		 if ($(this).text() == 1) {$(this).click(); return;}
		});

		if (dialog.find('.ui-extraborder.fix').size() > 0) {
			h = dialog.find('.ui-extraborder.fix').css('height');
			h = h.substring(0,h.length - 2)*1;
			dialog.find('.ui-extraborder.fix').css('height', (h-35) + 'px').removeClass('fix');
		}
		dialog.dialog('open');
		//fix size layout issue (prevent the middle white block from being too long when the width is very small)
		dialog.find('.ui-extraborder').parent().css('height','auto');
		return false;
	}

	//Create new popup
	$(this).after('<div class="popup_layer display-none" rel="' + uniqueId + '"><div class="ui-extraborder"></div></div>');
	$(this).parent().find(".popup_layer .ui-extraborder").load(link, {popup:1}, function(response, status, xhr) {

		if (status == "error") {
 			$(this).html(xhr.status + " " + xhr.statusText);
			w=300;h=300;
		}

		//Determine title
		if ($(this).find(".popupTitle").size() > 0) {
			title = $(this).find(".popupTitle").text();
			$(this).find(".popupTitle").remove();
		}

		//Determine style
		var style = 'default';
		if ($(this).find(".popup-style").size() > 0) {
			style = $(this).find(".popup-style").text();
		}

		//determine overrules settings
		if (link.indexOf("productPop-ups") == -1) {
			if ($(this).find(".popup-height").size() > 0) {
				h = $(this).find(".popup-height").text() * 1;h=h+10;}
			if ($(this).find(".popup-width").size() > 0) {
				w = $(this).find(".popup-width").text() * 1;}
		}

		if ($(this).find(".popup-modal").size() > 0) {
			modal = ($(this).find(".popup-modal").text() == 1);}
		if ($(this).find(".popup-draggable").size() > 0) {
			drag = ($(this).find(".popup-draggable").text() == 1);}

		if ($(this).find(".link-text").size() > 0) {
			linkText = $(this).find(".link-text").text();}
		if ($(this).find(".link-url").size() > 0) {
			linkUrl = $(this).find(".link-url").text();}

		$(this).css('height', (h-80) + 'px');

		//Open dialog
		$(this).parent().dialog({
			title: title,
			height: h,
			width: w,
			modal: modal,
			autoOpen: true,
			resizable: false,
			draggable: drag,
			position: [($('body').width()-w)/2,100]
		});

		//fix size layout issue (prevent the middle white block from being too long when the width is very small)
		var dialog = $("[rel='" + uniqueId  + "']");
		dialog.find('.ui-extraborder').parent().css('height','auto');

		if (/msie|MSIE 6/.test(navigator.userAgent)) {
			dialog.parent().bgiframe();
		}

		if (title == "") {
		dialog.find('.ui-extraborder').parent().parent().find('span.ui-dialog-title').css('display', 'none');
		}

		var parentNode = $(this).parent().parent();
		parentNode.addClass('popup-style-' + style);
		if (linkText.length > 0) {
			parentNode.append('<div class="ui-call-to-action"><div class="btn_holder btn"><span class="btn_inner"><a href="' + linkUrl + '">' + linkText + '</a></span></div></div>');
			$(this).addClass('fix');
		}
	});
};


$.fn.PopupLink = function() {
	this.live('click', function() {
		var title = $(this).attr('title');
		var link = $(this).attr('href');

		$(this).OpenPopup(title, link);

		//to prevent visiting link as a page.
		return false;
	});
};

function openNewWindow(strURL, intWidth, intHeight) {
    openNewWin(strURL, intWidth, intHeight);
    return false;
};

$(document).ready(function() {
     //create linker for product selector in the footer
     $("#footer_dropnav_items").change(function() {
	    window.location = $(this).find('option:selected').val();
     });

     //enable pop-ups
     $('.popuplayer').PopupLink();

     //Popup function where class="popup" and rel="w,h"
     $('.popup').click(function() {
          var width = 615;
          var height = 345;

          var url = $(this).attr("href");
          if (url.indexOf("?") == -1) {
              url += "?window";
          } else {
              url += "&window";
          }
          var size = $(this).attr("rel");
          size = size.split(",");

          if (size.length == 2) {
               width = size[0].trim()*1;
               height = size[1].trim()*1;
          }

          openNewWin(url, width, height);
          return false;
     });

     //create popup for e-mail subscription in the footer
     $(".emailForm").submit(function() {
          //form
          var title = "";
          var link = $(this).attr("action") + "?email=" + $(this).find("[name=email]").val();
          openNewWin(link, 600, 550);
          return false;
     });
});
