
function getListMenu(id){
  var e = document.getElementById(id);
	if(e){
		var a = new Array();
		a.push('<ul>');
		a = a.concat(DOMToString(e));
		a.push('</ul>');
		//e.style.display = 'none';
		//return encodeURI(a.join('').removeLineBreaks().replace('&', 'and'));
		return encodeURI(a.join('').removeLineBreaks());
	}
}
 
function DOMToString(node){
 var a = new Array();
 var n = node.childNodes;
 var l = n.length;
 var nn;
 for(var i=0; i<l; i++){
  if(n[i].nodeType == 1){
   nn = n[i].nodeName.toLowerCase();
   a.push('<'); a.push(nn);
   if(nn == 'a'){
     if(n[i].getAttribute('href')){ a.push(' '); a.push('href="'); a.push(n[i].getAttribute('href')); a.push('"'); }
     if(n[i].getAttribute('target')){ a.push(' '); a.push('target="'); a.push(n[i].getAttribute('target')); a.push('"'); }
   }
   a.push('>');
   if(n[i].hasChildNodes) a = a.concat(DOMToString(n[i]));
   a.push('</'); a.push(nn); a.push('>');
  }else
   a.push(n[i].nodeValue.trim());
 }
 return a;
}


function getInnerText(id){
	var obj = document.getElementById(id);
	return (obj) ? obj.innerHTML.stripTags() : '';
}

function getHomepageXML(id){
	var e = document.getElementById(id);
	if(e){
		out = innerXHTML(id);
		return out;
		
	}
}

var menuDropDownEnabled = "false";
function setMovieArea(expanded, status){
	//alert("setMovieArea " + expanded);
	menuDropDownEnabled = expanded;
	var obj = document.getElementById('flash_menu');
	//var obj2 = document.getElementById('topmenu');
	if(obj){
		var h = "33px";
		if (expanded == "true" || expanded == true){
			h = "500px";
		}
		obj.style.height = h;
		//if (obj2) obj2.style.height = h;
		
		//alert("obj.style.height:" + obj.style.height);
	}
}

function setStatus(status){
  window.status = status;
}

String.prototype.stripTags = function() { return this.replace(/<\/?[^>]+>/gi, ''); }
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); }
String.prototype.removeLineBreaks = function() { return this.replace(/\n/g, ' '); }



function getHomepageXMLFromFlash(){
	//alert('getHomepageXMLFromFlash:');
	//alert("getHomepageXML:" + getHomepageXML);
	//var out = getHomepageXML('flash_homepage_xml');
	var id = "flash_homepage_xml";
	//alert("document:"+ document);
	var e = document.getElementById(id);
	//alert("test");
	alert("e: " + document.getElementById(id));
	
	if(e){
		trace("e:" + e);
		//out = e.innerHTML;
		out = innerXHTML(id);
		}
	alert("out2:" + out);
	alert("innerXHTML:"+ innerXHTML);
	return out;
}

function openURL( url, target )
{
	try
	{
		var popup = window.open( url, target );
		if ( popup == null )
			return false;

		if ( window.opera )

			if (!popup.opera)

				return false;

	}

	catch(err)

	{

		return false;

	}

	return true;

}

