﻿function bookmarkit(){window.external.addFavorite('http://<%=strDomainName %>','<%=strTitle %>')}//改为你自己的网址和站名

//图片按比例缩放
var flag=false;
function DrawImage(ImgD,iwidth,iheight){
    //参数(图片,允许的宽度,允许的高度)
     var image=new Image();
     image.src=ImgD.src;
    if(image.width>0 && image.height>0){
     flag=true;
    if(image.width/image.height>= iwidth/iheight){
        if(image.width>iwidth){  
         ImgD.width=iwidth;
         ImgD.height=(image.height*iwidth)/image.width;
         }else{
         ImgD.width=image.width;  
         ImgD.height=image.height;
         }
         ImgD.alt=image.width+"×"+image.height;
         }
    else{
        if(image.height>iheight){  
         ImgD.height=iheight;
         ImgD.width=(image.width*iheight)/image.height;        
         }else{
         ImgD.width=image.width;  
         ImgD.height=image.height;
         }
         ImgD.alt=image.width+"×"+image.height;
         }
     }
}

function ajsign(sid) 
{
    var leftw= $(window).width()/2 - 230;   //弹出窗位置为正中央
    $('#dingyue').css({"left":leftw});      //将值添加至CSS
    $('#dingyue').show();
    $('#dds').append(sid);
}
function close()
{
    $('#dingyue').hide();
}
function sendem()
{
    var data = "nid=" + $('#dds').html() +"&email="+ $('#ctl00_ContentPlaceHolder1_TextBox1').val();
   $.ajax({
    	    type: "Get",
    	    url: "SendEmail.aspx",
		    data: data,
    	    error: function(){
                alert("程序出错!");
    	    },
    	    success: function(msgg){
    	        $('#sussed').html(msgg);
    	    }
	    });
}
function sendem1()      //控件用
{
    var data = "nid=" + $('#dds').html() +"&email="+ $('#ctl00_ContentPlaceHolder1_Bottom_month1_TextBox1').val();
   $.ajax({
    	    type: "Get",
    	    url: "SendEmail.aspx",
		    data: data,
    	    error: function(){
                alert("程序出错!");
    	    },
    	    success: function(msgg){
    	        $('#sussed').html(msgg);
    	    }
	    });
}

// 选项卡
$(function(){
	$(".tab dl dt>a:first").addClass("tabActive");
	$(".tab dl dd div").not(":first").hide();
	$(".tab dl dt>a").unbind("mouseover").bind("mouseover", function(){
		$(this).siblings("a").removeClass("tabActive").end().addClass("tabActive");
		var index = $(".tab dl dt>a").index( $(this) );
		$(".tab dl dd div").eq(index).siblings(".tab dl dd div").hide().end().fadeIn("slow");
   });
});

// 选项卡
$(function(){
	$(".atab dl dt>a:first").addClass("tabActive");
	$(".atab dl dd div").not(":first").hide();
	$(".atab dl dt>a").unbind("mouseover").bind("mouseover", function(){
		$(this).siblings("a").removeClass("tabActive").end().addClass("tabActive");
		var index = $(".atab dl dt>a").index( $(this) );
		$(".atab dl dd div").eq(index).siblings(".atab dl dd div").hide().end().fadeIn("slow");
   });
});

// 选项卡
$(function(){
	$(".mtab dl dt>a:first").addClass("tabActive");
	$(".mtab dl dd div").not(":first").hide();
	$(".mtab dl dt>a").unbind("mouseover").bind("mouseover", function(){
		$(this).siblings("a").removeClass("tabActive").end().addClass("tabActive");
		var index = $(".mtab dl dt>a").index( $(this) );
		$(".mtab dl dd div").eq(index).siblings(".mtab dl dd div").hide().end().fadeIn("slow");
   });
});
