﻿//调用方法              onkeypress="onlyNumber(event)"
//用户电话格式焦点设置
function telfocus(value, var1) {
	if (value.length == 3) {

		if (var1 == 1) {
			$("usphone2").focus();

		}
		if (var1 == 2) {
			$("usphone3").focus();

		}
	}
}
function onlyNumber(e) {
	var isIE = false;
	var isFF = false;
	var isSa = false;

	if ((navigator.userAgent.indexOf("MSIE") > 0) && (parseInt(navigator.appVersion) >= 4)) isIE = true;
	if (navigator.userAgent.indexOf("Firefox") > 0) isFF = true;
	if (navigator.userAgent.indexOf("Safari") > 0) isSa = true;

	var iKeyCode;
	iKeyCode = window.event ? e.keyCode : e.which;
	if (!(((iKeyCode >= 48) && (iKeyCode <= 57)) || (iKeyCode == 13) || (iKeyCode == 46) || (iKeyCode == 45) || (iKeyCode == 37) || (iKeyCode == 39) || (iKeyCode == 8))) {
		if (isIE) {
			e.returnValue = false;
		}
		else {
			e.preventDefault();
		}
	}

}
//调用方法             onkeypress="money(this.value)"
//钱
function money(str) {
	var nc = event.keyCode;
	var s = str;
	if ((nc >= 48) && (nc <= 57)) {
		if (s.substring(0, 1) == "0" && s.indexOf('.') < 0) {
			event.keyCode = 0;
			return;
		}
		else {

			if (s.indexOf('.') > 0) {
				if (s.indexOf('.') < s.length - 4) {
					event.keyCode = 0; return;
				}
			}
		}
	} else if (nc == 46) {
		if (s.length < 1) {
			event.keyCode = 0; return;
		}
		for (var i = 0; i < s.length; i++) {
			if (s.charAt(i) == '.') {
				event.keyCode = 0; return;
			}
		}
	}
	else {
		event.keyCode = 0; return;
	}
}

function timeStyle(str) {
	var nc = event.keyCode;
	var s = str;
	if ((nc >= 48) && (nc <= 57)) {
		if (s.indexOf('.') > 0) {
			if (s.indexOf('.') < s.length - 2) {
				event.keyCode = 0; return;
			}

		}
	} else if (nc == 46) {
		if (s.length < 1) {
			event.keyCode = 0; return;
		}
		for (var i = 0; i < s.length; i++) {
			if (s.charAt(i) == '.') {
				event.keyCode = 0; return;
			}
		}
	}
	else {
		event.keyCode = 0; return;
	}
}

//禁用字符
function charuse() {
	//alert(event.keyCode);
	if (event.keyCode == 124) {
		event.returnValue = false;
	}
}

//textarea最大长度
function maxtextarea(tb, len) {
	var tbvalue = tb.value;
	if (tbvalue.length >= len) {
		event.returnValue = false;
		alert("Over max words!");
	}
}

//read COOKIE
function getCookie(cookiename) {
	var result;
	var mycookie = document.cookie;
	var start2 = mycookie.indexOf(cookiename + "=");
	if (start2 > -1) {
		start = mycookie.indexOf("=", start2) + 1;
		var end = mycookie.indexOf(";", start);

		if (end == -1) {
			end = mycookie.length;
		}

		result = unescape(mycookie.substring(start, end));
	}

	return result;
}

//write COOKIE
function setCookie(cookiename, cookievalue, hours) {
	var date = new Date();
	date.setTime(date.getTime() + Number(hours) * 3600 * 1000);
	document.cookie = cookiename + "=" + cookievalue + "; path=/;expires = " + date.toGMTString();

}


function changeRate(moneyvalue) {
	return moneyvalue;

	var oldMoney = moneyvalue;
	var newMoney = moneyvalue;
	var rates = getCookie("ratelist");
	var scusrate = cusrate();
	var getwebrates = 1; // getwebrate();
	newMoney = Math.round(Number(moneyvalue) * scusrate * getwebrates * 100) / 100;
	if (rates == null || rates == "") {
		return newMoney;
	}
	var ratearr = rates.split("!");
	if (ratearr.length != 2) {
		return newMoney;
	}
	else {
		if (ratearr[0] == "1") {
			newMoney = Math.round(Number(moneyvalue) * scusrate * getwebrates * 100) / 100;
		}
		if (parseInt(ratearr[0]) > 1) {
			var arr = ratearr[1].split("|");
			var moneyType = arr[1];
			var eurrate = Number(arr[2]);
			newMoney = Math.round(Number(moneyvalue) * (eurrate) * scusrate * getwebrates * 100) / 100;
		}
	}
	return newMoney;
}


