DIR : /home/kozerus/public_html/konet/kowz.php

/home/kozerus/public_html/konet

<?php

# kowz.php	20260815_1100 

$document_root=$_SERVER['DOCUMENT_ROOT'];
$progid="ko";
$dbfile="$progid.db3";
$sqlfile="$progid.sql";
$dttm=date('Ymd_His');

$htmout_hdr;
$htmout_style;
$htmout_script;
$htmout_body;
$htmout_ftr;

$set_dhtml="";
$leds_content="";
$rollover_content="";

$path_imgs="imgs/cab";
$path_btn="imgs/btn";
$path_leds="imgs/leds/ani_";
$path_leds="imgs/leds/hal_";
$path_leds="imgs/leds/crome_";

$leds_context="";
$leds_contexts="ai cab doc us";

startup();

function bugs($dbfile,$line) {
	if( $dbfile == "" ) {
		print( "bugs: $line" );
		}
	else {
		if( ! is_file( $dbfile )) {
			print( "bugs: BUGS_$line NOTFOUND dbfile=$dbfile<br>\n" );
			}
		else {
			print( "bugs: BUGS_$line ___FOUND dbfile=$dbfile<br>\n" );
			}
		}
	return;
	}

function startup() {
	global $progid;
	global $dttm;
	global $logfil;
	global $document_root;
	global $dbfile;
	global $leds_context;
	$default_role="anon";
	$default_role="";
#	$default_role="admin";

	pdo_leds();
	}

function pdo_leds() {
	global $dbfile;
	global $path_imgs;
	global $path_leds;

	global $htmout_hdr;
	global $htmout_style;
	global $htmout_script;
	global $htmout_body;
	global $htmout_ftr;


	global $set_dhtml;
	global $leds_content;
	global $rollover_content;

	$pdo = newpdo($dbfile);
	$sqlctx= "select val from cfg where fld=\"leds_context\"";
	foreach( $pdo->query($sqlctx) as $row ) {
		$leds_context=$row['val'];
		}
	$pdo=null;


        $ctx = $leds_context;

        switch( $ctx ) {
                case 'ai':  $tblname = 'leds_ai'; $tblimg = 'imgs/btn/leds_ai.png';  break;
                case 'cab':  $tblname = 'leds_cab'; $tblimg = 'imgs/btn/leds_cab.png';   break;
                case 'doc':  $tblname = 'leds_doc'; $tblimg = 'imgs/btn/leds_doc.png'; break;
                case 'us':  $tblname = 'leds_us'; $tblimg = 'imgs/btn/leds_us.png'; break;
                default:    $tblname = 'leds'; $tblimg = 'imgs/btn/leds.png';  break;
                }

#	bugs("","bugs_80 pdo_leds ctx=$ctx tblname=$tblname tblimg=$tblimg<br>\n" );
	$set_dhtml="";
	$set_dhtml .= "\"div_leds\"+SCALABLE,\n";
	$set_dhtml .= "\"div_ctx\"+SCALABLE,\n";
	$set_dhtml .= "\"div_links\"+SCALABLE,\n";
	$set_dhtml .= "\"div_rollover\"+SCALABLE,\n";

	$leds_content = "";
#	$leds_content .= "<div id=div_leds name=div_leds >\n";

	$rollover_content = "";
	$rollover_content .= "<script id=script_rollover_content>\n";	
	$rollover_content .= "content = new Array();\n";
	$j=0;
	$led_type="manual";
	$pdo = newpdo($dbfile);
	$sql = "select * from $tblname where led_dttm == 'current' and led_type == '$led_type'";
	foreach( $pdo->query($sql) as $row ) {
		$led_name=$row['led_name'];
		$led_id=$row['led_id'];
		$led_color=$row['led_color'];
		$led_speed=$row['led_speed'];
		$led_type=$row['led_type'];
		$led_dttm=$row['led_dttm'];
		$led_date=$row['led_date'];
		$led_cmd=$row['led_cmd'];
		$led_desc=$row['led_desc'];
		$led_misc=$row['led_misc'];

		$led_id="led_$j";
#		bugs("","bugs_107 j=$j led_id=$led_id <br>\n" );
		$set_dhtml .= "\"img_$led_id\"+SCALABLE,\n";
#		bugs("","<hr>bugs_110 j=$j led_id=$led_id set_dhtml=$set_dhtml<hr>\n" );


		$rollover_img="imgs/$ctx/tn/tn_$led_name.png height=200 border=0>\n";
		$led_output = "";
		$led_output .= "<div id=div_rollover name=div_rollover>\n";
		$led_output .= "$rollover_img<br>\n";
		$led_output .= "$led_id - ";
		$led_output .= "$led_name - ";
		$led_output .= "$led_dttm - ";
		$led_output .= "$led_color - ";
		$led_output .= "$led_speed - ";
		$led_output .= "$led_type - ";
		$led_output .= "$led_date - ";
		$led_output .= "$led_cmd - ";
		$led_output .= "$led_misc ";
		$led_output .= "</div id=div_rollover name=div_rollover>\n";

		$leds_content .= "	<a href=ko.php?detail/$led_name target=_blank ";
		$leds_content .= " class=\"screenshot\" title=\"$led_output\"  >\n";
		$leds_content .= "		<img src=$path_leds$led_color$led_speed.gif ";
		$leds_content .= " id=img_$led_id name=img_$led_id height=25 width=25 border=0>";
		$leds_content .= "		</a>\n";

		$rollover_img="<img src=imgs/$ctx/$led_name.png alt=$ctx/$led_name>";
#		$rollover_content .= "content[$j]='";
#		$rollover_content .= "$rollover_img <br>$led_output';\n";

		$j=$j+1;
		}
	$pdo=null;

#	$rollover_content .= "	</script id=script_rollover_content_end>\n";	
#	$rollover_content .= "\n";

	$set_dhtml .= "\"img_reports\"+SCALABLE,\n";
	$set_dhtml .= "\"img_ko\"+RESIZABLE,\n";
	$set_dhtml .= "\"img_koeye\"+RESIZABLE,\n";
	$set_dhtml .= "\"img_koeyeb\"+RESIZABLE,\n";
	$set_dhtml .= "\"img_koeyew\"+RESIZABLE,\n";
	$set_dhtml .= "\"img_handhither\"+RESIZABLE,\n";
	$set_dhtml .= "\"img_handhi\"+RESIZABLE";

#	bugs("","bugs_171 pdo_leds set_dhtml=$set_dhtml<br>\n" );
#	bugs("","bugs_172 pdo_leds leds_content=$leds_content<br>\n" );
#	bugs("","bugs_173 pdo_leds rollover_content=$rollover_content<br>\n" );
#	bugs("","bugs_171 pdo_leds set_dhtml=$set_dhtml<br>\n" );

#	$htmout = "";
#	$htmout .= html_header();
#	$htmout .= html_styles();
#	$htmout .= html_scripts();
#	$htmout .= html_body();
#	$htmout .= html_footer();
#	bugs("","bugs_145 pdo_leds<br>\n" );

	$htmout = "";
	$htmout .= html_top();
	$htmout .= html_styles();
	$htmout .= html_content();
	$htmout .= html_js();
	$htmout .= html_body();
	$htmout .= html_div_squares();
#	$htmout .= $leds_content;
#	$htmout .= html_div_leds_screenshot();
	$htmout .= html_div_leds($leds_content);
	$htmout .= html_div_ctx();
	$htmout .= html_div_links();
	$htmout .= html_div_rollover();
	$htmout .= html_footer();
	

	print( $htmout );
	exit;
	}


