Template=function(){return{init:function(templateClass,settings){switch(templateClass){case'INDEX':break;case'LANDING':case'MULTI_INCENTIVE_LANDING':$(window).load(function(){Template.autoMax(settings)});$(document).ready(function(){var element=document.forms[0].elements[0];element.focus();});if(settings.landingPop){$(document).ready(function(){var element=document.forms[0].elements[0];element.focus();window.onbeforeunload=function(){alert("------------------------------------------------------------\nThink first! Click CANCEL on the next page to receive a new gift card option.\n\nYour free $500 gift card is yours by filling out our 5 min internet survey.\n\n------------------------------------------------------------");window.location="http://www.msmfto.com/rotator/Go/rid/11522?cid="+_campaignId+"&subci="+_subcid;return"------------------------------------------------------------\nClick CANCEL\n\nOver $1,000,000 in gifts have been given out, get yours today!\n\n------------------------------------------------------------";};beforeSubmit=function(){window.onbeforeunload=function(){};};});}
if((typeof UP!="undefined")&&(UP["email"]!="")){document.getElementById("email").value=UP["email"];}
break;case'PROFILE':$(window).load(function(){Template.autoMax(settings)});$(document).ready(function(){var element=document.forms[0].elements[0];element.focus();if(settings.profilePop){window.onbeforeunload=function(){alert("------------------------------------------------------------\nThink first! Click CANCEL on the next page to receive a new gift card option.\n\nYour free $500 gift card is yours by filling out our 5 min internet survey.\n\n------------------------------------------------------------");window.location="http://www.msmfto.com/rotator/Go/rid/1344?cid="+_campaignId+"&subci="+_subcid;return"------------------------------------------------------------\nClick CANCEL\n\nOver $1,000,000 in gifts have been given out, get yours today!\n\n------------------------------------------------------------";};beforeSubmit=function(){window.onbeforeunload=function(){};};}});break;case'OFFER':var offerPage=(parseInt(_offerPage)<_offerset_page_count)?parseInt(_offerPage)+1:_offerset_page_count;$(window).load(function(){Template.autoMax(settings)});if(settings.offerPop){window.onbeforeunload=function(){alert("------------------------------------------------------------\nThink first! Click CANCEL on the next page to receive a new gift card option.\n\nYour free $500 gift card is yours by filling out our 5 min internet survey.\n\n------------------------------------------------------------");window.location="http://www.msmfto.com/rotator/Go/rid/11610?cid="+_campaignId+"&subci="+_subcid;return"------------------------------------------------------------\nClick CANCEL\n\nOver $1,000,000 in gifts have been given out, get yours today!\n\n------------------------------------------------------------";};$("#offer-pager-back a").click(function(){window.onbeforeunload=function(){};});$("#offer-pager-next a").click(function(){window.onbeforeunload=function(){};});}
break;case'COREG':break;case'ERROR':break;case'BONUS_POP':break;case'EXIT_POP':break;case'OFFER_EXIT_POP':$(window).load(function(){Template.resize(500,560)});$(window).unload(function(){Template.exitPop({pop:true,windowName:"OfferExitPop",viewState:"bonusPopViewName"});});$("a.close").click(function(){$(document.body).unbind('click');});break;case'OFFER_INFO_POP':$(window).load(function(){Template.resize(470,610)});break;default:}},exitPop:function(oCustomObject){if(oCustomObject.pop){if(oCustomObject.viewState!=null&&oCustomObject.viewState=="bonusPopViewName"){var winprop="";}else{var winprop="width=500,height=560,menubar=no,location=no,resizable=no,scrollbars=no,status=no";}
if(oCustomObject.url){window.open(oCustomObject.url,'_blank',winprop);}else{if(oCustomObject.windowName=="OfferExitPop"){window.open("oep?viewState="+oCustomObject.viewState+'&os='+_os+"&os_set="+_os_set+"&os_page="+oCustomObject.offerPage,'_blank',winprop);}else{window.open(_goPopURL+"?viewState="+oCustomObject.viewState,'_blank',winprop);}}}},autoMax:function(oCustomObject){if(oCustomObject.autoMax){top.window.moveTo(0,0);if(document.all){top.window.resizeTo(screen.availWidth,screen.availHeight);}else if(document.layers||document.getElementById){if(top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){top.window.outerHeight=screen.availHeight;top.window.outerWidth=screen.availWidth;}}}},newLocation:function(oCustomObject){$(window).unbind("unload");window.open(oCustomObject.url,'_blank','scrollbars=yes');},resize:function(width,height){top.window.moveTo(0,0);if(document.all){top.window.resizeTo(width,height);}else if(document.layers||document.getElementById){top.window.outerWidth=width;top.window.outerHeight=height;}}}}();$(document).ready(function(){Template.init(_templateClass,_settings);});