//changemoney
function changeRate2(moneyvalue) {

	return moneyvalue;

	var oldMoney = moneyvalue;
	var newMoney = moneyvalue;

	var rates = getCookie("ratelist");

	newMoney = Math.round(Number(moneyvalue) * 100) / 100;

	if (rates == null || rates == "") {
		return newMoney;
	}

	var ratearr = rates.split("!");

	if (ratearr.length != 2) {
		return newMoney;
	}
	else {
		if (ratearr[0] == "1") {
			newMoney = Math.round(Number(moneyvalue) * 100) / 100;
		}
		if (parseInt(ratearr[0]) > 1) {
			var arr = ratearr[1].split("|");

			var moneyType = arr[1];
			var eurrate = Number(arr[2]);


			newMoney = Math.round(Number(moneyvalue) * (eurrate) * 100) / 100;

			if (moneyType == "EUR" || moneyType == "GBP") {
				while (oldMoney < newMoney) {
					newMoney = Math.round(Number(moneyvalue) * (eurrate) * 100) / 100;
				}
			}

			if (moneyType == "AUD" || moneyType == "CAD") {
				while (oldMoney > newMoney) {
					newMoney = Math.round(Number(moneyvalue) * (eurrate) * 100) / 100;
				}
			}
		}
	}
	return newMoney;
}
//change moneytype
function getMoneyType() {
	//var rates = getCookie("ratelist");
	var rates = getCookie("ratelist");
	if (rates == null || rates == "") {
		return "$";
	}
	var ratearr = rates.split("!");

	if (ratearr.length != 2) {
		return "$";
	}
	else {
		var arr = ratearr[1].split("|");

		if (arr[0] == 1) {
			return "$";
		}
		if (arr[0] == 2) {
			return "€";
		}
		if (arr[0] == 3) {
			return "￡";
		}
		if (arr[0] == 4) {
			return "A$";
		}
		if (arr[0] == 5) {
			return "C$";
		}
	}

}

//getorderserial
function getserial() {
	var md = new Date();
	var year = md.getYear();
	year = year.toString();
	year = year.substring(2, 4);

	if (year.length == 1) {
		year = "0" + year;
	}

	var month = md.getMonth() + 1;
	if (month < 10) {
		month = "0" + month;
	}

	var day = md.getDate();
	if (day < 10) {
		day = "0" + day;
	}

	var s = "0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z";
	var arr = s.split(" ");
	var sn4 = "";
	while (sn4.length <= 3) {
		sn4 += arr[Math.round(Math.random() * 100) % 36];
	}
	return year + month + day + sn4;
}

function getserialpot() {
	var md = new Date();
	var year = md.getYear();
	year = year.toString();
	year = year.substring(2, 4);

	if (year.length == 1) {
		year = "0" + year;
	}

	var month = md.getMonth() + 1;
	if (month < 10) {
		month = "0" + month;
	}

	var day = md.getDate();
	if (day < 10) {
		day = "0" + day;
	}

	var s = "0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z";
	var arr = s.split(" ");

	var sn4 = "";
	while (sn4.length <= 3) {
		sn4 += arr[Math.round(Math.random() * 100) % 36];
	}
	return year + month + day + sn4 + "POT";
}
//web language
function getwebrate() {

	try {
		var language = "";

		if (document.all) {
			language = navigator.systemLanguage;
		}
		else {
			language = navigator.language;
		}

		if (language.toLowerCase() == "zh-cn") {
			//return 1.17;
			return 1;
		}
		else {
			return 1;
		}
	}
	catch (err) {
		return 1;
	}
}

//log rate
function cusrate() {
	var uinfo = getCookie("customerinfo");

	var rate = 1;
	try {
		if (uinfo != null) {
			var arr = uinfo.split("|||");
			var r = parseFloat(arr[8]) / 100.0;

			rate = rate - r;
		}
	}
	catch (err) {

	}

	return rate;
}
function getmoneytype2() {
	var tp = getMoneyType();
	var falg = false;

	var result = "USD";

	if (tp == "$") {
		result = "USD";
		falg = true;
	}

	if (tp == "€") {
		result = "EUR";
		falg = true;
	}

	if (tp == "￡") {
		result = "GBP";
		falg = true;
	}
	if (tp == "C$") {
		result = "CAD";
		falg = true;
	}
	if (tp == "A$") {
		result = "AUD";
		falg = true;
	}

	while (falg == false) {
		if (tp == "$") {
			result = "USD";
			falg = true;
		}

		if (tp == "€") {
			result = "EUR";
			falg = true;
		}

		if (tp == "￡") {
			result = "GBP";
			falg = true;
		}
		if (tp == "C$") {
			result = "CAD";
			falg = true;
		}
		if (tp == "A$") {
			result = "AUD";
			falg = true;
		}
	}

	
	return result;
}

