function cleanSearchTip(cli){
		var o = document.getElementById('site_search_input');
		if(o==null)return;
		if(o.value==o.title){
			if(cli==2){
				o.style.color = '#999';
			}else{
				o.value = '';
				o.style.color = '#000';
			}
		}else if(o.value=='' && cli>=1){
			o.value = o.title;
			o.style.color = '#999';
		}else{
			o.style.color = '#000';
		}
}
function sitesearchsubmit(alik){
	var o = document.getElementById('site_search_input');
	var f = document.getElementById('site_search_form');
	if(o==null || o.value==o.title || o.value=='' || f==null)
		document.location = alik.href;
	else{
		document.location = alik.href + "?k=" + encodeURIComponent(o.value);
	}
}
function init(){
	try{
		if(window.screen.width<1024){
			replaceClass('s2','contents2 contents2_1024','contents2 contents2_800');
		}
		if(window.XMLHttpRequest){}else{
			if(window.screen.width<800){
				replaceClass('navigation','navigation','navigation navigation_800');
				replaceClass('topbar','topbar','topbar navigation_800');
				replaceClass('content_border','content_border','content_border navigation_800');
				replaceClass('foot','foot','foot navigation_800');
			}else if(window.screen.width>1280){
				replaceClass('navigation','navigation','navigation navigation_1280');
				replaceClass('topbar','topbar','topbar navigation_1280');
				replaceClass('content_border','content_border','content_border navigation_1280');
				replaceClass('foot','foot','foot navigation_1280');
			}
		}
	}catch(e){alert(e);}
	try{
		cleanSearchTip(2);
	}catch(e){}
}
function replaceClass(id,oldclass,newclass){
	var o = document.getElementById(id);
	if(o!=null && o.className==oldclass)
		o.className=newclass;
}
function changeImg(tmark,imgname,imglink,imgwidth,imgheight){ try{

	var afull = document.getElementById(tmark+"afull");
	var aimg = document.getElementById(tmark+"aimg");
	var vimg = document.getElementById(tmark+"vimg");
	if(vimg==null || vimg.src == imgname)return;
		vimg.src = imgname;
	if(afull!=null) afull.href = imglink;
	
	var aheight = 0;
	if(aimg!=null){
		aheight = parseInt(aimg.style.height)
		if(isNaN(aheight)){
			aheight = ((parseInt(vimg.height)<imgheight)?imgheight:vimg.height) ;
			aimg.style.height = aheight + "px";
		}else{
			if(aheight<imgheight){
				aimg.style.height = imgheight+"px";
				aheight = imgheight;
			}
		}
		aimg.href = imglink;
	}
	vimg.width = imgwidth;
	vimg.height = imgheight;
	
	if(aheight>imgheight){
		vimg.style.marginTop = ((aheight-imgheight)/2)+"px";
	}else{
		vimg.style.marginTop = "0px";
	}

}catch(e){} }
var onLoadFn = init;
window.onload = onLoadFn;

function SendMSNMessage(name)
{
 //Send a message through MSN , only for IE
 //and you must have installed MSN or Window Message
 document.location = "msnim:chat?contact="+name+"@live.cn";
}

