<!--
var xmlHttpv2;
var completeDiv2;
var inputField;
var nameTable;
var nameTableBody;
var key_code;
var recom_s_str;
var recom_str;
var recom_str_num = null;

function promotion1(){
		document.getElementById("pro_show_img").src="http://image.buyfine.net/images/public/pro_3.jpg";
}
function promotion2(){
		document.getElementById("pro_show_img").src="http://image.buyfine.net/images/public/pro_2.jpg";
}
function promotion3(){
		document.getElementById("pro_show_img").src="http://image.buyfine.net/images/public/pro_1.jpg";
}
function promotion4(){
		document.getElementById("pro_show_img").src="http://image.buyfine.net/images/public/pro_2.jpg";
}
function promotion5(){
		document.getElementById("pro_show_img").src="http://image.buyfine.net/images/public/pro_3.jpg";
}
function show_brand_from(){
		document.getElementById("brand_from_show").style.display="block";
	}
function hide_brand_from(){
		document.getElementById("brand_from_show").style.display="none";
	}
function show_search_one(){
		document.getElementById("sort_search_one").style.display="block";
	}
function hide_search_one(){
		document.getElementById("sort_search_one").style.display="none";
	}
function show_search_two(){
		document.getElementById("sort_search_two").style.display="block";
	}
function hide_search_two(){
		document.getElementById("sort_search_two").style.display="none";
	}
function show_search_three(){
		document.getElementById("sort_search_three").style.display="block";
	}
function hide_search_three(){
		document.getElementById("sort_search_three").style.display="none";
	}
function show_search_four(){
		document.getElementById("sort_search_four").style.display="block";
	}
function hide_search_four(){
		document.getElementById("sort_search_four").style.display="none";
	}

function change_count(id){
	var count = document.getElementById("sbincrease"+id).value;
	var per = document.getElementById("per"+id).innerText;
	if(!isNumber(count)||count.length==0||count<=0){
		count = document.getElementById("sbincrease"+id).innerText = "1";
	}
	var per_total = document.getElementById("price"+id).innerText = per*count;
		
}
function buy_amount(){
		if(document.getElementById("buy_amount").value<1){
			document.getElementById("buy_amount").value=1;
			}
	}

function brand_idx_getCookie(Name) 
{
	var search = Name + "=";
	if (document.cookie.length > 0) 
	{
		offset = document.cookie.indexOf(search)
		if (offset != -1) 
		{
			offset += search.length
			end = document.cookie.indexOf(";", offset)
			if (end == -1)
			{
				end = document.cookie.length;
			}
			return unescape(document.cookie.substring(offset, end))
		}
	}
}

function brand_idx_setCookie(name, value, expdate) 
{ 
	document.cookie = name + "=" + escape (value) + "; path=/; expires=";
} 

