window.onload = function() { var cssFile = document.createElement("link"); cssFile.setAttribute("rel", "stylesheet"); cssFile.setAttribute("type", "text/css"); cssFile.setAttribute("href", "http://c.mojopages.com/mstatic/styles/bizWidgetEmbed.css"); document.getElementsByTagName( "head" )[0].appendChild( cssFile ); updateRank(); } // Update Current Rank and other variables (ie Voting countdown timer, reviews) function updateRank() { var currentRank = 0; //For Medium and Skyscraper widgets, update current Rank. Small widget does not show rank. if (!document.getElementById( "mojo_widget_" + 41062399 ).className.match(/mojoSmallWidget/) ) { if (currentRank >= 1 && currentRank <= 10) { if (currentRank == 1) { document.getElementById( "currentRank_" + 41062399 ).className = 'mojo1stPlace'; } else if (currentRank <= 5) { document.getElementById( "currentRank_" + 41062399 ).className = 'mojoTop5'; } else { document.getElementById( "currentRank_" + 41062399 ).className = 'mojoTop10'; } } else { //If outside of Top 10 or biz does not have any reviews, display Nominated and remove "Currently Ranked" text document.getElementById( "currentRank_" + 41062399 ).className = 'mojoNominated'; document.getElementById( "mojoCurrentlyRanked" ).innerHTML = ''; //remove "Currently Ranked" text } //Medium Widget if ( document.getElementById( "mojo_widget_" + 41062399 ).className.match(/mojoMediumWidget/) ) { //Update total votes count document.getElementById( "numVotes_41062399" ).innerHTML = 0; //Modify 'flourishes' background image for correct alignment for nominated vs. top x if ( document.getElementById( "currentRank_" + 41062399 ).className == 'mojoNominated' ) { document.getElementById( "mojoRankWrapper" ).className = 'nominated'; } //Start Countdown timer for Medium and Skyscraper sizes GetCount(); } //Skyscraper Widget if ( document.getElementById( "mojo_widget_" + 41062399 ).className.match(/mojoSkyscraperWidget/) ) { //Update spacing for "Nominated" if ( document.getElementById( "currentRank_" + 41062399 ).className == 'mojoNominated' ) { document.getElementById( "mojoRankWrapper" ).style.backgroundPosition = "45px 0"; document.getElementById( "currentRank_41062399" ).style.top = "16px"; } //Insert reviews document.getElementById( "reviews_41062399" ).innerHTML = ''; //clear previous values document.getElementById( "reviews_41062399" ).innerHTML = "