function leds_show( $options ) {
#	$output = html_header();
	global $progid;
	global $dbfile;
	global $leds_context;
	global $path_leds;
	global $path_imgs;
	global $path_btn;

	$dttm=date("Ymd_His");
        $php_self=$_SERVER['PHP_SELF'];
        $http_host=$_SERVER['HTTP_HOST'];
        $request_uri=$_SERVER['REQUEST_URI'];
	$preview=$_SESSION['preview'];

	$option1=$options[1];
	$option2=$options[2];
	$option3=$options[3];
	$option4=$options[4];
	$option5=$options[5];

	if( ! file_exists( $dbfile )) {
		$output .= "<hr>$progid $dttm ERR_50490 NOTFOUND dbfile=$dbfile<hr>\n";
		return;
		}

	$dttm=date( "Ymd_His" );
	$today = mktime( 0,0,0, date("m"), date("d"), date("y"));
	$pdo = newpdo($dbfile);


	# Determine the table based on leds_context
	$ctx = $leds_context;

	switch( $ctx ) {
		case 'ai':  $tblname = 'leds_ai'; $tblimg = 'imgs/btn/leds_ai.png';  break;
		case 'cab':  $tblname = 'leds_cab'; $tblimg = 'imgs/btn/leds_cab.png';   break;
		case 'doc':  $tblname = 'leds_doc'; $tblimg = 'imgs/btn/leds_doc.png'; break;
		case 'us':  $tblname = 'leds_us'; $tblimg = 'imgs/btn/leds_us.png'; break;
		default:    $tblname = 'leds'; $tblimg = 'imgs/btn/leds.png';  break;
		}

#	bugs("","5070 leds_show path_imgs=$path_imgs<br>\n" );
#	bugs("","5071  leds_show ctx=$ctx leds_context=$leds_context<br>\n" );

	$sql = "select * from $tblname where led_dttm == 'current'";
#	bugs("","5070 ctx=$ctx tblname=$tblname tblimg=$tblimg sql=$sql<br>\n" );


	if(( isset( $_REQUEST['led_type'] )) && ( ! $_REQUEST['led_type'] == "" )) {
		$led_type = $_REQUEST['led_type'];
		$sql = "select * from $tblname where led_dttm == 'current' and led_type == '$led_type'";
		}

	$collim=8;
	$collim=24;
	$colnum=1;
	$ctxdta = "";
	$j=1;
	$set_dhtml="";
	$colnum=1;


	foreach( $pdo->query($sql) as $row ) {
		$led_namnum="led_$j";
		$set_dhtml .= "\"$led_namnum\"+SCALABLE,";
		$led_output =
			$row['led_name'] . ' - ' .
			$row['led_dttm'] . ' - ' .
			$row['led_color' ] . ' - ' .
			$row['led_speed' ] . ' - ' .
			$row['led_type' ] . ' - ' .
			$row['led_date' ] . ' - ' .
			$row['led_cmd' ] . ' - ' .
			$row['led_desc' ] . ' - ' .
			$row['led_misc' ] . ' - ' .
			' <br />';


		if( $row['led_type'] == "date" ) {
			$mydt_yyyymd=$row['led_date'];
			if( $mydt_yyyymd == "current" ) {
				$mydt=$today;
				$mydt_yyyy=date("Y");
				$mydt_m=date("m");
				$mydt_d=date("d");
				}
			else {
				$mydt_yyyy=substr( $mydt_yyyymd, 0, 4 );
				$mydt_m=substr( $mydt_yyyymd, 4, 2 );
				$mydt_d=substr( $mydt_yyyymd, 6, 2 );
				}
			$mydt=mktime( 0,0,0, $mydt_m, $mydt_d, $mydt_yyyy );
			$diffdays=datediff( 'd', $today, $mydt );
			$leds_properties=datediff_leds( $diffdays);
			$diffdays=$leds_properties[0];
			$color=$leds_properties[1];
			$speed=$leds_properties[2];
#			$ledimg = "$path_ani/ani_" . $color . $speed . ".gif";
			$ledimg = "$path_leds" . $color . $speed . ".gif";
			}
		else {
			if( $row['led_type'] == "cmd" ) {
#				$ledimg = "$path_leds" . $row['led_color'] . $row['led_speed'] . ".gif";
#				$ledimg = "$path_ani/hal_" . $row['led_color'] . $row['led_speed'] . ".gif";
				$ledimg = "$path_leds" . $row['led_color'] . $row['led_speed'] . ".gif";
				$cmd_code=$row['led_cmd'];
				$led_cmd="";
				$cmdout[0]="";
				if( $cmd_code == "pwd" ) { $led_cmd = "pwd"; }
				if( $cmd_code == "date" ) { $led_cmd = "date"; }
				if( $cmd_code == "dir" ) { $led_cmd = "ls"; }
				if( $cmd_code == "dir" ) { $led_cmd = "ps -W | grep SSH "; }
				if( $cmd_code == "pwd" ) { $led_cmd = "ps -W | grep ssh "; }
				if( $cmd_code == "ls" ) { $led_cmd = "ls"; }
				if( $led_cmd != "" ) {
					$cmdout=leds_process_value( "", $led_cmd, $cmd_process );
					};
				if( $cmdout[0] == "" ) {
					$color="red"; $speed="90";
					}
				else {
					$color="grn"; $speed="90";
					}
#				$ledimg = "$path_ani/ani_$color$speed.gif";
#				$ledimg = "$path_ani/hal_$color$speed.gif";
				$ledimg = "$path_leds$color$speed.gif";
				}
			else {
#				$ledimg = "$path_ani/ani_" . $row['led_color'] . $row['led_speed'] . ".gif";
				$ledimg = "$path_leds" . $row['led_color'] . $row['led_speed'] . ".gif";
#				$ledimg = "$path_ani/crome_" . $row['led_color'] . $row['led_speed'] . ".gif";
				}
			}

		$rollover_nam = $row['led_name'];
		$rollover_name = str_replace( "fp", "fpb", $rollover_nam );
		$rollover_img = "$path_imgs/" . $rollover_name . ".png";
		$rollover_img = "$path_imgs/tn/tn_" . $rollover_name . ".png";
		$rollover_img_default = "$path_imgs/preview_default.png";
		$rollover_img_default_cmd = "$path_imgs/preview_default_cmd.png";
		$rollover_img_default_date = "$path_imgs/preview_default_date.png";
		$rollover_title = $row['led_name'] . "(";
		$rollover_title .= $row['led_title'] .") ";


		if(( $row['led_type'] == "manual" ) | ( $row['led_type'] == "" )) {
			$rollover_title .= " (" . $row['led_color'] . $row['led_speed'] . ")(";
			$rollover_title .= " bldg(";
			$rollover_title .= $row['led_bldg'] .") floor(";
			$rollover_title .= $row['led_floor'].")";
			$rollover_title .= " path_imgs=$path_fpb ";
			$rollover_title .= " fpbimg=$rollover_img ";
			}

		if( $row['led_type'] == "date" ) {
			$rollover_img_default = $rollover_img_default_date;
			$rollover_title .= "($color$speed)";
			$rollover_title .= " date(";
			$rollover_title .= $row['led_date'] .") diffdays($diffdays)";
			}
		if( $row['led_type'] == "cmd" ) {
			$rollover_img_default = $rollover_img_default_cmd;
			$rollover_title .= "($color$speed)";
			$rollover_title .= " cmd(";
			$rollover_title .= $row['led_cmd'] .")($led_cmd) cmdout(". $cmdout[0]. ")";
			}

		if( $row['led_type'] == "null" ) {
			$ledimg="led_null.png";
			$ledimg = "$path_leds"."0.gif";
			}

		$output .= "<div div_id=\"div_id_$led_namnum\"  name=\"div_$led_namnum\" ";
		$output .= "style=\"display: inline\" >\n";
		$output .= "<a href=$php_self?q=detail/".$row['led_name']." ";
		$output .= " name=\"href_$led_namnum\" ";

		if( $preview == "on" ) {
			if( $GLOBALS['screenshots_pcharts'] != "" ) {
				$host="l1033"; $path="/var"; $used=rand(1,100); $free=rand(1,900);
				$pchart_title="$dttm p=$path u=$used f=$free";
				$pchart_url="/ko_center/ko_pcharts_pie.php?q=df/$host/$host/$used/$free";
				$output .= " class=\"screenshot\" rel=\"$pchart_url\" title=\"$pchart_title\" ";
				}
			else {
				if( file_exists( $rollover_img )) {
					$output .= " class=\"screenshot\" rel=\"$rollover_img\" title=\"$rollover_title\" width=100 ";
					}
				else {
					$output .= " name=\"led_rollover\" class=\"screenshot\" rel=\"$rollover_img_default\" title=\"$rollover_title\" ";
					}
				}
			}

		$output .= ">\n";

		if( preg_match( "/ko_center/", $rollover_name, $matches )) {
			$output .= "<img src=\"$ledimg\" name=\"$led_namnum\" alt=\"$ledimg\" border=0 height=\"20\" width=\"20\" />";
			$output .= "</a>\n";
			}
		else {
			$output .= "<img src=\"$ledimg\" name=\"$led_namnum\"  alt=\"$ledimg\" border=0 height=\"15\" width=\"15\" />";
			$output .= "</a>\n";
			}
		$output .= "	</div id=\"div_id=div_id_$led_namnum\""."_end\">\n";

		if(( preg_match( "/ko_centert/", $rollover_name, $matches ))
		|| ( preg_match( "/nl/", $rollover_name, $matches ))
		|| ( preg_match( "/pl/", $rollover_name, $matches ))
		|| ( preg_match( "/ql/", $rollover_name, $matches ))
		|| ( preg_match( "/tl/", $rollover_name, $matches ))
		|| ( preg_match( "/vl/", $rollover_name, $matches ))
		|| ( preg_match( "/xl/", $rollover_name, $matches ))
		|| ( preg_match( "/vio/", $rollover_name, $matches ))
		|| ( preg_match( "/data/", $rollover_name, $matches ))) {
			$output .= "<br />\n";
			$colnum=1;
			}
		else {
			if(( preg_match( "/al/", $rollover_name, $matches ))
			|| ( preg_match( "/cl/", $rollover_name, $matches ))
			|| ( preg_match( "/el/", $rollover_name, $matches ))
			|| ( preg_match( "/gl/", $rollover_name, $matches ))
			|| ( preg_match( "/il/", $rollover_name, $matches ))
			|| ( preg_match( "/kl/", $rollover_name, $matches ))
			|| ( preg_match( "/ml/", $rollover_name, $matches ))
			|| ( preg_match( "/ol/", $rollover_name, $matches ))
			|| ( preg_match( "/ql/", $rollover_name, $matches ))
			|| ( preg_match( "/sl/", $rollover_name, $matches ))
			|| ( preg_match( "/ul/", $rollover_name, $matches ))) {
				$output .= "&nbsp - &nbsp \n";
				}
			$colnum=$colnum+1;
			if( $colnum > $collim ) {
				$output .= "<br />\n";
				$colnum=1;
				}
			}
# Display custom fields for the appropriate leds_ table when context is set

		if( $ctx == 'ai' && isset( $row['id'] ) && $row['id'] != '' ) {
			$ctxdta .= " <small>AI: ";
			$ctxdta .=  htmlspecialchars($row['id']);
			$ctxdta .= " | " . htmlspecialchars($row['name']);
			$ctxdta .= " | " . htmlspecialchars($row['vendor']);
			$ctxdta .= " | " . htmlspecialchars($row['type']);
			$ctxdta .= " | " . htmlspecialchars($row['status']);
			$ctxdta .= "</small><br>\n";
			}
		if( $ctx == 'cab' && isset( $row['id'] ) && $row['id'] != '' ) {
			$ctxdta .= " <small>CAB: ";
			$ctxdta .=  htmlspecialchars($row['id']);
			$ctxdta .= " | " . htmlspecialchars($row['name']);
			$ctxdta .= " | " . htmlspecialchars($row['vendor']);
			$ctxdta .= " | " . htmlspecialchars($row['type']);
			$ctxdta .= " | " . htmlspecialchars($row['status']);
			$ctxdta .= "</small><br>\n";
			}
		if( $ctx == 'doc' && isset( $row['id'] ) && $row['id'] != '' ) {
			$ctxdta .= " <small>DOC: ";
			$ctxdta .=  htmlspecialchars($row['id']);
			$ctxdta .= " | " . htmlspecialchars($row['name']);
			$ctxdta .= " | " . htmlspecialchars($row['vendor']);
			$ctxdta .= " | " . htmlspecialchars($row['type']);
			$ctxdta .= " | " . htmlspecialchars($row['status']);
			$ctxdta .= "</small><br>\n";
			}
		if( $ctx == 'us' && isset( $row['gender'] ) && $row['gender'] != '' ) {
			$ctxdta .= " <small>US: " . htmlspecialchars($row['title']);
			$ctxdta .= " " . htmlspecialchars($row['fname']);
			$ctxdta .= " " . htmlspecialchars($row['lname']);
			$ctxdta .= " | " . htmlspecialchars($row['city']);
			$ctxdta .= " | " . htmlspecialchars($row['country']);
			$ctxdta .= " | " . htmlspecialchars($row['email']);
			$ctxdta .= "</small><br>\n";
			}
		$j=$j+1;
		}

	$output .= "<br>\n";
	$output .= html_leds_context();
	$output .= "<br>\n";

#	$output .= "<a href=$php_self?q=kb target=_blank>\n";
#	$output .= "<img src=\"$path_btn/kbbooks.png\" alt=\"kb\" border=0 height=\"50\" width=\"50\" />";
#	$output .= "</a>\n";
#	$output .= "&nbsp &nbsp &nbsp \n";

	$output .= "<a href=/ko/ko.php?q=reports><img src=imgs/btn/reports.png name=\"reports\" border=0 height=50 width=50 alt=reports></a>\n";
	$output .= "&nbsp &nbsp &nbsp \n";
	$output .= "<a href=/ko/ko.php?q=reports><img src=imgs/btn/koeye.png name=koeye border=0 height=25 width=50 alt=koeye></a>\n";
	$output .= "&nbsp &nbsp &nbsp \n";
	$output .= "<a href=/ko/ko.php?q=reports><img src=imgs/btn/koeyeb.png name=koeyeb border=0 height=25 width=50 alt=koeyeb></a>\n";
	$output .= "&nbsp &nbsp &nbsp \n";
	$output .= "<a href=/ko/ko.php?q=reports><img src=imgs/btn/koeyew.png name=koeyew border=0 height=25 width=50 alt=koeyeb></a>\n";
	$output .= "&nbsp &nbsp &nbsp \n";
	$output .= "<a href=/ko/ko.php?q=reports><img src=imgs/btn/handhither.gif name=\"handhither\" border=0 height=50 width=50 alt=koeye></a>\n";
	$output .= "&nbsp &nbsp &nbsp \n";

#	$output .= "<a href=$php_self?q=hosts><img src=./imgs/btn/datacall.png border=0 height=50 width=50 alt=datacall></a>\n";
#
#	$output .= "<a href=$php_self?q=ko_plans><img src=./imgs/btn/whatsyourplan.png border=0 height=50 width=50 alt=plans></a>\n";
	$outout .= "<hr color=goldenrod>\n";
	$outout .= "<hr color=goldenrod>\n";
	$output .= "</div id=led_context_end>\n";

      	$output .= "<hr>\n";
	$pdo = null;


	if(! isset($_SESSION['hs_type'] )) { 	$hs_type="default"; }
	else {$hs_type=$_SESSION['hs_type'];}

	if(! isset($_SESSION['org_type'] )) { 	$org_type="p"; }
	else {$org_type=$_SESSION['org_type'];}

	$options[0]=$set_dhtml;
	$output .= html_footer($options);

	return( $output );
	}