function category_navi_assign(n, dt, c1, c2, c3, c4)
{
	if(dt == '4')
	{
		if(c1 && c2 && c3 && c4) 
		{
			document.getElementById('selected_ca1_str').innerHTML = ARR_CA_1[c1];
			document.getElementById('selected_ca1_str').title = ARR_CA_1[c1];
			document.getElementById('selected_ca2_str').innerHTML = ARR_CA_2[c1][c2];
			document.getElementById('selected_ca2_str').title = ARR_CA_2[c1][c2];
			document.getElementById('selected_ca3_str').innerHTML = ARR_CA_3[c2][c3];
			document.getElementById('selected_ca3_str').title = ARR_CA_3[c2][c3];
			document.getElementById('selected_ca4_str').innerHTML = ARR_CA_4[c3][c4];
			document.getElementById('selected_ca4_str').title = ARR_CA_4[c3][c4];
			category_navi_selected(n,dt,c1,c2,c3,c4);
		}
		else
		{
			category_navi_null(n);
		}
	}
	else if(dt == '3')
	{
		if(c1 && c2 && c3) 
		{
			document.getElementById('selected_ca1_str').innerHTML = ARR_CA_1[c1];
			document.getElementById('selected_ca1_str').title = ARR_CA_1[c1];
			document.getElementById('selected_ca2_str').innerHTML = ARR_CA_2[c1][c2];
			document.getElementById('selected_ca2_str').title = ARR_CA_2[c1][c2];
			document.getElementById('selected_ca3_str').innerHTML = ARR_CA_3[c2][c3];
			document.getElementById('selected_ca3_str').title = ARR_CA_3[c2][c3];
			category_navi_selected(n,dt,c1,c2,c3,'');
		}
		else
		{
			category_navi_null(n);
		}
	}
	else if(dt == '2')
	{
		if(c1 && c2) 
		{
			document.getElementById('selected_ca1_str').innerHTML = ARR_CA_1[c1];
			document.getElementById('selected_ca1_str').title = ARR_CA_1[c1];
			document.getElementById('selected_ca2_str').innerHTML = ARR_CA_2[c1][c2];
			document.getElementById('selected_ca2_str').title = ARR_CA_2[c1][c2];
			category_navi_selected(n,dt,c1,c2,'','');
		}
		else
		{
			category_navi_null(n);
		}
	}
	else if(dt == '1')
	{
		if(c1) 
		{
			document.getElementById('selected_ca1_str').innerHTML = ARR_CA_1[c1];
			document.getElementById('selected_ca1_str').title = ARR_CA_1[c1];
			category_navi_selected(n,dt,c1,'','','');
		}
		else
		{
			category_navi_null(n);
		}
	}
	else
	{
		category_navi_selected(n,'default','','','','');
	}

}

function category_navi_selected(n, dt, c1, c2, c3, c4)
{
	if(dt=='default' || dt=='1' || dt=='2' || dt=='3' || dt=='4') 
	{
		var sort_search_one_body = document.getElementById('sort_search_one');
		sort_search_one_body.innerHTML = "";
		var anchor;
		for(c1_key in ARR_CA_1)
		{
			anchor = document.createElement("a");
			anchor.href = "/sub_main.html?in=1&n="+n+"&dt=1&c1="+c1_key;
			anchor.innerHTML = ARR_CA_1[c1_key];
			anchor.title = ARR_CA_1[c1_key];
			sort_search_one_body.appendChild(anchor);
		}
	}
	if(dt=='1' || dt=='2' || dt=='3' || dt=='4') 
	{
		var sort_search_two_body = document.getElementById('sort_search_two');
		sort_search_two_body.innerHTML = "";
		var anchor;
		for(c2_key in ARR_CA_2[c1])
		{
			anchor = document.createElement("a");
			anchor.href = "/sub_main.html?in=1&n="+n+"&dt=2&c1="+c1+"&c2="+c2_key;
			anchor.innerHTML = ARR_CA_2[c1][c2_key];
			anchor.title = ARR_CA_2[c1][c2_key];
			sort_search_two_body.appendChild(anchor);
		}
	}
	if(dt=='2' || dt=='3' || dt=='4') 
	{
		var sort_search_three_body = document.getElementById('sort_search_three');
		sort_search_three_body.innerHTML = "";
		var anchor;
		for(c3_key in ARR_CA_3[c2])
		{
			anchor = document.createElement("a");
			anchor.href = "/sub_main.html?in=1&n="+n+"&dt=3&c1="+c1+"&c2="+c2+"&c3="+c3_key;
			anchor.innerHTML = ARR_CA_3[c2][c3_key];
			anchor.title = ARR_CA_3[c2][c3_key];
			sort_search_three_body.appendChild(anchor);
		}
	}
	if(dt=='3' || dt=='4') 
	{
		var sort_search_four_body = document.getElementById('sort_search_four');
		sort_search_four_body.innerHTML = "";
		var anchor;
		for(c4_key in ARR_CA_4[c3])
		{
			anchor = document.createElement("a");
			anchor.href = "/sub_main.html?in=1&n="+n+"&dt=4&c1="+c1+"&c2="+c2+"&c3="+c3+"&c4="+c4_key;
			anchor.innerHTML = ARR_CA_4[c3][c4_key];
			anchor.title = ARR_CA_4[c3][c4_key];
			sort_search_four_body.appendChild(anchor);
		}
	}
}

