﻿var xx1 =  new autoScroll('G_gukefk_middle_frame','G_gukefk_middle_content',40,1);
var xx =  new autoScroll('order_div3','order_div3_content',40,1);
function defaultSelectTag(){
	$("tag1").className="por-lt";
}
//预缓存图片
    function getImg(){
	var img1=new Image(752,290);
	img1.src="/image/38funv.jpg";
	var img2=new Image(752,290);
	img2.src="/image/5.1.jpg";
	var img3=new Image(752,290);
	img3.src="/image/888tj.jpg";
	var img4=new Image(752,290);
	img4.src="/image/lianhua.jpg";
	document.getElementById('index_img_1').src=img1.src;
	document.getElementById('index_img_2').src=img2.src;
	document.getElementById('index_img_3').src=img3.src;
	document.getElementById('index_img_4').src=img4.src;
   }
   
   function show_cate(){
	document.getElementById("select_item").style.display="block";
}
function hide_cate(){
	document.getElementById("select_item").style.display="none";
}
function select_word(word,word_value){
	document.getElementById('top_select').innerHTML=word;
	document.getElementById("select_item").style.display="none";
	document.getElementById("producttype").value=word_value;
}
function show_cate2(){
	document.getElementById("select_item2").style.display="block";
}
function hide_cate2(){
	document.getElementById("select_item2").style.display="none";
}

function select_word2(word,priceFirst,priceLast){
	document.getElementById('top_select2').innerHTML=word;
	document.getElementById("select_item2").style.display="none";
	document.getElementById("priceFirst").value=priceFirst;
	document.getElementById("priceLast").value=priceLast;
}

function enter_search(){
	var tit=document.getElementById("titleorcode").value;
	if(tit.length==0 || tit==""){
		alert("输入商品编号");
	}else{
		GetSearchByTitleOrCode();
	}
}

function GetSearchByTitleOrCode()
	 {
	     var titleorcode = document.getElementById("titleorcode").value;
	     if(titleorcode=="输入商品编号" || titleorcode=="")
	     {
	         alert('请输入产品编号');
	         document.getElementById("titleorcode").focus();
	         return false;
	     }else{
	     	SerachDWR.serachJewelryBySnOrName($('titleorcode').value,searchBack);
	     }
	 }
	 function searchBack(result){
	 	if(result=="no"){
	 		alert("找不到该产品!");
	 	}else{
	 		window.location.href="/product/prodetail.do?id="+result;
	 	}
	 }
	 function GetSearch()
	 {
	     var producttype = document.getElementById("producttype").value;
	     var price = document.getElementById("price").value;
	     
	     if(producttype!=0 || price !=0){
	         location.href="#";
	     }    
	 }