function leds_detail($options ) {
#	print( "BUGS_3100 leds_detail options=$options<br>\n" );
#	#bugs("","5335 leds_detail options1=".$options[1]."<br>\n" );
#	bugs("","5335 leds_detail options2=".$options[2]."<br>\n" );
#	bugs("","5335 leds_detail options3=".$options[2]."<br>\n" );

        $php_self=$_SERVER['PHP_SELF'];
        $http_host=$_SERVER['HTTP_HOST'];
        $request_uri=$_SERVER['REQUEST_URI'];

	global $dbfile;
	global $tblname;
	global $media_path;
        $pdo = newpdo($dbfile);
        $tblname=$tblname;
        $media_path=$media_path;
#        $path_ani="./imgs/ani";
        global $path_leds;
        global $path_imgs;
#	bugs("","5350 leds_detail path_imgs=$path_imgs option1=".$options[1]."<br>\n" );


        $output  = "";
        $output .= "<head>\n";
#      $output .= "    <script src=\"js/jqgrid.3.5.3/js/jquery-1.3.2.min.js\" type=\"text/javascript\"></script>\n";
        $output .= "    <script src=\"js/jqgrid-4.4.0/js/jquery-1.7.2.min.js\" type=\"text/javascript\"></script>\n";
#        $output .= "    <script src=\"js/tooltip/tooltip_main_screenshot.js\" type=\"text/javascript\"></script>\n";
        $output .= "    <script src=\"tooltip_main_screenshot.js\" type=\"text/javascript\"></script>\n";
#        $output .= "    <script src=\"js/wz/wz_library.js\" type=\"text/javascript\"></script>\n";
#        $output .= "    <script src=\"js/wz/wz_dragdrop.js\" type=\"text/javascript\"></script>\n";
        $output .= "    <script src=\"tooltip_main_screenshot.js\" type=\"text/javascript\"></script>\n";
        $output .= "    </head>\n";

       $output .= html_btn_squares( $options, "" );
#      $output .= "leds_detail MSG_3545:  name=[$led_name] title=[$led_title] led_loc_code=[$led_loc_code] led_comment=[$led_comment]<br>\n";
#      leds_show();

        $cab=$options[1];
        $led_name=$options[1];
        $os=$options[1];

        $osimg= sprintf("./imgs/btn/$os.png");
#      $output .= "<br><img src=$osimg width=10% height=6%><br>\n";
        $cabimg= sprintf("./imgs/cab/$cab.png");
#      $output .= "<br><img src=$cabimg width=10% height=6%><br>\n";
        $output .= "<br><img src=$cabimg height=50%><br>\n";


#       $tblname="ko_hw";
	$ctx="cab";
	$tblname=$ctx;
        $sql = "select * from $tblname";
        $sql = "select * from $tblname where led_name == '$led_name' and led_published == '1' and led_dttm == 'current'";
        $sql = "select * from $tblname where led_name == '$led_name'";
#      $sql = "select * from $tblname where cab == '$cab' and model != ''";
        $sql = "select * from $tblname where cab == '$cab' and item != ''";

#	bugs("","5380 leds_detail ctx=$ctx tblname=$tblname<br>\n" );
#	bugs( "","5381 leds_detail sql=$sql<br>\n" );
        $j=0;
        $samps=0;
        $output  .= "<table>\n";
        $tblhdr   = "";
        $tblhdr  .= "<tr>\n";
        $tblhdr  .= "<td>jhdr</td>";
        $tblhdr  .= "<td>item_img jk</td>";
        $tblhdr  .= "<td>item</td>";
        $tblhdr  .= "<td>amps</td>";
        $tblhdr  .= "<td>ip</td>";
        $tblhdr  .= "<td>sn</td>";
        $tblhdr  .= "<td>hrctag</td>";
        $tblhdr  .= "<td>hostname</td>";
        $tblhdr  .= "<td>machinename</td>";
        $tblhdr  .= "</tr>\n";

        $output .= $tblhdr;

        foreach( $pdo->query($sql) as $row ) {
                $j++;
#              printf( "BUGS_6160:  sql=[$sql]<br>\n" );
                $led_name = $row['led_name'];
                $led_dttm = $row['led_dttm'];
                $led_cab = $row['cab'];
                $btu = $row['btu'];
                $os = $row['os'];
                $item = $row['item'];
                $model = $row['model'];
                $sn = $row['sn'];
                $btu = $row['btu'];
                $amps = $row['amps'];
                $switch = $row['switch'];
                $hrctag = $row['hrctag'];
                $hostname = $row['hostname'];
                $machinename = $row['machinename'];
                $ip = $row['ip'];
#              $led_amps = $row['amps'];
                $led_sn = $row['sn'];
                $led_title = $row['led_title'];
                $led_comment = $row['led_comment'];
                $led_loc_code = $row['led_loc_code'];
                $led_published = $row['led_published'];
                $led_group = $row['led_group'];
                $led_orgs = $row['led_orgs'];
                $led_filename = $row['led_filename'];
                $samps=$samps+$amps;
                $item_img= sprintf("./imgs/cab/$item.png" );
#              $output_detail="<hr>";

		bugs("","5430 leds_detail item_img=$item_img<br>\n" );

                if( file_exists( $item_img )) {
                        $item_imgurl = "";
                        $item_imgurl .= "<a href=https:#$http_host$php_self?q=hw/$item&hrctag=$hrctag>";
                        $item_imgurl .= "<img src=$item_img border=0 ></a>\n";

                        $tbldtl  = "<tr>\n";
                        $tbldtl .= "<td>$j &nbsp </td>\n";
                        $tbldtl .= "<td>$item_imgurl &nbsp </td>\n";
                        $tbldtl .= "<td>$item &nbsp </td>\n";
                        $tbldtl .= "<td>$amps &nbsp </td>\n";
                        $tbldtl .= "<td>$ip &nbsp </td>\n";
                        $tbldtl .= "<td>$sn &nbsp </td>\n";
                        $tbldtl .= "<td>$hrctag &nbsp </td>\n";
                        $tbldtl .= "<td>$hostname &nbsp </td>\n";
                        $tbldtl .= "<td>$machinename &nbsp </td>\n";
                        $tbldtl .= "</tr>\n";

                        }
                else {
#/                     $output_detail .= "$item_img &nbsp &nbsp \n";
                        $tbldtl .= "<tr>\n";
                        $tbldtl .= "<td>$j &nbsp </td>";
                        $tbldtl .= "<td>$item_img &nbsp </td>";
                        $tbldtl .= "<td>$item &nbsp </td>";
                        $tbldtl .= "<td>$amps &nbsp </td>";
                        $tbldtl .= "<td>$ip &nbsp </td>";
                        $tbldtl .= "<td>$sn &nbsp </td>";
                        $tbldtl .= "<td>$hrctag &nbsp </td>";
                        $tbldtl .= "<td>$hostname &nbsp </td>";
                        $tbldtl .= "<td>$machinename &nbsp </td>";
                        $tbldtl .= "</tr>\n";
                        }

                $output .= $tbldtl;
                if( $led_filename != "" ) {
#                      $led_pathfile="$media_path/$led_filename";
#                      $led_pathfile="$media_path/$led_filename";
                        $led_pathfile="$path_ani/$led_filename";
                        if( file_exists( $led_pathfile)) {
                                $output .= "<img src=\"$led_pathfile\"><br/>\n";
                                }
                        }
#              print( $output );
                }

	bugs("","5480 leds_detail output=$output<br>\n" );
        $tbltot  = "";
        $tbltot .= "<tr>\n";
        $tbltot .= "<td> &nbsp </td>\n";
        $tbltot .= "<td><b>totals $dttm: $cab</b></td>\n";
        $tbltot .= "<td> $j </td>\n";
        $tbltot .= "<td><b>$samps</b></td>\n";
        $tbltot .= "<td> &nbsp </td>\n";
        $tbltot .= "</tr>\n";

        $output .= "$tbltot";
        $output .= "</table>\n";
        $output .= "<hr>\n";
        print( "<br/>\n" );
        if(! isset($_SESSION['hs_type'] )) {    $hs_type="default"; }
        else {$hs_type=$_SESSION['hs_type'];}

        if(! isset($_SESSION['org_type'] )) {   $org_type="p"; }
        else {$org_type=$_SESSION['org_type'];}


        $os=$options[1];
        if( preg_match( "/ko1/", $os, $matches )) {
                $output .= "<h3>System Management Branch</h3>\n";
                $output .= "<a href=$php_self?q=ko1/about>about</a> &nbsp &nbsp &nbsp \n";
                $output .= "<a href=/itil>itil</a><br>\n";
                $output .= "<hr>\n";
                }
       $tbllist="kb hs us sw vg hw dp bp";
        $tbls=explode( " ",$tbllist );

        $rollover_title="$os $tbl";
        foreach( $tbls as $tbl ) {
                $rollover_img= sprintf("./imgs/fpb/$tbl.png");
                $output .= "<a href=\"$php_self?q=detail/$os/$op"."_$tbl\" ";
                $output .= " class=\"screenshot\" rel=\"$rollover_img\" title=\"$rollover_title\" ";
                $output .= "><img src=$rollover_img border=0 height=40></a>  &nbsp &nbsp \n";
                }

        $led_name=$options[1];
#      printf( "BUGS_5300 o1=$option1 o2=$option2 options=$options<hr>\n" );
        if(( isset( $_SESSION['role'] )) && ( ! $_SESSION['role'] == "" )) {
                $output .= "<hr>role: ". $_SESSION['role'] . "<hr>\n";
                $output .= "<a href=$php_self?q=leds_update_form/$led_name>\n";
#              $output .= "update $led_name</a>\n";
                $output .= "<img src=./imgs/btn/postit.png height=20 border=0>";
                $output .= "</a>\n";
                $output .= " &nbsp &nbsp &nbsp &nbsp";
                $output .= "<a href=$php_self?q=rpts/$led_name>";
#/             $output .= "rpts $led_name</a><br/>\n";
                $output .= "<img src=./imgs/btn/postits.png height=20 border=0>\n";
                $output .= "</a><br/>\n";
                }
        else {
                $output .= "<hr>role: ". $_SESSION['role'] . " guest<hr>\n";
                $output .= "<a href=$php_self?q=leds_update_form/$led_name>";
                $output .= "<img src=./imgs/btn/postit.png height=20></a>";
                $output .= " &nbsp &nbsp &nbsp &nbsp";
                $output .= "<a href=$php_self?q=rpts/$led_name>";
                $output .= "<img src=./imgs/btn/postits.png height=20>";
                $output .= "</a><br/>\n";
                }
        $output .= "<hr><a href=$php_self?q=scrub_upload_form/$led_name>scrub_upload_form $led_name</a><br/><hr>\n";
        print( $output );
        return( $output );
	}	

function html_top() {
        $htmout = "";
        $htmout .= "<!DOCTYPE html PUBLIC \"-#W3C#DTD XHTML 1.0 Strict#EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
        $htmout .= "<html xmlns=\"http:#www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n";
        $htmout .= "<head>\n";
        $htmout .= "\n";
        $htmout .= "<style type=\"text/css\">\n";
        $htmout .= ".layer1 {margin: 0; padding: 0;  }\n";
        $htmout .= ".heading { \n";
        $htmout .= "        margin: 1px; color: white; padding: 3px 10px; cursor: pointer;\n";
        $htmout .= "        position: relative; background-color:grey;\n";
        $htmout .= "        }\n";
        $htmout .= ".content {padding: 5px 10px; background-color:white;}\n";
        $htmout .= "p { padding: 5px 0; }\n";
        $htmout .= "</style>\n";
        return($htmout);
        }



function html_content() {
        $htmout = "";
        $htmout .= "<script id=script_rollover_content>\n";
        $htmout .= "content = new Array();\n";
        $htmout .= "content[0]='<img src=imgs/cab/cm12.png alt=cab/cm12> <br>led_0 - cm12 - current - green - 0 - manual - 20100315 - nocmd - windows - misc -  <br />';\n";
        $htmout .= "content[1]='<img src=imgs/cab/cn12.png alt=cab/cn12> <br>led_1 - cn12 - current - green - 0 - manual - 20100315 - nocmd - windows - misc -  <br />';\n";
        $htmout .= "content[2]='<img src=imgs/cab/co12.png alt=cab/co12> <br>led_2 - co12 - current - green - 0 - manual - 20100315 - nocmd - windows - misc -  <br />';\n";
        $htmout .= "content[3]='<img src=imgs/cab/cp12.png alt=cab/cp12> <br>led_3 - cp12 - current - green - 0 - manual - 20100315 - nocmd - windows - misc -  <br />';\n";
        $htmout .= "content[4]='<img src=imgs/cab/cq12.png alt=cab/cq12> <br>led_4 - cq12 - current - green - 0 - manual - 20100315 - nocmd - windows - misc -  <br />';\n";
        $htmout .= "content[5]='<img src=imgs/cab/cw12.png alt=cab/cw12> <br>led_5 - cw12 - current - green - 0 - manual - 20100315 - nocmd - windows - misc -  <br />';\n";
        $htmout .= "content[6]='<img src=imgs/cab/ct12.png alt=cab/ct12> <br>led_6 - ct12 - current - green - 0 - manual - 20100315 - nocmd - windows - misc -  <br />';\n";
        $htmout .= "content[7]='<img src=imgs/cab/cu12.png alt=cab/cu12> <br>led_7 - cu12 - current - green - 0 - manual - 20100315 - nocmd - windows - misc -  <br />';\n";
        $htmout .= "content[8]='<img src=imgs/cab/cz17.png alt=cab/cz17> <br>led_8 - cz17 - current - green - 0 - manual - 20100315 - nocmd - windows - misc -  <br />';\n";
        $htmout .= "content[9]='<img src=imgs/cab/cy17.png alt=cab/cy17> <br>led_9 - cy17 - current - green - 0 - manual - 20100315 - nocmd - windows - misc -  <br />';\n";
        $htmout .= "content[10]='<img src=imgs/cab/cx17.png alt=cab/cx17> <br>led_10 - cx17 - current - green - 0 - manual - 20100315 - nocmd - windows - misc -  <br />';\n";
        $htmout .= "    </script id=script_rollover_content_end>\n";
        return($htmout);
        }


