<?
########## Confixx(R) 3.0 Professional ############
####### Copyright SWsoft, Inc. 2004-2005 ##########
#### http://www.sw-soft.com - info@sw-soft.com ####

/**
 * @return void
 * @param include_js array
 * @desc print html header 
 */
function print_header( $include_js = false )
{
	global $strSkinName, $lang_html_charset;
	global $HTTP_USER_AGENT, $alerts;
	if( count($alerts) )
	{
		$noFehlerJS = true;
		if($fehlertext)	
		{
			$fehlertext .= ". <br>";
		}
		$fehlertext .= implode($alerts, ". <br>");
	}
		
?>
<HTML>
<HEAD>
<META content="text/html; charset=<? echo $lang_html_charset; ?>" http-equiv=Content-Type>
<LINK href="<?=$strSkinName?>/style.css" rel=stylesheet type=text/css>
<script>
loaded = false;
</script>
<? if( is_array($include_js) ): foreach ($include_js as $jsfile): ?>
<script src="<? echo $jsfile; ?>"></script>
<? endforeach; endif; ?>
</HEAD>

<BODY bgColor=#ffffff bottomMargin=0 leftMargin=0 topMargin=0 MARGINHEIGHT="0" MARGINWIDTH="0" onload="loaded=true;">
<br><? include("../fehler.inc.php"); ?>
<script>
function doChange()
{
document.forms[0].submit();
}
</script>	
<?
}


function page_footer()
{
	return <<<FOOTER
</BODY>
</HTML>	
FOOTER;
}

function print_footer()
{
	echo page_footer();
}

function std_button($text, $action)
{
	global $strSkinName;
	
	return <<<BUTTON_CODE
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><input type=image border=0 src="$strSkinName/pics/buttons/bt_img_left.gif" onclick="$action; return false"></td>
<td background="$strSkinName/pics/buttons/bt_img_middle.jpg"><a href="$action" class="button-1">$text</a></td>
<td><input type=image border=0 src="$strSkinName/pics/buttons/bt_changepass.gif" onclick="$action; return false"></td>
</tr>
</table>
BUTTON_CODE;
}

function std_button_url($text, $url)
{
	global $strSkinName;
	
	return <<<BUTTON_CODE
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><input type=image border=0 src="$strSkinName/pics/buttons/bt_img_left.gif" href="$url"></td>
<td background="$strSkinName/pics/buttons/bt_img_middle.jpg"><a href="$url" class="button-1">$text</a></td>
<td><input type=image border=0 src="$strSkinName/pics/buttons/bt_changepass.gif" href="$url"></td>
</tr>
</table>
BUTTON_CODE;
}

function js_f_confirm($quest, $action = 'return false;') {
	$quoted_str = addslashes($quest);
	$quoted_str = js_message($quoted_str);
	$quoted_str = str_replace("\n", '\n', $quoted_str);
	$quoted_str = str_replace("\t", '\t', $quoted_str);
	
	return <<<JS_CONFIRM_CODE
	if (!confirm("$quoted_str")) {
		$action
	}\n
JS_CONFIRM_CODE;
}

function js_f_goto($url) {
	return <<<JS_GOTO_CODE
		document.location = "$url";\n
JS_GOTO_CODE;
}

function js_f_call_help($head_key, $text_key) {
	global $confixx_interface_version;
	if ($confixx_interface_version == 'xp30') {
		return <<<JS_HELP_CODE
if (parent.helpFrame) 
	parent.helpFrame.location.href= 'ver_xp30_frame_help.php?help_head_key=$head_key&help_text_key=$text_key';			
JS_HELP_CODE;
	} 
	return <<<JS_HELP_CODE2
if(parent.Help)
	parent.Help.location.href = 'help2.php?text1=$head_key&text2=$text_key';
JS_HELP_CODE2;
	
}

function js_message($text) {
    $trans_tbl = get_html_translation_table (HTML_ENTITIES);
    $trans_tbl = array_flip ($trans_tbl);
    return strtr ($text, $trans_tbl);
}

function js_alert($text) {
	return "alert('".js_message($text)."')";
}

function js_confirm($text) {
	return "confirm('".js_message($text)."')";
}
?>
