function getattributevalue(o, key) { if (!o.attributes) return null; var attr = o.attributes; for (var i = 0; i < attr.length; i++){ if (key.tolowercase() == attr[i].name.tolowercase()) return attr[i].value; } return null; } function focusinputele(o) { if (o.value == getattributevalue(o, 'defaultval')){ o.value = ''; o.style.color = "#b6b6b6"; } } function blurinputele(o) { if (o.value == '') { o.value = getattributevalue(o, 'defaultval'); o.style.color = "#b6b6b6"; } } $(function () { $(".nli").hover(function () { $(".nli a.li_h").css("color", "#0092e5"); $(".nli").find(".sub_bg").show(); $(".nli").find(".sub_line").show(); }, function () { $(".nli a.li_h").css("color", "#171717") $(".nli").find(".sub_bg").hide(); $(".nli").find(".sub_line").hide(); }); tabpic(); $("#nav").slide({ type: "menu",// 效果类型,针对菜单/导航而引入的参数(默认slide) titcell: ".nli", //鼠标触发对象 targetcell: ".sub", //titcell里面包含的要显示/消失的对象 effect: "fade", //targetcell下拉效果 delaytime: 0, //效果时间 triggertime: 0, //鼠标延迟触发时间(默认150) returndefault: true //鼠标移走后返回默认状态,例如默认频道是"预告片",鼠标移走后会返回"预告片"(默认false) }); }); //菜单 function navfun(selectedindex) { $("#nav li.up_li").eq(selectedindex - 1).addclass('hover'); } function download(obj) { var d_url = $("#" + obj).val(); if (d_url == "") { alert('请选择要下载的型号'); return; } window.open(d_url); } function checkform() { var kw = document.getelementbyid("txtkeywork"); if (kw.value == "" || kw.value == "请输入关键字") { alert('请输入关键字'); kw.focus(); return false; } } //切换图片 var tabpic = function () { var list = $(".submenu li"); if (list.length < 0) return; list.each(function () { var t = $(this); var a = t.find(".li_text .sub_p a"); var pic = t.find(".pic img"); var datasrc = pic.attr("src"); a.map(function () { var src = $(this).attr("data-src"); $(this).bind({ mouseenter: function () { pic.attr("src", src); }, mouseleave: function () { pic.attr("src", datasrc); } }); }); }); } var scurrimage = ""; //var scurrtext = ""; function showitem(sbig, w, h, text) { //if (document.getelementbyid("imgshow")) { // scurrimage = switchplay(sbig, w, h); // //scurrtext = text; // settimeout(showx, 10); //} if (sbig.indexof("youku") > 0) { sbig = sbig.replace("/upload/", ""); document.getelementbyid("imgshow").innerhtml = ""; return; } if (ac_fl_runcontent == 0) { alert("this page requires ac_runactivecontent.js."); } else { ac_fl_runcontent( 'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', 'width', w, 'height', h, 'src', '/jcplayer', 'quality', 'high', 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'align', 'middle', 'play', 'true', 'loop', 'true', 'scale', 'noscale', 'wmode', 'window', 'devicefont', 'false', 'id', 'jcplayer', 'bgcolor', '#ffffff', 'name', 'jcplayer', 'menu', 'true', 'allowfullscreen', 'true', 'allowscriptaccess', 'samedomain', 'flashvars', 'videourl=' + sbig + '&autoplay=true&startphotosource=&backgroundcolor1=0x333333&backgroundcolor2=0x222222', 'movie', '/jcplayer', 'salign', 'tl' ); } } function showx() { document.getelementbyid("imgshow").innerhtml = scurrimage; //document.getelementbyid("imgtext").innerhtml = scurrtext; } function switchplay(url, p_width, p_height) { var videowidth = p_width; var videoheight = p_height; var returnvalue = ""; if (url.indexof(".") != -1) { var swf_width = p_width; var swf_height = p_height; var extypearr = url.split("."); var extype = extypearr[extypearr.length - 1].tolowercase(); var sfwstring = ".swf"; var flvstring = ".flv"; var mpstring = ".mp3,.mp4,.wmv,.avi,.mpeg,.wma"; var rmstring = ".rm3,.rmvb"; var picstring = ".jpg,.gif,.bmp,.png"; if (sfwstring.indexof(extype) != -1) { swf_width = videowidth; swf_height = videoheight; returnvalue = "<\/embed>"; } else if (flvstring.indexof(extype) != -1) { swf_width = videowidth; swf_height = videoheight; var texts = ''; var files = url; returnvalue = returnvalue + ""; returnvalue = returnvalue + ""; returnvalue = returnvalue + ""; returnvalue = returnvalue + ""; returnvalue = returnvalue + ""; returnvalue = returnvalue + ""; } else if (mpstring.indexof(extype) != -1 || rmstring.indexof(extype) != -1) { returnvalue = "<\/embed>"; } else if (rmstring.indexof(extype) != -1) { swf_width = videowidth; swf_height = videoheight; returnvalue = "<\/embed>"; } else if (picstring.indexof(extype) != -1) { returnvalue = ""; } else { swf_width = videowidth; swf_height = videoheight; returnvalue = "<\/embed>"; } } return returnvalue; }