﻿// JavaScript Document


function mov(id,mn,dn,cls1,cls2){
	for(s=1;s<=20;s++){
		try{
			if(id==s){
				document.getElementById('img'+s).src='img/menu/m'+s+'_2.gif';
				//alert(mn+s);
				document.getElementById(mn+s).className=cls1;
				document.getElementById(dn+s).style.display='block';
			}
			else{
				document.getElementById('img'+s).src='img/menu/m'+s+'_1.gif';
				document.getElementById(mn+s).className=cls2;
				document.getElementById(dn+s).style.display='none';
			}
		}catch(e){}
	}
}


// 会员注册 鼠标事件
function reg_ov(id,cls){
	for(s=1;s<=20;s++){
		try{
			if(id==s){
				//alert(mn+s);
				document.getElementById(ln+s).style.display='block';
			}
			else{
				document.getElementById(ln+s).style.display='none'
			}
		}catch(e){}
	}
}

//会员输入框效果
function reg_ov(id,rn1){
	for(s=1;s<=20;s++){
		try{
			if(id==s){
				//alert(mn+s);
				document.getElementById(rn1+s).style.display='block';
			}
			else{
				document.getElementById(rn1+s).style.display='none'
			}
		}catch(e){}
	}
}


//通用Flash播件代码
function flash(src,w,h){
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'">');
document.write('<param name="movie" value="'+src+'"><param name="quality" value="high"><param name="menu" value="false">');
document.write('<param name="wmode" value="transparent">');
document.write('<param name="allowFullScreen" value="true">');
document.write('<embed src="'+src+'" width="'+w+'" height="'+h+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false" wmode="transparent"></embed>');
document.write(' </object>');
}

//首页中间大图广告代码
function index_ad(){
var defaultOpts = { interval: 5000, fadeInTime: 200, fadeOutTime: 200 };
//Iterate over the current set of matched elements
	var _titles = $("ul.slide-txt li");
	var _titles_bg = $("ul.op li");
	var _bodies = $("ul.slide-pic li");
	var _count = _titles.length;
	var _current = 0;
	var _intervalID = null;
	var stop = function() { window.clearInterval(_intervalID); };
	var slide = function(opts) {
		if (opts) {
			_current = opts.current || 0;
		} else {
			_current = (_current >= (_count - 1)) ? 0 : (++_current);
		};
		_bodies.filter(":visible").fadeOut(defaultOpts.fadeOutTime, function() {
			_bodies.eq(_current).fadeIn(defaultOpts.fadeInTime);
			_bodies.removeClass("cur").eq(_current).addClass("cur");
		});
		_titles.removeClass("cur").eq(_current).addClass("cur");
		_titles_bg.removeClass("cur").eq(_current).addClass("cur");
	}; //endof slide
	var go = function() {
		stop();
		_intervalID = window.setInterval(function() { slide(); }, defaultOpts.interval);
	}; //endof go
	var itemMouseOver = function(target, items) {
		stop();
		var i = $.inArray(target, items);
		slide({ current: i });
	}; //endof itemMouseOver
	_titles.hover(function() { if($(this).attr('class')!='cur'){itemMouseOver(this, _titles); }else{stop();}}, go);
	//_titles_bg.hover(function() { itemMouseOver(this, _titles_bg); }, go);
	_bodies.hover(stop, go);
	//trigger the slidebox
	go();
}


//简化获取对象方法.
function $I(id) {	//此处将原来的$()替换为$I(),避免与JQ中的定义冲突.
    return (typeof id == "string" ? document.getElementById(id) : id);
}
function $N(name) {
    return document.getElementsByName(name);
}
function $TN(name, root) {
    return root ? $I(root).getElementsByTagName(name) : document.getElementsByTagName(name);
}
function exist(id) {
    return $I(id) != null;
}
function $class(className) {
    return document.getElementsByClassName(className);
}
function $NodeClass(node, classname) {
    return getElementsByClassName(node, classname);
}

//产品滚动函数 可控制左右滚动模块.
//参数说明下面已有,不赘述,最后四个参数如省略,则为缺省值.
/*----使用方法-----
1、meta中加载"<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />",解决IE8下滚动滚没了的bug;
2、预先加载"<script type="text/javascript" language="javascript" src="js/ScrollPic.js"></script>";
3、调用实例"<script>goToScroll("caseList","goLeft","goRight",280);</script>";
----使用方法 end-----*/
<!--//--><![CDATA[//><!--
function goToScroll(listID,leftID,rightID,moveWidth,speedTime,stepWidth,isAuto,autoPlayIntervalTime) {
	var scrollPic_02 = new ScrollPic();
	scrollPic_02.scrollContId   = listID; //内容容器ID
	scrollPic_02.arrLeftId      = leftID;//左箭头ID
	scrollPic_02.arrRightId     = rightID; //右箭头ID
	scrollPic_02.frameWidth     = $I(listID).offsetWidth;//显示框宽度
	//alert($I(listID).offsetWidth);
	scrollPic_02.pageWidth      = moveWidth; //翻页宽度
	
	//如下参数如省略,则为缺省值.
	scrollPic_02.speed          = speedTime ? speedTime : 1; //移动速度(单位毫秒，越小越快)
	scrollPic_02.space          = stepWidth ? stepWidth : 10; //每次移动像素(单位px，越大越快)
	scrollPic_02.autoPlay       = isAuto != null ? isAuto : true; //自动播放
	scrollPic_02.autoPlayTime   = autoPlayIntervalTime ? autoPlayIntervalTime : 2; //自动播放间隔时间(秒)
	scrollPic_02.initialize(); //初始化
	
	setTimeout(function(){$I(listID).scrollLeft = 0;},100);	//重要,修复IE/FF下刷新后滚动位置错位的bug.
}
//--><!]]>
