function showpic (pic, ww, hh)
{
  if(ww==''||hh=='') return;
  var rww=ww;var rhh=hh;var scr='no';
  var sww=screen.availWidth;var shh=screen.availHeight-30;
  var cww=Math.round(sww/2)-Math.round(ww/2); var chh=Math.round(shh/2)-Math.round(hh/2);
  if(ww>sww){cww=0;ww=sww;}if(hh>shh){chh=0;hh=shh;ww+=16;scr='yes';}if(ww>sww){ww -= 22;}
  var wnd=window.open('','','menubar=no,width='+ww+',height='+hh+',scrollbars='+scr+',resizeable=no,left='+cww+',top='+chh);
  var doc = wnd.document;
  doc.write('<html><head><title>Preview</title><head><body>');
  if (pic.substr (pic.length-4,4) != '.swf') doc.write('<img src="'+pic+'" border="0" width="'+rww+'" height="'+rhh+'" style="position:absolute;left:0px;top:0px">');
  else doc.write('<OBJECT style="position:absolute;left:0px;top:0px" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH='+rww+' HEIGHT='+rhh+'><PARAM NAME=movie VALUE="'+pic+'"> <PARAM NAME=quality VALUE=high><PARAM NAME=menu VALUE=false><EMBED style="position:absolute;left:0px;top:0px" src="'+pic+'" quality=high bgcolor=#FFFFFF  WIDTH='+rww+' HEIGHT='+rhh+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>');
  doc.write('</body></html>');
  wnd.focus();
}

function checkPolls(frm)
{
  var checked = false;
  var cnt = frm.elements.length;
  for (i=0; i<cnt; i++)
  {
    if (frm.elements[i].name == 'panswer' && frm.elements[i].checked) { checked = true; break; }
  }
  return checked;
}

function go (f) { window.location = "#" + f; }

function trimP (s)
{
  var r1 = /^[ ]+/g;
  var r2 = /[ ]+$/g;
  s = s.replace (r1, '');
  s = s.replace (r2, '');
  return s;
}

function playVideo(WMP7, js_play_url)
{
  /*js_play_url = js_play_url;*/

			/* Windows Media Player 7 Code*/
			if ( WMP7 )
			{
					document.write ('<OBJECT ID=MediaPlayer ');
					document.write (' CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6');
					document.write (' standby="Loading Microsoft Windows Media Player components..."');
					document.write (' TYPE="application/x-oleobject" width="324" height="303">');
					document.write ('<PARAM NAME="url" VALUE="' + js_play_url + '">');
					document.write ('<PARAM NAME="AutoStart" VALUE="true">');
					document.write ('<PARAM NAME="ShowControls" VALUE="1">');
					document.write ('<PARAM NAME="uiMode" VALUE="full">');
					document.write ('</OBJECT>');
			}

			/* Windows Media Player 6.4 Code*/
			else
			{
					/*IE Code*/
					document.write ('<OBJECT ID=MediaPlayer ');
					document.write ('CLASSID=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 ');
					document.write ('CODEBASE=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 ');
					document.write ('standby="Loading Microsoft Windows Media Player components..." ');
					document.write ('TYPE="application/x-oleobject" width="324" height="303">');
					document.write ('<PARAM NAME="FileName" VALUE="' + js_play_url + '">');
					document.write ('<PARAM NAME="AutoStart" VALUE="true">');
					document.write ('<PARAM NAME="ShowControls" VALUE="1">');
					document.write ('<PARAM NAME="ShowStatusBar" VALUE="1">');
					document.write ('<PARAM name="ShowPositionControls" value="1">');
					document.write ('<PARAM name="ShowAudioControls" value="1">');
					document.write ('<PARAM name="ShowTracker" value="1">');
					document.write ('<PARAM name="ShowDisplay" value="0">');
					document.write ('<PARAM name="ShowGotoBar" value="0">');
					document.write ('<PARAM name="ShowCaptioning" value="0">');
					document.write ('<PARAM name="AnimationAtStart" value="0">');
					document.write ('<PARAM name="enableContextMenu" value="1">');
					document.write ('<PARAM name="TransparentAtStart" value="0">');


					/*Netscape code*/
					document.write ('    <Embed type="application/x-mplayer2"');
					document.write ('        pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&"');
					document.write ('        filename="' + js_play_url + '"');
					document.write ('        src="' + js_play_url + '"');
					document.write ('        Name=MediaPlayer');
					document.write ('        AutoStart=1');
					document.write ('        ShowPositionControls=1');
					document.write ('        ShowAudioControls=1');
					document.write ('        ShowTracker=1');
					document.write ('        ShowDisplay=0');
					document.write ('        ShowGotoBar=0');
					document.write ('        ShowCaptioning=0');
					document.write ('        AnimationAtStart=0');
					document.write ('        enableContextMenu=1');
					document.write ('        ShowControls=1');
					document.write ('        ShowStatusBar=1');
					document.write ('        TransparentAtStart=0');
					document.write ('        width=324');
					document.write ('        height=303>');
					document.write ('    </embed>');
					document.write ('</object>');
			}
}