﻿//在指定位置输出指定影片
function OutMovie(id,Url,Name,AutoCode,type)
{
   OutApplert(Url);
   $(id+"Name").innerHTML = "<b><a target='_blank' href='"+type+"/info.aspx?id="+AutoCode+"'>"+Name+"</b>";
}
///输出影片
function OutApplert(ImgURL)
{
$("PalyFrame").src ="3dPlayer.aspx?TheUrl="+ImgURL;
//var outstr = "<iframe src='3dPlayer.aspx?TheUrl="+ImgURL+"' scrolling=\"no\" width=\"440px\" height=\"370px\" frameborder=\"0\"></iframe>";
//return outstr;
}
///--------------------------选项卡切换2------------------------------------//
    function showTab2(elm,num,total,aname,hovername) {
			for(i=1;i<=total;i++) {
				document.getElementById(elm+"_"+i).className = aname ;
			}
			document.getElementById(elm+"_"+num).className = hovername ;
		}
		function showSub2(elm,num,total) {
			for (i=1;i<=total;i++) {
				document.getElementById(elm+"_sub_"+i).style.display = "none" ;
			}
			document.getElementById(elm+"_sub_"+num).style.display = "block" ;
		}
		
		function showRecommend2(elm,num,total,aname,hovername) {
			//showTab2(elm,num,total,aname,hovername) ;
			showSub2(elm,num,total) ;
			document.body.focus();
		}

///--------------------------选项卡切换2end---------------------------------//

//------------------头部顶部广告-------------------

//var time = 500;
//var h = 0;
//function addCount()
//{
//    divheight = $("adtop").style.height;
//    if(time>0)
//    {
//        time--;
//        h = h+5;
//    }
//    else
//    {
//        return;
//    }
//    if(h>divheight)  //高度
//    {
//        return;
//    }
//    $("adtop").style.display = "";
//    $("adtop").style.height = h+"px";
//    setTimeout("addCount()",30); 
//}
function showAds()
    {
        //addCount();
        setTimeout("noneAds()",5000); //停留时间自己适当调整
    }
var T = 260;
var N;

function noneAds()
{
    if(N==null)
    {
       N = Math.ceil($("adtop").offsetHeight); //高度
    }
    if(T>0)
    {
        T--;
        N = N-5;
    }
    else
    {
        return;
    }
    if(N<0)
    {
        $("adtop").style.display = "none";
        return;
    }
    
    $("adtop").style.height = N+"px";
    setTimeout("noneAds()",50); 
}
//-------------------






function show_selector_menu(select_menu_id){
	var select_menu = $(select_menu_id);
	if( select_menu.style.visibility == "inherit"){
		var menu_content = select_menu.firstChild;
		if(navigator.userAgent.indexOf('MSIE')>=0){
			menu_content.style.marginBottom = "0";
			var select_menu_height = select_menu.offsetHeight;
			var timer = setInterval(
								function(){
									var marginb = parseInt(menu_content.style.marginBottom);
									if( marginb<=parseInt("-"+select_menu_height) ){
										menu_content.style.marginBottom = "0";
										select_menu.style.visibility = "hidden";
										clearInterval(timer);	
									}else{
										menu_content.style.marginBottom = (marginb-20)+"px";
									}
								}
								,1);
		}else{
			select_menu.style.visibility = "hidden";
		}
	}else{
		var menu_content = select_menu.firstChild;
		if(navigator.userAgent.indexOf('MSIE')>=0){
			menu_content.style.marginBottom = "-"+ select_menu.offsetHeight+"px";
			var timer = setInterval(
								function(){
									var marginb = parseInt(menu_content.style.marginBottom);
									if(marginb>=0){
										menu_content.style.marginBottom = "0";
										clearInterval(timer);	
									}else{
										menu_content.style.marginBottom = (marginb+20)+"px";
									}
								}
								,1);
		}
		selector_is_clicked[select_menu_id] = true;
		select_menu.style.visibility = "inherit";
	}
}