function category_navi_null(n)
{
	document.getElementById('selected_ca1_str').innerHTML = "产品分类";
	document.getElementById('selected_ca2_str').innerHTML = "大分类";
	document.getElementById('selected_ca3_str').innerHTML = "中分类";
	document.getElementById('selected_ca4_str').innerHTML = "小分类";

	document.getElementById('sort_search_two').innerHTML = "未选类目";
	document.getElementById('sort_search_three').innerHTML = "未选大分类";
	document.getElementById('sort_search_four').innerHTML = "未选中分类";

	category_navi_selected(n,'default','','','','');
}

function top_auth_check(form)
{
	if(!form.email.value)
	{
		alert("请输入电子邮箱!");
		form.email.focus();
		return false;
	}
	if(!form.passwd.value)
	{
		alert("请输入密码!");
		form.passwd.focus();
		return false;
	}
	return true;
}

var movieName = "xmas_snow";

function thisMovie(movieName) {
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[movieName]
  }	else {
    return document[movieName]
  }
}

function FlexInc_v2(f_name,f_value,f_width,f_height)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="'+f_name+'" width="'+f_width+'" height="'+f_height+'" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"><param name="movie" value="'+f_value+'" /> <param name="quality" value="high" BASE="http://www.buyfine.net/" /><param name="allowScriptAccess" value="always" /><embed src="'+f_value+'" quality="high" width="'+f_width+'" height="'+f_height+'" name="'+f_name+'" align="middle" play="true" loop="false" quality="high" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" wmode=transparent BASE="http://www.buyfine.net/"></embed></object>');
}

