var is_start_script = false;
var ver_flash = false;
function showFlash(){
	if ( !arguments ) return;
	arg = new Object();
	j = 0;
	for ( i = 0; i < arguments.length; ++ i ){
		t = arguments[i].toString();
		pos = t.indexOf('=');
		if ( pos > 0 )
			arg[ t.substr( 0, pos ) ] = t.substr( pos + 1, t.length );
		else
			arg[ t ] = true;
	}
	d=document;
	m='<';
	b='>';
	if ( arg['flash'] ){
		if ( !is_start_script ){
			n=navigator;
			p=n.plugins;
			v=10;
			f=false;
			if (p){
				var fp=p['Shockwave Flash'];
				if(typeof fp=='object'){
					vv=fp.description;k=vv.indexOf('.');
					if(k)f=vv.substring(k-1,k+2);
				}                                                               
			}
			d.write(m+'SCRIPT language="VBScript"'+b+'\non error resume next \nDIM o \ni='+v+'\nf=0\nDo\nSET o = CreateObject("ShockwaveFlash.ShockwaveFlash."&i)\nIF IsObject(o) THEN \nf=i\nEND IF\ni=i-1\nLoop Until i<1 or f<>0\n'+m+'/SCRIPT'+b);
			is_start_script = true;
			ver_flash = f;
		}
		if (ver_flash){
			ver=(arg['ver']?arg['ver']:ver_flash);
			if (ver_flash>=ver){
				d.write(m+'object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+ver_flash+',0,0,0"'+(arg['width']?' width="'+arg['width']+'"':'')+(arg['height']?' height="'+arg['height']+'"':'')+(arg['name']?' name="'+arg['name']+'"':'')+b);
					d.write(m+'param name=movie value="'+arg['flash']+'"'+b);
					if ( arg['quality'] )
						d.write(m+'param name=quality value='+arg['quality']+b);
					d.write(m+'param name=menu value='+(arg['menu']?'true':'false')+b);
					d.write(m+'param name=loop value='+(arg['loop']?'true':'false')+b);
					if ( arg['bgcolor'] )
						d.write(m+'param name=bgcolor value='+arg['bgcolor']+b);
					if ( arg['background'] )
						d.write(m+'param name=wmode value=transparent'+b);
					d.write(m+'embed src="'+arg['flash']+'" swLiveConnect=false'+(arg['quality']?' quality='+arg['quality']:'')+(arg['menu']?' menu=true':' menu=false')+(arg['bgcolor']?' bgcolor='+arg['bgcolor']:'')+(arg['loop']?' loop=true':' loop=false')+(arg['width']?' width="'+arg['width']+'"':'')+(arg['height']?' height="'+arg['height']+'"':'')+(arg['background']?' wmode="transparent"':''));
					d.write(' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"'+b);
					d.write(m+'/embed'+b);
				d.write(m+'/object'+b);

				return;
			}
		}
	}
	if (arg['image'])
		d.write(m+'img src="'+arg['image']+'" border="0"'+(arg['width']?' width="'+arg['width']+'"':'')+(arg['height']?' height="'+arg['height']+'"':'')+(arg['alt']?' alt="'+arg['alt']+'"':'')+b);
	else
		if (arg['html'])
			d.write(arg['html']);
}

var w=0;

function iPop(img,w,h,ttl) {
	var tooBig = false;
	iPopURL = 'ipop.html' // set as location of ipop.html
	url = iPopURL;// + '?' + img + (ttl ? '&'+escape(ttl) : '');
	if(w > screen.availWidth) { w = screen.availWidth; tooBig = true; }
	if(h > screen.availHeight) { h = screen.availHeight; tooBig = true; }
	l = (screen.availWidth-w)/2;
	t = (screen.availHeight-h)/2;
	// w = w + 20;
	// h = h + 15;
	attribs = 'width=' + w + ',height=' + h + ',left=' + l + ',top=' + t;
	if(tooBig) attribs += ',scrollbars=yes,scrollbars=yes';
	w=window.open(iPopURL,"_blank",attribs);
      w.document.write("<html><head>");
      w.document.write("<title>" + ttl + "</title>");
	w.document.write("</head><body topmargin = '0' leftmargin = '0' marginwidth = '0' marginheight = '0'>");
	w.document.write("<img src = '" + img + "' cellspacing = '0' cellpadding = '0' align = 'left'>");
	w.document.write("</body></html>");
	// w.document.title = ttl;
	return false;
}

function ipop2(img,w,h,ttl) {
	iPopURL = 'ipop.html' // set as location of ipop.html
	l = (screen.availWidth-w)/2;
	t = (screen.availHeight-h)/2;
	attribs = 'width=' + w + ',height=' + h + ',left=' + l + ',top=' + t + ',scrollbars=yes,scrollbars=yes';
	w=window.open(iPopURL,"_blank",attribs);
      w.document.write("<html><head>");
      w.document.write("<title>" + ttl + "</title>");
	w.document.write("</head><body topmargin = '0' leftmargin = '0' marginwidth = '0' marginheight = '0'>");
	w.document.write("<img src = '" + img + "' cellspacing = '0' cellpadding = '0' align = 'left'>");
	w.document.write("</body></html>");
	return false;
}
