var lastVis=0;

function s(n){ with(document.HF){ pageNo.value=n; submit(); }}
function recheck(ok,fld,mode){
	if (mode==0){
		if (ok.checked && !document.QSF['CHK_'+fld].checked)
			document.QSF['CHK_'+fld].checked=true;
	} else if (ok.checked) document.ASF['CHK_'+fld].value=mode;
}

function within(n){
	var ok="1", fld='within'+n; 
	if (n==1) sel=document.QSF.country;
	else if (n==2) sel=document.ESF.country;
	else sel=document.ASF.country;
	v=sel.options[sel.selectedIndex].value;
	if (ok.indexOf(v)>-1) 
		document.getElementById(fld).style.display='block';
	else document.getElementById(fld).style.display='none';
}

function v(n,ok,mode){
	o=document.getElementById('V'+n);
	if (mode){
		if (o.style.visibility=='hidden') up=9; else up=0;
	} else {
		if (ok.checked) up=9; else up=0;
	}
	if (up) {
		if (lastVis) with(document){
			getElementById('VV'+lastVis).style.zIndex=0;
			getElementById('V'+lastVis).style.visibility='hidden';
		}
		lastVis=n;			
		o.style.visibility='visible';
	} else {
		o.style.visibility='hidden';
		lastVis=0;
	}
	o=document.getElementById('VV'+n);
	o.style.zIndex=up;
}
function show_as_selected(fld,val){
	if (!val) return;
	with(document.QSF[fld])	for(i=0;i<options.length;i++) 
		if (options[i].value==val || options[i].text==val) { selectedIndex=i; break; }
}

var show_note=1,FavToBeDeleted=new Array();

function delList(o,id){
	var cur=o.src,v='',set2;
	if (cur.indexOf('1.gif')>-1){o.src=o.src.replace('1.gif','.gif'); set2=0;}
	else { o.src=o.src.replace('.gif','1.gif'); set2=1; }
	FavToBeDeleted[id]=set2; set2=0;
	for(no in FavToBeDeleted) if (FavToBeDeleted[no]) { v+=((v)?',':'')+no; set2++; }
	document.DFF.delIds.value=v;
	document.DFF.sub.value="Delete Marked Records ("+set2+")";
	if (show_note) {
		show_note=0;
		alert("Remember!\r\n"+
			"When done marking all the records you want to\r\n"+
			"delete from your favorites,\r\n"+
			"Click the [Deleted marked records] at the bottom of the page");
	}
}

