//0.3

function String2ASCII(strStr) {
			
		var tmpReturnData = "";
	
		for (var i = 0; i < strStr.length; i++) {
		
			if (i != strStr.length - 1) {
				tmpReturnData = tmpReturnData + strStr.charCodeAt(i) + ",";
			}else{
				tmpReturnData = tmpReturnData + strStr.charCodeAt(i);
			}
		
		}
		
		return tmpReturnData;
	}
	
	
function ASCII2String(strASCII) {

	var tmpReturnData = ""; 
	var reg=new RegExp("[,]+", "g");
	var arrStr = strASCII.split(reg); 
	
	for (var i = 0; i < arrStr.length; i++) {
	
		tmpReturnData = tmpReturnData + String.fromCharCode(arrStr[i]);
	
	}
	
	return tmpReturnData;
	
}


if (window.XMLHttpRequest) {
	
	if (navigator.appName.indexOf("Microsoft")!=-1) {
		isIE = true;
	 }else{
		isIE = false;
	 }
// IE 7, mozilla, safari, opera 9
} else {
// IE6, older browsers
	if (navigator.appName.indexOf("Microsoft")!=-1) {
		isIE = true;
	 }else{
		isIE = false;
	 }
}


function AlignXCenter(objName){
				
	var winW = 630, winH = 460;
	
	if (window.XMLHttpRequest) {
	
		if (navigator.appName.indexOf("Microsoft")!=-1) {
		  winW = document.body.offsetWidth;
		  winH = document.body.offsetHeight;
		 }else{
		  winW = window.innerWidth;
		  winH = window.innerHeight;
		 }
	// IE 7, mozilla, safari, opera 9
	} else {
	// IE6, older browsers
		if (navigator.appName.indexOf("Microsoft")!=-1) {
		  winW = document.body.offsetWidth;
		  winH = document.body.offsetHeight;
		 }else{
		  winW = window.innerWidth;
		  winH = window.innerHeight;
		 }
	}
	
	
	var objW = document.getElementById(objName).offsetWidth;
	
	if (navigator.appName.indexOf("Microsoft")!=-1) {
		var intDifference = (winW /2) - (objW / 2) -10;
	}else{
		var intDifference = (winW /2) - (objW / 2) -9;
	}
	
	if (intDifference < 0) { intDifference = 0; }
	
	document.getElementById(objName).style.left = intDifference;
	
	
	if (objName == 'MainFrame') {
		document.getElementById('MainFrame').style.visibility = "visible";
		document.getElementById('pathbar2').style.visibility = "visible";
	}
	
}


function AlignFrames() {
	document.getElementById('MainFrame').style.visibility = "hidden";
	AlignXCenter('AjaxLoading');
	AlignXCenter('MainFrame');
	

}

function ChangePathBar(SecondArrow, SecondName, ThirdArrow, ThirdName){
	//if (SecondArrow == true) {
	//	document.getElementById('arrowFirst').style.visibility = "visible";
	//}else{
//		document.getElementById('arrowFirst').style.visibility = "hidden";
	//}
	
	//if (ThirdArrow == true) {
	//	document.getElementById('arrowSecond').style.visibility = "visible";
	//}else{
	//	document.getElementById('arrowSecond').style.visibility = "hidden";
	//}
	
	document.getElementById('pathSecond').innerHTML = SecondName;
	if (ThirdName != "") {
	document.getElementById('pathThird').innerHTML = "> " + ThirdName;
	}else{
	document.getElementById('pathThird').innerHTML = ThirdName;
	}
}


function ChangePicture(objName, Picture) {
	document.getElementById(objName).src = Picture;
}

function DisplayAjaxLoading(top, left, show) {
	
	document.getElementById('AjaxLoading').style.top = top; 
	document.getElementById('AjaxLoading').style.left = left;
	 
	if (show == true) {
		document.getElementById('AjaxLoading').style.visibility = "visible";
	}else{
		document.getElementById('AjaxLoading').style.visibility = "hidden";
	}
	
}