var global_slide_whats_new = 1;
var global_slideIntervalId = 0;
Cufon.set('fontFamily', 'Futura Book');
Cufon.replace('#home-main-content .info h2');
Cufon.replace('.country-dropdown-holder h2');
Cufon.replace('#home-secondary-content .header');
Cufon.replace('#subnav h2');
Cufon.replace('#plans-include h2');
Cufon.replace('#white-box .content h1');
Cufon.set('fontFamily', 'Futura Bold');
Cufon.replace('#header ul#utility-nav li:last-child');
Cufon.replace('#home-main-content .info h1');
Cufon.replace('#country-list #close');
Cufon.replace('#country-list-2 #close-2');
Cufon.replace('#plans.business .content #plan-1 h2,#plans.mobile .content #plan-1 h2');
Cufon.replace('.already-customer h3');
Cufon.set('fontFamily', 'Futura Medium');
Cufon.replace('#home-country-list h3');
Cufon.replace('ul#main-nav li a');
Cufon.replace('#home-features-box .feature .header h2');
Cufon.replace('.rate-calculator-container h2');
$(function() {
if($.browser.msie && $.browser.version == '6.0' || $.browser.version == '7.0') {
var flashOffset = '215px';
}
// set misc styles
$('p:last-child').css('margin-bottom','0');
$('#footer ul li:not(:last)').after('
|');
$('#header ul#utility-nav li:not(:last)').after('|');
$('#header ul#main-nav li:first-child').addClass('first');
$('#header ul#main-nav li:last-child').addClass('last');
//$('#home-secondary-content .content .home-secondary-content .row:last').css({'margin-bottom':'0','border-bottom':'0','padding-bottom':'0'});
// view countries dropdown
var showCountries = 0;
var showCountriesMultiple = 0;
var showBizCountries3 = 0;
var showBizCountries4 = 0;
$('#view-countries-button , #forty-five-countries , #residential-countries, #biz-countries-1 , #mobile-countries-1 , #mobile-countries-2').click(function(){
openCountries();
});
$('#biz-countries-2').click(function(){
openCountriesMultiple();
});
$('#biz-countries-3').click(function(){
openBizCountries3();
});
$('#biz-countries-4').click(function(){
openCountries4();
});
function openCountries() {
if (showCountries === 0) {
countriesOn();
}else{
countriesOff();
}
}
function openCountriesMultiple() {
if (showCountriesMultiple === 0) {
countriesMultipleOn();
}else{
countriesMultipleOff();
}
}
function openBizCountries3() {
if (showBizCountries3 === 0) {
bizCountries3On();
}else{
bizCountries3Off();
}
}
function openCountries4() {
if (showBizCountries4 === 0) {
bizCountries4On();
}else{
bizCountries4Off();
}
}
function countriesOn() {
showCountries = 1;
$('#view-countries-button').addClass('expanded');
$('#countries').slideDown(200);
// hacks for IE6/7
$('#home-features-box').hide();
$('#plans-include').hide();
$('#plans-include-replace').show();
if (flashOffset) { $('.offer').css({'height':flashOffset,'overflow':'hidden'}) };
}
function countriesOff() {
showCountries = 0;
$('#view-countries-button').delay(3000).removeClass('expanded');
$('#countries').hide();
// hacks for IE6/7
$('#home-features-box').show();
$('#plans-include').show();
$('#plans-include-replace').hide();
if (flashOffset) { $('.offer').css({'height':'auto','overflow':'visible'}) };
}
function countriesMultipleOn() {
showCountriesMultiple = 1;
$('#countries-2').slideDown(200);
// hacks for IE6/7
$('#plans-include').hide();
$('#plans-include-replace').show();
}
function countriesMultipleOff() {
showCountriesMultiple = 0;
$('#countries-2').hide();
// hacks for IE6/7
$('#plans-include').show();
$('#plans-include-replace').hide();
}
function bizCountries3On() {
showBizCountries3 = 1;
$('#countries-3').slideDown(200);
// hacks for IE6/7
$('#plans-include').hide();
$('#plans-include-replace').show();
}
function bizCountries3Off() {
showBizCountries3 = 0;
$('#countries-3').hide();
// hacks for IE6/7
$('#plans-include').show();
$('#plans-include-replace').hide();
}
function bizCountries4On() {
showBizCountries4 = 1;
$('#countries-4').slideDown(200);
// hacks for IE6/7
$('#plans-include').hide();
$('#plans-include-replace').show();
}
function bizCountries4Off() {
showBizCountries4 = 0;
$('#countries-4').hide();
// hacks for IE6/7
$('#plans-include').show();
$('#plans-include-replace').hide();
}
$('#country-list #close').click(function(){
countriesOff();
});
$('#country-list-2 #close-2').click(function(){
countriesMultipleOff();
});
$('#country-list-3 #close-3').click(function(){
bizCountries3Off();
});
$('#country-list-4 #close-4').click(function(){
bizCountries4Off();
});
$('#home-country-list h3').toggle(function() {
$('#country-lists').slideDown('fast');
$('.country-arrow').attr('src','/resources/images/active/arrow-circled-down.png');
}, function() {
$('#country-lists').slideUp('fast');
$('.country-arrow').attr('src','/resources/images/active/arrow-circled.png');
});
// slideshow
$(function() {
$('#slideshow').cycle({
fx: 'scrollRight',
speed: 600,
timeout: 6000,
pager: '#rotator-links',
pagerEvent: 'click'
});
});
$('#rotator-links a').click(function() {
$('#slideshow').cycle('pause');
});
// tooltip
$('a[rel=tooltip]').mouseover(function(e) {
var tip = $(this).attr('title');
$(this).attr('title','');
$('body').append('');
$('#tooltip').css('top', e.pageY + 10 );
$('#tooltip').css('left', e.pageX + 20 );
}).mousemove(function(e) {
$('#tooltip').css('top', e.pageY + 10 );
$('#tooltip').css('left', e.pageX + 20 );
}).mouseout(function() {
$(this).attr('title',$('.tipBody').html());
$('body').children('div#tooltip').remove();
});
$('.enter-phone').click(function() {
if($('.enter-phone').val() == 'enter phone #') {
$('.enter-phone').val('');
}else{
}
});
$('body').unbind('click').click(function(e) {
if($(e.target).is('.enter-phone')) {
return false;
}
if($('.enter-phone').val() == '') {
$('.enter-phone').val('enter phone #');
}
});
$('a.iframe').fancybox({
'hideOnContentClick' : true,
'overlayOpacity' : 0.6,
'padding' : 5,
'width' : 980,
'height' : 500,
'transitionIn' : 'elastic',
'transitionOut' : 'elastic',
'speedIn' : 600,
'speedOut' : 200
});
});
function slideChange(position) {
if (typeof(position) != 'undefined') {
global_slide_whats_new = position;
} else {
position = global_slide_whats_new++;
}
if (position > 2) {
position = 1;
global_slide_whats_new = position;
}
var slidesCount = 2;
for (i = 1; i <= slidesCount; i++) {
if (position == i) {
document.getElementById("slide_content_" + i).style.visibility = "visible";
document.getElementById("slide_" + i).style.border = "1px solid white";
} else {
document.getElementById("slide_content_" + i).style.visibility = "hidden";
document.getElementById("slide_" + i).style.border = "none";
}
}
}
function slideStart() {
global_slideIntervalId = setInterval("slideChange()", 5000);
}
function slideStop() {
if (global_slideIntervalId != 0) {
clearInterval (global_slideIntervalId);
global_slideIntervalId = 0;
}
}