// Custom JavaScript Functionality for SellYourCell.com
// -----------------------------------------------------
// Created by .Com Marketing
// Last Revision: 2007-05-04


// functionality for resetting the quantity of the phones
// being added back to 1 when it's triggered
function updateQty() {
	var selectBox = document.getElementById('PhoneQuantity')
	selectBox.value = '1'
}

// functionality for 'activating' the second step box
function activateTwo() {
	var stepTwoBox = document.getElementById('two')
	stepTwoBox.removeClassName('inactive')
}

// functionality for 'activating' the third step box
function activateThree() {
	var stepThreeBox = document.getElementById('three')
	stepThreeBox.removeClassName('inactive')
}


function deactivateLink(linkId) {
	var link = document.getElementById(linkId)
	link.setAttribute('onclick','return false;')
}

function activateLink(linkId) {
	var link = document.getElementById(linkId)
	link.setAttribute('onclick','return true;')
}

Event.observe(window, 'load', function() {
	Event.observe('PhoneManuSelect', 'change', function(event) {
		new Ajax.Updater('two','/home/stepTwo', {
			asynchronous:true, 
			evalScripts:true, 
			parameters:Form.serialize('stepOneForm'), 
			requestHeaders:['X-Update', 'two']
		}) 
	}, false);
});