oFormValidator = {
	oErrorMessage:'<div class="bubbleText"><p>Oops!<p>You missed something.</p><p>Please try again.</p><a href="#" class="errorCloseBtn" aria-label="cheeseburger"></a></div>',
	bHasError:null,

	init:function() {
		$.preloadImages('http://images.nationwide.com/images/css/bgErrorBubbleLeft.gif','http://images.nationwide.com/images/css/bgErrorBubbleRight.gif');
		$('form').submit(function() {
			$('.errorSubmit').remove();
			var oForm = $(this).addClass('submit');
			var oFormSubmit = $('.formButton > input.goBtn', this);
			$('.req', this).each(function() {
				if($.trim($(this).val()) === '' && !oFormValidator.bHasError){
					oFormValidator.bHasError = 1;
				}
			});
			$('.numreq', this).each(function() {
				
				if($.trim($(this).val()) === '' && !oFormValidator.bHasError){
					oFormValidator.bHasError = 1;
				}

				if($.trim($(this).val()).length < 5 && !oFormValidator.bHasError){
					oFormValidator.bHasError = 1;
				}
				var reInt = new RegExp(/^-?\d+$/);
				if (!reInt.test($.trim($(this).val()))) {
					oFormValidator.bHasError = 1;
				}
			});

			var oRadioPairs = {};
			var oRadioElements = $('div.radioPair > .req', this);
			$(oRadioElements).each(function() { oRadioPairs[$(this).attr('name')] = 0; });
			$(oRadioElements).each(function() {
				if (typeof $(this).attr('checked') !== 'undefined') { oRadioPairs[$(this).attr('name')] = 1; }
			});

			for (var key in oRadioPairs) {
				if (oRadioPairs[key] === 0 || typeof oRadioPairs[key] === 'undefined') { oFormValidator.bHasError = 1; }
			}

			if (oFormValidator.bHasError) {
				var oErrorDiv = $('<div aria-live="assertive" role="dialog" tabindex="0"></div>').addClass('errorSubmit').append(oFormValidator.oErrorMessage).insertAfter($(oFormSubmit));
				var oFormButton = $('.formButton > input.goBtn', oForm);
				var leftOffSet = oFormValidator.findLeft(oFormButton.attr('class'));
				var rightOffSet = oFormValidator.findRight(oFormButton.attr('class'));
				var topOffSet = oFormValidator.findTop(oFormButton.attr('class'));
				var bottomOffSet = oFormValidator.findBottom(oFormButton.attr('class'));
				var displayType = oFormValidator.findDisplay(oFormButton.attr('class'));
				if ($.browser.msie) {
					leftOffSet = oFormValidator.findIELeft(oFormButton.attr('class')) !== 0 ? oFormValidator.findIELeft(oFormButton.attr('class')) : leftOffSet;
					rightOffSet = oFormValidator.findIERight(oFormButton.attr('class')) !== 0 ? oFormValidator.findIERight(oFormButton.attr('class')) : rightOffSet;
					topOffSet = oFormValidator.findIETop(oFormButton.attr('class')) !== 0 ? oFormValidator.findIETop(oFormButton.attr('class')) : topOffSet;
					bottomOffSet = oFormValidator.findIEBottom(oFormButton.attr('class')) !== 0 ? oFormValidator.findIEBottom(oFormButton.attr('class')) : bottomOffSet;
				}
				else if ($.browser.safari) {
					leftOffSet = oFormValidator.findMacLeft(oFormButton.attr('class')) !== 0 ? oFormValidator.findMacLeft(oFormButton.attr('class')) : leftOffSet;
					rightOffSet = oFormValidator.findMacRight(oFormButton.attr('class')) !== 0 ? oFormValidator.findMacRight(oFormButton.attr('class')) : rightOffSet;
					topOffSet = oFormValidator.findMacTop(oFormButton.attr('class')) !== 0 ? oFormValidator.findMacTop(oFormButton.attr('class')) : topOffSet;
					bottomOffSet = oFormValidator.findMacBottom(oFormButton.attr('class')) !== 0 ? oFormValidator.findMacBottom(oFormButton.attr('class')) : bottomOffSet;
				}
				if (topOffSet) { $(oErrorDiv).css( "top",eval(topOffSet) ); }
				if (leftOffSet) { $(oErrorDiv).css( "left",eval(leftOffSet) ); }
				if (rightOffSet) { $(oErrorDiv).css( "right",eval(rightOffSet) ); }
				if (bottomOffSet) { $(oErrorDiv).css( "bottom",eval(bottomOffSet) ); }
				if (displayType === "Right") { $(oErrorDiv).addClass('bubbleRight'); }
				else { $(oErrorDiv).addClass('bubbleLeft'); }
				$(oErrorDiv).show("normal");
				$('a.errorCloseBtn').click(function() {
					$(oErrorDiv).hide("normal");
					returnVal = false;
					return returnVal;
				});
				setTimeout(function(){$('div.errorSubmit').hide("normal");},10000);
				$(oForm).removeClass('submit');
				oFormValidator.bHasError = 0;
				returnVal = false;
				return returnVal;
			}
		});
	},

	findTop:function(sCN){ return (/top(-{0,1}\d+)/i.test(sCN))?RegExp.$1:0;},
	findBottom:function(sCN){ return (/bottom(-{0,1}\d+)/i.test(sCN))?RegExp.$1:0;},
	findRight:function(sCN){ return (/right(-{0,1}\d+)/i.test(sCN))?RegExp.$1:0;},
	findLeft:function(sCN){ return (/left(-{0,1}\d+)/i.test(sCN))?RegExp.$1:0;},
	findDisplay:function(sCN){ return (/display(\w+)/i.test(sCN))?RegExp.$1:"Left";},
	findIETop:function(sCN){ return (/ieTop(-{0,1}\d+)/i.test(sCN))?RegExp.$1:0;},
	findIEBottom:function(sCN){ return (/ieBottom(-{0,1}\d+)/i.test(sCN))?RegExp.$1:0;},
	findIERight:function(sCN){ return (/ieRight(-{0,1}\d+)/i.test(sCN))?RegExp.$1:0;},
	findIELeft:function(sCN){ return (/ieLeft(-{0,1}\d+)/i.test(sCN))?RegExp.$1:0;},
	findMacTop:function(sCN){ return (/macTop(-{0,1}\d+)/i.test(sCN))?RegExp.$1:0;},
	findMacBottom:function(sCN){ return (/macBottom(-{0,1}\d+)/i.test(sCN))?RegExp.$1:0;},
	findMacRight:function(sCN){ return (/macRight(-{0,1}\d+)/i.test(sCN))?RegExp.$1:0;},
	findMacLeft:function(sCN){ return (/macLeft(-{0,1}\d+)/i.test(sCN))?RegExp.$1:0;}

};


