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_" + 18658791 ).className.match(/mojoSmallWidget/) )
{
if (currentRank >= 1 && currentRank <= 10)
{
if (currentRank == 1)
{
document.getElementById( "currentRank_" + 18658791 ).className = 'mojo1stPlace';
}
else if (currentRank <= 5)
{
document.getElementById( "currentRank_" + 18658791 ).className = 'mojoTop5';
}
else
{
document.getElementById( "currentRank_" + 18658791 ).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_" + 18658791 ).className = 'mojoNominated';
document.getElementById( "mojoCurrentlyRanked" ).innerHTML = ''; //remove "Currently Ranked" text
}
//Medium Widget
if ( document.getElementById( "mojo_widget_" + 18658791 ).className.match(/mojoMediumWidget/) )
{
//Update total votes count
document.getElementById( "numVotes_18658791" ).innerHTML = 3;
//Modify 'flourishes' background image for correct alignment for nominated vs. top x
if ( document.getElementById( "currentRank_" + 18658791 ).className == 'mojoNominated' ) {
document.getElementById( "mojoRankWrapper" ).className = 'nominated';
}
//Start Countdown timer for Medium and Skyscraper sizes
GetCount();
}
//Skyscraper Widget
if ( document.getElementById( "mojo_widget_" + 18658791 ).className.match(/mojoSkyscraperWidget/) )
{
//Update spacing for "Nominated"
if ( document.getElementById( "currentRank_" + 18658791 ).className == 'mojoNominated' )
{
document.getElementById( "mojoRankWrapper" ).style.backgroundPosition = "45px 0";
document.getElementById( "currentRank_18658791" ).style.top = "16px";
}
//Insert reviews
document.getElementById( "reviews_18658791" ).innerHTML = ''; //clear previous values
var liTag = '
Great ServiceWe can't say enough about the TEAM at Fidelity. Alma, Jason and Joe are absolutely great, the communication they have in their office and then to their customers is head and shoulders above any service company we've ever used. They've set up our workstations here in our office, their always available for support and we wouldnâÂÂt dare call someone else.
';
document.getElementById( "reviews_18658791" ).innerHTML += liTag;
var liTag = 'Great PlaceThey are very professional and know what they are doing.
';
document.getElementById( "reviews_18658791" ).innerHTML += liTag;
var liTag = 'Great serviceBeen using Fidelity for a few years now. Joe and his team are smart and know what they're doing!
';
document.getElementById( "reviews_18658791" ).innerHTML += liTag;
//Start Countdown timer for Medium and Skyscraper sizes
GetCount();
}
}
}
var thisDay = new Date();
var dateFutureYear = thisDay.getFullYear(); //use same 4 digit year as current year
var dateFutureMonth = thisDay.getMonth() + 1; //get 0-11 month, add 1 to offset array position
var dateFutureDay = 0; //set day, hour, min, sec to Sunday at 00:00 when awards voting ends
var dateFutureHours = 0;
var dateFutureMins = 0;
var dateFutureSeconds = 0;
var dateFuture = new Date( 1357027200000 );
function GetCount(){
var dateNow = new Date(); //grab current date
var amount = dateFuture.getTime() - dateNow.getTime(); //calc milliseconds between dates
delete dateNow;
// time is already past
if (amount < 0) {
//document.getElementById('countbox_biz_details').innerHTML="MojoAwards countdown complete!";
} else { // date is still good
var days = 0;
var hours = 0;
var mins = 0;
var secs = 0;
var out = "";
amount = Math.floor(amount/1000);//kill the "milliseconds" so just secs
days=Math.floor(amount/86400);//days
if ( days < 10 ) {
days = "0" + days;
}
amount=amount%86400;
hours=Math.floor(amount/3600);//hours
if ( hours < 10 ) {
hours = "0" + hours;
}
amount=amount%3600;
mins=Math.floor(amount/60);//minutes
if ( mins < 10 ) {
mins = "0" + mins;
}
amount=amount%60;
secs=Math.floor(amount);//seconds
if ( secs < 10 ) {
secs = "0" + secs;
}
document.getElementById('days').innerHTML = days;
document.getElementById('hours').innerHTML = hours;
document.getElementById('mins').innerHTML = mins;
document.getElementById('secs').innerHTML = secs;
setTimeout("GetCount()", 1000);
}
}