var HR2=new Image();
var HR3=new Image();
HR2.src="/p/080212_1.gif";
HR3.src="/p/080212_2.gif";
var h=0;

function ChangeIntroImg(){
	var iLoveHR=document.getElementById("HR");
	iLoveHR.src=(iLoveHR.src==HR3.src)?HR2.src:HR3.src;
	status=decodeURI('80出没,幸福注意');
}

function GetXY(){
	status='相对于图片的位置offsetX:'+event.offsetX+' offsetY:'+event.offsetY+' 相对于客户端浏览器的位置clientX:'+event.clientX+' clientY:'+event.clientY;
}

function MoveIntro(){
	var ek=event.keyCode;
	var iLoveHR=document.getElementById("HR");
	if (ek==13) location.href=location.protocol+'//'+location.host+'/blog/index.asp';
	if (ek==37) intro.style.posLeft-=5;
	if (ek==39) intro.style.posLeft+=5;
	if (ek==38) intro.style.posTop-=5;
	if (ek==40) intro.style.posTop+=5;
	iLoveHR.src=HR3.src;
}
//target="_blank"不符合标准?
function ExternalLinks(){
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	var i;
	for (i=0;i<anchors.length;i++){
		if (anchors[i].getAttribute("href") &&	anchors[i].getAttribute("rel") == "external")
			anchors[i].target = "_blank";
		}
}

function RollDoggie(){
	var iLoveHR=document.getElementById("HR");
	iLoveHR.src=(iLoveHR.src==HR3.src)?HR2.src:HR3.src;
	status=status==decodeURI('80出没,幸福注意')?decodeURI('幸福出没,80注意'):decodeURI('80出没,幸福注意');
}
function initMenuFun(){
	var dest=document.getElementById("menu").getElementsByTagName("a");
	if(!dest)return;
	
	for(var ii=0;ii<dest.length;ii++){
		dest[ii].onmouseover=ChangeIntroImg;
		dest[ii].onmouseout=ChangeIntroImg;
	}
}

function waasai(){
	ExternalLinks();
	initMenuFun();
	//setInterval(RollDoggie,500);
	//startPing();
}
window.onload = waasai;