function html_styles() {
        $htmout = "";
        $htmout .= "<style id=style_squares>\n";
        $htmout .= "    #div_squares {\n";
        $htmout .= "    position:absolute;\n";
        $htmout .= "    left:20;\n";
        $htmout .= "    top:10px;\n";
        $htmout .= "    width:200px;\n";
        $htmout .= "    height=50px;\n";
        $htmout .= "    border:1px solid #000099;\n";
        $htmout .= "    backgrount:linen;\n";
        $htmout .= "    layer-background-color:#eeeeee;\n";
        $htmout .= "    overflow:hidden;\n";
        $htmout .= "    }\n";
        $htmout .= "    </style id=style_div_leds_end >\n";
        $htmout .= "\n";
        $htmout .= "<style id=style_leds>\n";
        $htmout .= "    #div_leds {\n";
        $htmout .= "    position:absolute;\n";
        $htmout .= "    left:20;\n";
        $htmout .= "    top:50px;\n";
        $htmout .= "    width:625px;\n";
        $htmout .= "    height=261px;\n";
        $htmout .= "    border:1px solid #000099;\n";
        $htmout .= "    backgrount:linen;\n";
        $htmout .= "    layer-background-color:#eeeeee;\n";
        $htmout .= "    overflow:hidden;\n";
        $htmout .= "    }\n";
        $htmout .= "    </style id=style_div_leds_end >\n";
        $htmout .= "\n";
        $htmout .= "<style id=style_div_ctx >\n";
        $htmout .= "    #div_ctx {\n";
        $htmout .= "    position:absolute;\n";
        $htmout .= "    top:440px;\n";
        $htmout .= "    left:10px;\n";
        $htmout .= "    width:625px;\n";
        $htmout .= "    height=200px;\n";
        $htmout .= "    border:1px solid #000099;\n";
        $htmout .= "    background:linen;\n";
        $htmout .= "    layer-background-color:#eeeeee;\n";
        $htmout .= "    overflow:hidden;\n";
        $htmout .= "    }\n";
        $htmout .= "    </style id=style_div_ctx_end >\n";
        $htmout .= "\n";
        $htmout .= "<style id=style_div_links >\n";
        $htmout .= "    #div_links {\n";
        $htmout .= "    position:absolute;\n";
        $htmout .= "    top:570px;\n";
        $htmout .= "    left:10px;\n";
        $htmout .= "    width:625px;\n";
        $htmout .= "    height=300px;\n";
        $htmout .= "    border:1px solid #000099;\n";
        $htmout .= "    background:linen;\n";
        $htmout .= "    layer-background-color:#eeeeee;\n";
        $htmout .= "    overflow:hidden;\n";
        $htmout .= "//  visibility:hidden;\n";
        $htmout .= "    }\n";
        $htmout .= "    </style id=style_div_links_end >\n";
        $htmout .= "\n";
        $htmout .= "<style id=style_div_rollover >\n";
        $htmout .= "    #div_rollover {\n";
        $htmout .= "    position:absolute;\n";
        $htmout .= "    top:50px;\n";
        $htmout .= "    left:650px;\n";
        $htmout .= "    width:500px;\n";
        $htmout .= "    height=500px;\n";
        $htmout .= "    border:1px solid #000099;\n";
        $htmout .= "    background:#eeeeee;\n";
        $htmout .= "    layer-background-color:#eeeeee;\n";
        $htmout .= "    overflow:hidden;\n";
        $htmout .= "    }\n";
        $htmout .= "    </style id=style_div_rollover_end >\n";
        return($htmout);
        }



function html_header_orig() {
	global $htmout_hdr;
	global $htmout_style;
	global $htmout_js;
	global $htmout_body;
	global $htmout_ftr;
#	bugs("","bugs_700 html_header<br>\n" );

        $htmout  = "";
        $htmout .= "<!DOCTYPE html PUBLIC \"-#W3C#DTD XHTML 1.0 Strict#EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
        $htmout .= "<html xmlns=\"http:#www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n";
        $htmout .= "<head>\n";
        $htmout .= js_scripts();	
	$htmout .= html_styles();
	$htmout .= html_scripts();
#        $htmout .= "</head>\n";
        return( $htmout );
	}

function html_js() {
        $htmout = "";
        $htmout .= "<script type=\"text/javascript\" src=\"js/tooltip/tooltip_main_tooltip.js\"></script>\n";
        $htmout .= "<script type=\"text/javascript\" src=\"js/tooltip/tooltip_image_preview.js\"></script>\n";
        $htmout .= "<!--<script type=\"text/javascript\" src=\"js/tooltip/tooltip_main_screenshot.js\"></script> -->\n";
        $htmout .= "<script type=\"text/javascript\" src=\"tooltip_main_screenshot.js\"></script>\n";
        return($htmout);
        }




function html_styles_orig() {
#	bugs("","bugs_720 html_styles<br>\n" );
	$htmout = "";
	$htmout .= "<style id=style_leds>\n";
	$htmout .= "	</style id=style_leds_end>\n";

	$htmout .= "<style id=style_div_leds >\n";
	$htmout .= "	#div_leds {\n";
	$htmout .= "	position:absolute;\n";
	$htmout .= "	left:0px; top:20px; width:500px; height=500px;\n";
	$htmout .= "	border:1px solid #000099;\n";
	$htmout .= "	background:#eeeeee;\n";
	$htmout .= "	layer-background-color:#eeeeee;\n";
	$htmout .= "	overflow:hidden;\n";
	$htmout .= "//	visibility:hidden;\n";
	$htmout .= "	}\n";
	$htmout .= "	</style id=style_div_leds_end >\n";
	$htmout .= "\n";
	$htmout .= "<style id=style_div_ctx >\n";
	$htmout .= "	#div_ctx {\n";
	$htmout .= "	position:absolute;\n";
	$htmout .= "	left:10px; top:400px; width:500px; height=200px;\n";
	$htmout .= "	border:1px solid #000099;\n";
	$htmout .= "	background:#eeeeee;\n";
	$htmout .= "	layer-background-color:#eeeeee;\n";
	$htmout .= "	overflow:hidden;\n";
	$htmout .= "//	visibility:hidden;\n";
	$htmout .= "	}\n";
	$htmout .= "	</style id=style_div_ctx_end >\n";
	$htmout .= "\n";
	$htmout .= "<style id=style_div_links >\n";
	$htmout .= "	#div_links {\n";
	$htmout .= "	position:absolute;\n";
	$htmout .= "	left:0px; top:610px; width:500px; height=200px;\n";
	$htmout .= "	border:1px solid #000099;\n";
	$htmout .= "	background:#eeeeee;\n";
	$htmout .= "	layer-background-color:#eeeeee;\n";
	$htmout .= "	overflow:hidden;\n";
	$htmout .= "//	visibility:hidden;\n";
	$htmout .= "	}\n";
	$htmout .= "	</style id=style_div_links_end >\n";
	$htmout .= "\n";
	$htmout .= "<style id=style_div_rollover >\n";
	$htmout .= "	#div_rollover {\n";
	$htmout .= "	position:absolute;\n";
	$htmout .= "	left:700px; top:20px; width:300px; height=200px;\n";
	$htmout .= "	border:1px solid #000099;\n";
	$htmout .= "	background:#eeeeee;\n";
	$htmout .= "	layer-background-color:#eeeeee;\n";
	$htmout .= "	overflow:hidden;\n";
	$htmout .= "//	visibility:hidden;\n";
	$htmout .= "	}\n";
	$htmout .= "	</style id=style_div_rollover_end >\n";
	$htmout .= "\n";

	return($htmout);
	}
