
function jumpHttp(page) {
	location.href = changeProtocol("http", page);
}

function jumpHttps(page) {
	location.href = changeProtocol("https", page);
}

function toHttp(page) {
	return changeProtocol("http", page);
}

function toHttps(page) {
	return changeProtocol("https", page);
}

function changeProtocol(protocol, page) {
	var strUrl;
	strUrl = document.URL;

	var pathInfo = new Array();
	var pageInfo = new Array();
	pathInfo = strUrl.split('/');
	pageInfo = page.split('/');

	var changeUrl = "";
	var currentLevel = pathInfo.length;
	var count = 0;
	
	for (i = 0; i < pageInfo.length - 1; i++) {
		if (pageInfo[i] == "") {
			currentLevel = 0;
			break;
		}else if  (pageInfo[i] == ".")  {
			//
		}else if  (pageInfo[i] == "..")  {
			currentLevel--;
		}else {
			break;
		}
		count = i + 1;
	}
	changeUrl = protocol + "://" + pathInfo[2] + "/";
	for (i = 3; i < currentLevel - 1; i++) {
		changeUrl += pathInfo[i] + '/';
	}
	for (i = count; i < pageInfo.length - 1; i++) {
		changeUrl += pageInfo[i] + '/';
	}
	changeUrl += pageInfo[pageInfo.length - 1];

	return changeUrl;
}

function submitForm(buttonid) {
	var obj = document.getElementById(buttonid);
	if (obj.tagName == "A") {
		obj.removeAttribute('href');
	}else if (obj.tagName == "INPUT") {
		obj.disabled = true;
	}
	submitForm = disableSubmit;
	document.form1.submit();
}
function disableSubmit() {

}
