// JavaScript Document

$(document).ready(function () {
	
	$('input.host_add').hover(
		function () {
			$(this).addClass('hover');
		},
		function () {
			$(this).removeClass('hover');
		});
	
	$('div.features table').attr('cellpadding', '0').attr('cellspacing', '0');
	$('table tr td').addClass('col1');
	$('table tr td + td').removeClass('col1').addClass('col2');
	$('table tr td + td + td').removeClass('col2').addClass('col3');
	$('table tr td + td + td + td').removeClass('col3').addClass('col4');
	
	$('div.pick-plan').children('div:first').hide();
	$('div.pick-plan h3:first').css('cursor', 'pointer').append('<span>Let us help</span>').click( function() {
		if ($(this).next('div').is(":hidden")) {
			$(this).children('span').html('Hide Information');
			$(this).next('div').slideDown();
		} else {
			$(this).children('span').html('Let us help');
			$(this).next('div').slideUp();
		}
	}); 
	
	$('.compact').hide().after('<a href="javascript:void(0)" class="showmore">More Features</a>');
	
	$('.showmore').click( function() {
		if ($(this).prev('div.compact').is(":hidden")) {
			$(this).html('Hide Features');
			$(this).prev('div.compact').slideDown();
		} else {
			$(this).prev('div.compact').slideUp();
			$(this).html('More Features');
		}
	});
	
	
	$("div.hosting_options input:checked").parent().addClass('checked');
	$('input[type=radio]').click( function() {
		$("div.hosting_options input").parent().removeClass('checked');
		$(this).parent().addClass('checked');
	});
	
// Variable and code for price change on select

	var lbfile = new Array();
	lbfile['PEM-LBSCM'] = "lin_basic_hosting_price.jpg"; 
	lbfile['PEM-LBSCQ'] = "lin_basic_hosting_price_q.jpg";
	lbfile['PEM-LBSCY'] = "lin_basic_hosting_price_y.jpg"; 
	lbfile['PEM-LBSC2Y'] = "lin_basic_hosting_price_2y.jpg"; 
	lbfile['PEM-LBSC3Y'] = "lin_basic_hosting_price_3y.jpg"; 
	lbfile['PEM-LBSC5Y'] = "lin_basic_hosting_price_5y.jpg";
	
	var ldfile = new Array();
	ldfile['PEM-LDLXBM'] = "lin_deluxe_hosting_price.jpg"; 
	ldfile['PEM-LDLXBQ'] = "lin_deluxe_hosting_price_q.jpg";
	ldfile['PEM-LDLXBY'] = "lin_deluxe_hosting_price_y.jpg"; 
	ldfile['PEM-LDLXB2Y'] = "lin_deluxe_hosting_price_2y.jpg"; 
	ldfile['PEM-LDLXB3Y'] = "lin_deluxe_hosting_price_3y.jpg"; 
	ldfile['PEM-LDLXB5Y'] = "lin_deluxe_hosting_price_5y.jpg";
	
	var lufile = new Array();
	lufile['PEM-LULTM'] = "lin_ultra_hosting_price.jpg"; 
	lufile['PEM-LULTQ'] = "lin_ultra_hosting_price_q.jpg";
	lufile['PEM-LULTY'] = "lin_ultra_hosting_price_y.jpg"; 
	lufile['PEM-LULT2Y'] = "lin_ultra_hosting_price_2y.jpg"; 
	lufile['PEM-LULT3Y'] = "lin_ultra_hosting_price_3y.jpg"; 
	lufile['PEM-LULT5Y'] = "lin_ultra_hosting_price_5y.jpg"; 

	var wbfile = new Array();
	wbfile['PEM-WBSCM'] = "price-basic-windows.jpg"; 
	wbfile['PEM-WBSCQ'] = "price-basic-windows_q.jpg";
	wbfile['PEM-WBSCY'] = "price-basic-windows_y.jpg"; 
	wbfile['PEM-WBSC2Y'] = "price-basic-windows_2y.jpg"; 
	wbfile['PEM-WBSC3Y'] = "price-basic-windows_3y.jpg"; 
	wbfile['PEM-WBSC5Y'] = "price-basic-windows_5y.jpg";
	
	var wdfile = new Array();
	wdfile['PEM-WDLXBM'] = "price-deluxe-windows.jpg"; 
	wdfile['PEM-WDLXBQ'] = "price-deluxe-windows_q.jpg";
	wdfile['PEM-WDLXBY'] = "price-deluxe-windows_y.jpg"; 
	wdfile['PEM-WDLXB2Y'] = "price-deluxe-windows_2y.jpg"; 
	wdfile['PEM-WDLXB3Y'] = "price-deluxe-windows_3y.jpg"; 
	wdfile['PEM-WDLXB5Y'] = "price-deluxe-windows_5y.jpg";
	
	var wufile = new Array();
	wufile['PEM-WULTM'] = "price-ultra-windows.jpg"; 
	wufile['PEM-WULTQ'] = "price-ultra-windows_q.jpg";
	wufile['PEM-WULTY'] = "price-ultra-windows_y.jpg"; 
	wufile['PEM-WULT2Y'] = "price-ultra-windows_2y.jpg"; 
	wufile['PEM-WULT3Y'] = "price-ultra-windows_3y.jpg"; 
	wufile['PEM-WULT5Y'] = "price-ultra-windows_5y.jpg"; 

    $('select.lbselect').change(function() 
    { 
        var file_index = $(this).val();
		var packbg = lbfile[file_index];
        $('div.hosting ul li.basic').css('background', 'url(/images/dv7/hosting/' + packbg + ')');
    });
	
    $('select.blogselect').change(function() 
    { 
        var file_index = $(this).val();
		var packbg = lbfile[file_index];
        $('div.blog div.right').css('background', 'url(/images/dv7/hosting/' + packbg + ') 4px 23px no-repeat');
    });
	
    $('select.ldselect').change(function() 
    { 
        var file_index = $(this).val();
		var packbg = ldfile[file_index];
        $('div.hosting ul li.deluxe').css('background', 'url(/images/dv7/hosting/' + packbg + ')');
    });
	
    $('select.luselect').change(function() 
    { 
        var file_index = $(this).val();
		var packbg = lufile[file_index];
        $('div.hosting ul li.ultra').css('background', 'url(/images/dv7/hosting/' + packbg + ')');
    });

    $('select.wbselect').change(function() 
    { 
        var file_index = $(this).val();
		var packbg = wbfile[file_index];
        $('div.hosting ul li.basic').css('background', 'url(/images/dv7/hosting/' + packbg + ')');
    });
	
    $('select.wdselect').change(function() 
    { 
        var file_index = $(this).val();
		var packbg = wdfile[file_index];
        $('div.hosting ul li.deluxe').css('background', 'url(/images/dv7/hosting/' + packbg + ')');
    });
	
    $('select.wuselect').change(function() 
    { 
        var file_index = $(this).val();
		var packbg = wufile[file_index];
        $('div.hosting ul li.ultra').css('background', 'url(/images/dv7/hosting/' + packbg + ')');
    });
	
	
});