function html_div_leds_screenshot() {
        $htmout = "";
        $htmout .= "<div id=div_leds name=div_leds >\n";
        $htmout .= "    <center>\n";
        $htmout .= "    <hr color=goldenrod>\n";
        $htmout .= "            <a href=ko.php?detail/cm12 target=_blank class=\"screenshot\" rel=\"imgs/cab/tn/tn_cm12.png\"\n";
        $htmout .= "title=\"<div id=div_rollover name=div_rollover>\n";
        $htmout .= "<img src=imgs/cab/tn/tn_cm12.png height=300 border=0> <hr> led_1 cm12 -  led_name=cm12 - led_color1 led_speed1 led_type=manual <hr> path_tn=imgs/cab/tn/tn_cm12.png </div id=div_rollover name=div_rollover>\"\n";
        $htmout .= "                    >\n";
        $htmout .= "                    <img src=imgs/leds/crome_green0.gif  id=img_led_0 name=img_led_0 height=25 width=25 border=0>\n";
        $htmout .= "                    </a>\n";
        $htmout .= "            <a href=ko.php?detail/cn12 target=_blank class=\"screenshot\" rel=\"imgs/cab/tn/tn_cn12.png\"\n";
        $htmout .= "title=\"<div id=div_rollover name=div_rollover> <img src=imgs/cab/tn/tn_cn12.png height=300 border=0> <hr> led_id=cn12 -  led_name=cn12 - led_color1 led_speed1 led_type=manual <hr> path_tn=imgs/cab/tn/tn_cn12.png </div id=div_rollover name=div_rollover>\" \n";
        $htmout .= "                    >\n";
        $htmout .= "                    <img src=imgs/leds/crome_green0.gif  id=img_led_1 name=img_led_1 height=25 width=25 border=0>\n";
        $htmout .= "                    </a>\n";
        $htmout .= "\n";
        $htmout .= "            <a href=ko.php?detail/co12 target=_blank class=\"screenshot\" rel=\"imgs/cab/tn/tn_cm12.png\"\n";
        $htmout .= "title=\"<div id=div_rollover name=div_rollover> <img src=imgs/cab/tn/tn_co12.png height=300 border=0> <hr> led_id=co12 -  led_name=co12 - led_color1 led_speed1 led_type=manual <hr> path_tn=imgs/cab/tn/tn_co12.png </div id=div_rollover name=div_rollover>\"\n";
        $htmout .= "                    >\n";
        $htmout .= "                    <img src=imgs/leds/crome_green0.gif  id=img_led_2 name=img_led_2 height=25 width=25 border=0>\n";
        $htmout .= "                    </a>\n";
        $htmout .= "\n";
        $htmout .= "            <a href=ko.php?detail/cp12 target=_blank class=\"screenshot\" rel=\"imgs/cab/tn/tn_cp12.png\"\n";
        $htmout .= "title=\"<div id=div_rollover name=div_rollover> <img src=imgs/cab/tn/tn_cp12.png height=300 border=0> <hr> led_id=cp12 -  led_name=cp12 - led_color1 led_speed1 led_type=manual <hr> path_tn=imgs/cab/tn/tn_cp12.png </div id=div_rollover name=div_rollover>\"\n";
        $htmout .= "                    >\n";
        $htmout .= "                    <img src=imgs/leds/crome_green0.gif  id=img_led_3 name=img_led_3 height=25 width=25 border=0>\n";
        $htmout .= "                    </a>\n";
        $htmout .= "\n";
        $htmout .= "            <a href=ko.php?detail/cq12 target=_blank class=\"screenshot\" rel=\"imgs/cab/tn/tn_cq12.png\"\n";
        $htmout .= "title=\"<div id=div_rollover name=div_rollover> <img src=imgs/cab/tn/tn_cq12.png height=300 border=0> <hr> led_id=cq12 -  led_name=cq12 - led_color1 led_speed1 led_type=manual <hr> path_tn=imgs/cab/tn/tn_cq12.png </div id=div_rollover name=div_rollover>\"\n";
        $htmout .= "                    >\n";
        $htmout .= "                    <img src=imgs/leds/crome_green0.gif  id=img_led_4 name=img_led_4 height=25 width=25 border=0>\n";
        $htmout .= "                    </a>\n";
        $htmout .= "\n";
        $htmout .= "            <a href=ko.php?detail/cw12 target=_blank class=\"screenshot\" rel=\"imgs/cab/tn/tn_cw12.png\"\n";
        $htmout .= "title=\"<div id=div_rollover name=div_rollover> <img src=imgs/cab/tn/tn_cw12.png height=300 border=0> <hr> led_id=cw12 -  led_name=cw12 - led_color1 led_speed1 led_type=manual <hr> path_tn=imgs/cab/tn/tn_cm12.png </div id=div_rollover name=div_rollover>\"\n";
        $htmout .= "                    >\n";
        $htmout .= "                            <img src=imgs/leds/crome_green0.gif  id=img_led_5 name=img_led_5 height=25 width=25 border=0>\n";
        $htmout .= "                    </a>\n";
        $htmout .= "\n";
        $htmout .= "    <a href=ko.php?detail/ct12 target=_blank class=\"screenshot\" rel=\"imgs/cab/tn/tn_ct12.png\"\n";
        $htmout .= "title=\"<div id=div_rollover name=div_rollover> <img src=imgs/cab/tn/tn_ct12.png height=300 border=0> <hr> led_id=ct12 -  led_name=ct12 - led_color1 led_speed1 led_type=manual <hr> path_tn=imgs/cab/tn/tn_ct12.png </div id=div_rollover name=div_rollover>\"\n";
        $htmout .= "            >\n";
        $htmout .= "            <img src=imgs/leds/crome_green0.gif  id=img_led_6 name=img_led_6 height=25 width=25 border=0>\n";
        $htmout .= "            </a>\n";
        $htmout .= "\n";
        $htmout .= "\n";
        $htmout .= "    <a href=ko.php?detail/cu12 target=_blank class=\"screenshot\" rel=\"imgs/cab/tn/tn_cu12.png\" title=\"<div id=div_rollover name=div_rollover> <img src=imgs/cab/tn/tn_cu12.png height=300 border=0> <hr> led_id=cu12 -  led_name=cu12 - led_color1 led_speed1 led_type=manual <hr> path_tn=imgs/cab/tn/tn_cu12.png </div id=div_rollover name=div_rollover>\"\n";
        $htmout .= "            >\n";
        $htmout .= "            <img src=imgs/leds/crome_green0.gif  id=img_led_7 name=img_led_7 height=25 width=25 border=0>\n";
        $htmout .= "            </a>\n";
        $htmout .= "\n";
        $htmout .= "\n";
        $htmout .= "    <a href=ko.php?detail/cz17 target=_blank class=\"screenshot\" rel=\"imgs/cab/tn/tn_cz17.png\"\n";
        $htmout .= "title=\"<div id=div_rollover name=div_rollover> <img src=imgs/cab/tn/tn_cz17.png height=300 border=0> <hr> led_id=cz17 -  led_name=cz17 - led_color1 led_speed1 led_type=manual <hr> path_tn=imgs/cab/tn/tn_cz17.png </div id=div_rollover name=div_rollover>\"\n";
        $htmout .= "            >\n";
        $htmout .= "            <img src=imgs/leds/crome_green0.gif  id=img_led_8 name=img_led_8 height=25 width=25 border=0>\n";
        $htmout .= "            </a>\n";
        $htmout .= "\n";
        $htmout .= "\n";
        $htmout .= "    <a href=ko.php?detail/cy17 target=_blank class=\"screenshot\" rel=\"imgs/cab/tn/tn_cy17.png\"\n";
        $htmout .= "title=\"<div id=div_rollover name=div_rollover> <img src=imgs/cab/tn/tn_cy17.png height=300 border=0> <hr> led_id=cy17 -  led_name=cy17 - led_color1 led_speed1 led_type=manual <hr> path_tn=imgs/cab/tn/tn_cy17.png </div id=div_rollover name=div_rollover>\" \n";
        $htmout .= "            >\n";
        $htmout .= "            <img src=imgs/leds/crome_green0.gif  id=img_led_9 name=img_led_9 height=25 width=25 border=0>\n";
        $htmout .= "            </a>\n";
        $htmout .= "\n";
        $htmout .= "    <a href=ko.php?detail/cx17 target=_blank class=\"screenshot\" rel=\"imgs/cab/tn/tn_cx17.png\" title=\"<div id=div_rollover name=div_rollover> <img src=imgs/cab/tn/tn_cx17.png height=300 border=0> <hr> led_id=cx17 -  led_name=cx17 - led_color1 led_speed1 led_type=manual <hr> path_tn=imgs/cab/tn/tn_cx17.png </div id=div_rollover name=div_rollover>\" >\n";
        $htmout .= "            <img src=imgs/leds/crome_green0.gif  id=img_led_10 name=img_led_10 height=25 width=25 border=0>\n";
        $htmout .= "            </a>\n";
        $htmout .= "\n";
        $htmout .= "    <a href=ko.php?detail/cw17 target=_blank class=\"screenshot\" rel=\"imgs/cab/tn/tn_cw17.png\" title=\"<div id=div_rollover name=div_rollover> <img src=imgs/cab/tn/tn_cw17.png height=300 border=0> <hr> led_id=cw17 -  led_name=cw17 - led_color1 led_speed1 led_type=manual <hr> path_tn=imgs/cab/tn/tn_cw17.png </div id=div_rollover name=div_rollover>\" >\n";

        $htmout .= "            <img src=imgs/leds/crome_green0.gif  id=img_led_11 name=img_led_11 height=25 width=25 border=0>\n";
        $htmout .= "            </a>\n";
        $htmout .= "            </div id=div_led_260_end>\n";
        $htmout .= "    <hr color=goldenrod>\n";
        $htmout .= "    </center>\n";
        $htmout .= "    </div id=div_leds_end name=div_leds_end >\n";
        return($htmout);
        }


function html_scripts() {
	global $rollover_content;
#	bugs("","bugs_730 html_scripts<br>\n" );
	$htmout = "";
	$htmout .= "<script id=script_startup >\n";
	$htmout .= "	function startup(msg) {\n";
	$htmout .= "		alert( \"startup msg=\"+msg );\n";
	$htmout .= "	}\n";
	$htmout .= "	</script id=script_startup_end>\n";
	$htmout .= $rollover_content;
	return($htmout);
	}

function html_div_squares() {
        $htmout = "";
        $htmout .= "<hr>\n";
        $htmout .= "<div class=\"layer1\" id=\"leds_show\" >\n";
        $htmout .= "\n";
        $htmout .= "<div id=div_squares id=div_squares name=div_squares>\n";
        $htmout .= "<a href=/ko/kowz.php>\n";
        $htmout .= "<img src=\"imgs/btn/giphy_box_spinners.gif\" alt=\"btn_black\" border=0 height=\"20\" width=\"20\" /></a>\n";
        $htmout .= "<a href=/ko/kowz.php?q=login>\n";
        $htmout .= "<img src=\"imgs/btn/giphy_box_spinners.gif\" alt=\"btn_black\" border=0 height=\"20\" width=\"20\" /></a>\n";
        $htmout .= "<a href=/ko/kowz.php?q=tools>\n";
        $htmout .= "<img src=\"imgs/btn/giphy_box_spinners.gif\" alt=\"tools\" border=0 height=\"20\" width=\"20\" /></a>\n";
        $htmout .= "    </div id=div_squares_end id=div_squares_end name=div_squares_end>\n";
        return($htmout);
        }

function html_div_ctx() {
        $htmout = "";
        $htmout .= "<div id=div_ctx name=div_ctx >\n";
        $htmout .= "    <center>\n";
        $htmout .= "    <hr color=goldenrod>\n";
        $htmout .= "    <img src=imgs/btn/leds_ai.png id=img_led_ai name=img_led_ai height=100 width=100 border=0>\n";
        $htmout .= "    &nbsp &nbsp \n";
        $htmout .= "    <img src=imgs/btn/leds_cab.png id=img_led_cab name=img_led_cab height=100 width=100 border=0>\n";
        $htmout .= "    &nbsp &nbsp\n";
        $htmout .= "    <img src=imgs/btn/leds_doc.png id=img_led_doc name=img_led_doc height=100 width=100 border=0>\n";
        $htmout .= "    &nbsp &nbsp\n";
        $htmout .= "    <img src=imgs/btn/leds_us.png id=img_led_us name=img_led_us height=100 width=100 border=0>\n";
        $htmout .= "    <hr color=goldenrod>\n";
        $htmout .= "    </div id=div_ctx_end name=div_ctx_end >\n";
        return($htmout);
        }

function html_div_links() {
        $htmout = "";
        $htmout .= "<div id=div_links name=div_links >\n";
        $htmout .= "    <hr color=goldenrod>\n";
        $htmout .= "    <img src=imgs/btn/ko.png id=img_ko name=img_ko height=25 width=50 border=0>\n";
        $htmout .= "     &nbsp &nbsp    \n";
        $htmout .= "    <img src=imgs/btn/reports.png id=img_reports name=img_reports height=50 width=50 border=0>\n";
        $htmout .= "     &nbsp &nbsp    \n";
        $htmout .= "    <img src=imgs/btn/koeye.png id=img_koeye name=img_koeye height=25 width=50 border=0>\n";
        $htmout .= "    &nbsp &nbsp     \n";
        $htmout .= "    <img src=imgs/btn/koeyeb.png id=img_koeyeb name=img_koeyeb height=25 width=50 border=0>\n";
        $htmout .= "     &nbsp &nbsp    \n";
        $htmout .= "    <img src=imgs/btn/koeyew.png id=img_koeyew name=img_koeyew height=25 width=50 border=0>\n";
        $htmout .= "     &nbsp &nbsp    \n";
        $htmout .= "    <img src=imgs/btn/handhither.gif id=img_handhither name=img_handhither height=50 width=50 border=0>\n";
        $htmout .= "     &nbsp &nbsp    \n";
        $htmout .= "    <img src=imgs/btn/handhi.gif id=img_handhi name=img_handhi height=50 width=50 border=0>\n";
        $htmout .= "    <hr color=goldenrod>\n";
        $htmout .= "    </div id=div_links_end name=div_links_end >\n";
        return($htmout);
        }

function html_div_rollover() {
        $htmout = "";
        $htmout .= "\n";
        $htmout .= "<div id=div_rollover name=div_rollover >\n";
        $htmout .= "    <center>\n";
        $htmout .= "    <hr color=goldenrod>\n";
        $htmout .= "    <h1>div_rollover</h1>\n";
        $htmout .= "    <hr color=golderrod>\n";
        $htmout .= "    <hr color=golderrod>\n";
        $htmout .= "    <hr color=golderrod>\n";
        $htmout .= "    <hr color=golderrod>\n";
        $htmout .= "    <hr color=golderrod>\n";
        $htmout .= "    <hr color=golderrod>\n";
        $htmout .= "    <hr color=golderrod>\n";
        $htmout .= "    <hr color=golderrod>\n";
        $htmout .= "    <hr color=golderrod>\n";
        $htmout .= "    <hr color=golderrod>\n";
        $htmout .= "    <hr color=golderrod>\n";
        $htmout .= "    <br><br><br><br><br><br><br><br><br>\n";
        $htmout .= "    <hr color=goldenrod>\n";
        $htmout .= "    </center>\n";
        $htmout .= "    </div id=div_rollover_end name=rollover_end >\n";
        return($htmout);
	}

function html_body() {
	global $leds_content;
#	bugs("","bugs_800 html_body leds_content=$leds_content<br>\n" );

	$htmout = "";
	$htmout .= "	</head>\n";
	$htmout .= "<body bgcolor=linen onstartup=\"startup('startup'); return false;\" >\n";
	$htmout .= "<script type=\"text/javascript\" src=\"js/wz/wz_library.js\"></script>\n";

	$htmout .= "<script type=\"text/javascript\" src=\"js/wz/wz_library.js\"></script>\n";
	$htmout .= "<script type=\"text/javascript\" src=\"js/wz/wz_tooltip.js\"></script>\n";
	$htmout .= "<script type=\"text/javascript\" src=\"js/wz/wz_dragdrop.js\"></script>\n";
	$htmout .= "<script type=\"text/javascript\" src=\"js/wz/wz_scripts.js\"></script>\n";
	return($htmout);
	}

function html_div_leds($leds_content) {
	$htmout = "";
	$htmout .= "<hr color=goldenrod>\n";
	$htmout .= "<div id=div_leds name=div_leds >\n";
#	$htmout .= "	<h1>div_leds</h1>\n";
	$htmout .= $leds_content;
	$htmout .= "	</div id=div_leds_end name=div_leds_end >\n";
	return($htmout);
	}

function html_div_ctx_orig() {
	$htmout = "";
	$htmout .= "<hr color=goldenrod>\n";
	$htmout .= "<div id=div_ctx name=div_ctx >\n";
#	$htmout .= "	<h1>div_ctx</h1>\n";
	$htmout .= "	<img src=imgs/btn/leds_ai.png id=img_led_ai name=img_led_ai height=100 width=100 border=0>\n";
	$htmout .= "	&nbsp &nbsp \n";
	$htmout .= "	<img src=imgs/btn/leds_cab.png id=img_led_cab name=img_led_cab height=100 width=100 border=0>\n";
	$htmout .= "	&nbsp &nbsp\n";
	$htmout .= "	<img src=imgs/btn/leds_doc.png id=img_led_doc name=img_led_doc height=100 width=100 border=0>\n";
	$htmout .= "	&nbsp &nbsp\n";
	$htmout .= "	<img src=imgs/btn/leds_us.png id=img_led_us name=img_led_us height=100 width=100 border=0>\n";
	$htmout .= "	</div id=div_ctx_end name=div_ctx_end >\n";
	return($htmout);
	}

