﻿<!--

function getOffsetTop2 (el, p) {
    var _t = el.offsetTop;
    while (el = el.offsetParent) {
        if (el == p) break;
        _t += el.offsetTop;
    }

    return _t;
};
function getOffsetLeft2 (el, p) {
    var _l = el.offsetLeft;
    while (el = el.offsetParent) {
        if (el == p) break;
        _l += el.offsetLeft;
    }

    return _l;
};
var tt;
var curMenu;
var curLi;
function mouseover (th, menu) {
    if (tt) clearTimeout(tt);
    displayMenu(false);
    menu = document.getElementById('menu' + menu);

    menu.style.left = getOffsetLeft2(th) + 'px';
    menu.style.top  = getOffsetTop2(th) + th.offsetHeight + 'px';

    curMenu = menu;
    displayMenu(true);
}
function mouseout () {
    tt = setTimeout('displayMenu(false)', 200);
}
function _mouseover () {
    if (tt) clearTimeout(tt);
    displayMenu(true);
}
function _mouseout () {
    displayMenu(false);
}
function displayMenu (display) {
    if (curMenu) {
        curMenu.style.display = display ? 'block' : 'none';
    }
}
function check_keywords(){
	var keywords = document.formsearch.skeyword.value;
	if(keywords=="" || keywords=="输入关键字"){
		alert("请输入搜索关键字");
		document.formsearch.skeyword.focus();
		return false;
	}else{
		return true;
	}
}

function setValue(idname,v) {
	document.getElementById('buy').className='normal';
	document.getElementById('sell').className='normal';
	document.getElementById('product').className='normal';
	document.getElementById('company').className='normal';
	document.getElementById('industry').className='normal';
	document.getElementById('new').className='normal';
	switch(v) {
		case 1:
		    document.getElementById('skeyword').value = '请输入求购信息关键字,然后搜索';
		    document.getElementById(idname).className='current';
            document.getElementById('searchtype').value = 1;
			document.formsearch.action= "/offer/list.php";
			break;
		case 2:
		   document.getElementById('skeyword').value = '请输入供应信息关键字,然后搜索';
			document.getElementById(idname).className='current';
			document.getElementById('searchtype').value = 2;
			document.formsearch.action= "/offer/list.php";
			break;
		case 3:	
		    document.getElementById('skeyword').value = '请输入公司名称关键字,然后搜索';
			document.getElementById(idname).className='current';
			document.getElementById('searchtype').value = 3;
			document.formsearch.action= "/company.php";
			break;
		case 4:
		    document.getElementById('skeyword').value = '请输入产品关键字,然后搜索';
			document.getElementById(idname).className='current';
			document.getElementById('searchtype').value = 4;
			document.formsearch.action= "/product/list.php";
			break;
		case 5:
		    document.getElementById('skeyword').value = '请输入技术支持信息关键字';
			
			document.getElementById(idname).className='current';
			document.getElementById('searchtype').value = 5;
			document.formsearch.action= "/news/list.php";
			break;
		case 6:
		    document.getElementById('skeyword').value = '请输入供求信息关键字,然后搜索';
			document.getElementById(idname).className='current';
			document.getElementById('searchtype').value = 2;
			document.formsearch.action= "/offer/list.php";
			break;
		case 7:
		    document.getElementById('skeyword').value = '请输入资讯标题关键字,然后搜索';
			document.getElementById(idname).className='current';
			document.getElementById('searchtype').value = 7;
			document.formsearch.action= "/industry/list.php";
			break;
		case 8:
		    document.getElementById('skeyword').value = '请输入报价信息关键字,然后搜索';
			document.getElementById(idname).className='current';
			document.getElementById('searchtype').value = 8;
			document.formsearch.action= "/price/list.php";
			break;			
	}
	
}
//-->