(function($){$.fn.offermap=function(options){var opts=$.extend({},$.fn.offermap.defaults,options);var thisObj=this;var creg=null;var ie6=window.ActiveXObject&&!window.XMLHttpRequest;var imgs={};var turnOnRegion=function(reg){if(reg==null){return}$(".boxCont[region="+reg+"]",thisObj).each(function(){$(".boxContentOff",this).each(function(){var elem=$(this);elem.addClass("turnOn")});$("img[onsrc]",this).each(function(){var elem=$(this);var newimg=imgs[elem.attr("onsrc")].attr("src");if(ie6&&newimg.match(/\.png$/)){var filt='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+newimg+'",sizingMethod="scale")';elem.css("behavior","");elem.attr("src","images/blank.gif").css("filter",filt)}else{elem.attr("src",newimg)}})});$(".map[region="+reg+"]").each(function(){$(this).fadeIn(opts.mapFadeIn)})};var turnOffRegion=function(reg){if(reg==null){return}$(".boxCont[region="+reg+"]",thisObj).each(function(){$(".boxContentOff",this).each(function(){var elem=$(this);elem.removeClass("turnOn")});$("img[offsrc]",this).each(function(){var elem=$(this);var newimg=imgs[elem.attr("offsrc")].attr("src");if(ie6&&newimg.match(/\.png$/)){var filt='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+newimg+'",sizingMethod="scale")';elem.css("behavior","");elem.attr("src","images/blank.gif").css("filter",filt)}else{elem.attr("src",newimg)}})});$(".map[region="+reg+"]").each(function(){$(this).fadeOut(opts.mapFadeOut)})};this.init=function(){$(".mapover",thisObj).each(function(){var elem=$(this);if(elem.hasClass("boxCont")){var lnk=$("a[href]",elem)[0];if(lnk){elem.css("cursor","pointer");$(lnk).click(function(event){event.preventDefault()});elem.click(function(){window.open($(lnk).attr("href"),"_blank")})}}elem.mouseenter(function(){thisObj.highlightRegion(elem.attr("region"))})});$(".mapclick",thisObj).each(function(){var elem=$(this);elem.click(function(event){thisObj.highlightRegion(elem.attr("region"));event.preventDefault()})});$("img[onsrc]").each(function(){var elem=$(this);var onsrc=elem.attr("onsrc");var offsrc=elem.attr("src");if(onsrc.match(/\.png$/)){offsrc=onsrc.replace("_on","")}elem.attr("offsrc",offsrc);imgs[offsrc]=elem.clone().attr("src",offsrc);imgs[onsrc]=elem.clone().attr("src",onsrc)});return this};this.highlightRegion=function(region){if(creg===region){return this}turnOnRegion(region);turnOffRegion(creg);creg=region;return this};return this.init()};$.fn.offermap.defaults={mapFadeIn:500,mapFadeOut:400}})(jQuery);$(function(){$(".content").offermap().highlightRegion("nad")});