function html_div_links_orig() {
	$htmout = "";
	$htmout .= "<div id=div_links name=div_links >\n";
#	$htmout .= "	<h1>div_links</h1>\n";
	$htmout .= "	<img src=imgs/btn/ko.png id=img_ko height=25 width=50 border=0>\n";
	$htmout .= "	&nbsp &nbsp &nbsp &nbsp ";
	$htmout .= "	<img src=imgs/btn/reports.png id=img_reports height=50 width=50 border=0>\n";
	$htmout .= "	&nbsp &nbsp &nbsp &nbsp ";
	$htmout .= "	<img src=imgs/btn/koeye.png id=img_koeye name=img_koeye height=25 width=50 border=0>\n";
	$htmout .= "	&nbsp &nbsp &nbsp &nbsp ";
	$htmout .= "	<img src=imgs/btn/koeyeb.png id=img_koeyeb name=img_koeyeb height=25 width=50 border=0>\n";
	$htmout .= "	&nbsp &nbsp &nbsp &nbsp ";
	$htmout .= "	<img src=imgs/btn/koeyew.png id=img_koeyew name=img_koeyew height=25 width=50 border=0>\n";
	$htmout .= "	&nbsp &nbsp &nbsp &nbsp ";
	$htmout .= "	<img src=imgs/btn/handhither.gif id=img_handhither name=img_handhither height=50 width=50 border=0>\n";
	$htmout .= "	&nbsp &nbsp &nbsp &nbsp ";
	$htmout .= "	<img src=imgs/btn/handhi.gif id=img_handhi name=img_handhi height=50 width=50 border=0>\n";
	$htmout .= "	&nbsp &nbsp &nbsp &nbsp ";
	$htmout .= "	</div id=div_links_end name=div_links_end >\n";
	return($htmout);
	}

function html_div_rollover_orig() {
	$htmout = "";
	$htmout .= "<hr color=goldenrod>\n";
	$htmout .= "<div id=div_rollover name=div_rollover >\n";
	$htmout .= "	<h1>div_rollover</h1>\n";
	$htmout .= "<hr><hr><hr><hr><hr>\n";
	$htmout .= "	</div id=div_rollover_ned name=rollover_end >\n";
	return($htmout);
	}

function html_footer() {
        $htmout = "";
        $htmout .= "\n";
        $htmout .= "<script id=script_set_dhtml type=\"text/javascript\">\n";
        $htmout .= "<!--\n";
        $htmout .= "    SET_DHTML(\n";
        $htmout .= "\"div_squares\"+RESIZABLE,\n";
        $htmout .= "\"div_leds\"+RESIZABLE,\n";
        $htmout .= "\"div_ctx\"+RESIZABLE,\n";
        $htmout .= "\"div_links\"+RESIZABLE,\n";
        $htmout .= "\"div_rollover\"+RESIZABLE,\n";
        $htmout .= "\"img_led_1\"+SCALABLE,\n";
        $htmout .= "\"img_led_2\"+SCALABLE,\n";
        $htmout .= "\"img_led_3\"+SCALABLE,\n";
        $htmout .= "\"img_led_4\"+SCALABLE,\n";
        $htmout .= "\"img_led_5\"+SCALABLE,\n";
        $htmout .= "\"img_led_6\"+SCALABLE,\n";
        $htmout .= "\"img_led_7\"+SCALABLE,\n";
        $htmout .= "\"img_led_8\"+SCALABLE,\n";
        $htmout .= "\"img_led_9\"+SCALABLE,\n";
        $htmout .= "\"img_led_10\"+SCALABLE,\n";
        $htmout .= "\"img_reports\"+SCALABLE,\n";
        $htmout .= "\"img_ko\"+RESIZABLE,\n";
        $htmout .= "\"img_koeye\"+RESIZABLE,\n";
        $htmout .= "\"img_koeyeb\"+RESIZABLE,\n";
        $htmout .= "\"img_koeyew\"+RESIZABLE,\n";
        $htmout .= "\"img_handhither\"+RESIZABLE,\n";
        $htmout .= "\"img_handhi\"+RESIZABLE    );\n";
        $htmout .= "//-->\n";
        $htmout .= "    </script id=script_set_dhtml_end>\n";
        $htmout .= "    </body>\n";
        $htmout .= "    </html>\n";
        return($htmout);
        }

function html_main() {
        $htmout = "";
        $htmout .= html_top();
        $htmout .= html_styles();
        $htmout .= html_content();
        $htmout .= html_js();
        $htmout .= html_body();
        $htmout .= html_div_squares();
#       $htmout .= html_div_leds_screenshot();
#       $htmout .= html_div_leds();
        $htmout .= html_div_ctx();
        $htmout .= html_div_links();
        $htmout .= html_div_rollover();
        $htmout .= html_footer();
        return($htmout);
        }


function html_footer_orig() {
	global $set_dhtml;
#	bugs("","bugs_870 html_footer set_dhtml=$set_dhtml<br>\n" );
	$htmout="";
	$htmout .= 
	$htmout .= "<script id=script_set_dhtml type=\"text/javascript\">\n";
	$htmout .= "<!--\n";
	$htmout .= "	SET_DHTML(\n";
	$htmout .= "$set_dhtml";
	$htmout .= ");\n";
	$htmout .= "//-->\n";
	$htmout .= "	</script id=script_set_dhtml_end>\n";
	$htmout .= "	</body>\n";
	$htmout .= "	</html>\n";
#	bugs("","bugs_850 html_footer set_dhtml=$set_dhtml<br>\n" );

	return($htmout);
	}





function html_style_leds_context() {
#	print( "BUGS_4110 html_style_leds_context <br>\n" );

    $htmout = "";
    $htmout .= "    <style type=\"text/css\">\n";
    $htmout .= "        .leds_context {\n";
    $htmout .= "            -moz-box-shadow:inset 0px 1px 0px 0px #fcf8f2;\n";
    $htmout .= "            -webkit-box-shadow:inset 0px 1px 0px 0px #fcf8f2;\n";
    $htmout .= "            box-shadow:inset 0px 1px 0px 0px #fcf8f2;\n";
    $htmout .= "            background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #fae4bd), color-stop(1, #eac380) );\n";
    $htmout .= "            background:-moz-linear-gradient( center top, #fae4bd 5%, #eac380 100% );\n";
    $htmout .= "            filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fae4bd', endColorstr='#eac380');\n";
    $htmout .= "            background-color:#fae4bd;\n";
    $htmout .= "            -webkit-border-top-left-radius:0px;\n";
    $htmout .= "            -moz-border-radius-topleft:0px;\n";
    $htmout .= "            border-top-left-radius:0px;\n";
    $htmout .= "            -webkit-border-top-right-radius:0px;\n";
    $htmout .= "            -moz-border-radius-topright:0px;\n";
    $htmout .= "            border-top-right-radius:0px;\n";
    $htmout .= "            -webkit-border-bottom-right-radius:0px;\n";
    $htmout .= "            -moz-border-radius-bottomright:0px;\n";
    $htmout .= "            border-bottom-right-radius:0px;\n";
    $htmout .= "            -webkit-border-bottom-left-radius:0px;\n";
    $htmout .= "            -moz-border-radius-bottomleft:0px;\n";
    $htmout .= "            border-bottom-left-radius:0px;\n";
    $htmout .= "            text-indent:0;\n";
    $htmout .= "            border:1px solid #eeb44f;\n";
    $htmout .= "            display:inline-block;\n";
    $htmout .= "            color:#ffffff;\n";
    $htmout .= "            font-family:Arial;\n";
    $htmout .= "            font-size:15px;\n";
    $htmout .= "            font-weight:bold;\n";
    $htmout .= "            font-style:normal;\n";
    $htmout .= "            height:40px;\n";
    $htmout .= "            line-height:40px;\n";
    $htmout .= "            width:100px;\n";
    $htmout .= "            text-decoration:none;\n";
    $htmout .= "            text-align:center;\n";
    $htmout .= "            text-shadow:1px -21px 0px #cc9f52;\n";
    $htmout .= "        }\n";
    $htmout .= "        .leds_context:hover {\n";
    $htmout .= "            background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #eac380), color-stop(1, #fae4bd) );\n";
    $htmout .= "            background:-moz-linear-gradient( center top, #eac380 5%, #fae4bd 100% );\n";
  $htmout .= "            filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eac380', endColorstr='#fae4bd');\n";
    $htmout .= "            background-color:#eac380;\n";
    $htmout .= "        }\n";
    $htmout .= "        .leds_context:active {\n";
    $htmout .= "            position:relative;\n";
    $htmout .= "            top:1px;\n";
    $htmout .= "        }\n";
    $htmout .= "        .leds_context_img {\n";
    $htmout .= "            border:0;\n";
    $htmout .= "            cursor:pointer;\n";
    $htmout .= "        }\n";
    $htmout .= "    </style>\n";
    return( $htmout );
	}

