﻿
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 geustbook()
{
   $("#Form1").validate({
        rules: {
            Text1: "required",
            Text2: "required",
            Text3: {
                required: true,
                minlength: 10 
            },
            Text4: {
                required: true,
                email: true
            },
            Text6: "required",
            Text7: "required"
        },
        messages: {
            Text1: "*",
            Text2: "*",
            Text3: {
                required: "*",
                minlength: "请正确输入联系电话"
            },
            Text4: {
                required: "请输入 Email",
                email: "Email 格式错误"
            },
            Text6: "*",
            Text7: "*"
        }
    });
}

function en_geustbook()
{
   $("#Form1").validate({
        rules: {
            Text1: "required",
            Text2: "required",
            Text3: {
                required: true,
                minlength: 10 
            },
            Text4: {
                required: true,
                email: true
            },
            Text6: "required",
            Text7: "required"
        },
        messages: {
            Text1: "*",
            Text2: "*",
            Text3: {
                required: "*",
                minlength: "Please enter the correct telephone"
            },
            Text4: {
                required: "Enter Email",
                email: "Email Malformed"
            },
            Text6: "*",
            Text7: "*"
        }
    });
}
//留言板验证码更换
function href() {
    var randomnum = Math.random();
    var getimagecode = document.getElementById("Image1");
    getimagecode.src = "UserFiles/yanzheng.aspx? " + randomnum;
}
//Flash 动画
function thisFlash(imgurl, http,ftext,textwidth,fwidth,fheigth) {
    var focus_width = fwidth; //图片框的宽度 
    var focus_height = fheigth; //图片框的高度
    var text_height = textwidth; //文字的高度 
    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 doscroll()
{tab_menu();
var demo=document.getElementById("demo")
var demo1=document.getElementById("demo1")
var demo2=document.getElementById("demo2")
var Picspeed=40
demo2.innerHTML=demo1.innerHTML
function Marquee1(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar1=setInterval(Marquee1,Picspeed)
demo.onmouseover=function() {clearInterval(MyMar1)}
demo.onmouseout=function() {MyMar1=setInterval(Marquee1,Picspeed)}
}

 function tab_menu() {
    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($)
{
    $.fn.blockSlide = function(settings)
    {
        settings = jQuery.extend({
            speed: "normal",
            num: 4,
            timer: 1000,
            flowSpeed: 300
        }, settings);
        return this.each(function()
        {
            $.fn.blockSlide.scllor($(this), settings);
        });
    };
    $.fn.blockSlide.scllor = function($this, settings)
    {
        var index = 0;
        var imgScllor = $("div:eq(0)>div", $this);
        var timerID;
        //自动播放
        var MyTime = setInterval(function()
        {
            ShowjQueryFlash(index);
            index++;
            if (index == settings.num)
                index = 0;
        }, settings.timer);
        var ShowjQueryFlash = function(i)
        {
            $(imgScllor).eq(i).animate({ opacity: 1 }, settings.speed).css({ "z-index": "100" }).siblings().animate({ opacity: 0 }, settings.speed).css({ "z-index": "0" });
        }
    }
})(jQuery);
