/*******************************************************************************
 Program:	Author placement (JavaScript)
 File:		author.js
 Description:	display the author name or a logo file at the bottom-right corner
 Author:	jasonzh@hotmail.com
 Environment:	JavaScript1.2 IE4+/Netscape4+
 LoadInPerl:	$strUrlBase/pages/author.js
 Revision:	Alpha - 11/18/2001
		Beta  - 11/26/2001
 Note:
 *******************************************************************************/

 if (window.status == "")
 {
	window.status = "(c) 2001-"+(new Date()).getFullYear()+", RightHand Engineering LLC.";
 }

 var m1="gfx/images/japh1.gif"; hi=100;	// use half smaller height of the image
 var m2="gfx/images/japh2.gif"; wi=11;	// use half smaller width  of the image
 var margin_bottom = 16;

 var url="http://www.righthandeng.com/docs/JasonZhu";

 var ns=(navigator.appName.indexOf("Netscape")!=-1)?1:0;
 var ie=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;

 var vn=parseInt(navigator.appVersion);

 if (ns && vn<5) {
	document.write('<layer name="jsIcon" top="0" left="0" height='+hi+' width='+wi+'\n');
	document.write('       onMouseOver="hi*=2;wi*=2;demo_author();"  \n');
	document.write('       onMouseOut ="hi/=2;wi/=2;demo_author();" >\n');
	document.write('<a href="'+url+'" target="_new_"><img name="jz" src="'+m1+'" \n');
	document.write('   height="'+hi+'" width="'+wi+'" align="middle" border="0"  \n');
	document.write('   onMouseOver=\'jz.src="'+m2+'";jz.width*=2;jz.height*=2;\' \n');
	document.write('   onMouseOut= \'jz.src="'+m1+'";jz.width/=2;jz.height/=2;\' \n');
	document.write('   alt="See more about our programmer::Jason Zhu::"></a>\n');
	document.write('</layer>\n');
 }
 else {
	document.write('<div id="jsIcon" ');
	document.write('     style="position:absolute;top:0;left:0;height:'+hi+'px;width:'+wi+'px;" \n');
	document.write('     onMouseOver="hi*=2;wi*=2;demo_author();"  \n');
	document.write('     onMouseOut ="hi/=2;wi/=2;demo_author();" >\n');
	document.write('\n');
	document.write('<bgsound id="snd_popup" src="" volume="0" loop="1">\n');
	document.write('<a href="'+url+'" target="_new_"><img name="jz" src="'+m1+'" \n');
	document.write('   height="'+hi+'" width="'+wi+'" align="middle" border="0"  \n');
	document.write('   onMouseOver=\'jz.src="'+m2+'";jz.width*=2;jz.height*=2;snd_popup.src="media/balloon.wav";\' \n');
	document.write('   \n');
	document.write('   onMouseOut= \'jz.src="'+m1+'";jz.width/=2;jz.height/=2;\' \n');
	document.write('   alt="author" title="::==See more about Jason Zhu==::"></a>\n');
	document.write('</div>');
 }

 function demo_author()
 {
  if (isNaN(ns)) ns=(document.all)?0:1;
  if (ns)
  {
	if (vn >= 5)
	{
		objId = document.getElementById("jsIcon");
		Ypos = parseInt(document.body.offsetHeight) - hi - margin_bottom;
		Xpos = parseInt(document.body.offsetWidth)  - wi;
		objId.style.top = Ypos + "px";
		objId.style.left= Xpos + "px";
	} else {
		Ypos=window.pageYOffset+window.innerHeight - hi - margin_bottom;
		Xpos=window.pageXOffset+window.innerWidth  - wi;
		document.layers['jsIcon'].moveTo(Xpos,Ypos);
//		document.layers['jsIcon'].top = Ypos;
//		document.layers['jsIcon'].left= Xpos;
	}
  }
  else {
	Ypos=document.body.scrollTop+window.document.body.clientHeight - hi - margin_bottom;
	Xpos=document.body.scrollLeft+window.document.body.clientWidth - wi;
 	jsIcon.style.pixelTop = Ypos;
	jsIcon.style.pixelLeft= Xpos;
  }
 }

 setInterval("demo_author()", 3000);

/*******************************************************************************
 end of the script <author.js>
 *******************************************************************************/