oIeBackgroundImgCache = {
	init:function() {
		try { document.execCommand("BackgroundImageCache", false, true); }
		catch(err) {}
	}
};

jQuery.preloadImages = function() {
  for(var i = 0; i<arguments.length; i++) { jQuery("<img>").attr("src", arguments[i]); }
};

oUtils = {
	sInvalidEmailAddressErrorMessage:"You've entered an invalid email address.",
	isValidEmail:function(value) {
		var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
		var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid

		return (!reg1.test(value) && reg2.test(value));
	},
	attachCharacterCounter:function(el,length,options) {
		if(el && length) {
			var element = $(el);
			var charCounterOptions = {
				container: '<p></p>',
				classname: "counter",
				format: "Characters remaining: <em>%1</em>",
				pulse: false,
				delay: 0,
				overLimitClassname: "overLimit"
				};

			$.extend(charCounterOptions, options);

			element.charCounter(length, charCounterOptions);
		}
	}
};






oIdolSearchAutoComplete = {
  sAutocompleteClass:".suggest",
init:function() {
  var autoCompleteFlag = true;
  var str = "/search/idol_query.htm?action=autocomplete";
  if(autoCompleteFlag)
  {
	  $(oIdolSearchAutoComplete.sAutocompleteClass).autocomplete(str,
		{
		  delay:40,
		  minChars:3,
		  scroll:false,
		  selectFirst:false,
		  matchContains:false,
		  max:5,
		  width:262
		}).result(function(){
			$(this).parent("form").submit();
		  });
  }
  returnVal = false;
  return false;
    }
};

$(document).ready(function(){
	oFormValidator.init();
	oIeBackgroundImgCache.init();
    oIdolSearchAutoComplete.init();
    $("span.toolTip").tooltip({
      showBody: " ~ ",
      extraClass: "",
      top:3,
      left:-10
    });
    if($("ul.dropdowns")){
		$("ul.dropdowns").superfish({
			animation:{
				opacity:"show",
				height:"show"
			}
			,delay:1000
		}).find(">li:has(ul)").mouseover(function(){
			$("ul",this).bgIframe({opacity:false,src:'about:blank'});
		}).find("a").focus(function(){
			$("ul",$(".superfish>li:has(ul)")).bgIframe({opacity:false,src:'about:blank'});
		});
	}
});

var MP = {
<!-- mp_trans_disable_start -->
    Version: '1.0.14',
    Domains: {'es':'espanol.nationwide.com'},
	SrcLang: 'en',
<!-- mp_trans_disable_end -->
	UrlLang: 'mp_js_current_lang',
	SrcUrl: unescape('mp_js_orgin_url'),
<!-- mp_trans_disable_start -->
	init: function() {
	   if (MP.UrlLang.length!=2) {
	       MP.UrlLang = MP.SrcLang;
	   }
	   if (MP.SrcUrl.indexOf('p_js_orgin_url')==1) {
	       MP.SrcUrl = location.href;
	   }
	},
    switchLanguage: function(lang) {
		if (lang!=MP.SrcLang) {
            var script = document.createElement('SCRIPT');
            script.src = location.protocol+'//'+MP.Domains[lang]+'/'+MP.SrcLang+lang+'/?1023749632;'+escape(MP.SrcUrl);
            document.body.appendChild(script);
        } else if (lang==MP.SrcLang) {
		    MP.switchToLang(MP.SrcUrl);
		}
		return false;
    },
	switchToLang: function(url) {
        var mplink=document.createElement('A');
		if (mplink.click) { // using location.href will cause IE6 to not report referrer
		    mplink.href=url;
            document.body.appendChild(mplink);
            mplink.click();
		} else {
		    location.href=url;
		}
	}
<!-- mp_trans_disable_end -->
};

