var item=0;
function headQuery(data){
	item=data;
	document.getElementById("img1").setAttribute("src", "index/images/index_08_2.gif");
	document.getElementById("img2").setAttribute("src", "index/images/index_09_2.gif");
	document.getElementById("img3").setAttribute("src", "index/images/index_10_2.gif");
	document.getElementById("img4").setAttribute("src", "index/images/index_11_2.gif");
	if (item==1)document.getElementById("img1").setAttribute("src", "index/images/index_08.gif");
	if (item==2)document.getElementById("img2").setAttribute("src", "index/images/index_09.gif");
	if (item==3)document.getElementById("img3").setAttribute("src", "index/images/index_10.gif");
	if (item==4)document.getElementById("img4").setAttribute("src", "index/images/index_11.gif");
	
}
function submitenter(e)
{
	
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
	querySubmit();
   return false;
   }
else
   return true;
}
function querySubmit(){
	if (document.getElementById("query").value=="輸入關鍵字"){
		document.getElementById("query").value='';
	}
	if (document.getElementById("query").value) {
		document.query.query.value=document.getElementById("query").value
	if (item==1 || item==0){
		document.query.setAttribute('action', 'QueryPartner');
		document.query.submit();
	}
	if (item==2){
		document.query.setAttribute('action', 'QueryAd');
		document.query.submit();
	}
	if (item==3){
		document.query.setAttribute('action', 'QueryProduct');
		document.query.submit();
	}
	if (item==4){
		document.query.setAttribute('action', 'QueryNews');
		document.query.submit();
	}
	}else {
	   alert("請輸入關鍵字");document.getElementById("query").focus();
	}
	
}
/*
function sc3(){
		document.getElementById("iRFloating").style.top=document.documentElement.scrollTop;
	    document.getElementById("iRFloating").style.left=document.documentElement.scrollLeft+document.documentElement.clientWidth-document.getElementById("iRFloating").offsetWidth;
	   // alert(document.documentElement.scrollTop);
 } 

window.onscroll=sc3;
window.onresize=sc3;
window.onload=sc3;
*/
function campainsChange(){
	document.campainsform.submit();
}















