
<!-- 搜索框更换-->
function idObj(theIdName) {
	return document.getElementById(theIdName);
}
function tyepTturn(arg) {
	document.getElementById("judgeATy").value = arg;
}
function closeothers(thisid) {
	if (thisid.style.display == "") {
		boxhotel.style.display = "none";
		boxplane.style.display = "none";
		boxpkg.style.display = "none";
		thisid.style.display = "";
	} else {
		thisid.style.display = "";
	}
}
//搜索框机酒度切换
function chg_box(num) {
	var div_name = "searchbox" + num;
	for (i = 1; i <= 3; i++) {
		document.getElementById("searchbox" + i).style.display = "none";
	}
	document.getElementById("boxbgpic").className = "title" + num;
	document.getElementById(div_name).style.display = "block";
	if (num == 1) {
		commoncitys = commoncitysHotel;
		citys = citysForHotel;
		document.getElementById("hCity").value = "\u4e2d\u6587/\u62fc\u97f3";
	} else {
		if (num == 2) {
			commoncitys = commoncitysFlight;
			citys = citysFlight;
			document.getElementById("bCity").value = "\u4e2d\u6587/\u62fc\u97f3";
		}
	}
}

//button变换
function change_iframe(obj) {
	var left = obj.parentNode.parentNode.getElementsByTagName("a");
	for (i = 0; i < left.length; i++) {
		if (left[i] == obj) {
			left[i].className = "current";
		} else {
			left[i].className = "";
		}
	}
}


//友情连接
function golink() {
	if (document.yqlink.searchlink.options[document.yqlink.searchlink.selectedIndex].value != "") {
		window.open(document.yqlink.searchlink.options[document.yqlink.searchlink.selectedIndex].value);
	}
}

//站内搜索
function getBytes(chrList) {
	var bytes = [];
	for (var i = 0; i < chrList.length; i++) {
		c = "";
		ch = chrList.charAt(i);
		execScript("c = Hex(Asc(ch))", "vbscript");
		bytes.push(c);
	}
	return bytes;
}
function replaceStr(str) {
	var temp = "";
	bytes = getBytes(str);
	for (var i = 0; i < bytes.length; i++) {
		if (bytes[i] == 20) {
			temp += "+";
		} else {
			temp += "%" + bytes[i].substring(0, 2);
			temp += "%" + bytes[i].substring(2, 4);
		}
	}
	return temp;
}
function searchSubmit(temp) {
	var bytes = [];
	var out = "";
	var str = "";
	var strLength = temp.length;
	for (var i = 0; i < strLength; i++) {
		if (temp.charCodeAt(i) > 255) {
			str = replaceStr(temp.charAt(i));
		} else {
			str = temp.substring(i, i + 1);
		}
		out += str;
	}
	window.location.href = "http://cmssearch.mangocity.com:8080/fly/search.jsp?test=" + out;
}


//button变换
function change_iframe1(obj, cityId) {
	document.cookie = "cityId=" + cityId + "; path=/";
	var left = obj.parentNode.parentNode.getElementsByTagName("a");
	for (i = 0; i < left.length; i++) {
		if (left[i] == obj) {
			left[i].className = "current";
		} else {
			left[i].className = "";
		}
	}
}

//button变换
function change_iframe2(obj, cityId) {
	document.cookie = "cityCode=" + cityId + "; path=/";
	var left = obj.parentNode.parentNode.getElementsByTagName("a");
	for (i = 0; i < left.length; i++) {
		if (left[i] == obj) {
			left[i].className = "current";
		} else {
			left[i].className = "";
		}
	}
}
// 检测登陆会员类型( onLoad="checkbiz();)
var mycookie = document.cookie;
function readcookie(name) {
	var start1 = mycookie.indexOf(name + "=");
	if (start1 == -1) {
		value = "empty";
	} else {
		start = mycookie.indexOf("=", start1) + 1;
		var end = mycookie.indexOf(";", start);
		if (end == -1) {
			end = mycookie.length;
		}
		var value = unescape(mycookie.substring(start, end));
	}
	return value;
}
function isBusiness() {
	var role = readcookie("role");
	if (role == "1" || role == "2" || role == "3" || role == "4") {
		return true;
	} else {
		return false;
	}
}
function checkbiz() {
	if (isBusiness()) {
		window.location.href = "/biz/index.htm";
	} else {
	}
}
function hotelinit() {
	document.cookie = "cityId=PEK; path=/";
	document.cookie = "cityCode=HKG; path=/";
}