//showrep
function showrep() {

	if ($("repddl7") != null) {
		if ($("repddl7") != "undefined") {
			$("repddl").id = "repddl1";
			$("repddl7").id = "repddl";
		}
	}


var url = "ashx/WebisMarter.ashx";


	var myAjax = new Ajax.Request(
                                 url,
                                        {
                                        	method: "get",
                                        	onComplete: showrep_doy
                                        }
                                       );


}
function showrep_doy(xmlhttp) {
	var result = xmlhttp.responseText;

	if (result == "0") {
		$("repddl").id = "repddl7";
		$("repddl1").id = "repddl";
	}

	if ($("rad1").checked == true) {
		$("repddl").style.display = "none";
	}

	if ($("rad2").checked == true) {
		$("repddl").style.display = "";
	}
}
//getuid
function getuid() {
	var uid = 0;

	var uinfo = getCookie("customerinfo");

	if (uinfo != null) {
		var arr = uinfo.split("|||");
		uid = arr[0];
	}

	uid = parseInt(uid);

	if (uid == null || isNaN(uid)) {
		uid = 0;
	}
	uid = parseInt(uid);

	if (isNaN(uid)) {
		uid = 0;
	}
	return uid;
}

//huang hang
function hh() {
	var D = document;
	F(D.body);
	function F(n) {
		var u, r, c, x;
		if (n.nodeType == 3) {
			u = n.data.search(/\S{10}/);
			if (u >= 0) {
				r = n.splitText(u + 10);
				n.parentNode.insertBefore(D.createElement("WBR"), r);
			}
		}
		else if (n.tagName != "STYLE" && n.tagName != "SCRIPT") {
			for (c = 0; x = n.childNodes[c]; ++c) {
				F(x);
			}
		}
	}
}

//
function witerlivechat(xmlhttp) {

	var result = xmlhttp.responseText;

	if (result != null && result.length >= 1) {
		window.open("" + result + "");
	}
}



//livechat
var win;
function openLiveChat() {
	var url = "";
	var myAjax = "";
	if (win == null) {
		url = "/ashx/getOrdercode.ashx";
		myAjax = new Ajax.Request(
                                        url,
                                        {
                                        	method: "get",
                                        	onComplete: getordercodedo
                                        }
                                   );
	}
	else {
		if (win.closed) {
			url = "/ashx/getOrdercode.ashx";
			myAjax = new Ajax.Request(
                                            url,
                                            {
                                            	method: "get",
                                            	onComplete: getordercodedo
                                            }
                                       );
		}
		else {
			win.focus();
		}
	}
}


function getordercodedo(xmlhttp) {
	var ordercode = xmlhttp.responseText;

	if (ordercode != null) {
		win = window.open(ordercode, 'newWindow', 'width=600,height=521,center=yes,alwaysRaised=yes,location=no,menubar=no,resizable=yes,scrollbars=no');
	}
}

//get current url 
function getpagetype() {
	var cpage = window.location.href;
	var arr = cpage.split(".");
	var hz;
	if (arr.length == 0) {
		return "";
	}
	else {
		hz = arr[arr.length - 1].toLowerCase();
	}

	if (hz.indexOf("aspx") > 0) {
		return "aspx";
	}

	if (hz.indexOf("htm") > 0 && hz.indexOf("html") < 0) {
		return "htm";
	}

	if (hz.indexOf("html") > 0) {
		return "html";
	}
}
//open complaint page
function opencp() {
	var curl = "customer_complaint" + "." + getpagetype();
	curl = "customer_complaint.html"
	window.open(curl, "_self")
}

//customer points
function upoints() {
	var jifen = 0;

	var url = "/ashx/jifen.ashx?cid=" + getuid();

	var myAjax = new Ajax.Request(
                                        url,
                                        {
                                        	method: "get",
                                        	onComplete: getponitsdo0
                                        }
                                   );
}

