function FrameNumber(){
	var setme = number.options.value;
	setme = setme-1;
	document.sample.TGotoFrame("/", ""+setme+"");
}

function FrameLabel(frame){
	var i = 0;
	for(i = 0; i < frame.elements.length; i++) {
		if (frame.elements[i].type == "select-one") {
			var temptext = frame.elements[i].options[frame.elements[i].selectedIndex].text;
			if (temptext.indexOf(" (Add") > 0)
				temptext = temptext.substr(0, temptext.indexOf(" (Add"));
			if (frame.elements[i].options[0].text == "Color - Couleur")
				document.sample.TGotoLabel("/Product_Main", temptext);
			else if (frame.elements[i].options[0].text == "Design")
				document.sample.TGotoLabel("/Product_Main/Imprint_Main", temptext);
			else if (frame.elements[i].options[0].text == "Location - Localisation") {
				loc = i;
				document.sample.TGotoLabel("/Product_Main/Location_Main", temptext);
			} else if (frame.elements[i].options[0].text == "Logo")
				document.sample.TGotoLabel("/Product_Main/Location_Main/Logo_Main", temptext);
		} else if (frame.elements[i].type == "text") {
			if (frame.elements[i].id.substr(frame.elements[i].id.length - 9,frame.elements[i].id.length) == "txtCustom") {
				if (frame.elements[i].value.length > 0)
					frame.elements[i].onkeyup();
			}
		}
	}
}	

// set the variable in the SWF
function changetext(which, str){
	if(loc > 0)
		which = "/Product_Main/Location_Main" + which.substring(13,which.length);
	if(window.sample) window.document["sample"].SetVariable(which, str);
	if(document.sample) document.sample.SetVariable(which, str);
}

function PostFrameLabel(id, attrib, val){
	var temptext = val;
	if (temptext.indexOf(" (Add") > 0)
		temptext = temptext.substr(0, temptext.indexOf(" (Add"));
	if (attrib == "Size - Taille")
		eval('loc'+id+' = 0');
	else if (attrib == "Color - Couleur") {
		eval('loc'+id+' = 0');
		eval('document.sample_'+id+'.TGotoLabel("/Product_Main", temptext)');
	} else if (attrib == "Design")
		eval('document.sample_'+id+'.TGotoLabel("/Product_Main/Imprint_Main", temptext)');
	else if (attrib == "Location - Localisation") {
		eval('loc'+id+' = 1');
		eval('document.sample_'+id+'.TGotoLabel("/Product_Main/Location_Main", temptext)');
	} else if (attrib == "Logo")
		eval('document.sample_'+id+'.TGotoLabel("/Product_Main/Location_Main/Logo_Main", temptext)');
}

function Postchangetext(id, which, str){
	if (eval('loc'+id) > 0)
		which = "/Product_Main/Location_Main" + which.substring(13,which.length);
	eval('if(window.sample_'+id+') window.document["sample_'+id+'"].SetVariable(which, str)');
	eval('if(document.sample_'+id+') document.sample_'+id+'.SetVariable(which, str)');
}

function force_flash_update(id, attrib, val){
	PostFrameLabel(id, attrib, val);
	for ($ffloop = 0; $ffloop < 15000; $ffloop += 250){
		setTimeout(function(){PostFrameLabel(id, attrib, val);}, $ffloop);
	}
}

function force_flash_text_update(one, two, three){
	Postchangetext(one, two, three);
	for ($ffloop = 0; $ffloop < 15000; $ffloop += 250){
		setTimeout(function(){Postchangetext(one, two, three);}, $ffloop);
	}
}