var wnd
function popup(url,w,h,pos,props){
	var left=0,top=0
	if(!pos||pos=='center'){left=screen.width?(screen.width-w)/4:100; top=screen.height?(screen.height-h-36-30)/2:100} // 36 = taskbar, 30 = popup title bar
	props='width='+w+',height='+h+',top='+top+',left='+left+(props==''?'':','+props)
	wnd=window.open(url,'wnd',props)
}
function popup_addressbook(){
  popup('addressbook.asp?bgcolor='+xbd.replace(/^#/,''),220+20,360+20,null,'status=1')
}
window.onunload = function(){if(wnd)wnd.close()}

function flaObj(id,url,width,height,bgcolor){
  if(typeof bgcolor=='undefined')bgcolor='#FFFFFF'
  return '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+width+'" height="'+height+'" id="'+id+'" align="middle">'
    +'<param name=movie value='+url+'>'
    +'<param name=quality value=high>'
    +'<param name=bgcolor value='+bgcolor+'>'
    +'<embed src="'+url+'" quality="high" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" name="'+id+'" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>'
    +'</object>'
}
function hmenuURL(s){
  if(typeof hmenu_background=='undefined') hmenu_background = ''
  if(typeof hmenu_background_y=='undefined') hmenu_background_y = -26
  if(typeof hmenu_fontColor1=='undefined') hmenu_fontColor1 = ''
  if(typeof hmenu_fontColor2=='undefined') hmenu_fontColor2 = ''
  if(typeof hmenu_fontColor3=='undefined') hmenu_fontColor3 = ''
  if(typeof hmenu_color1=='undefined') hmenu_color1 = ''
  if(typeof hmenu_color2=='undefined') hmenu_color2 = ''
  if(typeof hmenu_color3=='undefined') hmenu_color3 = ''
  if(typeof hmenu_alpha2=='undefined') hmenu_alpha2 = ''
  if(typeof hmenu_alpha3=='undefined') hmenu_alpha3 = ''
  return 'images/hmenu.swf?'
        +'url='+window.location.href.replace(/.*\//i,'')
        +'&src=images/'+s
        +'&background='+hmenu_background
        +'&background_y='+hmenu_background_y
        +'&fontColor1='+hmenu_fontColor1
        +'&fontColor2='+hmenu_fontColor2
        +'&fontColor3='+hmenu_fontColor3
        +'&color1='+hmenu_color1
        +'&color2='+hmenu_color2
        +'&color3='+hmenu_color3
        +'&alpha2='+hmenu_alpha2
        +'&alpha3='+hmenu_alpha3
        //+'&xid=[#GETARG(xid)#]'
}
function xgoURL(s){
  return 'images/xgo.swf?ver=100&'+s
}

function flipImage(src,id){var theImage=findImage(document,id,0);if(theImage){theImage.src=src}}
function findImage(doc,name){
	var theImage=false
	if(doc.images){if(doc.images[name])return doc.images[name]}
	if(doc.layers)
		for(var j=0;j<doc.layers.length;j++){
			theImage=findImage(doc.layers[j].document,name,0)
			if(theImage){return(theImage)}
		}
	return(false)
}

/*
// http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/activating_activex.asp
// Crashes some flash
function eolas_fix(){
  for (var o=document.getElementsByTagName("object"), i=0; i<o.length; i++) 
    o[i].outerHTML = o[i].outerHTML 
}
*/
/*
initFlash('id1','flash1.swf',100,100,'#FFFFFF')
<script src=include/createFlash.js></script>
*/
function EolasFix(){
  this.set = function(id,url,w,h,bg,trans){
    this.id = id
    this.url = url
    this.w = w
    this.h = h
    this.bg = typeof bg == 'undefined' ? '#FFFFFF' : bg
    this.trans = typeof trans == 'undefined' ? true : trans
  }
}
var _fla = new EolasFix()
function initFlash(a1,a2,a3,a4,a5,a6){
  _fla.set(a1,a2,a3,a4,a5,a6)
}

