// JavaScript Document		
    function popup(){
		var h = this.getAttribute( 'h' );
		var w = this.getAttribute( 'w' );
		var c = this.getAttribute( 'c' );

		var properties = { width: w,
                       height: h,
                       scrollbars: 'no',
                       resizable: 'yes' ,
					   location: 'no',
					   menubar: 'no',
					   toolbar: 'no'};

		if (c=='vertical'){
			properties.width=490;
			properties.height=640;
		}
		if (c=='square'){
			properties.width=640;
			properties.height=640;
		}
		if (c=='horizontal'){
			properties.width=640;
			properties.height=490;
		}

      var link = this.getAttribute( 'href' );
      var prop_str = '';
      for( prop in properties ){
        prop_str = prop_str + prop + '=' + properties[prop] + ',';
      }
      prop_str = prop_str.substr( 0, prop_str.length - 1 );
	  //document.write(prop_str); return;
      var newWindow = window.open( link, '_blank', prop_str );
      if( newWindow ){ newWindow.focus();
        //if( newWindow.focus ) 
        return false;
      }
      return true;
    }
    function setupPopups(){
      var links = document.getElementsByTagName( 'a' );
      for( var i=0; i<links.length; i++ ){
        if( links[i].getAttribute( 'rel' ) &&
            links[i].getAttribute( 'rel' ) == 'popup' ) links[i].onclick = popup;
      }
    }
    window.onload = function(){ 
      setupPopups();
    }
