window.onload = Load;
document.onmousemove = ousemove;
document.onmouseout = mouseout; 

function Load(){
  showDate();showTime();
  setInterval('showTime()',1000);
  return;
}

function ousemove(){
  if(event.srcElement.className=='productsImg') event.srcElement.className = 'productsImgFocus';
}

function mouseout(){
 if(event.srcElement.className=='productsImgFocus') event.srcElement.className = 'productsImg';
}

//找回密码
function FindPwd(){
  var UserName = $id('FindUserName').value;
  if(IsNull(UserName)){
    showmsg('FindPwdmsg','Error','请输入要找回密码的用户名!');return;
  }
  showmsg('FindPwdmsg','QQLoading','正在处理,请稍候...');
  var Url = 'ajax.asp?UserName='+UserName+'&Action=FindPwd';
  ajax.response(Url,FindPwded);
}

function FindPwded(){
  var html = ajax.request();
  if(html.indexOf('已')!=-1){
	showmsg('FindPwdmsg','right',html);
	setTimeout('hidebg("FindPwdbox")',2500);
   }else{
    showmsg('FindPwdmsg','Error',html);
   }
}
//用户登陆
function Login(){
  var UserName = $id('UserName').value;
  var UserPwd = $id('UserPwd').value;
if(IsNull(UserName)||UserPwd==''){
    $id('UserName').focus();return;
 }
   var Url = "ajax.asp?UserName="+UserName+"&UserPwd="+UserPwd+"&Action=Login";
   ajax.response(Url,LoginOk);
}
function LoginOk(){
   var html = ajax.request();
	   if(html.indexOf("成功")!=-1){
	      goUrl('member.asp');return;
	    }else if(html.indexOf("失败")!=-1){
		  alert(html);
		}
}

//网站投票与查看
function vote(ParentID){
  var IDs = $tag($id(ParentID),'input');
   var VoteID = '';
   for(var i=0;i<IDs.length;i++){
    if(IDs[i].checked==true){
	    VoteID += IDs[i].value+',';
	  }
	}
	 IDs = '';
	for(var i=0;i<VoteID.length-1;i++){
	   IDs += VoteID.charAt(i);
	}
  if(IDs==''){
    alert('请选择投票项!');return;
  }
  var mousePos = mouseCoords(window.event);
  $id('Vote').x = mousePos.x-50;
  $id('Vote').y = mousePos.y+15;
  showdiv('msg','smallLoading','absolute','block','auto',20,$id('Vote').y,$id('Vote').x,'正在投票,请稍候..');
  var Url = 'ajax.asp?VoteIDs='+IDs+'&ParentID='+ParentID+'&Action=Vote';
  ajax.response(Url,voted);
}

function voted(){
  var html = ajax.request();
  showdiv('msg','smallLoading','absolute','block','auto',20,$id('Vote').y,$id('Vote').x,html);
  setTimeout('SetDisplay("msg","none")',2000);
}

function getVote(VoteID){
  var Url = 'Vote.asp?id='+VoteID;
  ajax.response(Url,getVoted);
}

function getVoted(){
  var html = ajax.request();
  showdiv('msg','voteWindow','absolute','block','auto','auto',document.body.scrollTop+150,300,html);
  initDrag();
}

//中英文转换
function ctoe(){
  var url = window.location.href;
  var pos = url.lastIndexOf('/');
  url = url.insert(pos+1,'E_');
  goUrl(url);
}
function etoc(){
  var url = window.location.href;
  url = url.replace(/E_/g,'');
  goUrl(url);
}

function showDate(){
  var date = new Date();
  $id('date').innerHTML = date.getYear()+'年'+(date.getMonth()+1)+'月'+date.getDate()+'日';
}

function showTime(){
  var date = new Date();H = date.getHours();M = date.getMinutes();S = date.getSeconds();
  $id('time').innerHTML = H+':'+M+':'+S;
}

function imenu(parent,obj){
  	var pos = new getPos(parent);
	$id(obj).style.top = pos.y + parent.offsetHeight - 2;
	$id(obj).style.left = pos.x;
	SetDisplay(obj,'block');
}

function Search(key,Url){
	if(IsNull(key))return;
	if(key.indexOf('请输入')!=-1) return;
	window.location = Url+'&key='+key;
}
//有侧面广告时用
/*
function Scroll(obj){
	if(!$id(obj)) return;
	$id(obj).className = 'ScrollAd';
	$id(obj).style.display = 'block';
	var ScrollWidth = 6;
	switch(document.body.offsetWidth){
	  case 1088	:ScrollWidth = 50;break;
	  case 1152	:ScrollWidth = 70;break;
	  case 1280:ScrollWidth = 150;
	}
	$id(obj).style.left = ScrollWidth + document.body.offsetWidth - (document.body.offsetWidth - $id('box').offsetLeft);
	if(document.body.scrollTop>($id('box').offsetHeight-$id(obj).offsetHeight)) return;
	$id(obj).style.top = document.body.scrollTop+180;
}

window.onscroll = function(){
  Scroll('ScrollAd');
}

window.onload = function(){
 document.body.scrollTop++;document.body.scrollTop--;	
}
*/