function getponitsdo0(xmlhttp) {
	var jifen = xmlhttp.responseText;

	$("spjifen").innerHTML = jifen;

	if ($("spjifen2") != null) {
		$("spjifen2").innerHTML = jifen;
	}
}

//ws 2
function ws2(sz) {
	return Math.round(parseFloat(sz) * 100) / 100;
}

//jude login
function islogin() {
	if (getuid() == 0) {
		window.location.href = "index.html";
	}
}


//jude login
function checklogin() {
	if (getuid() == 0) {
		if ($("checklogin") != null) {
			$("checklogin").style.display = "";
			$("spbody").style.display = "none";
			if ($("k2serverlist") != null) {
				$("k2serverlist").style.display = "none";
			}
		}
	} else {
		if ($("checklogin") != null) {
			$("checklogin").style.display = "none";
			$("spbody").style.display = "";
			if ($("k2serverlist") != null) {
				$("k2serverlist").style.display = "";
			}
		}
	}
}


function ontop(obj) {
	for (var i = 1; i < 10; i++) {
		$("id" + i).className = "m" + i;
	}
	$("id" + obj).className = "m" + obj + "0";
}

function offTop(obj) {
	$("ap" + obj).className = "off" + i;
}

//get pagevisit

//getuid
function getpid() {
	var pid = 0;

	var pid = getCookie("pid");

	if (pid == null) {
		pid = "0";
	}

	if (isNaN(pid)) {
		pid = 0;
	}
	return pid;
}

function GetRequest() {
	var url = location.search; //获取url中"?"符后的字串   
	var strss = "?";
	if (url.indexOf("?") != -1) {
		var str = url.substr(1);
		strs = str.split("&");
		for (var i = 0; i < strs.length; i++) {
			strss += strs[i].split("=")[0] + "=" + strs[i].split("=")[1] + "&";
		}
	}
	if (strss == "?") {
		strss = "";
	}
	return strss;
}

function setvisit() {
	var pid = getpid();
	var uid = getuid();
	var refurl = document.referrer + GetRequest();
	var cururl = document.URL;

	if (refurl == null) {
		refurl = "";
	}

	var url = "ashx/visit.ashx?pid=" + pid + "&uid=" + uid + "&refurl=" + escape(refurl) + "&cururl=" + escape(cururl);

	var myAjax = new Ajax.Request(
                                    url,
                                    {
                                    	method: "get",
                                    	onComplete: setvisitdo
                                    }
                               );
}

function setvisitdo(xmlhttp) {
	var result = xmlhttp.responseText;
	if (getpid("pid") == 0) {
		setCookie("pid", result, 2.0);
	}
}



//isMarter
function ismarter() {
	var url = "ashx/WebisMarter.ashx";

	var myAjax = new Ajax.Request(
                                        url,
                                        {
                                        	method: "get",
                                        	onComplete: marterdo
                                        }
                                   );
}

function marterdo(xmlhttp) {
	var result = xmlhttp.responseText;
	if (result != null) {
		if ($("trs1") != null && $("trs2") != null && $("trs3") != null) {
			if (result == 0) {
				$("trs1").style.display = "";
			}
			if (result == 1) {
				$("trs2").style.display = "";
				$("trs3").style.display = "";
			}
		}
	}
}





function CPos(x, y) {
	this.x = x;
	this.y = y;
}
//获取控件的位置
function GetObjPos(ATarget) {
	var target = ATarget;
	var pos = new CPos(target.offsetLeft, target.offsetTop);

	var target = target.offsetParent;
	while (target) {
		pos.x += target.offsetLeft;
		pos.y += target.offsetTop;

		target = target.offsetParent
	}

	return pos;
}



function Prompt() {
	if (getCookie("sss") == null) {
		if ($("Right1_DropDownList1") != null) {
			var proc = GetObjPos($("Right1_DropDownList1"));
			$("divPrompt").style.display = "block";
			$("divPrompt").style.position = "absolute";
			$("divPrompt").style.top = (proc.x - 497) + "px";
			$("divPrompt").style.left = (proc.y - 80) + "px";
			$("divPrompt").style.display = "";

		}
	} else {
		if ($("divPrompt") != null) {
			$("divPrompt").style.display = "none";
		}
	}
}

function Cannel() { $("divPrompt").style.display = "none"; }


function dissp() {
	setCookie("sss", "sss", 1);
	$("divPrompt").style.display = "none";
}

