function   choose(){   
  if(form1.searchkey[0].checked)   
  {   document.form1.action="product.php";   
     // document.form1.target="_blank";   
      document.form1.submit();   
    }   
  if(form1.searchkey[1].checked)   
  {   
    document.form1.action="news.php";   
  //  document.form1.target="_blank";   
    document.form1.submit();   
    }     
 }   
        var focus_width=252;
		var focus_height=213;
		var text_height=18;
		var swf_height = focus_height+text_height
		var pics = '';
		var links = '';
		var texts = '';
function ati(url, img, title){
	if(pics != ''){
		pics = "|" + pics;
		links = "|" + links;
		texts = "|" + texts;
		}
		pics = escape(img) + pics;
		links = escape(url) + links;
		texts = title + texts;
	}
	//the adversty...
function showad(){
var adb=document.getElementById("adb");
 if(parseInt(adb.style.height)<213){
	//if(minheight)clearInterval(minheight);
	adb.style.height=parseInt(adb.style.height)+4+"px";
 }else clearInterval(maxheight);
 }
function closead(){
	var adb=document.getElementById("adb");
	if(parseInt(adb.style.height)>100){
	 if(maxheight)clearInterval(maxheight);
	 adb.style.height=parseInt(adb.style.height)-4+"px";
   }else clearInterval(minheight);
}
//ajax initial...
function initajax(){
	if(window.XMLHttpRequest){
		return new XMLHttpRequest;
	}else if(window.ActiveXObject){
		return new ActiveXObject("msxml2.XMLHTTP");
	}
}
/**
 * 更新顶部广告
 */
banner_ajax = initajax();
banner_ajax.open('get', '/js/advs.js?'+Math.random(), true);
banner_ajax.send(null);
banner_ajax.onreadystatechange = function()
{
    if(banner_ajax.readyState == 4)
    {
        eval('banner_json='+banner_ajax.responseText);
        if(banner_json.href.indexOf('http://') !== 0)
        {
            pre_dir = '/';
        }
        else
        {
            pre_dir = '';
        }
        document.getElementById('header_advs').getElementsByTagName('a')[0].href = pre_dir+banner_json.href;
        document.getElementById('header_advs').getElementsByTagName('img')[0].src = '/'+banner_json.img;
    }
}

/**
 * 首页导航效果
 */
//鼠标停留
function navigatorOver()
{
    var e = arguments[0] || window.event;
    var srcElemet = e.target || e.srcElement;
    if(srcElemet.tagName == "IMG")
    {
        if(srcElemet.src.indexOf('r1') > 0)
        {
            var preName = srcElemet.src.substring(0, srcElemet.src.indexOf('r1')+1);
            var extName = srcElemet.src.substring(srcElemet.src.indexOf('r1')+2);
            srcElemet.src = preName+2+extName;
        }
    }
}
// 鼠标离开
function navigatorOut()
{
    var e = arguments[0] || window.event;
    var srcElemet = e.target || e.srcElement;
    if(srcElemet.tagName == "IMG")
    {
        if(srcElemet.className != 'current')
        {
            if(srcElemet.src.indexOf('r2') > 0)
            {
                var preName = srcElemet.src.substring(0, srcElemet.src.indexOf('r2')+1);
                var extName = srcElemet.src.substring(srcElemet.src.indexOf('r2')+2);
                srcElemet.src = preName+1+extName;
            }
        }
    }
}

//效果设置
function setEffect()
{
    if(document.getElementById('navigator'))
    {
        document.getElementById('navigator').onmouseover=navigatorOver;
        document.getElementById('navigator').onmouseout=navigatorOut;
        window.clearInterval(effectStart);
    }
}

effectStart = window.setInterval('setEffect()', 500);
//marquee effect

