(function($){
//MOBILE BENEFIT ACTION CLICK
if($(window).outerWidth(true) <= 768)
{
$("#control ul li").on("click",function(e)
{
//$("style[data-name='benefits'],style[data-name='home-hash'],style[data-name='dashboard'],style[data-name='plans-page']").remove();
if($(this).find(".control-desc").hasClass("open")) { $(this).find(".control-desc").removeClass("open").stop(true, true).slideUp(100,function(){
//$("body").prepend("");
}); return false; }
$("#control ul li").find(".control-desc").stop(true, true).slideUp(100);
$("#control ul li").find(".control-desc.open").removeClass("open");
if(!$(this).find(".control-desc").hasClass("open"))
{
$(this).find(".control-desc").stop(true, true).slideDown(100,function(){
setTimeout(function(){
//$("body").prepend("");
},200)
}).addClass("open");
}
return false;
});
}
$(window).on("resize",function(){
if($(window).outerWidth(true) <= 768)
{
$("#control ul li").on("click",function(e)
{
//if($(this).find(".control-desc").hasClass("open")) { return; }
//$("style[data-name='benefits'],style[data-name='home-hash'],style[data-name='dashboard'],style[data-name='plans-page']").remove();
$("#control ul li").find(".control-desc").stop(true, true).slideUp(100);
$("#control ul li").find(".control-desc.open").removeClass("open");
if(!$(this).find(".control-desc").hasClass("open"))
{
$(this).find(".control-desc").stop(true, true).slideDown(100,function(){
// setTimeout(function(){
// $("body").prepend("");
// },200);
}).addClass("open");
}
return false;
});
}
});
//MOBILE SWIPE EVENT
var old_tab_link = $("section#plans-tabs .tab-container ul.tab-links").clone();
$.fn.swiperNoSwiping = function(opts){
var old_tab_contents = "";
var divPoints = [];
divPoints[1] = "div#banner";
divPoints[2] = "section#plans-tabs";
divPoints[3] = "section#control";
divPoints[4] = "section#buy-sim";
var defaults = {
max_window_width : 768, // in pixels
current_page : $("#mobile_current_page"),
target : ["div#banner","#plans-tabs","section#control","#buy-sim"]
};
$.fn.extend(defaults,opts);
var self = $(this);
var curr_window_width = $(window).outerWidth(true);
var half = parseInt(curr_window_width / 3);
self.NextPage = null;
self.ActivePage = null;
self.PrevPage = null;
self.numberPage = 1;
self.plansPage = function(toMobile){
if(toMobile)
{
var personalised = $("section#pricing #personalised.personalised-page").detach();
$("ul.pricing-nav li.personalised-tab").append(personalised);
var payg = $("section#pricing div#pay-as-you-go").detach();
$("ul.pricing-nav li.payg-tab").append(payg);
var unli = $("section#pricing div#unlimited").detach();
$("ul.pricing-nav li.unlimited-tab").append(unli);
}else{
// from mobile back to desktop
var personalised = $("section#pricing #personalised.personalised-page").detach();
personalised.insertAfter("section#pricing div.pricing-tabs");
var payg = $("section#pricing div#pay-as-you-go").detach();
$("ul.pricing-nav li.payg-tab").append(payg);
payg.insertAfter("section#pricing div.pricing-tabs");
var unli = $("section#pricing div#unlimited").detach();
$("ul.pricing-nav li.unlimited-tab").append(unli);
unli.insertAfter("section#pricing div.pricing-tabs");
}
}
/*self.processOtherPages= function(){
setTimeout(function(){
$("section.plans").css({
'top' : 150
});
$("section#pricing").css({
'top' : $("section.plans").outerHeight(true) + 150
});
$("section#banner_pages").css({
'top' : 150
})
$("section#banner_activate").css({
'top' : 150
});
$("section.content").css({
'top' : $("section#banner_activate,section#banner_pages,section#page-banner").outerHeight(true) + 150
});
$("section#award").css({
'top' : $("div#banner").outerHeight(true) + 150
});
$("section#content-coverage-map").css({
'top' : $("#coverage-banner").outerHeight(true)
});
$("section#why-yomojo").css({
'top' : 150 + $("#coverage-banner").outerHeight(true) + $("section#content-coverage-map").outerHeight(true)
});
$("#banner-contact-us, #coverage-banner").css({
'top' : 150
})
$("section#contact-page").css({
'top' : $("#banner-contact-us").outerHeight(true) + 150
})
//footer padding
//$("footer.footer-pages").css({ 'top' : $("section#banner_activate,section.plans").outerHeight(true) + 150 + $("section.content,section#pricing").outerHeight(true) });
if(window.location.hash == "#unlimited")
{
//$("footer.footer-pages").css({ 'top' : $("section.plans").outerHeight(true) + 170 + $("section#pricing div#unlimited.tab-contenttt").outerHeight(true) });
}
//footer padding
$("footer#contact-page-single").css({
'top' : $("#banner-contact-us,section#banner_pages.banner_unli.plans.ty,section#banner_pages.banner_unli.plans,div#banner").outerHeight(true) + 150 + $("section#contact-page").outerHeight(true)
});
$("footer#contact-coverage-single").css({
'top' : 150 + $("#coverage-banner").outerHeight(true) + $("section#content-coverage-map").outerHeight(true) + $("section#why-yomojo").outerHeight(true)
});
},500);
}*/
self.transitionResizeCheck = function(){
$(".ajaxmodal").show();
setTimeout(function(){
$(".ajaxmodal").fadeOut();
if(defaults.current_page.attr('data-size') > 768)
{
//self.retainSelectedTab();
/*self.transformLayout("mobile",defaults.current_page.attr('data-index'));*/
//defaults.current_page.attr('data-size', $(window).outerWidth(true))
}else{
/*self.transformLayout("desktop",defaults.current_page.attr('data-index'));*/
//defaults.current_page.attr('data-size', $(window).outerWidth(true))
}
var mqlPortrait = window.matchMedia("(orientation: portrait)");
var mqlLandscape = window.matchMedia("(orientation: landscape)");
/*if(mqlPortrait.matches || mqlLandscape.matches) {
if(typeof defaults.current_page.attr('data-index') === 'undefined' && defaults.current_page.val() == "div#banner")
{
self.transformLayout("mobile",0);
}else{
self.transformLayout("mobile",defaults.current_page.attr('data-index'));
}
self.retainSelectedTab();
}*/
},300);
}
/*self.retainSelectedTab = function(){
//retain selected tab when mobile when resizing
$.each(defaults.target,function(i,v){
if(defaults.current_page.val() == defaults.target[i])
{
$(defaults.target[i]).animate({'left':0},100).css({ 'visibility' : 'visible' });
$("footer#contact-us").css({'top' : $(defaults.target[i]).outerHeight(true) + $("header#homepage").outerHeight(true) });
}else{
if($(window).outerWidth(true) <= 768)
{
$(defaults.target[i]).animate(
{
'left': (($(window).outerWidth(true) * i) - (defaults.current_page.attr('data-index') * $(window).outerWidth(true) ))
},
100
).css({ 'visibility' : 'hidden' });
}else{
// $(defaults.target[i]).animate(
// {
// 'left': (($(window).outerWidth(true) * i) - (defaults.current_page.attr('data-index') * $(window).outerWidth(true) ))
// },
// 100
// ).css({ 'visibility' : 'visible' });
}
$("footer#contact-us").css({ 'top' : $(defaults.target[i]).outerHeight(true) + $("header#homepage").outerHeight(true) });
}
});
}*/
self.resizeLayout = function(){
var ww = $(window).outerWidth(true);
/*$(window).on("resize",function(e){
if(ww != $(window).outerWidth(true))
{
$(window).scrollTop(0);
}
setTimeout(function(){
if(Modernizr.touch)
{
if(ww != $(window).outerWidth(true))
{
ww = $(window).outerWidth(true);
self.transitionResizeCheck();
}
//e.preventDefault();
}else{
self.transitionResizeCheck();
self.retainSelectedTab();
}
},300);
});*/
/*window.addEventListener("orientationchange", function(e) {
if(Modernizr.touch)
{
$(".ajaxmodal").show();
setTimeout(function(){
$(".ajaxmodal").fadeOut();
//self.processOtherPages();
self.retainSelectedTab();
},300);
}
});*/
}
/*self.transformLayout = function(t,index){
if($(window).outerWidth(true) <= 768)
{
if(t == "mobile")
{
setTimeout(function(){
if($("section#award").length > 0)
{
$("section#award").css({
'position' : 'absolute',
'top' : $("div#banner").outerHeight(true) + 169,
'left' : 0,
'z-index' : 999
});
}
},500);
$.each(defaults.target,function(k,l){
$(defaults.target[k]).css({
'position' : 'absolute',
'left' : k * $(window).outerWidth(true),
'top' : 169,
'visibility' : 'hidden'
})
if(typeof index != 'undefined')
{
if(index == k)
{
$(defaults.target[k]).css({
'visibility' : 'visible'
});
setTimeout(function(){
$("footer#contact-us").css('top', $(defaults.target[k]).outerHeight(true) + 160);
if($("section#award").length > 0)
{
$("footer#contact-us").css('top', $(defaults.target[k]).outerHeight(true) + $("section#award").outerHeight(true) + 160);
}
},500)
}
}
});
}
}else{
if(t == "desktop")
{
setTimeout(function(){
if($("section#award").length > 0)
{
$("section#award").css({
'position' : 'static',
'top' : 0,
'left' : 0,
'z-index' : 999
});
}
},500);
$.each(defaults.target,function(k,l){
$(defaults.target[k]).css({
'position' : 'relative',
'left' : 0,
'top' : 'initial',
'visibility' : 'visible',
}).show();
});
}
}
}*/
self.otherPagesHeaderLinkClickAction = function(){
$(window).on("load",function(){
$(".mobile-nav-black ul li a").each(function(i,v){
if($(this).data("hash") == window.location.hash && $(window).outerWidth(true) <= 768)
{
$(".mobile-nav-black ul li a").removeClass("active");
$("#mobile_current_page").val($(this).data("content"));
$(this).addClass("active");
$("section#award").hide();
if(i == 0)
{
$("section#award").show();
}
$.each(defaults.target,function(k,v){
if(i == k)
{
$(defaults.target[i]).animate({
'left': 0
},100,function(){
$(defaults.target[i]).css('visibility' , 'visible').show();
/*$("footer#contact-us").css('top', $(defaults.target[i]).outerHeight(true) + $("header").outerHeight(true));*/
});
}else{
$(defaults.target[k]).animate({
'left' : ((k * $(window).outerWidth(true)) - ($(window).outerWidth(true) * i))
},100,function(){
$(defaults.target[k]).css('visibility' , 'hidden').hide();
/*$("footer#contact-us").css('top', $(defaults.target[i]).outerHeight(true) + $("header").outerHeight(true));*/
});
}
});
}
});
});
}
self.init = function()
{
defaults.current_page.attr('data-size', $(window).outerWidth(true));
self.resizeLayout();
/*self.transformLayout("mobile",0);*/
self.otherPagesHeaderLinkClickAction();
$(window).on("load",function(){
$(".ajaxmodal").fadeOut();
self.linkAction();
});
self.plansPage();
}
self.linkAction = function(){
$("ul.sidr-class-menu li a.sidr-class-mobile-benefit-link, header #mobile-nav-contact.mobile-nav-black ul li a").each(function(i,v){
if($(this).attr("href") !== "javascript:void(0);")
{
return true;
}
$(this).on("click",function(){
var dis = $(this);
$("style[data-name='benefits'],style[data-name='home-hash'],style[data-name='dashboard'],style[data-name='plans-page']").remove();
$("header#homepage #mobile-nav-contact.mobile-nav-black.homepage ul li a").removeClass("active");
$("header#homepage #mobile-nav-contact.mobile-nav-black.homepage ul li a").each(function(i,v){
if(dis.text().toUpperCase() == $(this).text())
{
$(this).addClass("active");
}
});
$("#mobile_current_page").attr('data-index', i);
$("#mobile_current_page").val(defaults.target[i]);
if(i == 4) // benefits sidebar menu
{
$("#mobile_current_page").val(defaults.target[2]);
}
if($(this).attr("class").indexOf('sidr') != -1)
{
i = 2;
}
$.each(defaults.target,function(k,v){
if(i == k)
{
$(defaults.target[i]).animate({
'left': 0
},100,function(){
$(defaults.target[i]).css('visibility' , 'visible').show();
//$("footer#contact-us").css('top', $(defaults.target[i]).outerHeight(true) + $("header").outerHeight(true));
});
}else{
//var l = parseInt($(defaults.target[k]).css('left'));
$(defaults.target[k]).animate({
'left' : ((k * $(window).outerWidth(true)) - ($(window).outerWidth(true) * i))
},100,function(){
$(defaults.target[k]).css('visibility' , 'hidden').hide();
//$("footer#contact-us").css('top', $(defaults.target[i]).outerHeight(true) + $("header").outerHeight(true));
});
}
});
$("section#award").hide();
if(i === 0)
{
$("section#award").show();
setTimeout(function(){
$("footer#contact-us").css('top', $(defaults.target[i]).outerHeight(true) + $("header").outerHeight(true) + $("section#award").outerHeight(true));
},200);
}
return false;
});
});
}
return self.init();
}
//CHANGE PLAN SLIDER
$.fn.changePlanSlider = function(opts){
var defaults = {
disabled : false,
dataValues : [0,1,2,3,4,5],
valueMappings : [0,1,2,3,4,5],
bundleMappings: [0,1,2,3,4,5],
initialAmount : 9.90,
amountEl : ".amt-holder",
totalAmountEl : "#unlimited .finalAmount",
totalPoints : "#unlimited .finalPoints",
perAmount : ".perAmount",
type : "unlimited",
animate : 'fast',
value : 0,
min : 0,
max : 0,
indicatorBG : '#d62c63',
indicatorBGHeight : '18px',
decimalPlaces : true,
changeLabelColorOnChange : true,
eventChange : function(){}
};
var finalAmount = 0;
var self = $(this);
$.fn.extend(defaults,opts);
self.setFinalAmount = function(amount){
finalAmount = amount;
}
self.getFinalAmount = function(){
return finalAmount;
};
self.updateTotalAmount = function(amount){
var total = 0;
$("#" + defaults.type + " " + defaults.amountEl).each(function(i,v){
if(parseInt($(this).val()) == 9 && defaults.type == "unlimited") {
total += parseInt($(this).val());
total++;
} else {
if(defaults.type != "broadband") {
if(defaults.type == "data-only" || defaults.type == "family") {
total += parseFloat($(this).val());
} else {
total += parseInt($(this).val());
}
} else {
total += parseFloat($(this).val());
}
}
});
if(defaults.decimalPlaces)
{
var gt = (defaults.initialAmount + total).toFixed(2);
if(defaults.type == "family") {
var gt = (defaults.initialAmount + total).toFixed(1);
}
}else{
if(defaults.type == "data-only") {
var gt = (defaults.initialAmount + total).toFixed(2);
} else {
var gt = (defaults.initialAmount + total);
}
}
self.setFinalAmount(gt);
$(defaults.totalAmountEl).text(gt);
if(defaults.type == "unlimited") {
//setnewamount(gt);
newgt = (parseFloat(gt) - 9.90) + parseFloat($("#unli_planamount").val());
$(".finalAmount").html(newgt.toFixed(2));
}
self.updateTotalPoints(gt);
};
self.updateTotalPoints = function(amount){
if(defaults.type == "unlimited")
{
$(defaults.totalPoints).text(((amount * 10) - 9));
}else{
$(defaults.totalPoints).text(amount * 10);
}
};
self.sliderUI = function(instance){
var isd = instance.attr("isDisabled");
var initialized = true;
if(typeof isd !== typeof undefined && isd !== false)
{
defaults.disabled = isd;
}
if(defaults.type == "family")
{
setTimeout(function(){
var len = $(".ui-slider-pip").length;
$(".ui-slider-pip").each(function(k,l){
var sliderWidth = $(".slider.ui-slider").outerWidth(true);
var perc = Math.ceil(((parseInt($(this).css('left')) / sliderWidth * 100)) - 2);
if(k != (len -1))
{
var perc = Math.ceil(((parseInt($(this).css('left')) / sliderWidth * 100)) + 2);
}
$(this).css('left', perc + "%");
});
},1000);
}
instance.slider({
disabled : defaults.disabled,
animate : defaults.animate,
value: defaults.value,
min: defaults.min,
max: defaults.dataValues.length - 1,
slide : function( event, ui ){
var opset = $(this).find(".ui-slider-pip-selected").attr("style");
var new_opset = opset.split("left: ");
var wth = new_opset[1].replace(";","");
if(defaults.type == "family")
{
var wth = parseInt(new_opset[1].replace(";","")) + 2;
}
$(this).find("span.indicator").css({
backgroundColor : defaults.indicatorBG,
height : defaults.indicatorBGHeight,
width : wth
});
unliSlider = instance.attr('class');
if (unliSlider.indexOf('data-plan-slider') != -1) {
instance.find("span.ui-slider-pip-selected span.ui-slider-label").css('float', 'left');
}
},
change: function( event, ui ) {
if (instance.attr('class').indexOf('slider-top-up') >= 0) {
$('.topup-select').val(defaults.valueMappings[ui.value]);
}
payGSlider = instance.attr('class');
if (payGSlider.indexOf('payg-top-up-credit-plan-slider') != -1) {
if (instance.find("span.ui-slider-pip-selected span.ui-slider-label").text() != 0) {
$('.family-payg-notif').css('display', 'inline-block');
} else {
$('.family-payg-notif').css('display', 'none');
}
} else {
$('.family-payg-notif').css('display', 'none');
}
unliSlider = instance.attr('class');
if (unliSlider.indexOf('data-plan-slider') != -1) {
// for 3G selection
if (instance.find("span.ui-slider-pip-selected span.ui-slider-label").text() == '30GB#' || instance.find("span.ui-slider-pip-selected span.ui-slider-label").text() == '90GB#') {
$('#note_3g').html("#This is a 3G service");
} else {
$('#note_3g').html(' ');
}
// instance.find("span.ui-slider-pip-selected span.ui-slider-label").css('float', 'left');
}
if(instance.parent().hasClass("unlimited-slider-data-pack"))
{
if(ui.value > 0)
{
$("span.unlimited_notice").css({ 'visibility' : 'hidden' });
}else{
$("span.unlimited_notice").css({ 'visibility' : 'visible' });
}
}
var opset = $(this).find(".ui-slider-pip-selected").attr("style");
var new_opset = opset.split("left: ");
var wth = new_opset[1].replace(";","");
if(defaults.type == "family")
{
wth = parseInt(new_opset[1].replace(";","")) + 2 + "%";
}
if(instance.find(".indicator"))
{
instance.find(".indicator").remove();
}
// var wth = new_opset[1].replace(";","");
// if(defaults.type == "family")
// {
// var wth = parseInt(new_opset[1].replace(";","")) + 2;
// }
// if(instance.parent().find(".indicator-label"))
// {
// instance.parent().find(".indicator-label").remove();
// }
$(" ").insertBefore(instance.find(".ui-slider-handle.ui-state-default.ui-corner-all")).css({
'width' : wth
});
if(defaults.valueMappings[ui.value] > 0)
{
if(defaults.type != "family")
{
instance.parent().find(".indicator-label").css({
'left' : (parseInt(new_opset[1].split("%")) - 1.5) + "%"
}).text(defaults.dataValues[ui.value]);
}else{
var lft = new_opset[1].replace(";","");
if(parseInt(lft) < 100 && defaults.valueMappings.length != (ui.value + 1))
{
lft = (parseInt(lft) - 2.5) + "%";
}else{
lft = "100%";
}
if(initialized)
{
if(parseInt(lft) < 100 && ui.value == 2)
{
lft = (parseInt(lft) + 2.5) + "%";
}
initialized = false;
}
instance.parent().find(".indicator-label").css({
'left' : lft
}).text(defaults.dataValues[ui.value] + " " + instance.parent().find(".indicator-label").attr("data-default"));
}
}
// $("" + defaults.valueMappings[ui.value] + "").insertBefore(instance.find(".ui-slider-handle.ui-state-default.ui-corner-all")).animate({
// 'left' : new_opset[1]
// });
if(defaults.changeLabelColorOnChange)
{
instance.parent().find(".ui-slider-label").css({
color: '#000'
})
for(var i = 0;i <= ui.value; i++)
{
instance.parent().find(".ui-slider-pip-" + i + " .ui-slider-label").css({
color: '#FFF'
});
}
}
if(defaults.type == "family")
{
instance.parent().find(".ui-slider-pip-" + ui.value + " .ui-slider-label").css({
color: '#ff9005'
});
}
instance.parent().find(defaults.amountEl).val(defaults.valueMappings[ui.value]);
instance.parent().find(defaults.amountEl).attr('bundle-id', defaults.bundleMappings[ui.value]);
instance.parent().find(defaults.perAmount).text("$" + defaults.valueMappings[ui.value]);
self.updateTotalAmount(defaults.valueMappings[ui.value]);
if(typeof defaults.eventChange == 'function')
{
defaults.eventChange.call(self, ui.value);
}
},
stop : function(event,ui){
if(defaults.changeLabelColorOnChange)
{
instance.parent().find(".ui-slider-label").css({
color: '#000'
})
for(var i = 0;i <= ui.value; i++)
{
instance.parent().find(".ui-slider-pip-" + i + " .ui-slider-label").css({
color: '#FFF'
});
}
}
instance.parent().find(defaults.amountEl).val(defaults.valueMappings[ui.value]);
instance.parent().find(defaults.amountEl).attr('bundle-id', defaults.bundleMappings[ui.value]);
instance.parent().find(defaults.perAmount).text("$" + defaults.valueMappings[ui.value]);
self.updateTotalAmount(defaults.valueMappings[ui.value]);
if(defaults.type == "personalised" || defaults.type == "recommendation")
{
if(ui.value > 0)
{
$("#" + defaults.type + " " + ".freeYmin").text(defaults.dataValues[ui.value]);
}else{
$("#" + defaults.type + " " + ".freeYmin").text("");
}
}
}
}).slider("pips",{
first : false,
labels : defaults.dataValues
});
}
return self.each(function(i,v){
self.sliderUI($(this));
})
}
$.fn.filterRates = function(opts){
var defaults = {
list : '.rate-table'
};
$.extend(defaults,opts);
var self = this;
$.filterAction = function(instance){
instance.on("click",function(){
var f = $(this).attr("data-filter").toUpperCase();
$(defaults.list).find("tbody tr").show();
if(f != "ALL")
{
$(defaults.list).find("tbody tr").hide();
$(defaults.list).find("tbody tr[data-first=" + f + "]").show();
}
});
}
return self.each(function(i,v){
$.filterAction($(this));
});
};
editable = function(fields,btn){
var self = this;
self.edit_link = '.edit-link';
self.cancel_link = '.cancel-edit';
self.save_btn = btn;
self.errors = '';
self.fields = fields;
self.clickAction = function(){
$(document).on("click",this.edit_link,function(){
$(this).hide();
$(this).parents('.editable-form-uneditable').hide().next().show().queue(function(){
var context = $(this);
$.each(self.fields,function(i,v){
if(v != '.sim-nick-name'){
var recent = $(v).attr("data-recent");
context.find("input" + v).val(recent);
}
//var recent = $(v).attr("data-recent");
//context.find("input" + v).val(recent);
});
}).dequeue();
return false;
});
};
self.cancelAction = function(){
$(document).on("click",self.cancel_link,function(){
$(this).parents('.editable-form').hide().prev().show().find(self.edit_link).show();
$(".err").text("");
return false;
});
};
self.saveAction = function(){
$(document).on("click",self.save_btn,function(){
var invalid = new Array();
$.each(self.fields,function(i,v){
var val = $(v).val();
if(self.isEmpty(val,v))
{
invalid.push("invalid");
}
});
if(invalid.length === 0)
{
return true;
}
return false;
});
};
self.isEmpty = function(value,err){
if($.trim(value) == "")
{
if(err != '.sim-nick-name'){
$(err + "-error").html("Field is left blank.");
return false;
}
}else{
$(err + "-error").html("");
}
};
self.editable = function(){
self.clickAction();
self.cancelAction();
self.saveAction();
};
};
//HOMEPAGE CAROUSEL
/*$('#myCarousel').on('slide.bs.carousel', function () {
if($(window).outerWidth(true) <= 768)
{
setTimeout(function(){
if($("section#award").length > 0)
{
$("section#award").css({
'position' : 'absolute',
'top' : $("div#banner").outerHeight(true) + 169,
'left' : 0,
'z-index' : 999
});
}
if($("div#banner").css("display") == "block")
{
$("footer#contact-us").css({
'top' : $("header").outerHeight(true) + $("div#banner").outerHeight(true) + $("section#award").outerHeight(true)
});
}
},10);
}
else {
var outerHeightbanner = $("div#banner").outerHeight(true);
if (outerHeightbanner >= 718) {
setTimeout(function(){
if($("div#banner").css("display") == "block")
{
$('div#banner').css('max-height', '900px!important');
$("footer#contact-us").css({
'top' : $("header").outerHeight(true) + $("div#banner").outerHeight(true) + $("section#award").outerHeight(true)
});
}
},10);
}
}
})*/
/*$('#myCarousel').on('slid.bs.carousel', function () {
if($(window).outerWidth(true) <= 768)
{
setTimeout(function(){
if($("section#award").length > 0)
{
$("section#award").css({
'position' : 'absolute',
'top' : $("div#banner").outerHeight(true) + 169,
'left' : 0,
'z-index' : 999
});
}
if($("div#banner").css("display") == "block")
{
$("footer#contact-us").css({
'top' : $("header").outerHeight(true) + $("div#banner").outerHeight(true) + $("section#award").outerHeight(true)
});
}
},10);
}
else {
var outerHeightbanner = $("div#banner").outerHeight(true);
if (outerHeightbanner >= 718) {
setTimeout(function(){
if($("div#banner").css("display") == "block")
{
$('.carousel-inner').css('height', '900px!important');
$("footer#contact-us").css({
'top' : $("header").outerHeight(true) + $("div#banner").outerHeight(true) + $("section#award").outerHeight(true)
});
}
},10);
}
}
})*/
// RECOMMENDATION CHANGE PLAN
// $(".slider.recommendation-voice-plan-slider").changePlanSlider({
// dataValues : ["0","100","200","400","600","1000"],
// valueMappings : [0,7,10,14,17,23],
// indicatorBG : '#21C404',
// type : 'recommendation',
// totalAmountEl : "#recommendation .finalAmount",
// totalPoints : "#recommendation .finalPoints",
// initialAmount : 0,
// });
// $(".slider.recommendation-sms-plan-slider").changePlanSlider({
// dataValues : ["0","100","200","400","600","1000"],
// valueMappings : [0,6,9,11,13,17],
// indicatorBG : '#5FAFE7',
// type : 'recommendation',
// totalAmountEl : "#recommendation .finalAmount",
// totalPoints : "#recommendation .finalPoints",
// initialAmount : 0,
// });
// $(".slider.recommendation-data-plan-slider").changePlanSlider({
// dataValues : ["0","200MB","500MB","1GB","2GB","3GB","5GB","10GB"],
// valueMappings : [0,5,9,11,15,25,39,69],
// indicatorBG : '#D62C63',
// type : 'recommendation',
// totalAmountEl : "#recommendation .finalAmount",
// totalPoints : "#recommendation .finalPoints",
// initialAmount : 0,
// });
// $(".slider.recommendation-intl-min-credit-plan-slider").changePlanSlider({
// dataValues : ["0","50","100","200","300"],
// valueMappings : [0,5,10,20,30],
// indicatorBG : '#F88E39',
// type : 'recommendation',
// totalAmountEl : "#recommendation .finalAmount",
// totalPoints : "#recommendation .finalPoints",
// initialAmount : 0,
// });
// $(".slider.recommendation-top-up-credit-plan-slider").changePlanSlider({
// dataValues : ["0","100","200","400","600","1000"],
// valueMappings : [0,10,20,30,40,50],
// indicatorBG : '#F3D136',
// type : 'recommendation',
// totalAmountEl : "#recommendation .finalAmount",
// totalPoints : "#recommendation .finalPoints",
// initialAmount : 0,
// });
// SAVE PLAN RECOMMENDATION
// $(document).on("click","#recommendation .recommendation-save-plan",function(){
// var final_amount = $("#recommendation .finalAmount").text();
// var total_points = $("#recommendation .finalPoints").text();
// alert("Final Amount is: " + parseFloat(final_amount).toFixed(2) + "\r\n" + "Final Points is: " + parseInt(total_points));
// return false;
// });
// RECOMMENDATION CHANGE PLAN
// if(el == "#recommendation")
// {
// $(".slider.recommendation-voice-plan-slider").slider({ value : 1 });
// $(".slider.recommendation-sms-plan-slider").slider({ value : 0 });
// $(".slider.recommendation-data-plan-slider").slider({ value : 0 });
// $(".slider.recommendation-intl-min-credit-plan-slider").slider({ value : 0 });
// $(".slider.recommendation-data-plan-slider").slider({ value : 7 });
// $(".recommendation-sms-plan-slider-selected-amount").text("$0");
// $(".recommendation-intl-min-credit-slider-selected-amount").text("$0");
// $(".recommendation-top-up-credit-plan-slider-selected-amount").text("$0");
// $(".recommendation-voice-min-plan-slider-selected-amount.perAmount").text("$7");
// $(".recommendation-data-plan-slider-selected-amount.perAmount").text("$69");
// $("#recommendation .finalAmount").text("76.00");
// $("#recommendation .finalPoints").text("760");
// }
$(".mb_search.mb_automaticsearch ul li").on("click", function () {
$(".mb_search.mb_automaticsearch ul").toggle();
});
})($);