var form_amount=1;



function checkname(form_name){

	myform=$(form_name);

	rec_name=myform["os2"].value;

	if(rec_name==""){

		alert("please assure you enter your relative's name");

		return false;

	}

	else{

		return true;	

	}

}



function addForm(){

	form_amount=form_amount+1;

	

	field = "<form onSubmit=\"return checkname('Y-STR_relative_"+form_amount+"')\" name=\"Y-STR_relative_"+form_amount+"\" id=\"Y-STR_relative_"+form_amount+"\" target=\"paypal\" action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\"><input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\"><input type=\"hidden\" name=\"on2\" id=\"on2\" value=\"Relative Name\"><span>Relative Name:<input type=\"text\" name=\"os2\" id=\"os2\">&nbsp;</span><input type=\"hidden\" name=\"hosted_button_id\" value=\"3500947\"><span><input type=\"image\" src=\"images/add_to_cart.gif\" border=\"0\" name=\"submit\"></span><img border=\"0\" src=\"https://www.paypal.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\"></form>"; 

				

	$('more_relatives').insert(field, { position: 'bottom' });

	return false;

}

function addFormDisc(){

	form_amount=form_amount+1;

	

	field = "<form onSubmit=\"return checkname('Y-STR_relative_d_"+form_amount+"')\" name=\"Y-STR_relative_d_"+form_amount+"\" id=\"Y-STR_relative_d_"+form_amount+"\" target=\"paypal\" action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\"><input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\"><input type=\"hidden\" name=\"on2\" id=\"on2\" value=\"Relative Name\"><span>Relative Name:<input type=\"text\" name=\"os2\" id=\"os2\">&nbsp;</span><input type=\"hidden\" name=\"hosted_button_id\" value=\"3500971\"><span><input type=\"image\" src=\"images/add_to_cart.gif\" border=\"0\" name=\"submit\"></span><img border=\"0\" src=\"https://www.paypal.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\"></form>"; 

				

	$('more_relatives').insert(field, { position: 'bottom' });

	return false;

}


function load_info(){

	p_i = $("personal_info");
	athletic_panel_d = $("Athletic_Panel_d");
	form_ySTR_d = $("Y-STR_d");
	athletic_panel_and_y_d = $("Athletic_Panel_and_y_d");
	Mt_DNA_d = $("Mt-DNA-d");
	
	if(p_i["promo"].value=="zahabimma" || p_i["promo"].value=="nweisman" || p_i["promo"].value=="tomm0309" || p_i["promo"].value=="peted0309" || p_i["promo"].value=="keithw0309" || p_i["promo"].value=="susanw0309" || p_i["promo"].value=="neilc0309" || p_i["promo"].value=="roots" || p_i["promo"].value=="Roots" || p_i["promo"].value=="brianm0309"){
		
		athletic_panel_d["os3"].value=p_i["promo"].value;
		form_ySTR_d["os3"].value=p_i["promo"].value;
		athletic_panel_and_y_d["os3"].value=p_i["promo"].value;
		Mt_DNA_d["os3"].value=p_i["promo"].value;
		//alert("hello");
		$("button_discount").show();
		$("button_2_discount").show();
		$("button_4_discount").show();
		$("button_5_discount").show();
		$("button_6_discount").show();
		$("button_7_discount").show();

		$("button_6").hide();
		$("button").hide();
		$("button_2").hide();
		$("button_4").hide();
		$("button_5").hide();
		$("button_7").hide();
		
		return false;

	}
	else{
		$("errors").innerHTML="That promo Code doesnt exist";
		
		$("button").show();
		$("button_2").show();
		$("button_4").show();
		$("button_5").show();
		$("button_6").show();
		$("button_7").show();

		$("button_discount").hide();
		$("button_2_discount").hide();
		$("button_4_discount").hide();
		$("button_5_discount").hide();
		$("button_6_discount").hide();
		$("button_7_discount").hide();
		
		return false;

	}
	
	$("errors").innerHTML="";
	return false;

}