$(document).ready(function() { $('a#SDN0').click(function(e){ e.preventDefault(); if ($('#unit').val() < 1) { $('#selectterm-dialog').dialog('open'); } else { window.location = $(this).attr('href'); } }); $('a#SDN1').click(function(e){ e.preventDefault(); if ($('#unit').val() < 1) { $('#selectterm-dialog').dialog('open'); } else { window.location = $(this).attr('href'); } }); $('a#SDN2').click(function(e){ e.preventDefault(); if ($('#unit').val() < 1) { $('#selectterm-dialog').dialog('open'); } else { window.location = $(this).attr('href'); } }); $('#selectterm-dialog').dialog({ autoOpen: false, bgiframe: true, title: false, modal: true, closeOnEscape: true, height: 320, width: 520, buttons: { 'Close': function() { $(this).dialog('close'); } } }); $('#content a[tooltip]').each(function() { $(this).click(function() { return false; }); $(this).qtip( { content: $(this).attr('tooltip'), position: { corner: { tooltip: 'bottomLeft', target: 'topRight' } }, style: { color: '#FFFFFF', border: { width: 5, radius: 10, color: '#686868' }, padding: 10, textAlign: 'left', tip: true, name: 'light', background: '#686868' }, hide: { when: 'mouseout', fixed: true, delay: 250 } }); }); $('#discount-dialog').dialog({ autoOpen: false, bgiframe: true, modal: true, closeOnEscape: true, height: 420, width: 500, open: function() { $('#contact').text(''); $('#email').text(''); $('#phone').text(''); $('#phone_cc').text(''); $('#dialogwarning').hide(); }, buttons: { 'Submit': function() { $.ajax({ type: 'POST', url: 'ajax_sdn_discount.jsp', data: 'contact=' + $('#contact').val() + '&email=' + $('#email').val() + '&phone_cc=' + $('#phone_cc').val() + '&phone=' + $('#phone').val() + '&type=' + $('#type').val() + '&details=' + $('#details').val() + '&comments=' + $('#comments').val() + '&transition=' + $('#transition').val(), success: function(xml) { var status = $(xml).find('status').text(); var msg = $(xml).find('msg').text(); if (status == 0) { $('#dialogwarning').hide(); $('#discountform').hide(); $('#dialoginfo').show(); window.location = 'pro1.jsp'; } else { $('#dialogwarning-content').text(msg); $('#dialogwarning').show(); } } }); }, 'Cancel': function() { $('#dialogwarning').hide(); $(this).dialog('close'); } } }); }); function discountDisplay() { $('#discount-dialog').dialog('open'); }; $(document).ready(function() { changeTerm(-1); }); function selectTerm() { var termPref = parseInt($('#unit').val()); changeTerm(termPref); } function selectTermRightNav() { var termPref = parseInt($('#rightnavunit').val()); $.ajax({ type: 'POST', url: 'ajax_build.jsp', dataType: 'xml', data: 'unit=' + termPref, success: function(xml) { var error = parseInt($(xml).find('error').text()); if (error == 0) window.location.reload(); else alert($(xml).find('errorMsg').text()); } });} $(window).scroll(function(){ var pos = (212 + $(window).scrollTop()); if (pos < 620) { pos = 0; } else { pos = $(window).scrollTop() - 320; var buffer = 120 + $(window).scrollTop() + $('#costcalc').height() - $('#ja-botsl').position().top; if(buffer > 0) pos -= buffer; if(pos < 0) pos = 0; } mypos = pos + 'px'; $('#costcalc').stop().animate({ 'marginTop': mypos}, 1000); }); function changeTerm(termPref) { if (termPref <= 0) termPref = 1000; $('#lite').html(getPrice('',pricing[100000 + '-' + termPref + '-1'], pricingunit[100000 + '-' + termPref + '-1'], (termPref == 2000 ? 20 : (termPref == 3000 ? 30 : 0)))); $('#basic').html(getPrice('',pricing[100100 + '-' + termPref + '-1'], pricingunit[100100 + '-' + termPref + '-1'], (termPref == 2000 ? 20 : (termPref == 3000 ? 30 : 0)))); $('#standard').html(getPrice('',pricing[100200 + '-' + termPref + '-1'], pricingunit[100200 + '-' + termPref + '-1'], (termPref == 2000 ? 20 : (termPref == 3000 ? 30 : 0)))); $('#premium').html(getPrice('',pricing[100300 + '-' + termPref + '-1'], pricingunit[100300 + '-' + termPref + '-1'], (termPref == 2000 ? 20 : (termPref == 3000 ? 30 : 0)))); $('#SDN0').attr('href', 'pro1.jsp?pid=100000&unit=' + termPref); $('#SDN1').attr('href', 'pro1.jsp?pid=100100&unit=' + termPref); $('#SDN2').attr('href', 'pro1.jsp?pid=100200&unit=' + termPref); $('#SDN3').attr('href', 'pro1.jsp?pid=100300&unit=' + termPref); } function confirmReset() { $('#confirmreset').dialog('open'); } function closeConfirmReset() { $('#confirmreset').dialog('close'); } function selectHw(option, eligible) { if (!eligible) { $('#clearbox').dialog('open'); return; } if (option == 'software') { $('#software').show(); $('#box100delivery').hide(); $('#box100').hide(); $('#box300delivery').hide(); $('#box300').hide(); $('#configure_cb_100_options').hide(); $('#configure_cb_300_options').hide(); $('#softwareradio').attr('checked', 'checked'); } else if (option == 'box100') { $('#0110_cpu501040_500010').attr('checked', 'checked'); $('#0120_memory502000_500010').attr('checked', 'checked'); $('#0130_disk503010_500010').attr('checked', 'checked'); $('#0140_nic0_500010').attr('checked', 'checked'); $('#0190_warranty505000_500010').attr('checked', 'checked'); $('#software').hide(); $('#box300delivery').hide(); $('#box300').hide(); $('#box100delivery').show(); $('#box100').show(); $('#configure_cb_100_options').show(); $('#configure_cb_300_options').hide(); $('#box100radio').attr('checked', 'checked'); } else if (option == 'box300') { $('#0110_cpu501070_500030').attr('checked', 'checked'); $('#0120_memory502015_500030').attr('checked', 'checked'); $('#0130_disk503020_500030').attr('checked', 'checked'); $('#0140_nic0_500030').attr('checked', 'checked'); $('#0190_warranty505000_500030').attr('checked', 'checked'); $('#box100delivery').hide(); $('#box100').hide(); $('#software').hide(); $('#box300delivery').show(); $('#box300').show(); $('#configure_cb_100_options').hide(); $('#configure_cb_300_options').show(); $('#box300radio').attr('checked', 'checked'); } setItem('0100_chassis', 1); } function getPrice(prefix, price, unit, discount) { return '' + prefix + '$' + price + '' + unit + '' + (discount > 0 ? '
SAVE ' + discount + '%
' : ''); } function setCredits(field, productid, quantity) { setProduct(field, 0, productid, $('#creditquantity').val()); }