
// Pop Up Windows
var currentImage = "";
var newwindow;
function popup(url){
	newwindow=window.open(url,'name','height=400,width=745, scrollbars=yes, toolbar=no, menubar=no, resizable=yes');
	if (window.focus) {newwindow.focus()}
}
function popuppic(id){
	if(currentImage != ''){
		newwindow=window.open('/info/index.html?id=' + currentImage,'name','height=620,width=560, scrollbars=yes, toolbar=no, menubar=no, resizable=yes');
	}else{
		newwindow=window.open('/info/index.html?id=' + id,'name','height=620,width=560, scrollbars=yes, toolbar=no, menubar=no, resizable=yes');
	}
	if (window.focus){
		newwindow.focus();
	}
}
function updatepic(pic,name,id){
	currentImage = id;
	var mainImage = document.getElementById('main-image');
	var enlargeLink = document.getElementById('enlarge');
	mainImage.src = '/cms_media/images/210x210_fitbox-' + pic;
	enlargeLink.href = '/cms_media/images/500x500_fitbox-' + pic;
}

// Bookmarking
function bookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  	window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}

function showFeature(id){
	if(document.getElementById(id + 'info')){
		document.getElementById(id + 'info').className = 'show';
	}
}
function hideFeature(id){
	if(document.getElementById(id + 'info')){
		document.getElementById(id + 'info').className = 'hide';
	}
}


// Table info display
function getFeatures(){
	var container = document.getElementById('tabcontainer');
	var features = container.getElementsByTagName("TR");
	for(i=0; i<features.length; i++){
		feature = features[i];
		if(feature.className != 'hide' && feature.id != ''){
			feature.onmouseover = function(){
				showFeature(this.id);
			}
			feature.onmouseout = function(){
				hideFeature(this.id);
			}
		}
	}
}