﻿// JavaScript Document
jQuery(document).ready(function(){
//导航菜单
	jQuery('.nav>ul>li').each(function(){
		jQuery(this).hover(
			function(){
				jQuery(this).children().addClass('active');
				jQuery(this).children().children('li:first').addClass('first');
				jQuery(this).children().children('li:last').addClass('last');
				jQuery(this).find('ul:eq(0)').show();
			},
			function(){
				jQuery(this).find('ul:eq(0)').hide();
				if(jQuery(this).children().attr("isdisplay")!="1")
				{jQuery(this).children().removeClass('active');}
			}
		);
	});
//	jQuery('.nav>ul>li>ul').mouseover(function(){
//		jQuery(this).prev('a').addClass('active');
//	}).mouseout(function(){
//		jQuery(this).prev('a').removeClass('active');
//	});
	var mktheight = jQuery('.sh_right').outerHeight();
	jQuery('.no_bar .sh_place').css('height',mktheight);
//	jQuery('.nav>ul>li>ul>li:last').addClass('aaa');
//	alert ("aaa");
	jQuery('.info_title ul li a').mouseover(function(){
		jQuery('.info_title ul li a').removeClass('cur');
		jQuery(this).addClass('cur');
	});
	jQuery('#but_0').mouseover(function(){
		jQuery('.info_cnt').css('display','none');
		jQuery('#cp_0').css('display','block');
	});
	jQuery('#but_1').mouseover(function(){
		jQuery('.info_cnt').css('display','none');
		jQuery('#cp_1').css('display','block');
	});
	jQuery('#but_2').mouseover(function(){
		jQuery('.info_cnt').css('display','none');
		jQuery('#cp_2').css('display','block');
	});
	jQuery('#but_3').mouseover(function(){
		jQuery('.info_cnt').css('display','none');
		jQuery('#cp_3').css('display','block');
	});
    jQuery('#but_4').mouseover(function(){
		jQuery('.info_cnt').css('display','none');
		jQuery('#cp_4').css('display','block');
	});
    jQuery('#but_5').mouseover(function(){
		jQuery('.info_cnt').css('display','none');
		jQuery('#cp_5').css('display','block');
	});
    jQuery('#but_6').mouseover(function(){
		jQuery('.info_cnt').css('display','none');
		jQuery('#cp_6').css('display','block');
	});
    jQuery('#but_7').mouseover(function(){
		jQuery('.info_cnt').css('display','none');
		jQuery('#cp_7').css('display','block');
	});
});

function down(ID,type)
{
    jQuery.get("/AJAX/DowdnLoadeds.aspx",{down:jQuery("#Text2").val()},function(data){
        if(data=="1")
        {
            jQuery("#temp").val(jQuery("#Text2").val())
            Ext.getCmp("windows1").close();
            window.location.href="/AJAX/DowdnLoadeds.aspx?codes="+jQuery("#temp").val()+"&id="+ID+"&type="+type;
        }
        else if(data=="2")
        {alert("验证码过期！");jQuery("#Text2").val("");}
        else if(data=="3")
        {alert("验证码错误！");jQuery("#Text2").val("");}
        else if(data=="4")
        {alert("请填写验证码！");}
    });
}
function OpenWindow(ID,type)
{
    var htmls="<table border='0' cellpadding='0' cellspacing='0' style='width: 350px; height: 1px'><tr><td style='width: 30%; height: 25px;text-align:right;'>验证码：</td><td width='88%' style='text-align: left; height: 25px;'><input id='Text2' style='width: 150px; height: 18px' type='text' maxlength='20' /></td></tr><tr><td colspan='2' style='width: 30%; height: 25px;text-align:center;'><br/>请与管理员索取验证码<br/>联系电话：0316-3216095&nbsp;&nbsp;0316-7650389</td></tr></table>";
    var win=new Ext.Window({
    id:"windows1",
    title:"验证码",
    width:360,
    height:150,
    resizable:false,
    draggable:true,
    constrain:true,
    collapsible:true,
    buttonAlign:'right',
    bodyStyle:'padding:8px',
    shadowOffset:0,
    disabled:false,
    html:htmls,
    buttons:[{text:"确定",handler:function(){down(ID,type);}},{text:"取消",handler:function(){Ext.getCmp("windows1").close();}}]
    })
    win.show();
}