//import word
function ExpHtmlToWord() {
	var oWD = new ActiveXObject("Word.Application");
	var oDC = oWD.Documents.Add("", 0, 1);
	var oRange = oDC.Range(0, 1);
	var sel = document.body.createTextRange();

	sel.moveToElementText(nr);
	sel.select();
	sel.execCommand("Copy");
	oRange.Paste();
	oWD.Application.Visible = true;
}

////showrep
//function showrep()
//{
//    if($("rad1").checked == true)
//    {
//        $("repddl").style.display = "none";
//    }
//    
//    if($("rad2").checked == true)
//    {
//        $("repddl").style.display = "";
//    }
//  
//    
//}

//XML构造
function XML() {

	this.TestXml = function (arrr) {
		var count = arrr[0].split("|").length;
		var testArr = arrr[0];
		var valueArr = arrr[1];
		var myXml = "<none>" + "\n";
		for (var i = 0; i < count; i++) {

			myXml += "<" + testArr.split("|")[i] + ">" + valueArr.split("#")[i] + "</" + testArr.split("|")[i] + ">" + "\n";


		}
		myXml += "</none>";
		return myXml;

	}
}

function readusercookielog() {
	ok();
	var result = getCookie("customerinfo");
	var arr;

	if (result != null && result != "") {
		arr = result.split("|||");
		if (arr.length == 11) {
			$("spname").innerHTML = arr[2];
			$("spvip").innerHTML = levelimgs(arr[10], "");
			upoints();
			$("logtb1").style.display = "none";
			$("logtb2").style.display = "";
		}
	}
}

function levelimgs(level, img) {
	var html = "";
	for (var i = 0; i < level; i++) {
		html += "<img src=\"images/thcheap-member-center_03.jpg\" width=\"16\" height=\"16\" />"
	}

	return html;
}
//加载客服列表-------------------------------
function loding_Customer() {
	var url = "ashx/Power_Customer.ashx";

	var myAjax = new Ajax.Request(
                                    url,
                                    {
                                    	method: "get",
                                    	onComplete: customer_add
                                    }
                                );
}
function customer_add(xmlhttp) {
	var result = xmlhttp.responseXML;

	var getserverdll = $("repddl");
	getserverdll.innerHTML = "";
	if (xmlhttp.responseText != "<NewDataSet />") {
		var pricelist = result.getElementsByTagName("ds");
		var op = document.createElement("option");
		op.appendChild(document.createTextNode("Please Choose Customer Rep"));
		getserverdll.appendChild(op);
		for (var i = 0; i < pricelist.length; i++) {
			var op = document.createElement("option");

			var optext = pricelist[i].getElementsByTagName("enName")[0].childNodes[0].nodeValue;
			op.appendChild(document.createTextNode(optext));
			getserverdll.appendChild(op);
		}
	}
}
//清空所有代练下单信息cookie
function power_del_allcookie() {
	setCookie("power_itname", -1);
	setCookie("power_itemprice", -1);
	setCookie("power_time", -1);
	setCookie("power_needgold", -1);
	setCookie("power_gametype", -1);
	setCookie("power_gameid", -1);
	setCookie("power_goldtyoe", -1);
}
//获取登陆ID
function get_uid() {
	var uid = 0;

	var uinfo = getCookie("customerinfo");

	if (uinfo != null) {
		var arr = uinfo.split("|||");
		uid = arr[0];
	}

	uid = parseInt(uid);

	if (uid == null || isNaN(uid)) {
		uid = 0;
	}
	uid = parseInt(uid);

	if (isNaN(uid)) {
		uid = 0;
	}
	return uid;
}

function ok() {
	if (document.addEventListener) {//如果是Firefox   5:   
		document.addEventListener("keypress", fireFoxHandler, true);
	}
	else {
		document.attachEvent("onkeypress", ieHandler);
	}
	function fireFoxHandler(evt) {
		//alert("firefox");
		if (evt.keyCode == 13) {
			login_sumit(); //你的代码  
		}
	}
	function ieHandler(evt) {
		//alert("IE");
		if (evt.keyCode == 13) {
			login_sumit(); //你的代码
		}
	}
}



function codeclass() {
	var code = $F("txtcode");
	if (code == "") {
		alert("Please enter the verification code!");
		return;
	}
	else {
		$("txtcode").readonly = "true";
		if ($("fbtn") != null) {
			$("fbtn").style.display = "none";
		}
		var xml = "<NOED>";
		xml += "<code>" + escape(code) + "</code>";
		xml += "</NOED>";
		var url = "ashx/Sns_Code.ashx?type=getemail";
		var myAjax = new Ajax.Request(
                                        url,
                                        {
                                        	method: "post",
                                        	postBody: xml,
                                        	onComplete: codelook
                                        }
                                    );
	}

}

