$(document).ready(function() {
	/*
	dewa m widyakumara
	dewa.widyakumara AT switchlab DOT com
	widyakumara AT gmail DOT com
	*/

	$('#corp li').hover(
		function() {$(this).addClass('hover');},
		function() {$(this).removeClass('hover');}
		);
	var $userNumLabel = $('label.myVectoneInputUser').hide();
	var $userNumInput = $('input.myVectoneInputUser');
	var $userNumText  = $userNumLabel.text();
	if($userNumInput.attr('value') == '') {
		$userNumInput.attr('value', $userNumText);
		}
	$userNumInput.focus(function() {
		if($userNumInput.attr('value') == $userNumText) {
			$userNumInput.attr('value', '');
			}
		});
	$userNumInput.blur(function() {
		if($userNumInput.attr('value') == '') {
			$userNumInput.attr('value', $userNumText);
			}
		});
	var $userPassLabel = $('label.myVectoneInputPass').hide();
	var $userPassInput = $('input.myVectoneInputPass');
	var $userPassText  = $userPassLabel.text();
	var $userPassFaux = $("<input type='text' class='myVectoneInput' />");
		$userPassFaux.attr('value', $userPassText);
		$userPassInput.before($userPassFaux);
		$('span.myVectoneInputPass').show();
		$userPassFaux.hide();
	if($userPassInput.attr('value') == '') {
		$userPassFaux.show();
		$userPassInput.hide();
		}
	$userPassFaux.focus(function() {
		$userPassFaux.hide();
		$userPassInput.show().focus();
		});
	$userPassInput.blur(function() {
		if($userPassInput.attr('value') == '') {
			$userPassFaux.show();
			$userPassInput.hide();
			}
		});
	$('.myVectoneInput').focus(function() {
		if($('.myVectoneMsg').is(':visible')) {
			$('.myVectoneMsg').fadeOut();
			}
		});
	$('#neck ul li').hover(
		function() { $(this).addClass('hover'); },
		function() { $(this).removeClass('hover'); }
		);
	/*$('#rotate-banners').after('<div id="rotate-control">').cycle({
		fx:     'fade',
		speed:   1500,
		timeout: 5000,
		requeueTimeout: 5000,
		pause: 1,
		pager:  '#rotate-control'
		}); */
	// TARIFF Free SMS every day for after top-up
	// tariffs/plus/international-rates.aspx
	// tariffs/standard/international-rates.aspx
	var tariffRateValue = '';
	var dada = '';
	var ratesPfx1 = ' ';
	var ratesSfx1TC = ' Pence per minute <span style="font-size:13px; font-family:Tahoma; font-weight:normal;"></span>';
	var ratesSfx1 = ' pence per minute';
	var ratesSMSfx1 = ' pence/text &nbsp;'; // &nbsp; required for IE8
	jQuery('.tariffList select').change(function () {
		$('#special_offer_1').remove();
		$('#special_offer_2').remove();
		$('#special_offer_3').remove();

		jQuery(this).children('option:selected').each(function () {
			tariffRateValue = jQuery(this).val();
			dada = jQuery(this).parent().parent().parent().parent();
			tariffCountry = jQuery(this).text();
			tariffCountry = jQuery.trim(tariffCountry);
			switch(tariffCountry) {
			/* sony 2011 05 03
				case 'Pakistan':
				case 'India':
				case 'Lithuania':
				case 'Sri Lanka':
				case 'Turkey':
				case 'Bangladesh':
				case 'Nigeria':
			*/
				case 'Bahrain':
					tariffCountrySpecial = false;
					break;
				default:
					tariffCountrySpecial = false;
					break;
				}
			$('.ratesResultSpecial').hide().remove();
			if(tariffCountrySpecial && !jQuery(this).parents('table').hasClass('tariffListPlus')) {
				row = $('<tr>').addClass('ratesResult ratesResultSpecial').appendTo('.tariffList').css('border','none');
				$('<td>').addClass('td-left').html('&nbsp;').appendTo(row).css('border','none');
				$('<td>').addClass('td-rite').html('<a href="http://www.vectonemobile.co.uk/info-help/terms-and-conditions.aspx"><b>Terms & Conditions</b> Apply</a>').appendTo(row).css('border','none');
				}

			switch(tariffCountry) {
				case 'Japan':
					mp = [[15,5], [30,10], [60,20], [90,30], [120,40], [150,50]];
					special_offer = true;
					special_offer_ltd = false;
					special_offer_mp  = false;
					break;

// begin: Adi 2011 05 24
				// 10 Minutes promo
				/*case 'Afghanistan.':
				case 'Bosnia Herzegov':
				case 'Bulgaria':
				case 'Congo':
				case 'Ecuador':
				case 'Eritrea.':
				case 'Estonia':
				case 'Ethiopia':
				case 'Gabon':
				case 'Ghana':
				case 'GuineaBissau':
				case 'GuineaR':
				case 'Iran.':
				case 'Ivory Coast':
				case 'Jamaica.':
				case 'Jordan.':
				case 'Kosovo':
				case 'Lebanon':
				case 'Liberia':
				case 'Morocco':
				case 'Rwanda':
				case 'Senegal':
				case 'Slovenia':
				case 'St Lucia.':
				case 'Syria':
				case 'Tanzania':
				case 'Tunisia':
				case 'Zimbabwe':
					mp = [[10,5], [20,10], [40,20], [60,30], [80,40], [100,50]];
					special_offer = false;
					special_offer_ltd = true;
					special_offer_mp = true;
					break;*/

				// 15 Minutes promo
				/*case 'Albania':
				case 'Angola':
				case 'Bangladesh':
				case 'Barbados':
				case 'Botswana':
				case 'Brazil':
				case 'Burundi':
				case 'Cameroon':
				case 'Democratic Republic of Congo':
				case 'Croatia':
				case 'Czech Republic':
				case 'Dominican Republic':
				case 'Egypt':
				case 'Hungary':
				case 'Indonesia':
				case 'Iraq':
				case 'Israel':
				case 'Kenya.':
				case 'Latvia':
				case 'Lithuania':
				case 'Malawi':
				case 'Mauritius':
				case 'Moldova':
				case 'Nepal':
				case 'Nigeria':
				case 'Peru.':
				case 'Philippines':
				case 'Slovakia':
				case 'South Africa':
				case 'Sudan.':
				case 'Trinidad Tobago':
				case 'Uganda':
				case 'Ukraine':
				case 'Yemen':
					mp = [[15,5], [30,10], [60,20], [90,30], [120,40], [150,50]];
					special_offer = false;
					special_offer_ltd = true;
					special_offer_mp = true;
					break;*/

				// 25 Minutes promo
				/*case 'Cambodia':
				case 'Poland':
				case 'Poland':
				case 'Romania':
				case 'Russia':
				case 'Thailand':
				case 'Turkey':
				case 'Vietnam':
					mp = [[25,5], [50,10], [100,20], [150,30], [200,40], [250,50]];
					special_offer = false;
					special_offer_ltd = true;
					special_offer_mp = true;
					break;*/
				case 'Sri Lanka':
					mp = [[25,5], [50,10], [100,20], [150,30], [250,50]];
					special_offer = false;
					special_offer_ltd = true;
					special_offer_mp = true;
					break;
				//end: Adi 2011 05 24

				/*case 'Algeria':
					mp = [[15,5], [30,10], [60,20], [90,30], [120,40], [150,50]];
					special_offer = true;
					special_offer_ltd = false;
					special_offer_mp = false;
					break;
				case 'Kenya':
					mp = [[15,5], [30,10], [60,20], [90,30], [120,40], [150,50]];
					special_offer = true;
					special_offer_ltd = false;
					special_offer_mp = false;
					break;
				case 'Lebanon':
					mp = [[15,5], [30,10], [60,20], [90,30], [120,40], [150,50]];
					special_offer = true;
					special_offer_ltd = false;
					special_offer_mp = false;
					break;
				case 'Namibia':
					mp = [[15,5], [30,10], [60,20], [90,30], [120,40], [150,50]];
					special_offer = true;
					special_offer_ltd = false;
					special_offer_mp = false;
					break;*/

				/* 17 may 2011*/
				default:
					special_offer = false;
					special_offer_ltd = false;
					special_offer_mp = false;
					break;
				}

				/* Sony | 17 may 2011*/
				/* */
				if(special_offer && !jQuery(this).parent().hasClass('tariffListPlus')) {
					special_offer_text = '<p><b>New offers:</b>';
					mpl = mp.length;
					for(i = 0; i < mpl; i++) {
						special_offer_text += '<br />get ' + mp[i][0] + ' minutes at the rate of 1p/min to ' + tariffCountry + ' with every &pound;' + mp[i][1] + ' you top up';
						}
					$('<p>',{id:'special_offer_1',className:'special_offer_1',html:special_offer_text}).insertAfter('.tariffList');
					}

				else if(special_offer_ltd && !jQuery(this).parent().hasClass('tariffListPlus')) {
					special_offer_text_ltd = '<p><b>New offers:</b>';
					mpl = mp.length;
					for(i = 0; i < mpl; i++) {
						special_offer_text_ltd += '<br />get ' + mp[i][0] + ' minutes at the rate of 1p/min to ' + tariffCountry + ' mobile with every &pound;' + mp[i][1] + ' you top up';
						}
					$('<p>',{id:'special_offer_1',className:'special_offer_1',html:special_offer_text_ltd}).insertAfter('.tariffList');
					} 

			});

		if(jQuery(this).parents('table').hasClass('tariffListPlus')) {
			special_offer = false;
			special_offer_ltd = false;
			}

		jQuery(dada).children('.ratesResult').fadeOut('fast', function() {
			if(tariffRateValue != '') {
				tariffRateValues = tariffRateValue.split('|');
				if(tariffRateValues[0] == '999') {
					jQuery(dada).find('.ratesResultLandlines .td-rite').html('&nbsp;');
					jQuery(dada).find('.ratesResultLandlines').addClass('hide');
					}			
				else {	
					if(tariffCountry == 'Sri Lanka') {
						jQuery(dada).find('.ratesResultLandlines .td-rite').html(ratesPfx1 + '1' + '<span>*</span>' + ratesSfx1);
						special_offer_ltd = true;
							
						
					 if(special_offer) {
						jQuery(dada).find('.ratesResultLandlines .td-rite').html(ratesPfx1 + '1' + ratesSfx1TC);
						if($('#special_offer_2').length == 0) {
							//17 may 2011
							//special_offer_text_2 = 'Landlines ' + tariffRateValues[0] + ' pence per minute (After 1P minutes)'
							//special_offer_text_2 = '* After promotional minutes allowance the standard rates of '+ tariffRateValues[0] + 'p/min (' + tariffCountry + ' ) will be apply'
							special_offer_text_2 = '* After promotional Allowance, the excess minutes will be charged at Standard rates of '+ tariffRateValues[0] + 'P/Min (' + tariffCountry + ')';
							$('<p>',{id:'special_offer_2',className:'special_offer_2',html:special_offer_text_2}).insertAfter('#special_offer_1');
							}
						}
					else if(special_offer_ltd) {
						// jQuery(dada).find('.ratesResultLandlines .td-rite').html(ratesPfx1 + '1' + ratesSfx1TC);
						jQuery(dada).find('.ratesResultLandlines .td-rite').html(ratesPfx1 + '1' + '<span>*</span>' + ratesSfx1);
						if($('#special_offer_2').length == 0) {
							//17 may 2011
							//special_offer_text_2 = 'Landlines ' + tariffRateValues[0] + ' pence per minute (After 1P minutes)'
							
							if(tariffCountry == 'Sri Lanka') {
								tariffRateValues[0] = 7;
								tariffRateValues[1] = 10;
								}
								
							special_offer_text_2 = '* After promotional minutes allowance, the excess minutes will be charged at standard rates of '+ tariffRateValues[0] + 'p/min (' + tariffCountry + ') and '+ tariffRateValues[1] +'p/min (' + tariffCountry + ' mobile) '
							$('<p>',{id:'special_offer_2',className:'special_offer_2',html:special_offer_text_2}).insertAfter('#special_offer_1');
							}
						}
						}
					else {
						jQuery(dada).find('.ratesResultLandlines .td-rite').html(ratesPfx1 + tariffRateValues[0] + ratesSfx1);
						}
					jQuery(dada).find('.ratesResultLandlines').removeClass('hide');
					}
					
					
					
				if(tariffRateValues[1] == '999') {
					jQuery(dada).find('.ratesResultMobiles .td-rite').html('&nbsp;');
					jQuery(dada).find('.ratesResultMobiles').addClass('hide');
					jQuery(dada).find('.ratesResultMobiles').hide();
					}
				else {
					// dmw 2011.05.18 added * per request
					if(tariffCountry == 'Bangladesh2' || tariffCountry == 'Nigeria2' || tariffCountry == 'Sri Lanka') {
						jQuery(dada).find('.ratesResultMobiles .td-rite').html(ratesPfx1 + '1' + '<span>*</span>' + ratesSfx1);
						}
					else if(special_offer_mp) {
						jQuery(dada).find('.ratesResultMobiles .td-rite').html(ratesPfx1 + '1' + ratesSfx1 + ' <span style="font-family:Tahoma; font=-size:13px; font-weight:normal;">*</span>');
						}
					else {
						jQuery(dada).find('.ratesResultMobiles .td-rite').html(ratesPfx1 + tariffRateValues[1] + ratesSfx1);
						}

					jQuery(dada).find('.ratesResultMobiles').removeClass('hide');
					
					}
					

				if(tariffRateValues[2] == '999') {
					jQuery(dada).find('.ratesResultSMS .td-rite').html('&nbsp;');
					jQuery(dada).find('.ratesResultSMS').addClass('hide');
					}
				else {
					jQuery(dada).find('.ratesResultSMS .td-rite').html(tariffRateValues[2] + ratesSMSfx1);
					jQuery(dada).find('.ratesResultSMS').removeClass('hide');
					}
				if(jQuery.browser.msie && jQuery.browser.version.substr(0,1) == '8') {
					jQuery(dada).children('.ratesResult').show();
					}
				else {
					jQuery(dada).children('.ratesResult').fadeIn('fast');
					}
				}
			else {
				if(jQuery.browser.msie && jQuery.browser.version.substr(0,1) == '8') {
					jQuery(dada).children('.ratesResult').hide();
					}
				else {
					jQuery(dada).children('.ratesResult').fadeOut();
					}
				}
			});
		}).change(); // .tariffList select

	// dmw 20100219 REPLACEMENT FOR script-inc-roaming.js USED ON /offers/free-roaming.aspx
	var ratesPfx2 = ' ';
	var ratesSfx2 = ' pence per minute';
	var ratesSMSfx2 = ' pence &nbsp;'; // dmw - &nbsp; required for IE 8
	jQuery('.incomingRoamingList select').change(function () {
		/**/
		var tariffRateValue = '';
		jQuery('.incomingRoamingList select option:selected').each(function () {
			tariffRateValue = jQuery(this).val();
			});
		jQuery('.ratesResult').fadeOut('fast', function() {
			if(tariffRateValue != '') {
				tariffRateValues = tariffRateValue.split('|');
				if(tariffRateValues[0] == '0') {
					jQuery('.ratesResultLandlines .td-rite').html('&nbsp;');
					jQuery('.ratesResultLandlines').addClass('hide');
					jQuery('.ratesResultLandlines').removeClass('show');
					}
				else {
					jQuery('.ratesResultLandlines .td-rite').html(ratesPfx2 + tariffRateValues[0] + ratesSfx2);
					jQuery('.ratesResultLandlines').addClass('show');
					jQuery('.ratesResultLandlines').removeClass('hide');
					}
				if(tariffRateValues[1] == '0') {
					jQuery('.ratesResultMobiles .td-rite').html('&nbsp;');
					jQuery('.ratesResultMobiles').addClass('hide');
					jQuery('.ratesResultMobiles').removeClass('show');
					}
				else {
					jQuery('.ratesResultMobiles .td-rite').html(ratesPfx2 + tariffRateValues[1] + ratesSfx2);
					jQuery('.ratesResultMobiles').addClass('show');
					jQuery('.ratesResultMobiles').removeClass('hide');
					}

				jQuery('.ratesTable tr.show').fadeIn('fast');
				if(jQuery.browser.msie && jQuery.browser.version.substr(0,1) == '8') {
					jQuery('.ratesTable .show').show();
					}
				else {
					jQuery('.ratesTable .show').fadeIn('fast');
					}
				}
			else {
				if(jQuery.browser.msie && jQuery.browser.version.substr(0,1) == '8') {
					jQuery('.ratesTable .hide').hide();
					}
				else {
					jQuery('.ratesTable .hide').fadeOut();
					}
				}
			});
		}).change();
	/* /// ALSO ENJOY ///////////////////////////////////////////////////// */
	$('select.selectAlsoEnjoy').change(function () {
		/**/
		$('.ratesResultAlsoEnjoy').hide();
		$radioAlsoEnjoy = $('.radioAlsoEnjoy input:checked').val();
		$('select.selectAlsoEnjoy option:selected').each(function () {
			$txtAlsoEnjoy = $(this).text();
			$valAlsoEnjoy = $(this).val() == '' ? '' : $(this).val().split('|');
			});
		var $sfxAlsoEnjoy = '';
		switch($txtAlsoEnjoy) {
			case 'UK Landline':
			case 'UK Mobile':
				$sfxAlsoEnjoy = ' minutes';
				break;
			case 'UK Texts':
				$sfxAlsoEnjoy = ' Text Messages';
				break;
			case 'Internet':
				break;
			}
		if($valAlsoEnjoy != '') {
			$('.ratesResultAlsoEnjoy .td-left').html($txtAlsoEnjoy);
			$('.ratesResultAlsoEnjoy .td-rite').html($valAlsoEnjoy[$radioAlsoEnjoy] + $sfxAlsoEnjoy);
			$('.ratesResultAlsoEnjoy').fadeIn();
			}
		else {
			$('.ratesResultAlsoEnjoy .td-left').html('&nbsp;');
			$('.ratesResultAlsoEnjoy .td-rite').html('&nbsp;');
			}
		}).change();

	$('.radioAlsoEnjoy input').click(function () {
		$('.ratesResultAlsoEnjoy').hide();
		$radioAlsoEnjoy = $('.radioAlsoEnjoy input:checked').val();
		$('select.selectAlsoEnjoy option:selected').each(function () {
			$txtAlsoEnjoy = $(this).text();
			$valAlsoEnjoy = $(this).val() == '' ? '' : $(this).val().split('|');
			});
		var $sfxAlsoEnjoy = '';
		switch($txtAlsoEnjoy) {
			case 'UK Landline':
			case 'UK Mobile':
				$sfxAlsoEnjoy = ' minutes';
				break;
			case 'UK Texts':
				$sfxAlsoEnjoy = ' Text Messages';
				break;
			case 'Internet':
				break;
			}
		if($valAlsoEnjoy != '') {
			$('.ratesResultAlsoEnjoy .td-left').html($txtAlsoEnjoy);
			$('.ratesResultAlsoEnjoy .td-rite').html($valAlsoEnjoy[$radioAlsoEnjoy] + $sfxAlsoEnjoy);
			$('.ratesResultAlsoEnjoy').fadeIn();
			}
		else {
			$('.ratesResultAlsoEnjoy .td-left').html('&nbsp;');
			$('.ratesResultAlsoEnjoy .td-rite').html('&nbsp;');
			}
		});
	/* \\\ ALSO ENJOY \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ */
	$("<ul class='tabHeads' /><div class='tabBodys' />").prependTo('.tabs');
	$('.tabs .tabhead').each(function(i) {
		n = $('div').index($(this).parent());
		t = $(this).parent().children('.tabHeads');
		$('<li/>').html('<a href="#tab-' + n + '-' + i + '">' + $(this).html() + '</a>').appendTo(t);
		$(this).remove();
		});
	$('.tabs .tabbody').each(function(i) {
		n = $('div').index($(this).parent());
		t = $(this).parent().children('.tabBodys');
		$(this).attr('id', 'tab-' + n + '-' + i).wrapInner("<div class='pad'/>").appendTo(t);
		});
	$('.tabBodys .tabbody').hide();
	$('.tabBodys .tabbody:first').show();
	$('.tabHeads li:first').addClass('active');
	$('.tabs .tabHeads a').click(function() {
		t = $(this).attr('href');
		if($('.tabBodys ' + t).is(':hidden')) {
			$(this).parent().parent().children().removeClass('active');
			$(this).parent().addClass('active');
			$('.tabBodys .tabbody').hide();
			$('.tabBodys ' + t).fadeIn();
			}
		return false;
		});
	if($.browser.msie) {
		if($.browser.version < 7) {
			if($('.ecom-confirm').length) {
				$('.pad-10').css({position:'relative'});
				$('.ecom-box-right').removeClass('float-left').addClass('plekenyufication');
				}
			}
		}
	/* /// 1P ///////////////////////////////////////////////////////////// */
	var ratesLPfx       = $('.ratesResultLandlines .cBlueLite').text() + ' ';
	var ratesMPfx       = $('.ratesResultMobiles .cBlueLite').text() + ' ';
	var ratesSfx        = ' International minutes';
	var onepweekendSfx  = ' weekends';
	$('.ratesResultLandlines .cBlueLite').remove();
	$('.ratesResultMobiles .cBlueLite').remove();
	var onepweekend = new Array(
		1,	// 10
		2,	// 20
		3,	// 30
		4	// 50
		);
	$('.ratesResult').removeClass('show').hide();
	$('#one-p-rbs input').click(function() {
		$('.ratesResult').removeClass('show').fadeOut('fast', function() {
			$('.onepweekendRate').html('&nbsp;');
			tariffRateVal = $('.ratesTable1P select option:selected').val();
			if(tariffRateVal != '') {
				tariffRadioId = $('#one-p-rbs input').index($('#one-p-rbs input:checked'));
				tariffRateTmp = tariffRateVal.split('|');
				tariffRates = new Array();
				$('.onepweekendRate').html(onepweekend[tariffRadioId] + onepweekendSfx);
				for(i in tariffRateTmp) {
					tariffRateChunk = tariffRateTmp[i].split(':');
					tariffRateRate  = tariffRateChunk[1].split(',');
					tariffRates[tariffRateChunk[0]] = tariffRateRate[tariffRadioId + 1];
					}
				if(tariffRates['L'] == '999') {
					$('.ratesResultLandlines .td-rite').html('&nbsp;');
					}
				else {
					$('.ratesResultLandlines .td-rite').html(ratesLPfx + tariffRates['L'] + ratesSfx);
					}
				if(tariffRates['M'] == '999') {
					$('.ratesResultMobiles .td-rite').html('&nbsp;');
					}
				else {
					$('.ratesResultMobiles .td-rite').html(ratesMPfx + tariffRates['M'] + ratesSfx);
					}
				$('.ratesResultLandlines').addClass('show');
				$('.ratesResultMobiles').addClass('show');
				$('.onepweekendRate').addClass('show');
				}
			$('.ratesTable1P .show').show();
			});
		});
	$('.ratesTable1P select').change(function() {
		$('.ratesResult').removeClass('show').fadeOut('fast', function() {
			$('.onepweekendRate').html('&nbsp;');
			tariffRateVal = $('.ratesTable1P select option:selected').val();
			if(tariffRateVal != '') {
				tariffRadioId = $('#one-p-rbs input').index($('#one-p-rbs input:checked'));
				tariffRateTmp = tariffRateVal.split('|');
				tariffRates = new Array();
				$('.onepweekendRate').html(onepweekend[tariffRadioId] + onepweekendSfx);
				for(i in tariffRateTmp) {
					tariffRateChunk = tariffRateTmp[i].split(':');
					tariffRateRate  = tariffRateChunk[1].split(',');
					tariffRates[tariffRateChunk[0]] = tariffRateRate[tariffRadioId + 1];
					}
				if(tariffRates['L'] == '999') {
					$('.ratesResultLandlines .td-rite').html('&nbsp;');
					}
				else {
					$('.ratesResultLandlines .td-rite').html(ratesLPfx + tariffRates['L'] + ratesSfx);
					}
				if(tariffRates['M'] == '999') {
					$('.ratesResultMobiles .td-rite').html('&nbsp;');
					}
				else {
					$('.ratesResultMobiles .td-rite').html(ratesMPfx + tariffRates['M'] + ratesSfx);
					}
				$('.ratesResultLandlines').addClass('show');
				$('.ratesResultMobiles').addClass('show');
				$('.onepweekendRate').addClass('show');
				}
			$('.ratesTable1P .show').show();
			});
		});
	/* /// 1P ///////////////////////////////////////////////////////////// */
	/* dmw : 2010-06-30 : offers/extra-credit.aspx */
	$('.CustomerCare td.td-left').html("<select><option value='' selected='selected'>Select Operator</option><option value='150'>T-Mobile</option><option value='150'>Orange Contract</option><option value='450'>Orange PAYG</option><option value='4445'>O2 PAYG</option><option value='202'>02 Contract</option><option value='191'>Vodafone</option><option value='322'>Lyca Mobile</option><option value='5588'>Lebara Mobile</option><option value='325'>Nomi Mobile</option><option value='333'>3 Mobile</option><option value='2732'>Asda</option></select>");
	$('.CustomerCare td.td-rite').wrapInner('<b></b>');
	$('.CustomerCare select').change(function() {
		$(this).children('option:selected').each(function () {
			num = $(this).val();
			});
		$('.CustomerCare td.td-rite b').fadeOut(function() {
			if(num != '') {
				$('.CustomerCare td.td-rite').html('<b>' + num + '</b>');
				}
			else {
				$('.CustomerCare td.td-rite').html('<b>&nbsp;</b>');
				}
			$('.CustomerCare td.td-rite b').fadeIn();
			});
		});

	$('.btn-purple').each(function() {
		$(this).after("<div class='clear'></div>");
		$(this).wrap("<div class='btn-purple-l'></div>");
		$(this).wrap("<div class='btn-purple-r'></div>");
		$(this).parent().parent().addClass($(this).attr('class').replace('btn-purple', ''));
		});

	// FOR offers/india-bundle.aspx
	$('.FiveRows select').change(function() {
		$(this).children('option:selected').each(function () {
			num = $(this).val();
			});
		$('.FiveRows td.td-rite span').fadeOut(function() {
			switch(num) {
				case '1':
					frC1 = "150 Minutes<br /><b>SMS Code- 'REG IN150'</b>";
					frC2 = "300 Minutes<br /><b>SMS Code- 'REG IN300'</b>";
					frC3 = "800 Minutes<br /><b>SMS Code- 'REG IN800'</b>";
					frC4 = "Unlimited Calls<br /><b>SMS Code- 'REG INUNL Number'</b>";
					break;
				case '2':
					frC1 = "75 Minutes<br /><b>SMS Code- 'REG PA75'</b>";
					frC2 = "150 Minutes<br /><b>SMS Code- 'REG PA150'</b>";
					frC3 = "350 Minutes<br /><b>SMS Code- 'REG PA350'</b>";
					frC4 = "N.A.";
					break;
				case '3':
					frC1 = "100 Minutes<br /><b>SMS Code- 'REG BA100'</b>";
					frC2 = "200 Minutes<br /><b>SMS Code- 'REG BA200'</b>";
					frC3 = "500 Minutes<br /><b>SMS Code- 'REG BA500'</b>";
					frC4 = "N.A.";
					break;
				case '4':
					frC1 = "70 Minutes<br /><b>SMS Code- 'REG NI70'</b>";
					frC2 = "140 Minutes<br /><b>SMS Code- 'REG NI140'</b>";
					frC3 = "300 Minutes<br /><b>SMS Code- 'REG NI300'</b>";
					frC4 = "N.A.";
					break;
				case '5':
					frC1 = "160 Minutes<br /><b>SMS Code- 'REG CH160'</b>";
					frC2 = "320 Minutes<br /><b>SMS Code- 'REG CH320'</b>";
					frC3 = "800 Minutes<br /><b>SMS Code- 'REG CH800'</b>";
					frC4 = "Unlimited Calls<br /><b>SMS Code- 'REG CHUNL Number'</b>";
					break;
				case '6':
					frC1 = "&pound;5.99 - 200 Minutes<br /><b>SMS Code- 'REG PO200'</b>";
					frC2 = "&pound;9.99 - 500 Minutes<br /><b>SMS Code- 'REG PO500'</b>";
					frC3 = "&pound;19.99 - 1000 Minutes<br /><b>SMS Code- 'REG PO1000'</b>";
					frC4 = "Unlimited Calls<br /><b>SMS Code- 'REG POUNL Number'</b>";
					break;
				default:
					frC1 = "&nbsp;";
					frC2 = "&nbsp;";
					frC3 = "&nbsp;";
					frC4 = "&nbsp;";
					break;
				}
				$('.FiveRows td.frC1').html('<span>' + frC1 + '</span>');
				$('.FiveRows td.frC2').html('<span>' + frC2 + '</span>');
				$('.FiveRows td.frC3').html('<span>' + frC3 + '</span>');
				$('.FiveRows td.frC4').html('<span>' + frC4 + '</span>');
				$('.FiveRows td.td-rite').css('line-height','150%');
				$('.FiveRows td.td-rite span').fadeIn();
			});
		});

	// FOR offers/global-bundle.aspx
	$('.BundleMinutes select').change(function() {
		var s = $(this).children('option:selected');
		var txt = $(s).text().toLowerCase();
		if(txt == 'india') {
			window.location='http://www.vectonemobile.co.uk/offers/free-calls-to-india.aspx';
			}
		else {
			var num = $(s).val();
			$('.BundleMinutes td.td-rite span').fadeOut(function() {
				if(num == 2) {
					$('.BundleMinutes td.td-rite').html('<span>Landline and Mobile</span>');
					}
				else if(num == 1){
					$('.BundleMinutes td.td-rite').html('<span>Landline Only</span>');
					}
				else {
					$('.BundleMinutes td.td-rite').html('<span>&nbsp;</span>');
					}
				$('.BundleMinutes td.td-rite').css('line-height','150%');
				$('.BundleMinutes td.td-rite span').fadeIn();
				});
			}
		});

});
