/*Updated 09-24-2015*/ /*! * DW JS LIBRARY 1.0 * * jQuery 1.4.2 * Colorbox 1.3.9 * jQuery Tools 1.2.5 * jQuery UI 1.8.5 * jScrollPane v2.0.0beta5 * scrollTo 1.4.2 * curvyCorners */ $(document).ready(function() { initFront(); $("td:empty").html(" "); //remove when all td elements are fixed in the backend var wins = $('.statsFeedWrap:eq(0) .stat_2 .feedDesc2').text(); calcTrophies(wins); checkFA(); }); function checkFA() { var mrpFaCookie = "mrpFaCheck"; function GetMrpFaCookie() { var keyValue = document.cookie.match('(^|;) ?' + mrpFaCookie + '=([^;]*)(;|$)'); return keyValue ? keyValue[2] : null; } if (GetMrpFaCookie()) { //check for old FA icons $("*").each(function () { if ($(this).hasClass("fa") && !$(this).hasClass("fas")) alert($(this).attr("class")); }); } else if (querySt("checkMrpFa")) { alert("setting cookie"); var date = new Date(); date.setTime(date.getTime() + (7 * 24 * 60 * 60 * 1000)); var expires = '; expires=' + date.toUTCString(); document.cookie = mrpFaCookie + '=dismiss' + expires + "; path=/"; } } function newWindow(path, w, h, scroll) { var height = h; var width = w; var wleft = (screen.width - width - 20) / 2; var wtop = (screen.height - height) / 2; window.open(path, 'newwin', 'fullscreen=0,scrollbars=' + scroll + ',height=' + height + ',width=' + width + ',top=' + wtop + ',left=' + wleft + ''); } var iHeight = 500; var iWidth = 980; var iHeightDefault = 500; var iWidthDefault = 980; var iHeightOffset = 160; var iContentSrc = ""; var navTimers = []; var fileDomain = ""; //currently only used to prepend locally included files with "http://localhost" but could be used for different domains, etc. var isLocal = false; if (!location.host.indexOf("localhost") > 0) isLocal = true; if (isLocal) fileDomain = "http://localhost"; function iAdmin(aHref, stdUserOnly) { setPanelDimsByPage(aHref); // if (!stdUserOnly) // $(".iControls .adminOnly").show(); // else // $(".iControls .adminOnly").hide(); if ($("#siteBar, #sourceBar").size() > 1) iHeightOffset = 90; //if ((location.hostname == "localhost") && !stdUserOnly) { //strip out the port if we are on localhost // aHref = "http://localhost/admin" + aHref.split("/admin")[1]; // //alert(aHref); //} $("#iAdmin").attr("src", iContentSrc + aHref); //$("#mrpPanel .adminPanelWrap").siblings().hide(); $("#mrpPanel .adminPanelWrap").show(); if ($("#mrpPanel").length > 0) { if ((!$("#mrpPanel").is(":visible")) || ((iHeight != $("#mrpPanel").height()) || (iWidth != $("#mrpPanel").width()) && $("#mrpPanel").is(":visible"))) { showPanel($("#mrpPanel")); } } else if ($("body").attr("id") == "popAdminBody")//popped out { showPoppedAdmin(aHref); } } function iUser(aHref) { iAdmin(aHref, true, iHeight, iWidth); } function setPanelDimsByPage(page) { page = page.toLowerCase(); page = page.split(".aspx")[0]; if (page.indexOf(location.host.toString()) != -1) page = page.split(location.host.toString())[1]; //alert(page); switch (page) { //case '/admin/cr/myaccount/': iHeight = 400; iWidth = 730; allowPanelResize = false; break; case '/admin/cr/myaccount/signin': iHeight = 460; iWidth = 730; allowPanelResize = false; break; case '/admin/cr/myaccount/signup': iHeight = 460; iWidth = 730; allowPanelResize = false; break; case '/admin/cr/claim/request': iHeight = 520; iWidth = 730; allowPanelResize = false; break; case '/admin/cr/claim/submit': iHeight = 520; iWidth = 730; allowPanelResize = false; break; default: iHeight = iHeightDefault; iWidth = iWidthDefault; break; } } function iAdminResize(smart) { var curHeight = $("#mrpPanel").height(); var curWidth = $("#mrpPanel").width(); var availHeight = $(window).height() - iHeightOffset; //alert(getPanelLock()); if (getPanelLock() == false) { if (($("#mrpPanel").is(":visible")) && (allowPanelResize == true) && (!$("#mrpPanel").is(":animated"))) { //if (smart) { //if (curHeight > ($(window).height() - iHeightOffset)) { $("#mrpPanel").animate({ height: (availHeight) + "px" }, 500); //} //else { //$("#mrpPanel").animate({ height: iHeight + "px" }, 500); //} //} //else { //if (curHeight == iHeight) { //$("#mrpPanel").animate({ height: ($(window).height() - iHeightOffset) + "px" }, 500); //} else { //$("#mrpPanel").animate({ height: iHeight + "px" }, 500); //} //} } else if (curHeight > (availHeight) && !$("#mrpPanel").is(":animated")) { $("#mrpPanel").animate({ height: (availHeight) + "px" }, 500); } else if ((curHeight < iHeight) && (availHeight > iHeight)) { //full but strict if (iHeight == iHeightDefault) $("#mrpPanel").animate({ height: (availHeight) + "px" }, 500); else $("#mrpPanel").animate({ height: (iHeight) + "px" }, 500); } else if ((curHeight < iHeight) && (availHeight > curHeight)) { //full but less than strict (only do available) $("#mrpPanel").animate({ height: (availHeight) + "px" }, 500); } if ($("#iAdmin").contents().find(".smartHeight").length > 0) { //internal smart heights such as results page / schedule lookup page setTimeout('initSmartHeight()', 600); } } } function setPanelOffset(panel) { var topBarHeight = 26; if ($("#topBarWrap").length > 0) { topBarHeight = $("#topBarWrap").height(); } $(".panelWrap").css("padding-top", topBarHeight + "px"); } function showPanel(panel) { if (window.stopSite) { stopSite(); } $("html, body").css("overflow", "hidden").css("height", "100%"); winScroll(); $("#mrpOverlay").show().css({ opacity: '0.9' }); //setPanelOffset(panel); //only animate panel if it is already visible if ($(panel).is(":visible")) { $(panel).animate({ width: iWidth + "px", marginLeft: (iWidth / -2) + "px" }, 150) } //if it is not visible then we just do a quick set of the width and margin before showing else { $(panel).css("width", iWidth + "px") .css("margin-left", (iWidth / -2) + "px"); } $(panel).show(); if (($(window).height() - iHeightOffset) > iHeight) { if (iHeight == iHeightDefault) { //show panel full screen $("#mrpPanel").animate({ height: ($(window).height() - iHeightOffset) + "px" }, 500); } else { $(panel).animate({ height: iHeight + "px" }, 1000); } } else { $("#mrpPanel").animate({ height: ($(window).height() - iHeightOffset) + "px" }, 300); } var resizeTimer = null; $(window).resize(function() { resizeWindow(); }); function resizeWindow() { if (resizeTimer) { clearTimeout(resizeTimer); } resizeTimer = setTimeout('iAdminResize(true);', 500); } } function setPoppedAdminHeight() { var availHeight = ($(window).height() - $("#mrpBar").height()) / $(window).height() * 100; $("#iAdmin").height(availHeight + "%"); } function showPoppedAdmin(aHref) { setHash(aHref.split("/admin/")[1]); var resizeTimer = null; $(window).resize(function() { resizePoppedAdmin(); }); function resizePoppedAdmin() { if (resizeTimer) { clearTimeout(resizeTimer); } resizeTimer = setTimeout('setPoppedAdminHeight();', 500); } setPoppedAdminHeight(); } //function aniWindow() { // if (window.startSite) { // startSite(); // } // var panel = parent.document.getElementById("mrpPanel"); // $(panel).animate({ height: "0px" }, // 600, function() { $(this).hide(); $(".panelWrap").hide(); }); // $(".panelWrap iframe").each(function() { // $(this).attr("src", ""); // }); //} function buildPopOutLink(el) { $(el).attr("href", getHashFromIframe(true)); } function checkPopAdminHash() { //called when iframe loads var curHash = getHash(); if (curHash) { $("#iAdmin").attr("src", curHash); } } function refreshAdmin() { var f = document.getElementById('iAdmin'); f.contentWindow.location.reload(true); } ///INIT FUNCTIONS/// function initFront() { if ($("#mrpBar ul, #siteBar ul").length > 0) { $('#mrpBar ul, #siteBar ul').superfish({ hoverClass: 'active', delay: 300, animation: { height: 'show' }, speed: 'fast', pathClass: 'curActive', autoArrows: false }); } if ($(".txtMax").length > 0) { initMaxLengths(); } if ($(".wordCount").length > 0) { initWordCount(); } if ($(".modalBox").length > 0) { initModalBox(); } if ($("a.modalFrame").length > 0) { initModalFrame(); } if ($("#sourceBar .sourceHeadlineWrap li").length > 1) { custScroll(2000, 8500, -18, 'top', '.sourceHeadlineWrap', '.headlineList', 'headlineItem'); } //if (typeof initToolTips == 'function') if (!$("body").hasClass("mobileBody")) { initToolTips(); if ($(".mrp_contentMenu.menuAllowMore").length > 0) { $(".mrp_contentMenu.menuAllowMore").each(function(i) { checkMrpDropDown(i); //do we need a "more" dropdown }); } } if ($("body").attr("ID") == "productDetailBody") { bindSubItemInputs(); } //QUICK Contact $("#contactSet .fieldWrap input").click( function(){ markQCGood(this); } ); //Scrollable feeds if (($("div.resultsFeed .feedContent").length > 1) && ($("div.resultsFeed .resultsNext").length > 0)) { $("div.resultsFeedSub").scrollable({ clickable: false, loop: false, size: 1, keyboard: false, next: ".resultsNext", prev: ".resultsPrev", items: "div.resultsScrollable" }); } if (($("div.pointsFeed .feedContent").length > 1) && ($("div.pointsFeed .pointsNext").length > 0)) { $("div.pointsFeedSub").scrollable({ clickable: false, loop: false, size: 1, keyboard: false, next: ".pointsNext", prev: ".pointsPrev", items: "div.pointsScrollable" }); } } function initTabs() { //alert("tabs"); $("ul.tabs").tabs("div.panes > div.pane"); } function initModalBox() { if ($("a.modalForm").length > 0) { $("#colorbox").prependTo("form"); $("#cboxOverlay").prependTo("form"); } $("a.modalBox").colorbox(); $("a.inlineModal").colorbox({ transition: "none", inline: true, href: $(this).attr("href"), maxWidth: "98%", maxHeight: "98%", initialWidth: "100px", initialHeight: "100px" }); if (window.initEcomTypeModals) { initEcomTypeModals(); } } function initModalFrame() { $("a.modalFrame").each(function() { var modalDimensions = '350x350'; //&d= var modalCallBack = ''; //&f= var modalArgs = $(this).attr("rel"); if (modalArgs) { modalDimensions = parseArgs('d', modalArgs); modalCallBack = parseArgs('f', modalArgs); } modalWidth = parseInt(modalDimensions.split("x")[0]) + "px"; modalHeight = parseInt(modalDimensions.split("x")[1]) + "px"; $(this).colorbox({ iframe: true, width: modalWidth, height: modalHeight, rel: 'nofollow', onClosed: function() { eval(modalCallBack); } }); }); } function parseArgs(ji, toParse) { hu = toParse; gy = hu.split("|"); for (i = 0; i < gy.length; i++) { ft = gy[i].split(":"); if (ft[0] == ji) { return ft[1]; } } } function initAdminResize() { $("#mrpPanel").resizable({ maxHeight: 1000, maxWidth: 980, minHeight: 300, minWidth: 980, handles: 's', grid: 1 }); } function initScrollPane(el) { if (el) { $(el).jScrollPane({ reinitialiseOnImageLoad: true }); } $(".jScrollPane").jScrollPane({ reinitialiseOnImageLoad: true }); } function initValidate() { $("#aspnetForm").validate({ ignoreTitle: true, submitHandler: function(form) { form.submit(); }, invalidHandler: function(form, validator) { var errors = validator.numberOfInvalids(); if (errors) { var message = errors == 1 ? 'You missed 1 field. It has been highlighted' : 'You missed ' + errors + ' fields. They have been highlighted'; $("div.err span").html(message); $("div.err").show(); } else { $("div.err").hide(); } }, rules: { email: { email: true }, password2: { equalTo: "password1" } } }); jQuery.validator.addClassRules({ fname: { required: true, minlength: 2 }, lname: { required: true, minlength: 2 }, zip: { required: true, digits: true, minlength: 5, maxlength: 5 } }); } function initMaxLengths() { $(".txtMax").each(function() { var max = parseInt($(this).attr("class").split("chars")[1]); initMax(this, max); }); } function initWordCount() { $('.wordCount').each(function() { wordCount(this); $(this).keyup(function() { wordCount(this) }); }); } function wordCount(el) { if ($(el).next().is(".curWordCount")) { $(el).next().remove(); } $(el).after("
"); var number = 0; var matches = $(el).val().match(/\b/g); if (matches) { number = matches.length / 2; } $(el).parent().find('.curWordCount').html('Approximately ' + number + ' word' + (number != 1 ? 's' : '')); } function initMax(el, max) { if ($(el).next().is(".charsRemaining")) { $(el).next().remove(); } $(el).after(""); $(el).parent().find('.charsRemaining').html('You have ' + (max - $(el).val().length) + ' characters remaining.'); $(el).keydown(function() { $(el).parent().find('.charsRemaining').html('You have ' + (max - $(el).val().length) + ' characters remaining.'); if ($(el).val().length > max) { $(el).val($(el).val().substr(0, max)); } $(el).parent().find('.charsRemaining').html('You have ' + (max - $(el).val().length) + ' characters remaining.'); }); } function initSmartHeight(el) { if (el) { //setHeight(el); } else { $("#iAdmin").contents().find(".smartHeight").each(function() { setHeight(this); }); } function setHeight(el) { var elOffset = $(el).offset(); var winHeight = $("#mrpPanel").height(); var newHeight = (winHeight - elOffset.top - iHeightOffset) + "px"; $(el).css("height", newHeight); } } function initReplaceFont(siteName, class2Replace, fontWidth, fontHeight, container) { if (container) { } else { container = "body"; } $(container + " ." + class2Replace).each(function() { var unique = Math.floor(9999 * Math.random()); var textToReplace = escape($(this).text().replace(/ /g, " ")); //add extra space for this particular font var newElement = $(this).wrapInner(""); if (this.tagName == "A") { if ($(this).attr("onclick")) { var jsClick = $(this).attr("onclick"); $(this).mousedown(jsClick); $(this).attr("onclick", ""); replaceFont(textToReplace, "newId" + unique, "true", "", $(this).attr("onmousedown")); } else replaceFont(siteName, textToReplace, "newId" + unique, "true", $(this).attr("href"), "", fontWidth, fontHeight); } else { replaceFont(textToReplace, "newId" + unique, "false", fontWidth, fontHeight); } }); } ///END INIT FUNCTIONS/// function replaceFont(siteName, text, element, cursor, href, jsClick, fontWidth, fontHeight) { var flashvars = { setCursor: cursor, txtString: text }; var params = { quality: "best", allowFullScreen: "false", scale: "showall", wmode: "transparent" }; if (jsClick) var attributes = { onmousedown: jsClick }; else if (href) var attributes = { onmousedown: "window.location='" + href + "';" }; else var attributes = {}; swfobject.embedSWF("/css/" + siteName + ".swf", element, fontWidth, fontHeight, "9.0.28", false, flashvars, params, attributes); } function toggleDDbox(box, ref) { box = $("#ddBox" + box); if (box.is(":visible")) { box.fadeOut("fast"); } else { $(".ddBox").fadeOut("fast"); box.fadeIn("fast"); } $("#siteWrapper").click(function(e) { box.fadeOut("fast"); }); } function swapEl(toShow, toHide, navClicked) { if (navClicked) { $(navClicked).siblings().removeClass("genUrl"); $(navClicked).addClass("genUrl"); } $(toShow).show(); $(toHide).hide(); } function quickToggle(el) { //pass an element and it will toggle the children that have a class of "quickHide" $(el).find(".quickHide").toggle(); } function quickToggleAll(el) { //pass an element to change the text. it will toggle all elements that have a class of "quickHide" $(".mrp_schedule").find(".quickHide").toggle(); } function moneyConvert(value) { var buf = ""; var sBuf = ""; var j = 0; value = String(value); if (value.indexOf(".") > 0) { buf = value.substring(0, value.indexOf(".")); } else { buf = value; } if (buf.length % 3 != 0 && (buf.length / 3 - 1) > 0) { sBuf = buf.substring(0, buf.length % 3) + ","; buf = buf.substring(buf.length % 3); } j = buf.length; for (var i = 0; i < (j / 3 - 1); i++) { sBuf = sBuf + buf.substring(0, 3) + ","; buf = buf.substring(3); } sBuf = sBuf + buf; if (value.indexOf(".") > 0) { value = sBuf + value.substring(value.indexOf(".")); } else { value = sBuf; } return value; } function allowInputNumbersOnly(e) { var key = e.charCode || e.keyCode || 0; // allow backspace, tab, delete, arrows, numbers and keypad numbers ONLY return ( key != 229 || key == 8 || key == 9 || key == 46 || (key >= 37 && key <= 40) || (key >= 48 && key <= 57) || (key >= 96 && key <= 105) ); } function querySt(ji) { hu = window.location.search.substring(1); gy = hu.split("&"); for (i = 0; i < gy.length; i++) { ft = gy[i].split("="); if (ft[0] == ji) { return ft[1]; } } } function getHash() { return document.location.hash.replace("#", ""); } function setHash(newHash) { return document.location.hash = newHash; } function getHashFromIframe(withDomain) { //withDomain includes http://domain.com/admin/ var iframe = $('#iAdmin'); var contentWnd = iframe.attr('contentWindow'); var curDomain = ""; var curAdmin = contentWnd.window.location.href; var newHash = "#"; if (withDomain) { curDomain = curAdmin.split('/admin/')[0]; curDomain = curDomain + "/admin/"; } newHash = newHash + curAdmin.split('/admin/')[1]; newHash = curDomain + newHash; //alert(newHash); return newHash; } function winScroll(id, CssClass) { if (id) { $.scrollTo($("#" + id), 'slow', { offset: { top: -50, left: 0} }); } else if (CssClass) $.scrollTo($("." + CssClass), 'slow', { offset: { top: -50, left: 0} }); else { $('html, body').animate({ scrollTop: 0 }, 'slow'); } return false; } function isOnScreen(element) { var curPos = element.offset(); var curTop = curPos.top; var screenHeight = $(window).height(); if (curTop > screenHeight) return false; else return true; } function stickySide(id, gutter) { if (window.XMLHttpRequest) { if (document.documentElement.scrollTop > gutter || self.pageYOffset > gutter) { $('#' + id).css('position', 'fixed'); $('#' + id).css('top', '8px'); } else if (document.documentElement.scrollTop < gutter || self.pageYOffset < gutter) { $('#' + id).css('position', 'absolute'); $('#' + id).css('top', gutter + 'px'); } } } function initPhotoFader(picFadeSelector, interval, speed, startItem) { var photoItems; var currPhotoItem = 0; if (!speed) var speed = 3000; function fadePhotos(picFadeSelector, currPhotoItem, photoItems) { $(picFadeSelector + ":eq(" + currPhotoItem + ")").fadeOut(speed); currPhotoItem = ++currPhotoItem % photoItems; $(picFadeSelector + ":eq(" + currPhotoItem + ")").fadeIn(speed); return currPhotoItem; } function updateCurrPhotoItem() { currPhotoItem = fadePhotos(picFadeSelector, currPhotoItem, photoItems); } $(picFadeSelector).fadeIn("fast"); photoItems = $(picFadeSelector).hide().size(); if (startItem) { if (startItem == "random") currPhotoItem = Math.ceil(photoItems * Math.random()) - 1; else currPhotoItem = startItem - 1; } $(picFadeSelector + ":eq(" + currPhotoItem + ")").show(); setInterval(updateCurrPhotoItem, interval); //time in milliseconds } function custScroll(custScrollSpeed, custScrollPause, itemOffset, cssDir, wrap1, wrap2, itemClass) { var curScrollWrap2 = ''; var curScrollItem = ''; function getItems() { curScrollWrap2 = $(wrap1 + ' ' + wrap2); curScrollItem = $(wrap1 + ' .' + itemClass + ':first'); } function doScroll() { getItems(); //animate if (cssDir == "top") { curScrollWrap2.animate({ top: itemOffset + "px" }, custScrollSpeed, function () { curScrollWrap2.append(curScrollItem.fadeIn(custScrollSpeed)); } ); curScrollItem.fadeOut(custScrollSpeed, function() { curScrollWrap2.css("top", "0px"); }); } else { curScrollWrap2.animate({ left: itemOffset + "px" }, custScrollSpeed, function () { curScrollWrap2.append(curScrollItem.fadeIn(custScrollSpeed)); }); curScrollItem.fadeOut(custScrollSpeed, function() { curScrollWrap2.css("left", "0px"); }); } } getItems(); //setInterval(doScroll, custScrollPause); var wait = setInterval(function() { if ((!curScrollWrap2.is(":animated")) && (!curScrollItem.is(":animated"))) { //clearInterval(wait); doScroll(); } }, custScrollPause); } function LoadGallery(pictureName, imageFile, titleCaption, captionText, curEl) { if (curEl) { $(".activeThumb").removeClass("activeThumb"); $(curEl).parent().addClass("activeThumb"); } var picture = document.getElementById(pictureName); if (picture.filters) { picture.style.filter = "blendTrans(duration=1)"; picture.filters.blendTrans.Apply(); } picture.src = imageFile; if (picture.filters) { picture.filters.blendTrans.Play(); } document.getElementById(titleCaption).innerHTML = captionText; if(document.getElementById("picPrintLink") != null) { $('#picPrintLink a').attr('href', imageFile); } // if ($.colorbox) { // var newWidth = picture.clientWidth; // if (newWidth < $("#picThumbsWrap").width()) // newWidth = $("#picThumbsWrap").width(); // $.colorbox.resize({ innerWidth: newWidth + 40 + 'px' }); // } } function LoadPicture(pictureName, imageFile, captionText, photographer, photographerLink, nextId, picId) { var picture = document.getElementById(pictureName); var refId = pictureName.replace("photo", ""); picture.src = imageFile; if($("#captionCredit").length > 0) { if (photographerLink != "" && photographerLink != null) { if (photographerLink.match("http://")) { document.getElementById("captionCredit").innerHTML = "" + photographer + ""; } else if (photographerLink.match("mailto:")) { document.getElementById("captionCredit").innerHTML = "" + photographer + ""; } else { document.getElementById("captionCredit").innerHTML = photographer; } } else document.getElementById("captionCredit").innerHTML = photographer; } if($("#captionText").length > 0) { document.getElementById("captionText").innerHTML = captionText; if (captionText == "" && photographer == "") { document.getElementById("picCaption").style.visibility = "hidden"; } else { if (captionText == "") { document.getElementById("captionText").style.visibility = "hidden"; } else { document.getElementById("picCaption").style.visibility = "visible"; document.getElementById("captionText").style.visibility = "visible"; } if (photographer == "") { document.getElementById("captionCredit").style.visibility = "hidden"; } else { document.getElementById("picCaption").style.visibility = "visible"; document.getElementById("captionCredit").style.visibility = "visible"; } } } SetPicLink(nextId, refId); } function SetPicLink(nextId, refId) { var curPic = document.getElementById("picLink" + refId); var nextPic = document.getElementById(nextId); curPic.setAttribute("href", nextPic.getAttribute("href")); setActiveThumb(nextId.split("ga")[1]); }; function setActiveThumb(i) { //some pretty weird stuff, but it works... i = i - 2; if (i < 0) { i = $(".thumbWrap:last-child").index(); } $(".activeThumb").removeClass("activeThumb"); $(".thumbWrap:eq(" + i + ")").addClass('activeThumb'); } function loadComments_MRP(refId, refType, ele) { var com = $(ele); var stamp = new Date().getMilliseconds(); com.html("'); var pullUrl = "/api/get/ad.aspx"; $.get(pullUrl + "?data=ads" + extraArgs, function (data) { $(ele).html(data); if (extraArgs.split("numtoshow=")[1].split("&")[0] > 0) { var numtoshow = extraArgs.split("numtoshow=")[1].split("&")[0]; var scrolldir = extraArgs.split("scrolldir=")[1].split("&")[0]; var scrolldist = extraArgs.split("scrolldist=")[1].split("&")[0]; //this needs to be more generalized if ((extraArgs.split("placement=")[1].split("&")[0] == "sponsor") && $(".sponsorWrapper .singleAdWrap").length > numtoshow) { $(".sponsorWrapper .adWrap").css('width', '3000em').css('text-align', 'left'); custScroll(1200, 4000, scrolldist, scrolldir, '.sponsorWrapper', '.adWrap', 'singleAdWrap'); } } }); } //End AJAX Ads