function codelook(xmlhttp) {
	var result = xmlhttp.responseText;

	if (result == "") {
		alert("Error code, does not exist!");
		$("txtcode").readonly = "false";
		if ($("fbtn") != null) {
			$("fbtn").style.display = "";
		}
		return;
	}
	else {
		$("ondiv").style.display = "none";
		$("indiv").style.display = "";
		var uname = result.split("|||")[0];
		var cEmail = result.split("|||")[1];
		$("uname").innerHTML = uname;
		setCookie("friend", cEmail, 3)
		setCookie("uname", uname, 3)
	}
}

//disp
function numdisp(numdisplay, givenum, num, goldnum, coupongold, lossgold) {
	var chars = numdisplay.match(/[^0-9\.]+/g);
	var number = numdisplay;
	if (chars != null) {
		number = Number(numdisplay.replace(chars, ""));
	}
	if (givenum == null) {
		givenum = 0;
	}

	if (num == null) {
		num = 1;
	}

	if (goldnum == null) {
		goldnum = 0;
	}

	if (coupongold == null) {
		coupongold = 0;
	}

	if (lossgold == null) {
		lossgold = 0;
	}

	givenum = Number(givenum);
	num = Number(num);
	goldnum = Number(goldnum);
	coupongold = Number(coupongold);
	lossgold = Number(lossgold);

	var lv = goldnum / number;

	return ws2((givenum * num + goldnum * num + coupongold + lossgold) / lv) + chars;
}
//获取框架里的服务器
function SetGetIfram(serverid) {
	var serifr = null;
	try {
		if (document.all) {

			var bool = parent.document.frames['ifrm'].document.readyState == 'complete';
			if (bool) {
				serifr = document.frames["ifrm"].document.getElementById(serverid);
			}
		}
		else {

			serifr = document.getElementById("ifrm").contentDocument.getElementById(serverid);

		}
	} catch (err) {
		return null;
	}
	return serifr;
}




//----------------
//通过游戏缩写控制CDK显示
function setgameddl() {
	var gamesort = $F('gameddl');
	var cdkname = $('count').innerHTML;
	var sxp;
	if (gamesort != "") {
		for (var i = 0; i < cdkname; i++) {
			var sp = $('sp' + i);
			var xp = $('xp' + i);
			if (sp != null && xp != null) {
				xp.style.display = "none";
				if (gamesort == sp.innerHTML) {
					xp.style.display = "";
				}
			}
		}
	}
	else {
		for (var j = 0; j < cdkname; j++) {
			sxp = $('xp' + j);
			sxp.style.display = "";
		}
	}
}

//----------------
//通过汇率设置价格
function setrateddl() {
	var ratename = $("rateddl").options[$("rateddl").selectedIndex].text;
	var cdkname = $('count').innerHTML;
	var ratecount = $('rateddl').length;
	for (var i = 0; i < cdkname; i++) {
		var span = $(ratename + i);
		if (span != null) {
			for (var j = 0; j < ratecount; j++) {
				$($("rateddl").options[j].text + i).style.display = "none";
				if (ratename == $("rateddl").options[j].text) {
					$($("rateddl").options[j].text + i).style.display = "";
				}
			}
		}
	}

}


//----------------
//设置CDK数量-,+
function jjValue(inputID, itype) {
	var text = $(inputID);
	var Tvalue = Number(text.value);
	if (itype == "-") {
		if (Tvalue > 1)
			Tvalue = Tvalue - 1;
		text.value = Tvalue;
	}
	else {
		if (Tvalue < 10)
			Tvalue = Tvalue + 1;
		text.value = Tvalue;
	}
}



//---------------
//一般cdk下单获取汇率
function cdkrate() {
    moneytype = getrates();
    var len = $("rateddl").length;
    for (var i = 0; i < len; i++) {
        if ($("rateddl").options[i].text == moneytype) {
            $("rateddl").selectedIndex = i;
        }
    }
    setrateddl();
}


//-------------
//获取汇率信息
function getrates() {
    var rate = getCookie("ratetemp");
    if (rate == null || rate == "") {
        return "USD";
    }
    else {
        return rate;
    }
}
