 /*4Thought Menu*/
 /*Created by Erick Vargas 10/22/09*/

var contentInstances= new Array();
var instancesNames= new Array();
function SetDynamicYesNoSelect(ctrSelect, divContenido){
	$(divContenido).hide("slow");
	$(ctrSelect).change( function () { 
		var sval= $(ctrSelect).val();
		if(sval=='Yes'){
			$(divContenido).show("slow");
		}
		else
		{
			$(divContenido).hide("slow");
		}
	});	
}


function SetDynamicSelect(ctrSelect, pContents){
	instancesNames.push(ctrSelect);
	contentInstances.push(pContents);
	for (tupla in pContents){
		$(pContents[tupla][1]).hide();
	}
	$(ctrSelect).change( function () {
		dIndex=$.inArray(ctrSelect, instancesNames);
		var dContent=contentInstances[dIndex];
		var sval= $(ctrSelect).val();	
		for (tupla in dContent){
			if(dContent[tupla][0]==sval){
				$(dContent[tupla][1]).show();
			}
			else
			{
				$(dContent[tupla][1]).hide();
			}

		}
	});	
}


