var connectURL = '/facebook_connect/';
var ticketsURL = 'tickets.html';

function pop (page){
 switch (page) {
   case 'connect':
     popup(connectURL, 660, 800, 'win', 'no', 'no', 'yes', 'no', 'no', 'no');
     break;
     
   case 'tickets':
     popup(ticketsURL, 400, 381, 'win', 'no', 'no', 'auto', 'no', 'no', 'no');
     break;
   
   default:
     alert ('Uncaught popup request: ' + page);
 }
}

function popup( url, w, h, windowName, r, st, s, l, m, t) {
  try {
    win.close();
  } catch(e) {    
  }
    w += 15;
    h += 15;
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  win = window.open(url, windowName, 'height=' +h+ ', width=' +w+ ', resizable=' +r+ ', status= ' +st+ ', scrollbars=' +s+ ', location=' +l+ ', menubar=' +m+  ', toolbar= ' +t+ ', left='+winl+', top='+wint);
  win.focus();    
 
}

