function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function writeFlash() {	
	var  a = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="760" height="252">\n';
		a += '	<param name="movie" value="flash/home.swf">\n';
		a += '	<param name="quality" value="high">\n';
		a += '		<embed src="flash/home.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="760" height="252"></embed>\n';
		a += '</object>\n';
	
	document.writeln(a);
	document.close();
}

function imgRotator() {
	var imgRand=0;
	var imgMax = 20;
	
	do {
		imgRand = Math.floor(Math.random() * imgMax) + 1;
	} while (imgRand == imgLastRand)
	
	imgLastRand = imgRand;

	var a = '<img src="/images/header_photo' + imgRand + '.jpg" width="380" height="252" alt="Photo" hspace="0" vspace="0" border="0">';

	document.writeln(a);
	document.close();	
	
}

function writeMovie(movieName, movieWidth, movieHeight, movieRef) {
	var  a = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="' + movieWidth + '" height="' + movieHeight + '" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0">\n';				
		a += '	<param name="bgcolor" value="#fe9900">\n';
		a += '	<param name="type" value="video/quicktime">\n';
		a += '	<param name="target" value="myself">\n';
		a += '	<param name="src" value="mov/' + movieName + '">\n';
		a += '	<param name="pluginspage" value="http://www.apple.com/quicktime/download/index.html">\n';
		if (movieRef) a += '	<param name="href" value="' + movieRef + '">\n';
		a += '		<embed width="' + movieWidth + '" height="' + movieHeight + '" target="myself" src="mov/' + movieName + '" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/index.html" ';
		if (movieRef) a += 'href="' + movieRef + '" ';
		a += 'bgcolor="#fe9900"></embed>\n';
		a += '</object>\n';
	document.writeln(a);
	document.close();
}

sfFocus = function() {
	var sfEls = document.getElementsByTagName("INPUT");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onfocus=function() {
			this.className+=" sffocus";
		}
		sfEls[i].onblur=function() {
			this.className=this.className.replace(new RegExp(" sffocus\\b"), "");
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfFocus);

var imgLastRand = 0;