function html_btn_squares($options) {
	$dttm=date("Ymd_His");
        $php_self=$_SERVER['PHP_SELF'];
        $http_host=$_SERVER['HTTP_HOST'];
        $request_uri=$_SERVER['REQUEST_URI'];
	$path_btn="imgs/btn";
	$path_ani="imgs/ani";

#	$output .= "<body bgimage=imgs/chalk.gif>\n";
#	$output .= "<body bgcolor=lightblue>\n";
	$output .= "<body bgcolor=linen>\n";
	$output .= "<script type=\"text/javascript\" src=\"js/wz/wz_dragdrop.js\"></script>\n";
	$output .= "<script type=\"text/javascript\" src=\"js/wz/wz_library.js\"></script>\n"; 
	$output .= "<hr>\n";
	$output .= "<div class=\"layer1\" id=\"leds_show\" >\n";
#	$output .= "	<p class=\"heading\">leds_show</p>\n";
#	$output .= "	<div class=\"content\">\n";


	$output .= "<a href=$php_self>\n";
#	$output .= "<img src=\"$path_btn/btn_black.gif\" alt=\"btn_black\" border=0 height=\"20\" width=\"20\" />";
	$output .= "<img src=\"$path_btn/giphy_box_spinners.gif\" alt=\"btn_black\" border=0 height=\"20\" width=\"20\" />";
	$output .= "</a>\n";

	$session_role="";
	if( isset($_SESSION['role'] )) {
		$session_role=$_SESSION['role'];
		}
#	print( "BUGS_7610 login session_role=$session_role<br>\n" );
	
	if(( ! isset( $_SESSION['role'] )) || ( $_SESSION['role'] == "" )) {
		$output .= "<a href=$php_self?q=login>\n";
#		$output .= "<img src=\"$path_btn/btn_black.gif\" alt=\"btn_black\" border=0 height=\"20\" width=\"20\" />";
		$output .= "<img src=\"$path_btn/giphy_box_spinners.gif\" alt=\"btn_black\" border=0 height=\"20\" width=\"20\" />";
		$output .= "</a>\n";
		}
	if(( isset( $_SESSION['role'] )) && ( ! $_SESSION['role'] == "" )) {
		$output .= "<a href=$php_self?q=logout>\n";
		$output .= "<img src=\"$path_btn/btn_white.gif\" alt=\"btn_white\" border=0 height=\"20\" width=\"20\" />";
		$output .= "</a>\n";



#		$squares = array( 'config', 'zoom', 'db', 'fgmenu', 'fgmenu_dyn', 'fgmenu_htm' );
#		$squares = array( 'config', 'zoom', 'db', 'ptviewer', 'ptobject', 'fgmenu_htm' );
#		$squares = array( 'config', 'zoom', 'db', 'ptviewer', 'ptobject', 'fgmenu_htm', 'db/grid/fp/pano', 'db/grid/fp/obj' );
#		$squares = array( 'config', 'zoom', 'db/grid', 'db/grid/fp/pano', 'db/grid/fp/obj', 'fgmenu_htm' );
		$squares = array( 'config', 'db/grid' );
		foreach( $squares as $square ) {
			$output .= "<a href=$php_self?q=$square>\n";
#			$output .= "<img src=\"$path_btn/btn_black.gif\" alt=\"btn_black\" border=0 height=\"20\" width=\"20\" />";
			$output .= "<img src=\"$path_btn/giphy_box_spinners.gif\" alt=\"btn_black\" border=0 height=\"20\" width=\"20\" />";
			$output .= "</a>\n";
			}

#/		$output .= " &nbsp &nbsp &nbsp ";
#/		$output .= "<a href=https:#147.238.94.126/fp/fp.php target=_blank>\n";
#/		$output .= "<img src=\"$path_btn/btn_black.gif\" alt=\"btn_black_fp\" border=0 height=\"20\" width=\"20\" />";
#/		$output .= "</a>\n";

#/		$output .= "<a href=https:#147.238.94.126/ko_center/ko_center.php?q=scrub target=_blank>\n";
#/		$output .= "<img src=\"$path_btn/btn_black.gif\" alt=\"btn_black_scrub\" border=0 height=\"20\" width=\"20\" />";
#/		$output .= "</a>\n";

#/		$output .= "<a href=https:#hrc.mil target=_blank>\n";
#/		$output .= "<img src=\"$path_btn/btn_hrc.png\" alt=\"btn_hrc\" border=0 height=\"20\" width=\"20\" />";
#/		$output .= "</a>\n";

#/		$output .= "<a href=https:#us.army.mil target=_blank>\n";
#/		$output .= "<img src=\"$path_btn/btn_perscom.gif\" alt=\"btn_perscom\" border=0 height=\"20\" width=\"20\" />";
#/		$output .= "</a>\n";

#/		$output .= "<a href=https:#147.238.94.126/ko_center/media/zm/index.htm target=_blank>\n";
#/		$output .= "<img src=\"$path_btn/btn_hrc.png\" alt=\"btn_perscom\" border=0 height=\"20\" width=\"20\" />";
#/		$output .= "</a>\n";
		}

	$output .= "<a href=$php_self?q=tools>\n";
#	$output .= "<img src=\"$path_btn/btn_black.gif\" alt=\"tools\" border=0 height=\"20\" width=\"20\" />";
	$output .= "<img src=\"$path_btn/giphy_box_spinners.gif\" alt=\"tools\" border=0 height=\"20\" width=\"20\" />";
	$output .= "</a>\n";

	$output .= "<br>\n";
#	$output .= "		</div>\n";
	return( $output );

#	$output .= "<a href=$php_self?q=zoom>\n";
#	$output .= "<img src=\"$path_btn/btn_black.gif\" alt=\"btn_black\" border=0 height=\"20\" width=\"20\" />";
#	$output .= "</a>\n";
#	$output .= "<a href=$php_self?q=fgmenu>\n";
#	$output .= "<img src=\"$path_btn/btn_black.gif\" alt=\"btn_black\" border=0 height=\"20\" width=\"20\" />";
#	$output .= "</a>\n";
#	$output .= "<a href=$php_self?q=fgmenu_dyn>\n";
#	$output .= "<img src=\"$path_btn/btn_black.gif\" alt=\"btn_black\" border=0 height=\"20\" width=\"20\" />";
#	$output .= "</a>\n";
#	$output .= "<a href=$php_self?q=fgmenu_htm>\n";
#	$output .= "<img src=\"$path_btn/btn_black.gif\" alt=\"btn_black\" border=0 height=\"20\" width=\"20\" />";
#	$output .= "</a>\n";
#	$output .= "<a href=$php_self?q=view>\n";
#	$output .= "<a href=$php_self?q=db/grid>\n";
#	$output .= "<img src=\"$path_btn/btn_black.gif\" alt=\"btn_black\" border=0 height=\"20\" width=\"20\" />";
#	$output .= "</a>\n";
#	$output .= "<a href=$php_self?q=update>\n";
#	$output .= "<img src=\"$path_btn/btn_black.gif\" alt=\"btn_black\" border=0 height=\"20\" width=\"20\" />";
#	$output .= "</a>\n";
#	$output .= "<a href=$php_self?q=list>\n";
#	$output .= "<img src=\"$path_btn/btn_black.gif\" alt=\"btn_black\" border=0 height=\"20\" width=\"20\" />";
#	$output .= "</a>\n";

	}

function html_page($options) {

	$html  = "";
	$html .= html_header($options);
	$html .= html_btn_squares($options);

#	$html .= "<hr>$progid $dttm MSG_826 [$html]<hr>\n";

	$html .= leds_show( $options );
#	$html .= html_btn_themes($options,"");
#	$html .= html_btn_roles($options,"");
#	$html .= html_btn_orgs($options,"");
#	$html .= html_btn_hotspots($options,"");
#	$html .= html_footer($options,"");
	print( $html );
	}

function html_btn_footer( $options ) {
        print( "BUGS_7740 html_btn_footer option=$options<br>\n" );
        $path_btn="./imgs/btn";
        $path_ani="./imgs/ani";
        $http_host=$_SERVER['HTTP_HOST'];
        $server_name=$_SERVER['SERVER_NAME'];
        $server_addr=$_SERVER['SERVER_ADDR'];

        $html_btn_footer  = "";
        $html_btn_footer .= "<hr>\n";
        $html_btn_footer .= leds_show($options);

        $html_btn_footer .= "<a href=https:#us.army.mil target=_blank>\n";
        $html_btn_footer .= "<img src=\"$path_btn/ako.png\" alt=\"us.army.mil\" border=0 height=\"30\" width=\"50\" />";
        $html_btn_footer .= "</a>\n";
        $html_btn_footer .= " &nbsp &nbsp &nbsp &nbsp ";

        $html_btn_footer .= "<a href=https:#atc.us.army.mil/iastar/ target=_blank>\n";
        $html_btn_footer .= "<img src=\"$path_btn/iastar.png\" alt=\"atc.us.army.mil/iastar\" border=0 height=\"30\" width=\"60\" />";
        $html_btn_footer .= "</a>\n";
        $html_btn_footer .= " &nbsp &nbsp &nbsp &nbsp ";

        $html_btn_footer .= "<a href=https:#ia.signal.army.mil target=_blank>\n";
        $html_btn_footer .= "<img src=\"$path_btn/iasignal.png\" alt=\"ia.signal.army.mil\" border=0 height=\"30\" width=\"30\" />";
        $html_btn_footer .= "</a>\n";
        $html_btn_footer .= " &nbsp &nbsp &nbsp &nbsp ";

        $html_btn_footer .= "<a href=https:#www.iad.gov target=_blank>\n";
        $html_btn_footer .= "<img src=\"$path_btn/iad.png\" alt=\"iad.gov\" border=0 height=\"30\" width=\"30\" />";
        $html_btn_footer .= "</a>\n";
        $html_btn_footer .= " &nbsp &nbsp &nbsp &nbsp ";

        $html_btn_footer .= "<a href=https:#www.iad.gov/ioss/index.cfm target=_blank>\n";
        $html_btn_footer .= "<img src=\"$path_btn/ioss.png\" alt=\"iad.gov/ioss\" border=0 height=\"30\" width=\"30\" />";
        $html_btn_footer .= "</a>\n";

        $html_btn_footer .= "<a href=https:#www.hrc.army.mil target=_blank>\n";
        $html_btn_footer .= "<img src=\"$path_btn/btn_hrc.png\" alt=\"hrc.army.mil\" border=0 height=\"30\" width=\"30\" />";
        $html_btn_footer .= "</a>\n";
        $html_btn_footer .= " &nbsp &nbsp &nbsp &nbsp ";

        $html_btn_footer .= "<hr>\n";

        $html_btn_footer .= "<table>\n";
        $html_btn_footer .= "<tr>\n";
        $html_btn_footer .= "<td>\n";
        $html_btn_footer .= "ko_center<br>\n";
        $html_btn_footer .= "<a href=$php_self?q=ko1/about target=_blank>\n";
        $html_btn_footer .= "<img src=\"$path_btn/ko_center.png\" alt=\"ko_center\" border=0 height=\"35\" width=\"35\" />";
        $html_btn_footer .= "</a>\n";
        $html_btn_footer .= "</td>\n";

        $html_btn_footer .= "<td width=15> &nbsp </td>\n";
        $html_btn_footer .= "<td>\n";
        $html_btn_footer .= "ko_centere<br>\n";
        $html_btn_footer .= "<a href=$php_self?q=ko_centere target=_blank>\n";
        $html_btn_footer .= "<img src=\"$path_btn/ko_centere.png\" alt=\"ko_centere\" border=0 height=\"30\" width=\"30\" />";
        $html_btn_footer .= "</a>\n";
        $html_btn_footer .= "</td>\n";
        $html_btn_footer .= "<td width=15> &nbsp </td>\n";

        $html_btn_footer .= "<td>\n";
        $html_btn_footer .= "ko_centerd<br>\n";
        $html_btn_footer .= "<a href=$php_self?q=ko_centerd target=_blank>\n";
        $html_btn_footer .= "<img src=\"$path_btn/ko_centerd.png\" alt=\"ko_centerd\" border=0 height=\"30\" width=\"30\" />";
        $html_btn_footer .= "</a>\n";
        $html_btn_footer .= "</td>\n";
        $html_btn_footer .= "<td width=15> &nbsp </td>\n";
        $html_btn_footer .= "<td>\n";
        $html_btn_footer .= "ko_centert<br>\n";
        $html_btn_footer .= "<a href=$php_self?q=ko_centert target=_blank>\n";
        $html_btn_footer .= "<img src=\"$path_btn/ko_centert.png\" alt=\"ko_centert\" border=0 height=\"30\" width=\"30\" />";
        $html_btn_footer .= "</a>\n";
        $html_btn_footer .= "</td>\n";

        $html_btn_footer .= "<td width=15> &nbsp </td>\n";
        $html_btn_footer .= "<td width=15> &nbsp </td>\n";

        $html_btn_footer .= "<td>\n";
        $html_btn_footer .= "itil<br>\n";
        $html_btn_footer .= "<a href=/itil/index.html target=_blank>\n";
        $html_btn_footer .= "<img src=\"$path_btn/itil.png\" alt=\"itil\" border=0 height=\"30\" width=\"30\" />";
        $html_btn_footer .= "</a>\n";
        $html_btn_footer .= "</td>\n";
        $html_btn_footer .= "<td width=15> &nbsp </td>\n";
        $html_btn_footer .= "</tr>\n";
        $html_btn_footer .= "</table>\n";

        $html_btn_footer .= "<a href=http:#arcsight.com target=_blank>\n";
        $html_btn_footer .= "<img src=\"$path_btn/arcsight.png\" alt=\"arcsight\" border=0 height=\"30\" width=\"40\" />";
        $html_btn_footer .= "</a>\n";
        $html_btn_footer .= " &nbsp &nbsp &nbsp &nbsp ";

        $html_btn_footer .= "<a href=https:#147.238.94.170/console/app.showApp.cmd target=_blank>\n";
        $html_btn_footer .= "<img src=\"$path_btn/tripwire.png\" alt=\"tripwire\" border=0 height=\"30\" width=\"40\" />";
        $html_btn_footer .= "</a>\n";
        $html_btn_footer .= " &nbsp &nbsp &nbsp &nbsp ";

        $html_btn_footer .= "<a href=https:#147.238.94.105/zabbix target=_blank>\n";
        $html_btn_footer .= "<img src=\"$path_btn/zabbix.gif\" alt=\"zabbix\" border=0 height=\"30\" width=\"50\" />";
        $html_btn_footer .= "</a>\n";
        $html_btn_footer .= " &nbsp &nbsp &nbsp &nbsp ";

        $html_btn_footer .= "<a href=https:#sbm.usarec.army.mil target=_blank>\n";
        $html_btn_footer .= "<img src=\"$path_btn/serena.png\" alt=\"serena\" border=0 height=\"30\" width=\"60\" />";
        $html_btn_footer .= "</a>\n";

        return( $html_btn_footer );
        }

