BOM={existing:{isBoxActive:false,isBtnActive:false,sel:"#menuExistingCustomerSub",open:function(){if(!(BOM.existing.isBoxActive)){var a='<img src="img/panel.jpg" border="0" usemap="#panel"><map name="panel" id="panel"><area shape="rect" coords="33,25,134,39" href="recontractnow.asp" /><area shape="rect" coords="38,44,127,59" href="checkusage.asp" /><area shape="rect" coords="41,92,121,105" href="checkexpiry.asp" /><area shape="rect" coords="41,101,121,118" href="javascript:BOM.openTopUp();" /></map>';jQuery(BOM.existing.sel).html(a);jQuery(BOM.existing.sel).fadeIn(400);BOM.existing.isBoxActive=true;BOM.existing.isBtnActive=true}},close:function(){jQuery(BOM.existing.sel).fadeOut(400);BOM.existing.isBoxActive=false;BOM.existing.isBtnActive=false},check:function(a){if(!(BOM.existing.isBoxActive)||(!(BOM.existing.isBtnActive))){BOM.existing.close()}}},Signup:{'dataplans':JSdata.dataplans,'mobileplans':[],validateInput:function(a,b){var c={contact:/(^[689]{1}[0-9]{7}$)/,mobile:/(^[89]{1}[0-9]{7}$)/,nric:/^[FGST]{1}[0-9]{7}[A-Z]{1}$/i,email:/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i};switch(b){case'mobile':return c.mobile.test(a);break;case'nric':return c.nric.test(a);break;case'contact':return c.contact.test(a);break;case'email':return c.email.test(a);break;default:return null;break}}},checkusage:function(){jQuery('#check_usage input').attr('disabled','disabled');jQuery('#check_usage').animate({'opacity':0.5},1500);jQuery('#SubsContent').append('<div style="position:absolute; left: 48%; top: 250px;"><img src="img/ajax-loader.gif" /></div>');$.post('usage.asp',{'ic':jQuery('#check_usage input[name="ic"]').val(),'mobile':jQuery('#check_usage input[name="mobile"]').val(),'source':'bbmobile'},function(a){var b=jQuery(a).find('result').attr('stat');if(b=="ok"){var c=jQuery(a).find('datausage').text();var d=jQuery(a).find('lastupdated').text();var e=jQuery(a).find('roamingdatausage').text();var f=jQuery(a).find('nextbill').text();if(e==''){writethis='<div id="usage_result"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top" class="head1">As at<br /><br /><span class="data">'+d+'</span></td><td valign="top" class="head2">Local Data Usage<br /><br /><span class="data">'+c+'</span> MB<br />(include download and upload usage)</td><td valign="top" class="head3">Your next bill statement will be on<br /><br /><span class="data">'+f+'</span></td></tr></table><div id="notes">Notes:<br />1. Data usage record will be updated once a day and the data may vary from your bill.<br />		2. The above data usage record will not include any data utilized while roaming overseas.<br />3. Only data usage of the mobile/data number login will be shown above.<br />4. Click <a href=".?page=laptop_promotions&amp;goto=1" target="_top">here</a> for your local data usage bundle for BroadBand on Mobile Data Plan.<br />&nbsp;&nbsp;&nbsp;&nbsp;Excess usage will be charged at $0.001/2KB (minimum of $0.005/session).<br />5. Click <a href=".?page=mobile_promotions&amp;goto=1" target="_top">here</a> for your local data usage bundle for BroadBand on Mobile Value-added service.<br />&nbsp;&nbsp;&nbsp;&nbsp;Excess usage will be charged at $0.0054/2KB (minimum of $0.03/session).<br />6. For roaming data rates, please refer to <a href="http://home.singtel.com/consumer/roaming/" target="new">http://home.singtel.com/consumer/roaming/</a></div></div>'}else{writethis='<div id="usage_result"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top" class="head1">Last Data Transaction as at:<br /><br /><span class="data">'+d+'</span></td><td valign="top" class="head2">Local Data Usage<br /><br /><span class="data">'+c+'</span> MB<br />(include download and upload usage)<br /><br />Roaming Data Usage<br /></br /><span class="data">'+e+'</span> MB<br />(include download and upload usage)</td><td valign="top" class="head3">Your next bill statement will be on<br /><br /><span class="data">'+f+'</span></td></tr></table><br /><div id="notes">Notes:<br />1. Data usage record will be updated once a day and the data may vary from your bill.<br />2. Only data usage of the mobile/data number login will be shown above.<br />3. Click <a href=".?page=laptop_promotions&amp;goto=1" target="_top">here</a> for your local data usage bundle for BroadBand on Mobile Data Plan.<br />&nbsp;&nbsp;&nbsp;&nbsp;Excess usage will be charged at $0.001/2KB (minimum of $0.005/session).<br />4. Click <a href=".?page=mobile_promotions&amp;goto=1" target="_top">here</a> for your local data usage bundle for BroadBand on Mobile Value-added service.<br />&nbsp;&nbsp;&nbsp;&nbsp;Excess usage will be charged at $0.0054/2KB (minimum of $0.03/session).<br />5. For roaming data rates, please refer to <a href="http://home.singtel.com/consumer/roaming/" target="new">http://home.singtel.com/consumer/roaming/</a></div></div>'}jQuery('#SubsContent').fadeOut('fast',function(){jQuery('#SubsContent').html(writethis);jQuery(this).fadeIn('fast',function(){jQuery('#SubsContent').attr('class','')})})}else{writethis='<div id="usage_result">'+jQuery(a).find('message').text()+'</div>';jQuery('#SubsContent').fadeOut('fast',function(){jQuery('#SubsContent').html(writethis);jQuery(this).fadeIn('fast',function(){jQuery('#SubsContent').attr('class','')})})}});return false},checkexpiry:function(){jQuery('#check_usage input').attr('disabled','disabled');jQuery('#check_usage').animate({'opacity':0.5},1500);jQuery('#SubsContent').append('<div style="position:absolute; left: 48%; top: 250px;"><img src="img/ajax-loader.gif" /></div>');jQuery.post('prepaid.asp',{'mobile':jQuery('#check_usage input[name="mobile"]').val()},function(a){var b=jQuery(a).find('result').attr('stat');if(b=="ok"){var c=jQuery(a).find('expirydate').text();writethis='<div id="usage_result">Your SingTel Prepaid BroadBand on Mobile will expire at <strong>'+c+' 23:59</strong><br /><br />If you would like to enjoy uninterrupted internet access for a longer period, please top up your Prepaid BroadBand on Mobile account before it expires.</div>';jQuery('#SubsContent').fadeOut('fast',function(){jQuery('#SubsContent').html(writethis);jQuery(this).fadeIn('fast',function(){jQuery('#SubsContent').attr('class','')})})}else{writethis='<div id="usage_result">'+jQuery(a).find('message').text()+'</div>';jQuery('#SubsContent').fadeOut('fast',function(){jQuery('#SubsContent').html(writethis);jQuery(this).fadeIn('fast',function(){jQuery('#SubsContent').attr('class','')})})}});return false},openTopUp:function(){var a=document.body.clientWidth;var b=document.body.clientHeight;var c=(document.all)?window.screenLeft:window.screenX;var d=(document.all)?window.screenTop:window.screenY+100;theLeft=5+c+((a-800)/2);theTop=200+d;BOM.trackPageview("ExistingCust/PrepaidTopUpNow");window.open("https://inno.ideas.singtel.com/PrepaidBoM/topup/","prepaidTopup","scrollbars=1,width=800,height=320,toolbar=0,top="+theTop+",left="+theLeft)},trackPageview:function(a){if(pageTracker){pageTracker._trackPageview("/bbmobile/?page="+a)}else{}}};if((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i))){window.scrollTo(0,1);addEventListener("load",function(){setTimeout(hideURLbar,0)},false);function hideURLbar(){window.scrollTo(0,1)}}function doTNC(a){window.open(a,"","width=650,height=500,scrollbars=yes,toolbars=no,sizeable=no")}jQuery(function($){$(BOM.existing.sel).hover(function(){BOM.existing.isBoxActive=true;BOM.existing.isBtnActive=true},function(){BOM.existing.isBoxActive=false;tExist=setTimeout('BOM.existing.check("box out")',100)});$('li#menuExistingCustomer a').hover(function(){BOM.existing.open()},function(){BOM.existing.isBtnActive=false;tExist=setTimeout('BOM.existing.check("button out")',100)});swfobject.embedSWF("img/liner.swf","flashliner","190","40","9.0.0","expressInstall.swf",{},{'wmode':'transparent'});BOM.flashvars={};if($.url.param("page")){BOM.flashvars["page"]=jQuery.url.param("page")}if($.url.param("goto")){BOM.flashvars["goto"]=jQuery.url.param("goto")}if(BOM.Flash){var a=Math.floor(Math.random()*1000);var b="base.swf?rnd="+a+"";swfobject.embedSWF(b,"STFlash","960","500","9.0.0","expressInstall.swf",BOM.flashvars)}$("#menuSurfLaptopSub").css('opacity',0);$("#menuSurfMobileSub").css('opacity',0);$('#BomMenu').css('display','none')});jQuery(window).load(function(){jQuery('#BomMenu').fadeIn(0,function(){if(BOM.Laptop){jQuery("#menuSurfLaptopSub").css('display','block').animate({'opacity':1},250,"linear",function(){jQuery('#STContentBG').fadeIn(1000,function(){jQuery('#BomContent').animate({'left':'33px','opacity':0.99},{"duration":800},"swing")})})}else if(BOM.Mobile){jQuery("#menuSurfMobileSub").css('display','block').animate({'opacity':1},250,"linear",function(){jQuery('#STContentBG').fadeIn(1000,function(){jQuery('#BomContent').animate({'left':'33px','opacity':0.99},{"duration":800},"swing")})})}else{jQuery('#STContentBG').fadeIn(1000,function(){jQuery('#BomContent').animate({'left':'33px','opacity':0.99},800,"linear",function(){if((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i))){}else if((jQuery.url.attr("file")=="checkexpiry.asp")&&(jQuery.url.param("mobile")!==undefined)){jQuery('#mobile').attr("value",jQuery.url.param("mobile"))}})})}})});
