/* this script is used for Personalized jerseys 
* edit:jt, update:cls 014.AUG.2007 */

/* do basic intialization of all the customization inputs, events, etc that are needed before user can begin customizing */
function showJersey(){
	document.getElementById('custContainer').style.visibility = "visible";
}

// create name to flash 
 function getFlashMovie() {
  var isIE = navigator.appName.indexOf("Microsoft") > -1;
  //return (isIE) ? window["custJersey"] : document["custJersey"];
  return document["custJersey"];
  //return document["custJersey"];
 }

//send to form field
 function formSend() {
		if(document.getElementById('numField').value.match(/[0-9]/)){
			document.getElementById('custErr').style.visibility = "hidden";
		}else{	
			document.getElementById('custErr').style.visibility = "visible";	// tell user they need to enter a number
			return;
		}
		var mv = getFlashMovie();
		//test alert("UU Testing do not be alarmed \n" +mv.name + "\n"+document.getElementById('numField').value+"\n"+document.getElementById('txtColor').value);
		mv.sendTextToFlash(document.getElementById('sendField').value, document.getElementById('numField').value, document.getElementById('txtColor').value);
}

/* JAT 2/22/08 - before jersey is added to basket, update the info_attr1 value on the form */
function updateInfoAttr(){
	var curColor = document.getElementById('txtColor').value;	// grab the value from the text color dropdown
	if(curColor == "0xffffff"){
		curColor = " light text";
	}else {
		curColor = " dark text";
	}
	
	document.form1.info_attr1[2].value = curColor;
	document.form1.submit();
}
