
function InsertContent(div1,div2,div3,val,val3) {
	document.getElementById(div1).style.display = val;
	document.getElementById(div2).style.display = val;
	document.getElementById(div3).style.display = val3;
}

function numOnly(){
	k = (document.all)?event.keyCode : arguments.callee.caller.arguments[0].which;
	if (k<48||k>57) return false
}

function radioBtnCheck() {
	if (gcForm.gc_print[0].checked) { 
		// set var radio_choice to false
		var radio_choice = false;
		
		// Loop from zero to the one minus the number of radio button selections
		for (counter = 0; counter < gcForm.gc_card_id.length; counter++) 	{
			// If a radio button has been selected it will return true
			// (If not it will return false)
			if (gcForm.gc_card_id[counter].checked) {
				radio_choice = true; 
			}
		}
			
		if (!radio_choice) 	{
			return false; // returns false and puts the fires the alert in formCheck
		}	
	}
}

function emptyvalidation(entered) {
	with (entered) {
		if (value==null || value=="") {
			return false;
		} else {
			return true;
		}
	}
}

function selectCheck(pulldown){
	if(pulldown.value == ""){
		pulldown.focus();
		return false;
	}
}


function formCheck(thisform) {
	with (thisform) {
		//
		if (selectCheck(gcForm.selectService) == false && emptyvalidation(customAmount)==false) {
			alert("Please select a service or enter an amount.");
			selectService.focus();
			return false;
		}
		//
		if (radioBtnCheck() == false) {
			alert("Please select a card design.");
			return false;
		};
		//
		if (gc_multiple_cards[1].checked && emptyvalidation(gc_multiple_inst)==false) {
			alert("Please enter instructions for multiple cards");
			gc_multiple_inst.focus(); 
			return false;
		};
		//
		if (emptyvalidation(gc_recipient)==false) {
			alert("Please enter the recipient's name");
			gc_recipient.focus(); 
			return false;
		};
		//
		if (emptyvalidation(gc_from)==false) {
			alert("Please enter your name");
			gc_from.focus(); 
			return false;
		};
		//
		if (emptyvalidation(gc_message)==false) {
			alert("Please enter a message");
			gc_message.focus(); 
			return false;
		};
		//
	}
}

function popup(mylink, windowname) {
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	   href=mylink;
	else
	   href=mylink.href;
	window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
	return false;
}








