﻿/*************************导航效果***************************/
$(document).ready(function() {
	$(".menu1").mouseover(function(){$(".submenudiv1").fadeIn("fast");});
	$('.submenudiv1').bind('mouseremainout', { delay: 5000 }, function(){$(".submenudiv1").fadeOut();});
	$(".menu2").mouseover(function(){$(".submenudiv2").fadeIn("fast");});
	$('.submenudiv2').bind('mouseremainout', { delay: 5000 }, function(){$(".submenudiv2").fadeOut();});
});
/*************************主页弹出广告***************************/
$(document).ready(function() {
		$(".popup .close").click( function () { 
			$(".popup").slideUp(1000); 
			$(".popup .cont").empty();
		});
});

/*************************左右相同高度***************************/
$(function(){
    var left_height = $('.NyLeft').height();
    var right_height = $('.NyRight').height();
    if( left_height > right_height ){
        $('.NyRight').height(left_height);
    }else{
        $('.NyLeft').height(right_height);
    }
});

/*************************首页图片切换***************************/
$(document).ready(function(){   
	var speed = 1000, timeout = 5000;
	var $img = $("#PicFade img");
	//图片容器样式
	$("#PicFade").css({
		position:"relative",
		overflow:"hidden"
	});
	//图片样式
	$("#PicFade img").css({
		position:"absolute",
		top:"0",
		left:"0",
		opacity: "0.0"
	});	
	$("#PicFade img:first").css({
		opacity: "1.0"
	});
	setTimeout(function(){ showNext(0, 1); }, timeout);
	
	function showNext(c, n){   
		$($img[c]).animate({opacity: 0.0}, speed);  
		$($img[n]).animate({opacity: 1.0}, speed);
		c = n;
		n = (n >= $img.length - 1) ? 0 : n+1;
		setTimeout(function(){ showNext(c, n); }, timeout);
	};
});

/********************Flash*********************/
function MakeFlash(Url,Width,Height){                   
document.writeln("<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=\"" + Width + "\" height=\"" + Height + "\">");   
document.writeln("<param name=\"movie\" value=\"" + Url + "\">");   
document.writeln("<param name=\"quality\" value=\"high\" />");       
document.writeln("<param name=\"wmode\" value=\"transparent\">");
document.writeln("<param name=\"menu\" value=\"false\">");
document.writeln("<embed src=\"" + Url + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"" + Width + "\"  height=\"" + Height + "\">");   
document.writeln("</object>");     
} 
//插入flash动画<script language="javascript" type="text/javascript">MakeFlash("images/logo.swf","322","550");</script>

/********************Mail Login*********************/
function MailLogin(User,Pass,Url,Enter,Reset){
document.writeln("<form id='login' action='http://mail.hs-cn.com/extmail/cgi/index.cgi' class='MailLogin' method='post' name='login' target='_blank'><table>")
document.writeln("<tr><td>"+User+"</td><td><input class='input_name' name='username' type='text' /><input class='input_domain' name='domain' type='hidden' value='"+Url+"' /></td></tr>")
document.writeln("<tr><td>"+Pass+"</td><td><input class='input_password' name='password' type='password' /></td></tr>")
document.writeln("<tr><td colspan='2'><input class='input_submit' type='submit' value='"+Enter+"' /><input class='input_submit' type='reset' value='"+Reset+"' /></td></tr>")
document.writeln("</table></form>")
}
//<script language="javascript" type="text/javascript">MailLogin("用户名[用户名文字]","密　码[密码文字]","bbcwx.com[邮箱后缀]","登录[登录文字]","重置[重置文字]");</script>

/********************video*********************/
function MakeVideo(Url,Width,Height){
document.writeln("<object type='application/x-shockwave-flash' data='/style/global/video.swf' width='"+Width+"' height='"+Height+"' id='vcastr3'>")
document.writeln("<param name='movie' value='/style/global/video.swf' /> ")
document.writeln("<param name='allowFullScreen' value='true' />")
document.writeln("<param name='FlashVars' value='xml=")
document.writeln("<vcastr>")
document.writeln("<channel>")
document.writeln("<item>")	
document.writeln("<source>"+Url+"</source>")
document.writeln("</item>")				
document.writeln("</channel>")
//document.writeln("<config>")							//播放器设置
//document.writeln("<defautVolume>0.8</defautVolume>")				//默认的声音大小,最大为1,最小为0
//document.writeln("<isAutoPlay>true</isAutoPlay>")					//是否影片自动开始播放,默认是true
//document.writeln("<isLoadBegin>true</isLoadBegin>")				//是否一开始就读取影片,默认是true
//document.writeln("<isRepeat>false</isRepeat>")					//是否循环播放影片,默认是false
//document.writeln("</config>")
document.writeln("</vcastr>'/>")
document.writeln("</object>")
}
//<script language="javascript" type="text/javascript">MakeVideo("default.flv[视频地址]","970[宽度]","490[高度]");</script>

/********************FocusPic*********************/
function MakeFocusPic(Url,Width,Height){
document.writeln("<object id='FocusPic' data='/style/global/FocusPic.swf?xml="+Url+"' type='application/x-shockwave-flash' width='"+Width+"' height='"+Height+"' >")
document.writeln("<param name='movie' value='/style/global/FocusPic.swf?xml="+Url+"' />")
document.writeln("<param name='quality' value='High' />")
document.writeln("<param name='wmode' value='transparent' />")
document.writeln("</object>")
}
//<script language="javascript" type="text/javascript">MakeFocusPic("/style/global/FocusPic.xml[XML文档地址]","970[宽度]","490[高度]");</script>

/********************IE6 png fix*********************/
/**
* DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML <IMG/>.
* Author: Drew Diller
* Email: drew.diller@gmail.com
* URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/
* Version: 0.0.8a
* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license
*
* Example usage:
* DD_belatedPNG.fix('.png_bg'); // argument is a CSS selector
* DD_belatedPNG.fixPng( someNode ); // argument is an HTMLDomElement
**/
//DD_belatedPNG.fix('div, li, a, img');		//去掉斜杠启用pngfix

