// JavaScript Document

//字體大小
function changebFontSize(){
	$.cookie('fontSize',2);
	location.reload();
}
function changesFontSize(){
	$.cookie('fontSize',1);
	location.reload();
}
//純文字
function loadTextlayout(){
	if($.cookie('layout')==1){
		cl_pic();
	}
}

function show_pic(){
	location.reload();
}

function cl_pic(){
	var len = document.images.length;
	for(i = 0; i < len; i++){
	 if(document.images[i].src.match("sc_btn")!=null){
		document.getElementById("search").style.display="";
	 }else if(document.images[i].src.match("icon_9")!=null){
		document.getElementById("rss").style.display="";
	 }
	 document.images[i].style.display='none';
	}
	document.getElementById("bgimage").style.background="";
	if(document.getElementById("titleimage")!=null){
		document.getElementById("titleimage").style.background="";
	}

	var lena = document.links.length;
	for(i = 0; i < lena; i++){
		document.links[i].className='black12';
	}
	document.getElementById('top_red').style.color="#000000";
	document.getElementById('top_setfont').style.color="#000000";

}

function cl_pic_txt(){
	var len = document.images.length;
	for(i = 0; i < len; i++){
	 if(document.images[i].src.match("sc_btn")!=null){
		document.getElementById("search").style.display="";
	 }else if(document.images[i].src.match("icon_9")!=null){
		document.getElementById("rss").style.display="";
	 }
//		 document.images[i].style.display='none';
	}
	//document.getElementById("bgimage").style.background="";
	if(document.getElementById("titleimage")!=null){
		document.getElementById("titleimage").style.background="";
	}

	var lena = document.links.length;
	for(i = 0; i < lena; i++){
//	 		document.links[i].className='black12';
	}
	$("#bottomlogo").show();
	$("#searchimg").show();
	$("#test").show();
}


function copyToClipBoard()
{
 var clipBoardContent=window.document.getElementById("rssurl").value;
 window.clipboardData.setData("Text",clipBoardContent);
}
function checkConditonhead()
{
	var condition=document.frms.txtCondition.value;
	send=true;
	if(condition!="")
	{
		if(!check(condition))
		{
			alert('<?php echo $lang["query"]?>');
			send=false;
		}
		else
		{
			send=true;
		}
	}
	if(condition=="请输入关键字" || condition=="請輸入關鍵字" || condition=="Keyword")
	{
		condition="";
	}
	document.frms.txtCondition.value=trim(condition);
	if(send)
	{
		document.frms.submit();
	}
}

function ltrim(s){
  return s.replace( /^\s*/, "");
}

//去右空格;
function rtrim(s){
	return s.replace( /\s*$/, "");
}
function trim(s){
	return rtrim(ltrim(s));
}