var showImageIndex = -1;
var imageTimer;
function showImage(imageIndex)
{
	var flash_img_div = document.getElementById("flash_img");
	var flash_title = document.getElementById("flash_title");	
	
	if(imageIndex>fImgs.length-1){
		imageIndex = 0;
	}
	
	if(!fImgs[imageIndex] || imageIndex==showImageIndex)
		return false;	
	var imgId = "__fImg"+imageIndex;
	flash_img_div.filters && flash_img_div.filters[0].Apply();
	for(i=0; i<flash_img_div.childNodes.length; i++){
		flash_img_div.childNodes[i].style.display = "none";
	}
	if( document.getElementById(imgId) ){
		var imga = document.getElementById(imgId);
		imga.style.display = "block";
		if(imga.tagName=="OBJECT"){
			imga.rewind();
			imga.Play();
		}
	}else{
		var pos = fImgs[imageIndex].img.lastIndexOf(".");
		if( fImgs[imageIndex].img.substr(pos+1).substr(0,3).toLowerCase()=="swf" ){
			flash_img_div.innerHTML += '\
				<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="320" height="240" id="'+imgId+'">\
					<param name="movie" value="'+fImgs[imageIndex].img+'" />\
					<param name="quality" value="high" />\
					<embed src="'+fImgs[imageIndex].img+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="320" height="240"></embed>\
				</object>';

		}else{
			var img = new Image();
			img.border = "0";
			img.src = fImgs[imageIndex].img;
			img.width = "320";
			img.height = "240";
			var a = document.createElement("a");
			a.href = fImgs[imageIndex].href;
			a.target = "_blank";
			a.id = imgId;
			a.appendChild(img);
			flash_img_div.appendChild(a);
		}
	}
	flash_img_div.filters && flash_img_div.filters[0].Play();
	var flash_show_ctl_msg = document.getElementById("flash_show_ctl_msg");
	flash_show_ctl_msg.filters && flash_show_ctl_msg.filters[0].Apply();
	flash_title.href = fImgs[imageIndex].href;
	flash_title.innerHTML = fImgs[imageIndex].title;
	flash_show_ctl_msg.filters && flash_show_ctl_msg.filters[0].Play();
	showImageIndex = imageIndex;
	return true;
}
function imagePlay()
{
	if(imageTimer) return;
	if(showImageIndex>=fImgs.length-1){
		showImageIndex = -1;
	}
	showImage(showImageIndex+1);
	imageTimer = setInterval(function(){
					var stat = showImage(showImageIndex+1);
					if(!stat){
						stop();
					}	
				},7000);
}
function stop(){
	clearInterval(imageTimer);
	imageTimer = null;
}
function showNextImage(){
	showImage(showImageIndex+1);
}
function showPrevImage(){
	showImage(showImageIndex-1);
}
var xmlHttp;//定义XMlResponse对象

function UserLogin()
{
    var uName =document.getElementById("txt_username").value;
    var pwd=document.getElementById("txt_password").value;
    if(uName.length<1)
    {
        alert("用户名不能为空!");
        return false;
    }else if(pwd.length<1)
    {
        alert("密码不能为空!");
        return false;
    }else
    {
        AcceptULogin(uName,pwd,"login","userinfo");
    }
}

function AcceptULogin(uName,pwd,a,b)
{
    var url ="UserManage/LoginProcess.aspx?action=Login&uName="+escape(uName)+"&pWord="+escape(pwd);
    CreateXmlHttp();
    xmlHttp.open("post",url);
    xmlHttp.onreadystatechange = function()
    {
        if (xmlHttp.readyState == 4)
        {
            if(xmlHttp.status==200)
            {
                if(xmlHttp.responseText=="false")
                {
                    location.href='UserManage/login.aspx?ERROR='+escape('用户名或密码错误');
                    return;
                }else
                {
                    document.getElementById(a).style.display="none";//隐藏登陆div
                    document.getElementById(b).style.display="block";//显示用户信息div
                    document.getElementById(b).innerHTML=xmlHttp.responseText;
                    return false;
                }
            }
        } 
    }    
    xmlHttp.send(null);
 }
 
 
 //创建xmlHttp对象
function CreateXmlHttp()
{
	try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }
	catch (e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }
	catch (e) { try { xmlHttp = new XMLHttpRequest(); }
	catch (e) { xmlHttp = false; }}}
}



























































