﻿function WheresMyCart()
{
    alert("Dude! Where's My Cart?!\n\nDid you have items in your shopping cart? Don't worry. Your order is safe.\n\nThis is a temporary cart we'll use to build your new device. When you're done, we'll add everything together with your existing shopping cart.");
}

function AllowNumbersOnly(evt)
{
 var charCode = (evt.which) ? evt.which : event.keyCode
 if (charCode > 31 && (charCode < 48 || charCode > 57))
    return false;

 return true;
}

function popUp(page, name, w, h, scroll, resiz, locat, showToolbar) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	var toolbar = 'toolbar=yes';
	if ( !showToolbar ) {
		toolbar = 'toolbar=no';
	}
	winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resiz+',location='+locat+',toolbar=' +toolbar;
	win = window.open(page, name, winprop);
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}

function swapColors(existingCode, colorCode, typeImage)
{
    var img2swap = document.getElementById('ctl00_cph_img_' + existingCode);
    img2swap.src = 'http://img.sprintfulfillment.com/phones/' + typeImage + '/' + colorCode + '.gif';
    
    var code2swap = document.getElementById("ctl00_cph_code_" + existingCode);
    code2swap.value = colorCode;
}