//here you place the ids of every element you want.
var ids=new Array('shipping','noshipping','issue','mii1','mii2','mii3','mii4','mii5');

function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}
function limitText(issueField) {
	if (issueField.value.length > 17) {
		showdiv('issueNum');

	} else {
		hidediv('issueNum');	

		}
}


function limitInput(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}



function issue(CardType)
{
  if (CardType=='MD' ||
	CardType=='SO') {
  document.getElementById('issue').style.display = 'block';
  
  }	else {
  document.getElementById('issue').style.display = 'none';
	}
  
}

function gift(Amount)
{
  if (Amount=='0') {
  document.getElementById('shipping').style.display = 'none';
  document.getElementById('noshipping').style.display = 'block';

  
  }	else {
  document.getElementById('shipping').style.display = 'block';
  document.getElementById('noshipping').style.display = 'none';
	}
  
}
