var inited = 0;
function popup(name,tw,th,myfile,scroll,title) {
  w = open("",name,"scrollbars="+scroll+",width="+tw+",height="+th+",resizable=no,status=no,location=no,toolbar=no,menubar=no");
  w.document.writeln('<html><head>');
  w.document.writeln('<title>' + title + '</title>');
  w.document.writeln('<link rel="stylesheet" type="text/css" href="global.css">');
  w.document.writeln('<link rel="stylesheet" type="text/css" href="layout.css">');
  w.document.writeln('</head>');
  w.document.writeln('<body style=\"margin: 0;\" onblur="self.close();" onload="self.focus();">');
  w.document.writeln('<div align=\"center\">' +myfile+ '</div>');
  w.document.writeln('</body></html>');
  w.document.close();
  return false;
}

function popmerch(name,tw,th,myfile,scroll,title) {
  w = open("",name,"scrollbars="+scroll+",width="+tw+",height="+th+",resizable=no,status=no,location=no,toolbar=no,menubar=no");
  w.document.writeln('<html><head>');
  w.document.writeln('<title>' + title + '</title>');
  w.document.writeln('<link rel="stylesheet" type="text/css" href="global.css">');
  w.document.writeln('<link rel="stylesheet" type="text/css" href="layout.css">');
  w.document.writeln('</head>');
  w.document.writeln('<body style=\"margin: 0;\" onblur="self.close();" onload="self.focus();">');
  w.document.writeln('<div align=\"center\"><img src=\"' +myfile+ '\" border=\"0\" alt=\"' +title+ '\"></div>');
  w.document.writeln('</body></html>');
  w.document.close();
}

/* Core Functions */
function addEvent( obj, type, fn ) {
 if ( obj.attachEvent ) {
	 obj['e'+type+fn] = fn;
	 obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
	 obj.attachEvent( 'on'+type, obj[type+fn] );
 } else
	 obj.addEventListener( type, fn, false );
}
function removeEvent( obj, type, fn ) {
 if ( obj.detachEvent ) {
	 obj.detachEvent( 'on'+type, obj[type+fn] );
	 obj[type+fn] = null;
 } else
	 obj.removeEventListener( type, fn, false );
}