﻿function DOMgetHTML(el) {
if (el.nodeType == 3) {       // Handle Text nodes
return el.nodeValue;
} else if (el.nodeType == 8) { // Handle Comments correctly
return '<!--' + el.nodeValue + '-->';
} else {
var txt = new Array();
var i=0;
txt[txt.length] = '<' + el.tagName.toLowerCase();   // Start creating tag
if (el.attributes)
{
for (a=0;a<el.attributes.length;a++) {  // Add Attributes
if (el.attributes[a].specified) {     // But only user Specified ones
txt[txt.length] = ' ' + el.attributes[a].nodeName + '="' + el.attributes[a].nodeValue + '"';
}
}
}
if (el.childNodes.length > 0)
{
txt[txt.length] = '>';
while(el.childNodes[i]) {
txt[txt.length] =  DOMgetHTML(el.childNodes[i]);
i++;
}
txt[txt.length] =  '</' + el.tagName.toLowerCase() + '>';
} else {
txt[txt.length] =  '/>';
}
}
return txt.join('');
};
function resizeMenu(height) {
var ref = document.getElementById('menufile');
if(isNaN(height) || height == '' || height < 45) {
	ref.style.height = '45px';
} else {
	ref.style.height = Math.ceil(height) + 'px';
}
};

function showLogin() {
var ref = document.getElementById('supportlogin');
if(!ref) { alert('no ref!'); return false; }
switch(ref.style.display) {
	case 'block' :
		hideLogin();
		break;
	default : 
		t1 = new Tween(ref.style,'right',Tween.regularEaseOut,-400,-50,3,'px');
		ref.style.right = '-400px';
		ref.style.display = 'block';
		setTimeout('t1.start()', 300);
		break;
}
};
function hideLogin() {
	var ref = document.getElementById('supportlogin');
	if(!ref) { return false; }
	t1 = new Tween(ref.style,'right',Tween.regularEaseIn,-50,-400,1,'px');
	t1.onMotionFinished = function() { ref.style.display = 'none'; }
	t1.start();
};