var cur_lyr;	
function swapLayers(id) {
  if (cur_lyr) hideLayer(cur_lyr);
  showLayer(id);
  cur_lyr = id;
}

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.display = "block";
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.display = "none";
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

function pop_me(mypage,myname,w,h,features) {
  if(screen.width){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  }else{winl = 0;wint =0;}
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
}

function past_festivals() {
	pop_me('/past.php','popup',400,300,'scrollbars=no');
}

function slideshow(gallery) {
	var gallerylocation = '/photos/' + gallery;
	pop_me(gallerylocation,'popup',640,480,'scrollbars=no,resizable=0,statusbar=0');
}

function register() {
	pop_me('http://2006.tromadance.com/include/register.php','register',500,500,'scrollbars=yes');
}

function stream(clip) {
  var cliplocation = 'http://streaming.tromadance.com/go/' + clip;
  win = window.open(cliplocation,'tromadanceondemand','height=450,width=400,scrollbars=no');
  win.window.focus();
}
function stream(s,title,director) {
	var stuff = '?s=' + s;
	stuff += '&title=' + title;
	stuff += '&director=' + director;
	pop_me('http://streaming.tromadance.com/stream.php'+stuff,'ondemand',450,400,'scrollbars=no');
}