﻿function GetXml(url)
{
	var shtml = "";
	var xmlDoc = new ActiveXObject("MSXML2.DOMDocument");
	xmlDoc.async = "false";
	xmlDoc.load(url);
	var focus_width=231;
	var focus_height=160;
	var text_height=20;
	var pics='';
	var links='';
	var texts=''; 
	var sCount=0;
	var swf_height = focus_height+text_height;
	var nodeList = xmlDoc.documentElement.selectNodes("/rss/channel/item");
	for(var i=0;i<nodeList.length;i++)
	{
		var sImg = nodeList[i].getElementsByTagName("picpath").item(0).text;
		if(trim_(sImg)!="")
		{
			var sTitle=nodeList[i].getElementsByTagName("title").item(0).text;
			sCount++;
			if(sCount<6)
			{
				if(sCount!=5)
				{
					pics += nodeList[i].getElementsByTagName("picpath").item(0).text + "|";
					links +=nodeList[i].getElementsByTagName("link").item(0).text + "|";
					texts += sTitle.substring(0,13) + "|";
				}
				else
				{
					pics += nodeList[i].getElementsByTagName("picpath").item(0).text;	
					links +=nodeList[i].getElementsByTagName("link").item(0).text + "|";
					texts += sTitle.substring(0,13);
				}
			}
		}
	}
	shtml += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">';
	shtml += '<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="/flash/picflash.swf"><param name="quality" value="high"><param name="bgcolor" value="#EbEbEb">';
	shtml += '<param name="menu" value="false"><param name=wmode value="opaque">';
	shtml += '<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">';
	shtml += '<embed src="flash/picflash.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#EbEbEb" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	shtml += '</object>';
	document.all('bmdt_pic').innerHTML = shtml;
}
function trim_(value_){
	var re=/\s+/gi;
	return value_.replace(re,"");
}

function login(user,password)
{
	if(user == null || user == ""){
		alert("用户名没有输入");
		return ;
	}
	if(password == null || password == ""){
		alert("密码没有输入");
		return ;
	}
	//document.login_submit.username.value=escape(document.login_submit.user.value);
	document.login_submit.submit();
	document.login_submit.username.value="";
	document.login_submit.user.value="用户名|昵称";
	document.login_submit.pass.value="";
}				
function clickinput(n) 
{
	var userName = document.getElementById("user")
	if (n == 0 && userName.value == "用户名|昵称"){userName.value="";}
	if (n == 1 && userName.value == ""){userName.value = "用户名|昵称";}
	if (n == 2)
	{
	    document.login_submit.user.value = "用户名|昵称";
	    document.login_submit.pass.value = "";
	}
}
function Enter()
{
	if(event.keyCode==13)
	{		
		login(document.login_submit.user.value,document.login_submit.pass.value);
		clickinput(1);	
	}
}

function login_youxiang(user,password)
{
	if(user == null || user == ""){
		alert("用户名没有输入");
		return ;
	}
	if(password == null || password == ""){
		alert("密码没有输入");
		return ;
	}
	window.open("http://jyta.hzxc.gov.cn/names.nsf?login&username="+user+"&password="+password);
	document.login_submit.username.value="";
	document.login_submit.user.value="用户名|昵称";
	document.login_submit.pass.value="";
}