﻿
function voidp(sp) {
    var objtt = "<embed id='bbbb' title='dvubb' loop='-1' wmode='opaque' type='application/x-oleobject'" +
            "codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'" +
           "flename='mp' src='" + sp + "' width='320' height='280'" +
            "autoplay='TRUE'></embed>";
    document.getElementById("img-shipin").innerHTML = objtt;
}

  
//留言板验证码更换
function href() {
    var randomnum = Math.random();
    var getimagecode = document.getElementById("Image1");
    getimagecode.src = "UserFiles/yanzheng.aspx? " + randomnum;
}
//Flash 动画
function thisFlash(imgurl, http,ftext,fwidth,fheigth) {
    var focus_width = fwidth; //图片框的宽度 
    var focus_height = fheigth; //图片框的高度 
    var text_height = 0; //文字的高度 
    var swf_height = focus_height + text_height; //flash的高度
    var pics = imgurl; //图片文件的的地址，以“|”为分界
    var links = http; //文字连接的地址，以“|”分界，注意，这个变量是空的时候，就是没有连接哦 
    var texts =ftext; //连接文字 
    document.write('<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 + '">');
    document.write('<param name="allowscriptAccess" value="sameDomain"><param name="movie" value="css/PrevNext.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">');
    document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
    document.write('<param name="FlashVars" value="pics=' + pics + '&links=' + links + '&texts=' + texts + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height + '">');
    document.write('<embed src="" wmode="opaque" FlashVars="pics=' + pics + '&links=' + links + '&texts=' + texts + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height + '" menu="false" bgcolor="#CCCCCC" quality="high" width="' + focus_width + '" height="' + focus_height + '" allowscriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); document.write('</object>');

}

//新闻放大放小
function Newdaxiao() {
   
        $("span").click(function() {

            var thisEle = $("#para").css("font-size");
            var textFontSize = parseFloat(thisEle, 10);
            var unit = thisEle.slice(-2); //获取单位
            var cName = $(this).attr("class");
            if (cName == "bigger") {
                if (textFontSize <= 22) {
                    textFontSize += 2;
                }
            } else if (cName == "smaller") {
                if (textFontSize >= 12) {
                    textFontSize -= 2;
                }
            }
            $("#para").css("font-size", textFontSize + unit); 
        });
    
}

$(function(){
	    var $div_li =$(".tab_menu li");
	    $div_li.mousemove(function(){
			$(this).addClass("selected")            //当前<li>元素高亮
				   .siblings().removeClass("selected");  //去掉其它同辈<li>元素的高亮
            var index =  $div_li.index(this);  // 获取当前点击的<li>元素 在 全部li元素中的索引。
			$("div.tab_box > div")   	//选取子节点。不选取子节点的话，会引起错误。如果里面还有div 
					.eq(index).show()   //显示 <li>元素对应的<div>元素
					.siblings().hide(); //隐藏其它几个同辈的<div>元素
		}).hover(function(){
			$(this).addClass("hover");
		},function(){
			$(this).removeClass("hover");
		})
	 
	}); 
	
	
function selecttiaoma()
{
var tiaoma=document.getElementById("prottiaoma").value;

 $(document).ready(function(){
        $.ajax({
        
           type:"GET",
           url:"UserFiles/Handler.ashx?tiaoma="+tiaoma,
           data:null,
           success:function(result){
              alert(result);
           }
        });
    });
}


function heartBeat(){ 

var diffY;
if (document.documentElement && document.documentElement.scrollTop)
    diffY = document.documentElement.scrollTop;
else if (document.body)
    diffY = document.body.scrollTop
else
    {/*Netscape stuff*/}
    
 
percent=.1*(diffY-lastScrollY); 
if(percent>0)percent=Math.ceil(percent); 
else percent=Math.floor(percent); 
document.getElementById("lovexin12").style.top=parseInt(document.getElementById("lovexin12").style.top)+percent+"px";
//document.getElementById("lovexin14").style.top=parseInt(document.getElementById("lovexin12").style.top)+percent+"px";

lastScrollY=lastScrollY+percent; 
 
}
/*---------------------------------------------------------------*/
 

function showMenu (baseID, divID) {
    baseID = $(baseID);
    divID  = $(divID);
    if (showMenu.timer) clearTimeout(showMenu.timer);
	hideCur();
    divID.style.display = 'block';
	showMenu.cur = divID;

    if (! divID.isCreate) {
        divID.isCreate = true;
        //divID.timer = 0;
        divID.onmouseover = function () {
            if (showMenu.timer) clearTimeout(showMenu.timer);
			hideCur();
            divID.style.display = 'block';
        };

        function hide () {
            showMenu.timer = setTimeout(function () {divID.style.display = 'none';}, 1000);
        }

        divID.onmouseout = hide;
        baseID.onmouseout = hide;
    }
	function hideCur () {
		showMenu.cur && (showMenu.cur.style.display = 'none');
	}
	function $(id) {
    return document.getElementById(id);
}

}

$(function timeimg(){

var ad = parseInt(Math.random()*7+1); 
document.getElementById("imgrund").src="images/imgt"+ad+".jpg";
setTimeout("timeimg()",1000);
});
