<?
/* check if we can create an xml parser */
if (! ($xmlparser = xml_parser_create()) ){ 
   die ("Cannot create parser");
}

/* declare a global so we can track it */
$current = "";
$menuname = "";


/* if we run into a starting tag execute following */
function start_tag($parser, $name, $attribs) {
	/* retrieve the globals */
	global $current;
	global $menuname;


  	/* fill it with the current name of the tag */
	$current = $name;
	
	/* start running checks and take actions based on them */
	if($current == "MENUITEM"){
   		/* check the attributes */
		if (is_array($attribs)) {
			/* loop through them */
     			while(list($key,$val) = each($attribs)) {
				if($key == "MENUNAME"){
   	 				echo "<a href='#" . $val . "'>" . $val . "</a><br />";
					$menuname = $val;
				}
       			}
   		}

	}

}

/* if we run into the end tag execute following */
function end_tag($parser, $name) {

  // echo "end tag ".$name."<br /><br />";

}


/* if we run into data in between the tags */
function tag_contents($parser, $data) {
	/* retrieve the globals */
	global $current;
	global $menuname;

	if($current == "MENUITEM"){
   		echo "<a name='" . $menuname . "'>" . $data . "</a>";
	}
}

/* set the element handler */
xml_set_element_handler($xmlparser, "start_tag", "end_tag");

/* set the character data handler */
xml_set_character_data_handler($xmlparser, "tag_contents");


?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>OnTarget21 Translation Solutions</title>
	
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="description" content="translations, english, spanish, marcos broc valls, localisation, localization, linguist, website, translate, words, trados, wordfast, rates, translator, traductor, español, traducciones, inglés, localización, barato, cheap, affordable, lingüista, página web, traducir, palabras,
		tarifas, contratar, independiente, freelance, memsource, proz, tm-town, zaragoza, saragossa, manila, quezon city, spain, philippines, uk, london" />


	<script type="text/javascript" src="swfobject.js"></script>
	<script type="text/javascript" src="swfaddress.js"></script>
	<script type="text/javascript">
		var flashvars = {
		}

        	var params = {  
               		menu: "false",
                	allowfullscreen: "true",
                	scale: "noscale",
                	quality: "best"
       	 	};
		
		swfobject.embedSWF("site2009.swf", "index", "100%", "100%", "9.0.0", "expressInstall.swf",  flashvars, params, {id: 'index'});
	</script>

	<style type="text/css" media="screen">  
		html, body, #containerA, #containerB {height:100%;}  
		body 	{margin:0; padding:0; overflow:hidden;}
	</style>

	<style type="text/css">
        	body 	{height: 100%; margin: 0; padding: 0; background-color: #ffffff; font-family:Verdana; font-size:9pt;}
		div.c1 	{font-family:Verdana; font-size:9pt; font-color:#333333; text-align: center}
		div.c2 	{text-align: left; margin: 4px; padding: 4px;}
		h5	{display: block;}
		p	{display: inline;}
	</style>



</head>
<body>


<div id="index">
	<div class="c1"><strong>You either need a new version of FlashPlayer, or you need to enable JavaScript to view this page!</strong></div>
	<div class="c1">If you do have the correct settings, but still not see this page, click <a href="index.php?detectflash=false">here</a>.</div>
	<br />
	<br />
	<div class="c2"><p>
		<?php
		$filename = "xml/siteContent.xml";

		if (!($fp = fopen($filename, "r"))) { 
			die("cannot open ".$filename); 
		}

		while ($data = fread($fp, 4096)){

   			$data=eregi_replace(">"."[[:space:]]+"."<","><",$data);

   			if (!xml_parse($xmlparser, $data, feof($fp))) {
     			 	$reason = xml_error_string(xml_get_error_code($xmlparser));
     			 	$reason .= xml_get_current_line_number($xmlparser);
    			  	die($reason);
  			}
		}

		xml_parser_free($xmlparser);

		?>	</p></div>

</div>
</body>
</html>