function changeWindows() {
	window.location.href = getFileName(window.location.href);
}

function getFileName(frameFile) {
	var lastSlash = frameFile.lastIndexOf("/");
	var fullPath = frameFile.substring(0, lastSlash+1);
	var fileName = unescape(frameFile.substring(lastSlash+1));
	var fileUS = fileName.lastIndexOf("_");
	var cLang = fileName.charAt(fileUS+1);

	fileName = cLang == 'e'
		? substLast(fileName, '_e.', '_f.')
		: substLast(fileName, '_f.', '_e.');
	fileName = fullPath + fileName;
	return relocateUrl == ''
		? fileName
		: relocateUrl;
}

function substLast(aString, c1, c2) {
	if (aString == "") return aString;

	var i = aString.lastIndexOf(c1);
	if (i < 0) return aString;

	var s1 = aString.substring(0, i);
	var s2 = aString.substring(i+c1.length, aString.length);
	return s1+c2+s2;
}
		
function redmenuOver(tdID, tdClass) {
	var prop = document.getElementById(tdID);
	prop.className = prop.className == 'redmenuMainLevel'
		? 'redmenuMainSelect'
		: 'redmenuSubSelect';
	return false;
}

function redmenuOut(tdID, tdClass) {
	prop = document.getElementById(tdID);
	prop.className = prop.className == 'redmenuMainSelect'
		? 'redmenuMainLevel'
		: 'redmenuSubLevel';
	return false;
}

function setMenuBackground() {
	if ( document.all && !window.opera ) {
		var num = [ '01', '02', '03', '04', '05',  '06',  '07',  '08',  '09',  '10',  '11',  '12',  '13',  '14',  '15',  '16',  '17',  '18',  '19',  '20',  '21',  '22',  '23',  '24',  '25', '26' ];
		var pos = window.location.href.match(/_e\./)
			? [ '0', '23', '46', '69', '85', '100', '115', '137', '175', '198', '221', '237', '280', '295', '310', '325', '347', '377', '392', '407', '429', '459', '502', '517', '539', '569' ]
			: [ '0', '23', '46', '69', '85', '100', '115', '137', '175', '213', '236', '252', '281', '296', '311', '326', '348', '378', '393', '408', '430', '460', '502', '517', '532', '554' ];
		for ( var i = 0; i < num.length; i++ ) {
			document.getElementById('mn' + num[i])
				? document.getElementById('mn' + num[i]).style.backgroundPosition = '0px -' + pos[i] + 'px'
				: null;
		}
	}
}

function printIt() {
	if (window.print) {
   	window.print();
}else{
	alert('Press "CTRL-P" to print this page');
}
}
//v1
//function eservSubmit(){
//alert();
//	showform.style.display = "none";
//	showupload.style.display = "block";
	//alert(showupload.style.display);
//}
//v2
//function eservSubmit(){
		//x = 'test';
		//alert(x);
		//elem = document.getElementById("showform");
		//elem.style.display = "none";
		//elem = document.getElementById("showupload");
		//elem.style.display = "block";
	//}
	function eservSubmit(){
		//x = 'test';
		//alert(x);
		elem = document.getElementById("showform");
		if (elem != null) {
		    elem.style.display = "none";
		}
		elem = document.getElementById("showupload");
		if (elem != null) {
		    elem.style.display = "block";		    
		}
}