var speed=50;
function marque_over(){
	var out_contain = document.getElementById("verify_info_body");
	var in_contain = document.getElementById("verify_info");
	if((in_contain.offsetHeight/2) <= out_contain.scrollTop)
	{
		out_contain.scrollTop -= (in_contain.offsetHeight/2);
	}
	out_contain.scrollTop++;
}
function set_marque()
{
   var out_contain = document.getElementById("verify_info_body");
   var in_contain = document.getElementById("verify_info");
   in_contain.innerHTML += in_contain.innerHTML;
   mymar=window.setInterval(marque_over, speed);
   in_contain.onmouseover=function() {window.clearInterval(mymar)};
   in_contain.onmouseout=function() {mymar=window.setInterval(marque_over, speed)};
}
count_marque = 1;
//check marque
function get_marque()
{
	count_marque++;
	if(document.getElementById('verify_info'))
	{
		set_marque();
		window.clearInterval(get_marque_start);
	}
	else if(count_marque == 900)
	{
		window.clearInterval(get_marque_start);
	}
}
get_marque_start = window.setInterval(get_marque, 500);

//project future change
function change_future()
{
    var e = arguments[0] || window.event;
    var srcElemet = e.target || e.srcElement;
    if(srcElemet.tagName == "A")
    {
	    var parent_title = document.getElementById("future_title");
	    parent_title.style.background = "url(/images/"+srcElemet.id+".jpg)";
	    document.getElementById("future_body").innerHTML = document.getElementById(srcElemet.id+"s").innerHTML;
    }
}
/**
 * auto mouse over
 */
function auto_over(id)
{
    var contain = document.getElementById(id);
    var childs = contain.getElementsByTagName('a');
    if(childs.length > 0)
    {
        if(typeof(g_index) == 'undefined' || g_index >= childs.length)
        {
            g_index = 0;
        }
        childs[g_index].click();
        g_index++;
    }
}
/**
 * add click funtion to html for firefox
 */
if(!window.ActiveXObject)
{
    HTMLElement.prototype.click = function() {
        var evt = this.ownerDocument.createEvent('MouseEvents');
        evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
        this.dispatchEvent(evt);
    } 
}

count_future = 1;
function get_future()
{
	if(document.getElementById("future_body"))
	{
		document.getElementById("future_title").onmouseover=change_future;
		document.getElementById("future_title").onclick=change_future;
        future_auto_over = window.setInterval(function(){auto_over('future_title');}, 3000);
		window.clearInterval(get_future_start);
	}
	else if(count_future == 900)
	{
		window.clearInterval(get_future_start);
	}
}
get_future_start = window.setInterval(get_future, 500);
//changeShop
function change_shop()
{
    var e = arguments[0] || window.event;
    var srcElemet = e.target || e.srcElement;
    if(srcElemet.tagName == "A")
    {
	    var parent_title = document.getElementById("shop_title");
	    parent_title.style.background = "url(/images/"+srcElemet.id+".jpg)";
	    document.getElementById("shop_show").innerHTML = document.getElementById(srcElemet.id+"s").innerHTML;
    }
}
count_shop = 1;
function get_shop()
{
	if(document.getElementById("shop_show"))
	{
		document.getElementById("shop_title").onmouseover=change_shop;
		document.getElementById("shop_title").onclick=change_shop;
        future_auto_over = window.setInterval(function(){auto_over('shop_title');}, 3000);
		window.clearInterval(get_shop_start);
	}
	else if(count_shop == 1000)
	{
		window.clearInterval(get_shop_start);
	}
}
get_shop_start = window.setInterval("get_shop()", 500);


//openChild
function openChild()
{
    var e = arguments[0] || window.event;
    var srcElemet = e.target || e.srcElement;
    if(srcElemet.tagName == 'p')
    {
        var c = srcElemet.nextSibling;
    }
    else
    {
        if(srcElemet.parentElement)
        {
            c = srcElemet.parentElement.nextSibling;
        }
        else if(srcElemet.parentNode)
        {
            c = srcElemet.parentNode.nextSibling;
        }

    }
        if(c.style.display == 'none')
        {
            c.style.display = 'block';
        }
        else
        {
            c.style.display = 'none';
        }
}

count_parent_p = 1;
function get_parent_p()
{
    count_parent_p++;
    if(document.getElementById("child_list"))
    {
        document.getElementById('product_p').onclick=openChild;
        document.getElementById('product_p1').onclick=openChild;
        document.getElementById('product_p2').onclick=openChild;
        window.clearInterval(get_parent_p_start);
    }
    else if(count_parent_p == 1000)
    {
        window.clearInterval(get_parent_p_start);
    }
}
get_parent_p_start = window.setInterval('get_parent_p()', 500);

