// JavaScript Document

function tsvToggleCatDisplay ( tsvIDa ){
	if( tsvIDa == 'tsvCatList' ){
		document.getElementById( 'tsvCatList' ).style.display = 'inline';		
		document.getElementById( 'tsvCatGal' ).style.display = 'none';
	}
	if( tsvIDa == 'tsvCatGal' ){
		document.getElementById( 'tsvCatGal' ).style.display = 'inline';		
		document.getElementById( 'tsvCatList' ).style.display = 'none';		
	}	
}

function tsv_mm_jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function tsv_showRecent(flag){
	
	if( flag ){
		document.getElementById('recentlyViewed').style.display="none";
	}else{
		document.getElementById('recentlyViewed').style.display="block";
	}
	
}

function tsv_showLoginBox(){
	
	if( document.getElementById('loginBox').style.display == "block" ){
		document.getElementById('loginBox').style.display="none";
	}else{
		document.getElementById('loginBox').style.display="block";
	}
	
}

function popImg(url,width,height,wname) {
	if (!wname)
	 wname = "imgwin";
	if (wname == '')
	 wname = "imgwin";
	if(!width) width=650;
	if(!height) height=600;
	imgWin=window.open(url,wname,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width="+width+",height="+height);
	imgWin.focus();
}

function tsvRemoveCompareItem( colNum ){
	var thisCol = 'comp_'+colNum;
	
	var allTDs = document.getElementsByTagName('td');
	var len = allTDs.length;
	
	for(var i=0; i<len; i++){
		if( !allTDs[i] ) continue;
		
		var thisTDaccessKey = allTDs[i].getAttribute('accesskey');
		if( !thisTDaccessKey ) continue;
		
		if( thisTDaccessKey.search( thisCol ) > -1 ){
			var _p = allTDs[i].parentNode;
			_p.removeChild( allTDs[i] );			
		}
		
	}
		
}