Location: PHPKode > projects > EasyHint > easyhint/hint.class.php
<?php

/*
*   +------------------------------------------------------------------------------+
*       Hint class
*   +------------------------------------------------------------------------------+
*       Copyright © 2002 by Dynamix S.A.R.L.
*   +------------------------------------------------------------------------------+
*       Disclaimer Notice(s)
*	
* 		This code is free for non commercial use. 
*
*   +------------------------------------------------------------------------------+
*       Updates
*   +------------------------------------------------------------------------------+
* 
*   +------------------------------------------------------------------------------+
*       Author(s): Ben Yacoub Hatem
*   +------------------------------------------------------------------------------+
*/

class hint
{
	function javascript()
	{
		echo "\n<script language=\"JavaScript\">\n";
		echo "<!--\n";
		echo "// Easy Hint class Generator V1.0.0 by Hatem\n";
		echo "function hint(which) { \n";
		echo "	if (which.style.visibility==\"hidden\")\n";
		echo "	which.style.visibility=\"visible\"\n";
		echo "	else";
		echo "	which.style.visibility=\"hidden\"\n";
		echo "}\n";
		echo "// -->\n";
		echo "</script>\n";
	}
	
	function div($text,$id,$position="absolute",$left,$top,$width,$height,$zindex,$bgcolor,$bordercolor,$visibility,$bgimage="",$layerbgimage="")
	{
		if ($bgimage!=="" and $layerbgimage!==""){
		echo "\n<div id=\"$id\" style=\"position:$position; left:".$left."px; top:".$top."px; z-index:$zindex; background-color: $bgcolor; layer-background-color: $layerbgcolor; visibility: $visibility; background-image: url($bgimage); layer-background-image: url($layerbgimage)\">\n";
		} else {
		echo "\n<div id=\"$id\" style=\"position:$position; left:".$left."px; top:".$top."px; z-index:$zindex; background-color: $bgcolor; layer-background-color: $layerbgcolor; visibility: $visibility\">\n";
		}
		
		echo "<table width=\"$width\" border=\"1\" height=\"$height\">\n";
		echo "<tr>\n";
		echo "<th bordercolor=\"$bgcolor\" bgcolor=\"$bordercolor\">\n\t$text\n\n";
		echo "</tr></table></div>\n";
	}
	
	function link($name,$id)
	{
		echo "\n<a href=\"#\" onMouseOver=\"javascript:hint($id)\" onMouseOut=\"javascript:hint($id)\">$name</a>\n";
	}
}

?>
Return current item: EasyHint