function FlashInc_v2(f_name,f_value,f_width,f_height,f_align,f_param,f_is_wmode){
	
	var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
	var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
	var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
	var win = "transparent";
	/*
	L (left) R (right) 
	T (top) B (border) 
	or a combination 
	TL - TR - BL – BR 
	*/
	
	if(isIE && isWin && !isOpera)
	{
		document.write('<object id="'+f_name+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="'+f_width+'" height="'+f_height+'">');
		document.write('<param name="movie" value="'+f_value+'" />') ;
		document.write('<param name="quality" value="high"/>');
		document.write('<param name="menu" value="false" />') ;
		if(f_is_wmode==2) document.write('<param name="wmode" value="transparent"|"opaque" />');
		else if(f_is_wmode) document.write('<param name="wmode" value="transparent"/>');
		document.write('<param name="allowScriptAccess" value="always" />');
		document.write('<param name=scale value=noscale> ');
		document.write('<param name="SAlign" VALUE="'+f_align+'">') ;
		document.write('<param name="FlashVars" value="'+f_param+'" />') ;
		document.write('</object>') ;
	}
	else
	{
		document.write('<embed src="'+f_value+'" quality="high" name="'+f_name+'" allowScriptAccess="always" SAlign="'+f_align+'" scale=noscale pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+f_width+'" height="'+f_height+'" FlashVars="'+f_param+'"');
		if(f_is_wmode==2) document.write(' wmode="transparent"|"opaque"');
		else if(f_is_wmode) document.write(' wmode="transparent"');
		document.write('></embed>') ;
	}
}

//search
function top_search_form_check(form)
{
	if(!form.s_word.value)
	{
		alert('请输入搜索关键字');
		form.s_word.focus();
		return false;
	}
}

//search
function top_left_search_form_check(form)
{
	if(!form.s_word.value)
	{
		alert('请输入搜索关键字');
		form.s_word.focus();
		return false;
	}
}


function top_search_move(form, action_loc, s_type_str, t_type_str, s_s_type_str) 
{
	form.s_type.value = s_type_str;
	form.t_type.value = t_type_str;
	form.s_s_type.value = s_s_type_str;
	form.action = action_loc;
	form.submit();
}

function top_authout()
{
	window.top.location.href = "/member/auth_out.html";
}

function top_authlogin()
{
	try{
		window.top.location.href = "/member/auth_login.html?l_type=1&retURL2="+retURL2;
	}catch(e){
		window.top.location.href = "/member/auth_login.html?l_type=1";	
	}
}

function div_z_index_change(z1,z2,div1,div2)
{
	var layerObj1 = document.getElementById(div1);
	var layerObj2 = document.getElementById(div2);

	layerObj1.style.zIndex = z1;
	layerObj2.style.zIndex = z2;
}

function top_navi_bg_over(num)
{
	var open_div = "navi_"+num+"_";
	var close_div = "navi_"+num;

	document.getElementById(open_div).style.display="block"; 
	document.getElementById(close_div).style.display="none"; 
}

function top_navi_bg_out(num)
{
	var open_div = "navi_"+num;
	var close_div = "navi_"+num+"_";

	document.getElementById(open_div).style.display="block"; 
	document.getElementById(close_div).style.display="none"; 
}

function saw_goods_count(num)
{
	document.getElementById("amount_saw_goods").innerHTML = "";
	document.getElementById("amount_saw_goods").innerHTML = num;
}

function reserve_button_sel(reserve)
{
	var reserve_button_id = document.getElementById("id_reserve_button");
	var reserve_div_id = document.getElementById("reserve_iframe");
	var iframe_id = document.getElementById("p_c_r_iframe");
	iframe_id.src = "about:blank";
	var reserve_id_value = document.getElementById("c_r_iframe_id");
	var t_c_p_iframe_id_value = document.getElementById("t_c_p_iframe_id");
	
	var reserve_div_left = parseInt(reserve_button_id.offsetLeft) + 125;
	//var reserve_div_top = parseInt(reserve_button_id.offsetTop) + 5;
	reserve_div_id.style.top = '170px';
	reserve_div_id.style.left = reserve_div_left+"px";
	//reserve_div_id.style.top = reserve_div_top+"px";

	if(reserve_id_value.value=='1')
	{
		reserve_div_id.style.display='block';
		reserve_id_value.value='2';
		t_c_p_iframe_id_value.value='1';
		iframe_id.src = "/shop/reserve_iframe.inc?t=1&reserve="+reserve;
	}
	else if(reserve_id_value.value=='2')
	{
		reserve_div_id.style.display='none';
		reserve_id_value.value='1';
		iframe_id.src = "about:blank";
	}
}

function t_coupon_button_sel()
{
	var button_id = document.getElementById("id_t_a_coupon_button");
	var reserve_div_id = document.getElementById("reserve_iframe");
	var iframe_id = document.getElementById("p_c_r_iframe");
	iframe_id.src = "about:blank";
	var t_c_p_iframe_id_value = document.getElementById("t_c_p_iframe_id");

	var reserve_div_left = parseInt(button_id.offsetLeft) + 125;
	reserve_div_id.style.top = '195px';
	reserve_div_id.style.left = reserve_div_left+"px";

	if(t_c_p_iframe_id_value.value=='1')
	{
		reserve_div_id.style.display='block';
		t_c_p_iframe_id_value.value='2';
		iframe_id.src = "/shop/coupon_iframe_p.inc?init=1";
	}
	else if(t_c_p_iframe_id_value.value=='2')
	{
		reserve_div_id.style.display='none';
		t_c_p_iframe_id_value.value='1';
		iframe_id.src = "about:blank";
	}
}

function t_now_sale_bt()
{
	var loc_root_tb = document.getElementById("loc_root_tb");
	var now_sale_img_left = parseInt(loc_root_tb.offsetLeft) + 680;
	document.getElementById("offers_tips").style.left = now_sale_img_left+"px";
	document.getElementById('offers_tips').style.display='block';
}

function createXMLHttpRequestV2() 
{
	if (window.ActiveXObject)
	{
		xmlHttpv2 = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else if (window.XMLHttpRequest) 
	{
		xmlHttpv2 = new XMLHttpRequest();                
	}
}

document.onclick = function(e)
{
	try{
		initVar();
		completeDiv2.style.visibility='hidden';
	}catch(e){}
}

function initVar()
{
	inputField = document.getElementById("s_word");     
	nameTable = document.getElementById("name_table");
	completeDiv2 = document.getElementById("search_auto_popup");
	nameTableBody = document.getElementById("name_table_body");
}

function hidden_pop()
{
	initVar();
	completeDiv2.style.visibility='hidden';
}

function findNames(e) 
{
	var _event;
	initVar();
	if(inputField.value.length > 2)
	{
		//key_code = _event.keyCode;
		if (window.event) {
			_event = window.event;
			key_code = _event.keyCode;
		} else {
			key_code = e.keyCode;
		}
		
		//alert(key_code);
		completeDiv2.style.visibility='hidden';

		var inputVal = inputField.value;
		var f_inputVal = inputVal.substr(0,1);

		/*
		if(isAlphaNumStr(f_inputVal , false) == false) 
		{
			//영문, 숫자만 가능
			return false;
		}
		*/

		var s_type = document.search_f.s_type.value;
		//var s_type = '1';
		if(s_type=='1')
		{
			//if(key_code==8||(key_code>32&&key_code<41)||(key_code!=21&&key_code<32)||_event.altKey)
			//alert(_event.altKey);
			//if((key_code>32&&key_code<41)||(key_code>20&&key_code<32)||_event.altKey)
			if((key_code>32&&key_code<41)||(key_code>20&&key_code<32))
			{
				arrow_key();
			}
			else
			{
				recom_str_num = null;
				createXMLHttpRequestV2();
				recom_s_str = inputField.value;
				//var url = "/search/auto_form_proc.html?s_type=" + s_type +"&s_word=" + encodeURI(inputField.value);
				var url = "/search/auto_form_proc.html?s_type=" + s_type +"&s_word=" + encodeURIComponent(inputField.value);
				xmlHttpv2.open("GET", url, true);
				xmlHttpv2.onreadystatechange = callback;
				xmlHttpv2.send(null);
			}
		}
		else
		{
			return false;
		}
	} 
	else 
	{
		clearNames();
	}
}

function callback() 
{
	if (xmlHttpv2.readyState == 4) 
	{
		if (xmlHttpv2.status == 200) 
		{
			setNames(xmlHttpv2.responseXML.getElementsByTagName("sw"));
		} 
		else if (xmlHttpv2.status == 204)
		{
			clearNames();
		}
	}
}

function setNames(the_names) 
{            
	clearNames();
	recom_str = the_names;
	var size = the_names.length;
	//setOffsets();
	var row, cell, txtNode;
	if(size > 0) completeDiv2.style.visibility='';
	for (var i = 0; i < size; i++) 
	{
		var nextNode = the_names[i].firstChild.data;
		var arr_nextNode = nextNode.split("|-|");
		row = document.createElement("tr");
		cell = document.createElement("td");

		cell.className='autoTB';
		cell.onmouseout = function(){
			//this.style.backgroundColor='#FFFFFF';
			this.className='autoSearchOut';
		}
		cell.onmouseover = function(){
			//this.style.backgroundColor='#4d2b1f';
			this.className='autoSearchOver';
		}
		
		//cell.setAttribute("bgcolor", "#000000");
		//cell.setAttribute("border", "0");
		cell.onclick = function() { populateName(this); } ;                             
		
		var txtNode_str = arr_nextNode[0] + ' - ' + arr_nextNode[1];
		//var txtNode_str = nextNode;
		txtNode = document.createTextNode(txtNode_str);
		cell.title = arr_nextNode[0] + ' - ' + arr_nextNode[1]; 
		//cell.title = nextNode; 
		cell.appendChild(txtNode);
		row.appendChild(cell);
		nameTableBody.appendChild(row);
	}
	
	nameTable.style.width = "240px";
}

function setOffsets() 
{
	var loc_root_tb = document.getElementById("loc_root_tb");
	//var end = inputField.offsetWidth;
	//var left = calculateOffsetLeft(inputField);
	//alert(loc_root_tb.offsetLeft);
	//var left_loc = parseInt(loc_root_tb.offsetLeft) + 0;
	//var left_loc = 1;
	//var top_loc = calculateOffsetTop(inputField) + inputField.offsetHeight;
	//var top_loc = parseInt(inputField.offsetTop) + 21;
	
	
	//completeDiv2.style.border = "black 1px solid";
	//completeDiv2.style.left = left_loc + "px";
	//completeDiv2.style.left = "500px";
	//document.f1.g_info.value = left_loc+' : '+calculateOffsetTop(inputField)+' : '+inputField.offsetHeight+' : '+top_loc+' : '+completeDiv2.style.left;
	//completeDiv2.style.top = top_loc + "px";
	//nameTable.style.width = (end-7) + "px";
	//nameTable.style.width = "240px";
}

function calculateOffsetLeft(field) 
{
  return calculateOffset(field, "offsetLeft");
}

function calculateOffsetTop(field) 
{
  return calculateOffset(field, "offsetTop");
}

function calculateOffset(field, attr) 
{
	var offset = 0;
	while(field) 
	{
		offset += field[attr]; 
		field = field.offsetParent;
	}
	return offset;
}

function populateName(cell) 
{
	inputField.value = cell.firstChild.nodeValue;
	clearNames();
}

function clearNames() 
{
	var ind = nameTableBody.childNodes.length;
	for (var i = ind - 1; i >= 0 ; i--) 
	{
		 nameTableBody.removeChild(nameTableBody.childNodes[i]);
	}
	completeDiv2.style.border = "none";
	completeDiv2.style.visibility='hidden';
}

function arrow_key()
{
	try{
		var size2 = recom_str.length;
		if(size2 > 0) completeDiv2.style.visibility='';
		if(key_code == 40)
		{
			if(recom_str_num == null) 
			{
				recom_str_num = 0;
			} 
			else if(recom_str_num < nameTableBody.childNodes.length - 1) 
			{
				nameTableBody.childNodes[recom_str_num].className = "autoSearchOut";
				recom_str_num++;
			}

			var ratio_val = recom_str_num%3;

			if(recom_str_num>2 && ratio_val== 0)
			{
				completeDiv2.scrollTop = completeDiv2.scrollTop+60;
			}
			nameTableBody.childNodes[recom_str_num].className = "autoSearchOver";
			
			var nextNode = recom_str[recom_str_num].firstChild.data;
			var arr_nextNode = nextNode.split("|-|");
			document.search_f.s_word.value = arr_nextNode[0] + ' - ' + arr_nextNode[1];
			//document.search_f.s_word.value = nextNode;
		}
		else if(key_code == 38) 
		{
			if (recom_str_num > 0) 
			{
				nameTableBody.childNodes[recom_str_num].className = "autoSearchOut";
				var ratio_val2 = recom_str_num%3;
				if(recom_str_num>2 && ratio_val2== 0)
				{
					completeDiv2.scrollTop = completeDiv2.scrollTop-60;
				}
				recom_str_num--;
				nameTableBody.childNodes[recom_str_num].className = "autoSearchOver";

				var nextNode = recom_str[recom_str_num].firstChild.data;
				var arr_nextNode = nextNode.split("|-|");
				document.search_f.s_word.value = arr_nextNode[0] + ' - ' + arr_nextNode[1];
				//document.search_f.s_word.value = nextNode;
			}
		}
	}catch(e){
	
	}
}

function isAlphaChr(ch) 
{ 
	if ( isUpperAlphaChr(ch) == true || isLowerAlphaChr(ch) == true ) 
	{
		return true;
	}
	else
	{
		return false;
	}
}

function isUpperAlphaChr(ch) 
{ 
	if ( ch >= 'A' && ch <= 'Z' ) 
	{
		return true;
	}
	else 
	{
		return false;
	}
} 

function isLowerAlphaChr(ch) 
{ 
	if ( ch >= 'a' && ch <= 'z' ) 
	{
		return true;
	}
	else 
	{
		return false;
	}
} 

function isNumChr(ch) 
{ 
	if ( ch >= '0' && ch <= '9' ) 
	{ 
		return true; 
	} 
	else 
	{ 
		return false; 
	} 
} 

function isAlphaNumStr(stValue, Spok) 
{ 
	for(var i=0; i<stValue.length;i ++) 
	{ 
		if(stValue.charAt(i)=="~" || stValue.charAt(i)=="`" || stValue.charAt(i)=="!" || stValue.charAt(i)=="@" || stValue.charAt(i)=="#" || stValue.charAt(i)=="$" || stValue.charAt(i)=="^" || stValue.charAt(i)=="&" || stValue.charAt(i)=="*" || stValue.charAt(i)=="(" || stValue.charAt(i)==")" || stValue.charAt(i)=="-" || stValue.charAt(i)=="_" || stValue.charAt(i)=="=" || stValue.charAt(i)=="+" || stValue.charAt(i)=="[" || stValue.charAt(i)=="]" || stValue.charAt(i)=="{" || stValue.charAt(i)=="}" || stValue.charAt(i)==";" || stValue.charAt(i)==":" || stValue.charAt(i)=="<" || stValue.charAt(i)==">" || stValue.charAt(i)=="," || stValue.charAt(i)=="." || stValue.charAt(i)=="/" || stValue.charAt(i)=="?")
		{
			continue;
		}
		else
		{
			if ( isAlphaChr( stValue.charAt(i) ) == true ) continue; 
			if ( isNumChr( stValue.charAt(i) ) == true ) continue; 
			if ( Spok == true ) 
			{ 
				if ( isSpChr(stValue.charAt(i)) == true ) 
				{ 
					continue; 
				} 
			} 
		}
		return false; 
	} 
	return true; 
}

//add by wesley,修改背景图片
function update_body_bgImg(str){
	var imgUrl = '';
	if(str!=""){
		$str_arr = str.split("|");
		if($str_arr[0] == "iframe_size"){
			resize_iframe($str_arr[1]);
		}else{
			imgUrl = str;
		}
	}

	if(imgUrl == ""){
		document.body.style.background="url(about:blank)"; //改变背景图片
	}else{
		document.body.style.background="url("+imgUrl+")"; //改变背景图片
	}
}

function changeEDMPage(page) {
	var form = document.edm_f;
	var action_loc = "/edm/edm_info_list.html";
	form.page.value = page;
	form.action = action_loc;
	form.submit();
}

function change_style(type)
{
	var menu_a_style = document.getElementById('menu_category_a1').style;
	var menu_k_style = document.getElementById('menu_category_k1').style;
	menu_a_style.width = "118px";
	menu_a_style.height = "26px";

	menu_k_style.width = "117px";
	menu_k_style.height = "26px";
	
	if(type=='a'){
		//menu_k_style.backgroundPosition = "-238px -389px";
		menu_a_style.backgroundPosition = "-119px -389px";
	}else if(type=='k'){
		//menu_a_style.backgroundPosition = "0 -389px";
		menu_k_style.backgroundPosition = "-356px -389px";
	}
}

function change_style_out(type,n,is_br){
	var menu_a_style = document.getElementById('menu_category_a1').style;
	var menu_k_style = document.getElementById('menu_category_k1').style;
	menu_a_style.width = "118px";
	menu_a_style.height = "26px";

	menu_k_style.width = "117px";
	menu_k_style.height = "26px";
	if(type=='a'){
		if((n=='1'||n=='') && is_br==0){
			menu_a_style.backgroundPosition = "-119px -389px";
		}else{
			menu_a_style.backgroundPosition = "0 -389px";
		}
	}else if(type=='k'){
		if(n=='2' && is_br==0){
			menu_k_style.backgroundPosition = "-356px -389px";
		}else{
			menu_k_style.backgroundPosition = "-238px -389px";
		}
	}
}
//-->