//Javascript Function


function viewDoc(content) {

	$('contenutiterliv').innerHTML = content;
}

function reprise() {
	$('contenutiterliv').innerHTML = oldHTML;	
}

function setHeight(html) {
	/*
	var integ = 1430;				
	var length = html.length;
	var newLen = 350;	
	if (length/integ > 1)			
		newLen = 350 * (length/integ);	
		
	var boxterHeig = $('boxterliv').style.height;
	//alert(boxterHeig);
	if (boxterHeig < newLen)		
		$('boxterliv').style.height = newLen+"px";	
		*/
}

function startUp(path) {
	
	if (path != '') {
		initStartUp(path);		
	} else {
		
		
	new Ajax.Request(
		"index",
		{
			method: 'post',
			parameters: "command=checkLan",
			onSuccess: function(res) {
				var respT = res.responseText;
				//alert(respT);
				if (respT == "done") {				
					initStartUp();
					loadFooter();
				}
			}
		
		}
	);
	}

}

function encodeUtf(string) {
    string = string.replace(/\r\n/g,"\n");
    var utftext = "";

    for (var n = 0; n < string.length; n++) {

        var c = string.charCodeAt(n);

        if (c < 128) {
            utftext += String.fromCharCode(c);
        }
        else if((c > 127) && (c < 2048)) {
             utftext += String.fromCharCode((c >> 6) | 192);
             utftext += String.fromCharCode((c & 63) | 128);
        }
        else {
             utftext += String.fromCharCode((c >> 12) | 224);
             utftext += String.fromCharCode(((c >> 6) & 63) | 128);
             utftext += String.fromCharCode((c & 63) | 128);
        }

     }
	 return utftext;
}