# ------------------------------------------------------------------
# html_leds_context — four clickable images in div_leds_context
# ------------------------------------------------------------------
function html_leds_context() {
	$htmout = "";
	global $leds_context;
	$ctximg = "/imgs/btn/leds.png";

	$htmout .= "<div id=\"div_leds_context\" name=\"div_leds_context\" >\n";
	$htmout .= "<hr color=goldenrod>\n";
	$htmout .= "<hr color=goldenrod>\n";

	$contexts = array( "ai", "cab", "doc", "us" );
	foreach( $contexts as $ctx ) {
#		bugs("","7926 html_leds_context ctx=$ctx<br>\n" );

	        $ctximg = "imgs/btn/leds_$ctx.png";
	        $label = ( $ctx === "" ) ? "blank" : strtoupper( $ctx );
	        if( $GLOBALS['leds_context'] === $ctx ) { $height = 150; } else { $height = 100; }
	        $htmout .= "    <form method=\"post\" action=\"\" style=\"display:inline;margin:0;padding:0;\">\n";
	        $htmout .= "        <input type=\"hidden\" name=\"set_leds_context\" value=\"$ctx\" />\n";
	        $htmout .= "        <button type=\"submit\" name=\"leds_context\" class=\"leds_context\" value=\"$ctx\">\n";
	        $htmout .= "            <img class=\"leds_context_img\" src=\"$ctximg\" height=\"$height\" alt=\"$label\" />\n";
	        $htmout .= "        </button>\n";
	        $htmout .= "    </form>\n";
	        $htmout .= "    &nbsp;\n";

#		bugs("","7940 html_ctx ctx=$ctx ctximg=$ctximg output=<br>$outout<br>\n" );
		}

	$htmout .= "</div>\n";
	$htmout .= "<hr color=goldenrod>\n";
	$htmout .= "<hr color=goldenrod>\n";
	return( $htmout );
	}




function newpdo( $dbfile ) {
#       print( "BUGS_6580 newpdo  dbfile=$dbfile <br>\n" );
        $php_self=$_SERVER['PHP_SELF'];
        $http_host=$_SERVER['HTTP_HOST'];
        $request_uri=$_SERVER['REQUEST_URI'];

        if( ! file_exists( $dbfile )) {
                print( "$php_self newpdo ERR_5000:  NOT_EXISTS dbfile=[$dbfile]<br>\n" );
                if( $GLOBALS['install'] != true ) {
                        print( "$php_self newpdo ERR:  NOT_INSTALL dbfile=[$dbfile]<br>\n" );
                        return;
                        }
                else {
                        print( "$php_self newpdo MSG:  CREATE dbfile=[$dbfile]<br>\n" );
                        }
                }

        try {
                $pdo = null;
                $pdo = new PDO("sqlite:$dbfile" );
                $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
#              $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
#              $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);

                if( $pdo == null ) {
                        print( "$php_self newpdo ERR:   dbfile=[$dbfile]<br>\n" );
                        return $pdo;
                        }
                return $pdo;
                }


        catch(PDOException $e ) {
                $errmsg = $e->getMessage();
                print( "$php_self newpdo ERR:  pdo=[$pdo] dbfile=[$dbfile] errmsg=[$errmsg]<br>\n" );
                $pdo = null;
                return $pdo;
                }
        }


# pqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpq
# jquiery functions
# bdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbd
function js_scripts() {
	$output = "";
        $http_host=$_SERVER['HTTP_HOST'];
        $php_self=$_SERVER['PHP_SELF'];
##        $themes = $GLOBALS['themes'];
##        $theme = $_SESSION['theme'];

# expand collapse toggle
        $output_css  = "<style type=\"text/css\">\n";
#      $output_css .= ".layer1 {margin: 0; padding: 0; width: 600px; }\n";
        $output_css .= ".layer1 {margin: 0; padding: 0;  }\n";
        $output_css .= ".heading { \n";
        $output_css .= "        margin: 1px; color: white; padding: 3px 10px; cursor: pointer;\n";
        $output_css .= "        position: relative; background-color:grey;\n";
        $output_css .= "        }\n";
#      $output_css .= ".content {padding: 5px 10px; background-color:#fafafa;}\n";
        $output_css .= ".content {padding: 5px 10px; background-color:white;}\n";
        $output_css .= "p { padding: 5px 0; }\n";
        $output_css .= "</style>\n";
        $output_css .= "\n";
        $output_css .= "\n";
##        $output_css .= head_jqui_css($options);


        $output_css_jqui_dragdrop  = "";
        $output_css_jqui_dragdrop .= "<style type=\"text/css\"><!--\n";
        $output_css_jqui_dragdrop .= "#drop { width:200px; height:150px; margin:3px auto; background:#eddaa8; font-size:16px;}\n";
        $output_css_jqui_dragdrop .= "#drop #sw { text-decoration:underline; cursor:pointer; }\n";
        $output_css_jqui_dragdrop .= "#drag { width:50px; height:40px; margin:2px auto; border:1px solid silver; font-size:16px;}\n";
        $output_css_jqui_dragdrop .= "#drag .drg { margin:10px 12px; }\n";
        $output_css_jqui_dragdrop .= "#drag div.drg { width:150px; height:50px; background:#07da08; border:2px solid blue;}\n";
        $output_css_jqui_dragdrop .= "--></style>\n";


        $output_css_jqui_resizable = "";
        $output_css_jqui_resizable .= " <style>\n";
        $output_css_jqui_resizable .= " #resizable { width: 150px; height: 150px; padding: 0.5em; }\n";
        $output_css_jqui_resizable .= " #resizable h3 { text-align: center; margin: 0; }\n";
        $output_css_jqui_resizable .= " </style>\n";
        $output_css_jqui_resizable .= " <script>\n";
        $output_css_jqui_resizable .= " $(function() {\n";
        $output_css_jqui_resizable .= " $( \"#resizable\" ).resizable();\n";
        $output_css_jqui_resizable .= " });\n";
        $output_css_jqui_resizable .= " </script>\n";



#      $js_output = "";
##        if( $GLOBALS['js_output'] ) { $js_output = $GLOBALS['js_output']; }

        $gridimgpaths['redmond1']="js/themes/redmond_save/imgs";
        $gridimgpaths['redmond']="js/themes/redmond/imgs";
        $gridimgpaths['humanity']="js/themes/humanity/imgs";
        $gridimgpaths['frog']="js/themes/le-frog/imgs";
        $gridimgpaths['swanky']="js/themes/swanky-purse/imgs";
        $gridimgpaths['darkness']="js/themes/ui-darkness/imgs";
        $gridimgpaths['lightness']="js/themes/ui-lightness/imgs";
        $gridimgpaths['sunny']="js/themes/sunny/imgs";
        $gridimgpaths['mint']="js/themes/mint-choc/imgs";

        $themepaths['redmond1']="js/themes/redmond_save/jquery-ui-1.7.1.custom.css";
        $themepaths['redmond']="js/themes/redmond/jquery-ui-1.7.2.custom.css";
        $themepaths['humanity']="js/themes/humanity/jquery-ui-1.7.2.custom.css";
        $themepaths['frog']="js/themes/le-frog/jquery-ui-1.7.2.custom.css";
        $themepaths['swanky']="js/themes/swanky-purse/jquery-ui-1.7.2.custom.css";
        $themepaths['darkness']="js/themes/ui-darkness/jquery-ui-1.7.2.custom.css";
        $themepaths['lightness']="js/themes/ui-lightness/jquery-ui-1.7.2.custom.css";
        $themepaths['sunny']="js/themes/sunny/jquery-ui-1.7.2.custom.css";
        $themepaths['mint']="js/themes/mint-choc/jquery-ui-1.7.2.custom.css";


##        $themepath=$themepaths[$theme];
##        $gridimgpath=$gridimgpaths[$theme];


##        $_SESSION['gridimgpath']=$gridimgpath;

#              "js/jqgrid.3.5.3/themes/ui.jqgrid.css"
##        $jq_css_includes_list = array(
##                "js/fg-menu/fg.menu.css",
##                "js/fg-menu/theme/ui.all.css",
##                "$themepath",
##                "js/jqgrid-4.4.0/themes/ui.jqgrid.css"
##                );


##        foreach( $jq_css_includes_list as $jq_css_include ) {
##                if(! file_exists( $jq_css_include )) {
##                        $html_theme_links = "<!-- pdo_grid ERR_2435:  NOTFOUND jq_css_include=[$jq_css_include]<br>-->\n";
##                        }
##                else {
##                        $output .= "<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"$jq_css_include\" />\n";
##                        }
##                }

        $jq_includes_list = array(
#              "js/jquery-1.3.2.js",
#              "js/jqgrid.3.5.3/js/jquery-1.3.2.min.js",
#              "js/jqgrid-4.4.0/js/jquery-1.7.2.min.js",
#              "js/jqgrid-4.4.0/js/jquery-1.7.2.min.js",
#              "js/jquery-ui-1.7.2/js/jquery-ui-1.7.2.custom.min.js",
                "js/jquery-1.8.3.js",
                "js/jquery-ui-1.9.2.custom.js",
#              "js/jquery.ui.touch-punch.js",

                "js/jqgrid-4.4.0/js/i18n/grid.locale-en.js",
                "js/jqgrid-4.4.0/js/jquery.jqGrid.min.js",
#              "js/jqgrid.3.5.3/js/i18n/grid.locale-en.js",
#              "js/jqgrid.3.5.3/js/jquery.jqGrid.min.js",


                "js/tooltip/tooltip_main_screenshot.js",
#              "js/tooltip/tooltip_main_tooltip.js",
#              "js/tooltip/tooltip_main_preview.js",
                );

#        foreach( $jq_includes_list as $jq_include ) {
#                if(! file_exists( $jq_include )) {
#                        $output .= "<!-- pdo_grid ERR_2455:  NOTFOUND jq_include=[$jq_include]<br> -->\n";
#                        }
#                else {
#                        $output .= "<script src=\"$jq_include\" type=\"text/javascript\"></script>\n";
#                        }
#                }


	$outout = "";
        $output .= "\n";
        $output .= $output_css;
#      $output .= $output_css_jqui_dragdrop;
#      $output .= $output_css_jqui_resizable;
        $output .= "\n";

        $output .= "\n";
##        $output .= "<script type=\"text/javascript\"><!--\n";
##
##        $output .= "var gridimgpath = '$gridimgpath';\n";
##        $output .= "$(document).ready(function(){\n";
##
##        $output .= $js_output;
####        $output .= jqui_script($options);
##
##        $output .= "--></script>\n";
##        $output .= "</script>\n";
        return( $output );
        }


function head_jqui_css($options) {
	$output = "";
        $output .= "<style>\n";
        $output .= "#ko { \n";
#      $output .= "    background-image: url(imgs/ko/ko_100.png); \n";
        $output .= "    width: 90px; \n";
        $output .= "    height: 25px; \n";
        $output .= "    padding: 0.5em; \n";
        $output .= "    float: left; \n";
        $output .= "    margin: 10px 10px 10px 0; \n";
        $output .= "    }\n";
        $output .= "#ko_drag { \n";
        $output .= "    background-color:white; \n";
#      $output .= "    background-image: url(imgs/ko/kob.png); \n";
        $output .= "    width: 90px; \n";
        $output .= "    height: 25px; \n";
        $output .= "    float: left; \n";
        $output .= "    padding: 0.5em; \n";
        $output .= "    margin: 10px 10px 10px 0; \n";
        $output .= "    }\n";
        $output .= "#ko_drop { \n";
        $output .= "    background-color:white; \n";
#      $output .= "    background-image: url(imgs/ko/kiw.png); \n";
        $output .= "    width: 90px; \n";
        $output .= "    height: 20px; \n";
        $output .= "    padding: 0.5em; \n";
        $output .= "    float: left; \n";
        $output .= "    margin: 10px 10px 10px 0; \n";
        $output .= "    }\n";
        $output .= "#ko_dragdrop { \n";
#      $output .= "    background-color:black; \n";
#      $output .= "    background-image: url(imgs/ko/kib.png); \n";
        $output .= "    width: 90; \n";
        $output .= "    height: 25; \n";
        $output .= "    padding: 0.5em; \n";
        $output .= "    float: left; \n";
        $output .= "    margin: 10px 10px 10px 0; \n";
        $output .= "    }\n";
        $output .= "#ko_dropdrag { \n";
        $output .= "    background-color:white; \n";
#      $output .= "    background-image: url(imgs/ko/kiw.png); \n";
        $output .= "    width: 90; \n";
        $output .= "    height: 25; \n";
        $output .= "    padding: 0.5em; \n";
        $output .= "    float: left; \n";
        $output .= "    margin: 10px 10px 10px 0; \n";
        $output .= "    }\n";
        $output .= "</style>\n";
        $output .= html_style_leds_context();
        return($output);
        }



function main() {
	global $progid;
	$dttm=date('Ymd_His');
	}
//


koh5_pano



Your browser does not support the HTML5 canvas element.


Drag mouse to navigate.

Navigation





17.Aug.2010, Martin Wengenmayer