function show(element,show){
// SHOW OR HIDE AN ELEMENT
// #element: element id
// #show: 'y' (show) or 'n' (hide)
	if (document.getElementById)
	{
	// this is the way the standards work
	   if(show=='y'){
		document.getElementById(element).style.display = 'block';
	   }else{
		document.getElementById(element).style.display = 'none';
	   }
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	   if(show=='y'){
		document.all[element].style.display='block';
	   }else{
		document.all[element].style.display=='none';
	   }
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	   if(show=='y'){
		document.all[element].style.display='block';
	   } else {
		document.all[element].style.display=='none';
	   }
	}
}


function openDescPanel(de,sl,el){
// SHOW DIVS FOR REFERRER INFO, DEPENDING ON WHAT IS SELECTED
// #de: if this word ...
// #sl: ... matches any of the words in this array ...
// #el: ... show this element (div id)
	var lel;
	lel=0;
	for(var x=0; x<sl.length; x++){
		if(de==sl[x]){
			lel=1;
		}
	}
	if(lel==1){
		show(el,'y');
	}else{
		show(el,'n');
	}
}

function openCountryPanel(value,arrShowLoc,pElementVal,pElementShowLoc,element){
	var lel;
	lel=0;
	for(var x=0; x<arrShowLoc.length; x++){
		if(value==arrShowLoc[x]){
			if(pElementVal.length>0 && pElementShowLoc.length>0){

				for(var z=0; z<pElementShowLoc.length; z++){
					if(pElementVal==pElementShowLoc[z]){
						lel=1;
					}
				}
			}else{
				lel=1;
			}
		}
	}
	if(lel==1){
		show(element,'y');
	}else{
		show(element,'n');
	}
}

function resetSourceDetail(){
	eval(document.createaccount.ddSourceDetail.selectedIndex = 0);
}

function sdSetIndex(ddElement,matchvalue){

	for (var i=0; i < document.createaccount.elements[ddElement].length;i++){
		 if(document.createaccount.elements[ddElement].options[i].value==matchvalue){
			 eval(document.createaccount.elements[ddElement].selectedIndex = i);
		 }
	}
}

