
document.write("<script type='text/javascript' src='../js/prototype-1.6.0.3.js'></script>");
function load(url, id) {
	new Ajax.Request(url, {method:"get", onSuccess:function (req) {
		$(id).innerHTML = req.responseText;
	}});
}
function changeChart(cid) {
	var c = $(cid);
	if (c.style.display === "block") {
		c.style.display = "none";
	} else {
		c.style.display = "block";
	}
}
function changeValidator(url) {
	var value = new Date().getTime();
	$("imgVcode").src = url + "?" + value;
}
function validateForm(txt, id) {
	var falg = true;
	if ((typeof XMLHttpRequest) != "undefined") {
		xmlHttpRequest = new XMLHttpRequest();
	} else {
		xmlHttpRequest = new ActiveXObject("Microsoft.XMLHttp");
	}
	var url = "ajaxvalidate.do?option=" + txt + "&element=" + encodeURIComponent($F(txt));
	xmlHttpRequest.open("GET", url, true);
	xmlHttpRequest.onreadystatechange = function () {
		if (xmlHttpRequest.readyState == 4) {
			var v = xmlHttpRequest.responseText;
			if (v == "1") {
				$(id).src = "../images/check_right.gif";
				return true;
			} else {
				$(id).src = "../images/check_error.gif";
				return false;
			}
		} else {
			$(id).src = "../images/loading.gif";
		}
	};
	xmlHttpRequest.send(null);
	return flag;
}
function check(id, cid) {
	if ($F(id) === "") {
		$(cid).src = "../images/check_error.gif";
		return false;
	} else {
		$(cid).src = "../images/check_right.gif";
		return true;
	}
}
function checkAll() {
	var a = $("im2").src.indexOf("check_right");
	var b = $("im1").src.indexOf("check_right");
	var c = $("checkname").src.indexOf("check_right");
	var d = $("checkcompany").src.indexOf("check_right");
	if (a === -1 || b === -1 || c === -1 || d === -1) {
		return false;
	} else {
		return true;
	}
}
function sendRequest(url) {
	new Ajax.Request(url, {method:"get", asynchronous:false, onSuccess:function (req) {
		html = req.responseText;
	}});
	return html;
}
function pdetailout(id) {
	$(id).innerHTML = "";
}
function pdetailover(id) {
	$(id).innerHTML = "click to inquire in shopping cart!";
}
function checkCommont(txt) {
	if ((typeof XMLHttpRequest) != "undefined") {
		xmlHttpRequest = new XMLHttpRequest();
	} else {
		xmlHttpRequest = new ActiveXObject("Microsoft.XMLHttp");
	}
	var url = "ajaxvalidate.do?option=" + txt + "&element=" + encodeURIComponent($F(txt));
	xmlHttpRequest.open("GET", url, true);
	xmlHttpRequest.onreadystatechange = function () {
		if (xmlHttpRequest.readyState == 4) {
			var v = xmlHttpRequest.responseText;
			if (v == "1") {
				$("check_comment").src = "../images/check_right.gif";
				$("submit_commont").style.display = "block";
			} else {
				$("check_comment").src = "../images/check_error.gif";
				$("submit_commont").style.display = "none";
			}
		} else {
			$(id).src = "../images/loading.gif";
		}
	};
	xmlHttpRequest.send(null);
}
function checkComment1(obj) {
	if (obj.value === "") {
		obj.value = "please input the contents here... ...";
	}
}
function checkComment2(obj) {
	if (obj.value == "please input the contents here... ...") {
		obj.value = "";
	}
}
function checkAllCommonts(url,id){
	if ($('commentContent').value === ""||$('commentContent').value == "please input the contents here... ...") {
		$('cccc').innerHTML="* please input the content of the commonts";
	}else if($('check_comment').src.indexOf('error')>=0){
		$('cccc').innerHTML="*the Verification Code error!";
	}else if($('check_comment').src.indexOf('gray')>=0){
		$('cccc').innerHTML="* please input the content of the check code";
	}else{
		$('cccc').innerHTML=" ";
		new Ajax.Request(url, {method:"get", onSuccess:function (req) {
			$(id).innerHTML = req.responseText;
	}});
	}
}

function getrows(obj){
	var a = $F(obj).split('\n');
	var rows = a.length;
	for(var i = 0; i < a.length;i++){
		var s = a[i].length;
		var le =  Math.ceil(s/40);
		if(le > 1) {
			rows += le - 1;
		}
		else
			rows = rows;
	}
	if(rows > 2)
		$(obj).rows = rows + 1;
	else
		$(obj).rows = 2;
}
function addrows(obj){
	var a = $F(obj).split('\n');
	var rows = a.length;
	for(var i = 0; i < a.length;i++){
		var s = a[i].length;
		var le =  Math.ceil(s/40);
		if(le > 1) {
			rows += le - 1;
		}
		else
			rows = rows;
	}
	if(rows<3)
		$(obj).rows=3;
	else
		$(obj).rows=rows + 1;
}