// JavaScript Document
var ov_ser = null
function search_tab(name,value,keyword_value){
	if(ov_ser != null){
		ov_ser.className = 'px_12';
		name.className = 'search_tab_text';
		document.getElementById('key_word').value = keyword_value;
	}else{
		name.className = "search_tab_text";
		document.getElementById('key_word').value = keyword_value;
	}
	ov_ser = name;
	document.getElementById('search_class').value = value;
}
var ov_cpcom = null;
function cpcom_cs(name){
	if(ov_cpcom != null){
		ov_cpcom.className = 'cpcom_b';
		name.className = 'cpcom_c';
	}else{
		name.className = 'cpcom_c';	
	}
	ov_cpcom = name;
}
function open_url(uid){
	open('http://www.ywpjw.com/message.html?uid='+uid,uid,'width=550,height=540,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no');
}
function ordering(pid){
	open("./ordering.php?pid="+pid);
}
function chang_img(dimg,simg,url){
	document.getElementById(dimg).src = simg;
	document.getElementById('url_img').href = url;
}
function close_div(name){
	document.getElementById(name).style.display = 'none';
}
function show_div(name,t_uid,p_id){
	document.getElementById(name).style.display = '';
	document.getElementById(name).style.top = document.body.scrollTop+100;
	document.getElementById('tuid').value = t_uid;
	document.getElementById('pid').value = p_id;

}
/*
name:Cookie的名称
value:Cookie的值
expiration:生存期以分钟为单位
domain:Cookie的作用域
path:Cookie的作用路径
secure:Cookie的安全选项
*/
function set_cookie(name,value,expiration,path,domain,secure){
		var live_time = new Date((new Date).getTime()+expiration*60000);
		document.cookie = name+"="+value+";expires ="+live_time.toGMTString()+";path="+path+";_domain="+domain+";"+secure
}
function get_cookie(cookieName){
		var cookieString = document.cookie;
		var start = cookieString.indexOf(cookieName + '=');
		// 加上等号的原因是避免在某些 Cookie 的值里有
		// 与 cookieName 一样的字符串。
		if (start == -1) // 找不到
		return null;
		start += cookieName.length + 1;
		var end = cookieString.indexOf(';', start);
		if (end == -1) return cookieString.substring(start);
		return cookieString.substring(start, end);
}