function changeBillingState(state) { f=document.forms['billingForm']; if (f.elements['electronicOnly'].value == 0) { if (state == 'AK' || state == 'HI') { document.getElementById('changeCountryWarning').style.display='block'; document.getElementById('changeCountryWarning').innerHTML='We only ship items to the continental United States. If you are located outside the continental United States we will automatically change the delivery method to Electronic Download for the items in your cart.'; } else { document.getElementById('changeCountryWarning').style.display='none'; document.getElementById('changeCountryWarning').innerHTML=''; } } } function changeShippingState(state) { f=document.forms['shippingForm']; if (f.elements['electronicOnly'].value == 0) { if (state == 'AK' || state == 'HI') { document.getElementById('changeCountryWarning').style.display='block'; document.getElementById('changeCountryWarning').innerHTML='We only ship items to the continental United States. If you are located outside the continental United States we will automatically change the delivery method to Electronic Download for the items in your cart.'; } else { document.getElementById('changeCountryWarning').style.display='none'; document.getElementById('changeCountryWarning').innerHTML=''; } } } function changeBillingCountry(newCountry) { f=document.forms['billingForm']; f.elements['state'].value=''; if (newCountry == 'US') { document.getElementById('stateContainerUS').style.display='block'; document.getElementById('stateContainerOutsideUS').style.display='none'; document.getElementById('zipCodeLabel').innerHTML='Zip Code'; //state = visible, postal code label = 'Zip Code' //get rid of the warning about electronic download document.getElementById('changeCountryWarning').style.display='none'; document.getElementById('changeCountryWarning').innerHTML=''; } else { document.getElementById('stateContainerOutsideUS').style.display='block'; document.getElementById('stateContainerUS').style.display='none'; document.getElementById('zipCodeLabel').innerHTML='Postal Code'; //state = hidden, postal code label = 'Label' //display warning saying that all items will be available by download only if (f.elements['electronicOnly'].value == 0) { document.getElementById('changeCountryWarning').style.display='block'; document.getElementById('changeCountryWarning').innerHTML='We only ship items to the continental United States. If you are located outside the continental United States we will automatically change the delivery method to Electronic Download for the items in your cart.'; } else { document.getElementById('changeCountryWarning').style.display='none'; document.getElementById('changeCountryWarning').innerHTML=''; } } } function moveRight() { f=document.forms['helperForm']; if (f.elements['endColumn'].value == f.elements['totalColumns'].value) return; gunType=f.elements['gunType'].value; leftColumn=document.getElementById('ulColumn1'); middleColumn=document.getElementById('ulColumn2'); rightColumn=document.getElementById('ulColumn3'); leftColumn.innerHTML=middleColumn.innerHTML; middleColumn.innerHTML=rightColumn.innerHTML; columnToFetch=parseInt(f.elements['endColumn'].value)+1; f.elements['startColumn'].value=parseInt(f.elements['startColumn'].value)+1; f.elements['endColumn'].value=parseInt(f.elements['endColumn'].value)+1; rightColumn.innerHTML=returnColumn(columnToFetch,gunType); toggleLink('Left','on'); if (f.elements['endColumn'].value == f.elements['totalColumns'].value) { toggleLink('Right','off'); } } function toggleLink(direction,action) { if (action == 'on') { //turn the link "on" document.getElementById('homeBrowse'+direction).src='/images/homeBrowse'+direction+'.gif' document.getElementById('browse'+direction+'Link').onmouseout=function onmouseout(){imageSwap('homeBrowse'+direction, '/images/homeBrowse'+direction+'.gif');}; document.getElementById('browse'+direction+'Link').onmouseover=function onmouseover(){imageSwap('homeBrowse'+direction, '/images/homeBrowse'+direction+'Over.gif')}; } if (action == 'off') { //turn the link "off" document.getElementById('homeBrowse'+direction).src='/images/homeBrowse'+direction+'Off.gif' document.getElementById('browse'+direction+'Link').onmouseout=function onmouseout(){imageSwap('homeBrowse'+direction, '/images/homeBrowse'+direction+'Off.gif');}; document.getElementById('browse'+direction+'Link').onmouseover=function onmouseover(){imageSwap('homeBrowse'+direction, '/images/homeBrowse'+direction+'Over.gif')}; } } function moveLeft() { f=document.forms['helperForm']; if (f.elements['startColumn'].value == 1) return; gunType=f.elements['gunType'].value; leftColumn=document.getElementById('ulColumn1'); middleColumn=document.getElementById('ulColumn2'); rightColumn=document.getElementById('ulColumn3'); rightColumn.innerHTML=middleColumn.innerHTML; middleColumn.innerHTML=leftColumn.innerHTML; // leftColumn.innerHTML=''; columnToFetch=parseInt(f.elements['startColumn'].value)-1; f.elements['startColumn'].value=parseInt(f.elements['startColumn'].value)-1; f.elements['endColumn'].value=parseInt(f.elements['endColumn'].value)-1; leftColumn.innerHTML=returnColumn(columnToFetch,gunType); if (parseInt(f.elements['startColumn'].value) > 1) { toggleLink('Left','on'); } else { toggleLink('Left','off'); //we need to grey out the left arrow } toggleLink('Right','on'); } function returnColumn(columnToFetch,gunType) { test = HTML_AJAX.grab('/aOutput/takeDownGuides.phtml?columnToFetch='+columnToFetch+'&gunType='+gunType); return test; } function showLongGuns() { changeGunLinks('Long'); f=document.forms['helperForm']; newContent = HTML_AJAX.grab('/aOutput/takeDownGuides.phtml?fetch=all&gunType=Long').split("!SPLITSPLITSPLIT!"); document.getElementById('divGunList').innerHTML=newContent[0]; f.elements['totalColumns'].value=newContent[1]; f.elements['gunType'].value='Long'; f.elements['startColumn'].value='1'; f.elements['endColumn'].value='3'; toggleLink('Left','off'); toggleLink('Right','on'); } function showHandGuns() { changeGunLinks('Hand'); f=document.forms['helperForm']; newContent = HTML_AJAX.grab('/aOutput/takeDownGuides.phtml?fetch=all&gunType=Hand').split("!SPLITSPLITSPLIT!"); document.getElementById('divGunList').innerHTML=newContent[0]; f.elements['totalColumns'].value=newContent[1]; f.elements['gunType'].value='Hand'; f.elements['startColumn'].value='1'; f.elements['endColumn'].value='3'; toggleLink('Left','off'); toggleLink('Right','on'); } function showAllGuns() { changeGunLinks('All'); f=document.forms['helperForm']; newContent = HTML_AJAX.grab('/aOutput/takeDownGuides.phtml?fetch=all&gunType=').split("!SPLITSPLITSPLIT!"); document.getElementById('divGunList').innerHTML=newContent[0]; f.elements['totalColumns'].value=newContent[1]; f.elements['gunType'].value=' '; f.elements['startColumn'].value='1'; f.elements['endColumn'].value='3'; toggleLink('Left','off'); toggleLink('Right','on'); } function changeGunLinks(currentType) { // alert('blah'); if (currentType == 'Long') { document.getElementById('longGunsLink').className='on'; document.getElementById('handGunsLink').className=''; document.getElementById('allGunsLink').className=''; } if (currentType == 'Hand') { document.getElementById('longGunsLink').className=''; document.getElementById('handGunsLink').className='on'; document.getElementById('allGunsLink').className=''; } if (currentType == 'All') { document.getElementById('longGunsLink').className=''; document.getElementById('handGunsLink').className=''; document.getElementById('allGunsLink').className='on'; } } function changeDeliveryMethod(newDeliveryMethod,itemID) { f=document.forms['cartForm']; // alert('got here'); f.elements['action2'].value='changeDeliveryMethod'; f.elements['itemID'].value=itemID; f.elements['newDeliveryMethod'].value=newDeliveryMethod; f.submit(); }