//搜尋列開始
function getCookie(cookieName) { 
	var allcookies = document.cookie; 
	cookieName += "="; 
	var pos = allcookies.indexOf(cookieName); 
	if( pos != -1) { 
		var start = pos + cookieName.length; 
		var end = allcookies.indexOf(";",start); 
		if(end == -1) end = allcookies.length; 
		return unescape(allcookies.substring(start,end));  
	} 
}
function initset(a) {
for (i=0; i<=document.all.BtnImg.length-1;i++) BtnImg[i].style.filter='alpha(opacity=0)';
  BtnImg[a].style.filter='alpha(opacity=100)';
  mainbox.className='t1';
}

function ChgTab(t,v1,v2,v3,v4) {
if (t.className=='bt0' || t.className=='bt1') {
  document.all.mainbox.className=v1;
  
	for (i=1; i<=5;i++)  
	document.getElementById('BtnType'+i).className='bt0';

  //for (i=0; i<=document.all.BoxEdge.length-1;i++) BoxEdge[i].className=v2;

  //for (i=0; i<=document.all.BtnImg.length-1;i++) BtnImg[i].style.filter='alpha(opacity=0)';
  t.className=v3;
  //BtnImg[v4].style.filter='alpha(opacity=100)';
}
}

function OverEffect(t) {
tmp=mainbox.className;
if (t.className=='bt0') t.className='bt1';
mainbox.className=tmp;
}

function OutEffect(t) {
tmp=mainbox.className;
if (t.className=='bt1') t.className='bt0';
mainbox.className=tmp;
}

function dlarcode(cc){
//瀏覽器 Firefox, Opera 8.0+, Safari, Internet Explorer 
var xmlhttp;
try { xmlhttp=new XMLHttpRequest(); }catch (e) {  try {xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e) {try {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e) { alert("Your browser does not support AJAX!"); return false;}}}

//我要買車
if(cc=="0"){
var strURL='indexsearchdata.asp?a=area&b=a1&brand=ok&urlsql=1&urlhtht=class.asp?articles=1';
xmlhttp.open('GET',strURL,true);
xmlhttp.send(null);  
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){
document.getElementById("Layer2").innerHTML=xmlhttp.responseText.split('|||')[0];
document.getElementById("carsearchkey").innerHTML=xmlhttp.responseText.split('|||')[1];
searchkeyclickurl('searchkeyshowurl',this,'searchkeyshowurl');//賦予ID在清單連結
}}
}

//我要賣車
if(cc=="1"){
var strURL='indexsearchdata.asp?a=area&b=a2&brand=ok&urlsql=2&urlhtht=class.asp?articles=2';
xmlhttp.open('GET',strURL,true);
xmlhttp.send(null);  
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){
document.getElementById("Layer2").innerHTML=xmlhttp.responseText.split('|||')[0];
document.getElementById("carsearchkey").innerHTML=xmlhttp.responseText.split('|||')[1];
searchkeyclickurl();//賦予ID在清單連結
}}
}

if(cc=="2"){
var strURL='indexsearchdata.asp?industrynews=ok&urlsql=3&urlhtht=industrynews_home.asp?articles=';
xmlhttp.open('GET',strURL,true);
xmlhttp.send(null);  
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){
document.getElementById("Layer2").innerHTML=xmlhttp.responseText.split('|||')[0];
document.getElementById("carsearchkey").innerHTML=xmlhttp.responseText.split('|||')[1];
searchkeyclickurl();//賦予ID在清單連結
}}
}

if(cc=="3"){
var strURL='indexsearchdata.asp?urlsql=4&urlhtht=classmanu.asp?articles=';
xmlhttp.open('GET',strURL,true);
xmlhttp.send(null);  
xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){
document.getElementById("Layer2").innerHTML=xmlhttp.responseText.split('|||')[0];
document.getElementById("carsearchkey").innerHTML=xmlhttp.responseText.split('|||')[1];
searchkeyclickurl();//賦予ID在清單連結
}}
}

if(cc=="4")document.getElementById("Layer2").innerHTML="<input type=\"hidden\" name=\"gosearch\" value=\"4\">&nbsp;<b><font size=\"3\">搜尋：</font></b><input name=\"name_key\" type=\"text\" value=\"請輸入關鍵字\" onFocus=\"if (this.value==this.defaultValue) this.value='';\" onBlur=\"if (this.value=='') this.value=this.defaultValue;\" size=\"25\">&nbsp;&nbsp;<input type=\"submit\" name=\"search\" value=\"搜尋\">";document.getElementById("carsearchkey").innerHTML="";
}

//搜尋列結束



//新聞開始
function ninitset() {
for (i=0; i<=document.all.nBtnImg.length-1;i++) nBtnImg[i].style.filter='alpha(opacity=0)';
  nBtnImg[0].style.filter='alpha(opacity=100)';
  nmainbox.className='nt1';
}

function nChgTab(t,v1,v2,v3,v4) {
if (t.className=='nbt0' || t.className=='nbt1') {
  document.all.nmainbox.className=v1;
  for (i=0; i<=document.all.nBoxEdge.length-1;i++) nBoxEdge[i].className=v2;
	for (i=1; i<=5;i++)  
	document.getElementById('nBtnType'+i).className='nbt0';
  for (i=0; i<=document.all.nBtnImg.length-1;i++) nBtnImg[i].style.filter='alpha(opacity=0)';
  t.className=v3;
  nBtnImg[v4].style.filter='alpha(opacity=100)';
}
}

function nOverEffect(t) {


tmp=nmainbox.className;
if (t.className=='nbt0') t.className='nbt1';
nmainbox.className=tmp;
}

function nOutEffect(t) {
tmp=nmainbox.className;
if (t.className=='nbt1') t.className='nbt0';
nmainbox.className=tmp;
}

function ndlarcode(ncc){
if(ncc=="0")document.getElementById("Layern0").style.display=''; else document.getElementById("Layern0").style.display='none';
if(ncc=="1")document.getElementById("Layern1").style.display=''; else document.getElementById("Layern1").style.display='none';
if(ncc=="2")document.getElementById("Layern2").style.display=''; else document.getElementById("Layern2").style.display='none';
if(ncc=="3")document.getElementById("Layern3").style.display=''; else document.getElementById("Layern3").style.display='none';
if(ncc=="4")document.getElementById("Layern4").style.display=''; else document.getElementById("Layern4").style.display='none';
}
//新聞結束