<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>Website</title>
	<script type="text/javascript">
		function change_style(div) {
			alert(div.innerHTML);
		}
	</script>
	<style>
		<?php
		
		$tpl_file		= '../template/template_v1.htm';
		$tpl			= new DOMDocument();
		$tpl			->loadHTMLFile($tpl_file);
		$tpl_root		= $tpl->documentElement;
		
		$layout_file		= '../.xml/page.css.xml';
		$layout				= new DOMDocument();
		$layout				->load($layout_file);
		$layout_root		= $layout->documentElement;
		
		// Style von HTML
		echo 'html{';
		$node = $layout_root -> getElementsByTagName ( 'html' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von Body
		echo 'body{';
		$node = $layout_root -> getElementsByTagName ( 'body' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von Top
		$node = $layout_root -> getElementsByTagName ( 'top' ) -> item ( 0 ) -> firstChild;
		echo '#top{';
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von Top_Left
		echo '#top_left{';
		$node = $layout_root -> getElementsByTagName ( 'top_left' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von Top_Right
		echo '#top_right{';
		$node = $layout_root -> getElementsByTagName ( 'top_right' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von Top_Right ul
		echo '#top_right ul{';
		$node = $layout_root -> getElementsByTagName ( 'top_right-ul' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von Top_Right li
		echo '#top_right li{';
		$node = $layout_root -> getElementsByTagName ( 'top_right-li' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von Top_Right li.active
		echo '#top_right li.active{';
		$node = $layout_root -> getElementsByTagName ( 'top_right-li.active' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von Top_Right li:hover
		echo '#top_right li:hover{';
		$node = $layout_root -> getElementsByTagName ( 'top_right-li.hover' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von Header
		echo '#header{';
		$node = $layout_root -> getElementsByTagName ( 'header' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von header img
		echo '#header img{';
		$node = $layout_root -> getElementsByTagName ( 'header-img' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von header_top_left
		echo '#header_top_left{';
		$node = $layout_root -> getElementsByTagName ( 'header_top_left' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von header_top_right
		echo '#header_top_right{';
		$node = $layout_root -> getElementsByTagName ( 'header_top_right' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von header_bottom_left
		echo '#header_bottom_left{';
		$node = $layout_root -> getElementsByTagName ( 'header_bottom_left' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von header_bottom_right
		echo '#header_bottom_right{';
		$node = $layout_root -> getElementsByTagName ( 'header_bottom_right' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von navi_top
		echo '#navi_top{';
		$node = $layout_root -> getElementsByTagName ( 'navi_top' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von navi_top_left
		echo '#navi_top_left{';
		$node = $layout_root -> getElementsByTagName ( 'navi_top_left' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von navi_top_right
		echo '#navi_top_right{';
		$node = $layout_root -> getElementsByTagName ( 'navi_top_right' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von frame
		echo '#frame{';
		$node = $layout_root -> getElementsByTagName ( 'frame' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von footer
		echo '#footer{';
		$node = $layout_root -> getElementsByTagName ( 'footer' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von footer_rist
		echo '#footer_rist{';
		$node = $layout_root -> getElementsByTagName ( 'footer_rist' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		// Style von footer_rist a
		echo '#footer_rist a{';
		$node = $layout_root -> getElementsByTagName ( 'footer_rist-a' ) -> item ( 0 ) -> firstChild;
		echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
		while ( $node = $node->nextSibling )
			{
				echo $node->nodeName . ':' . $node->getAttribute('value') . ';';
			}
		echo "}\n";
		?>
	</style>
</head>
<?php
$site_for_output = $tpl->saveHTML();
echo $site_for_output;