﻿
//等比例缩放方法
//divslt()
//diver获取标签
//widther宽
//heighter高
function divslt(diver,widther,heighter){
		 	jQuery.fn.autoResize = function(options){
				var opts = {
					'width' : widther,
					'height': heighter
				}
				var opt = $.extend(true, {},opts,options || {});
				width = opt.width;
				height = opt.height;
				$('img',this).each(function(){
					var image = new Image();
					image.src = $(this).attr('src');   if(image.width > 0 && image.height > 0 ){
						var image_rate = 1;
						if( (width / image.width) < (height / image.height)){
							image_rate = width / image.width ;
						}else{
							image_rate = height / image.height ;
						}
						if ( image_rate <= 1){
							$(this).width(image.width * image_rate);
							$(this).height(image.height * image_rate);
						}
					}
				})}
			$(diver).autoResize({height:heighter});
		 }

	var timoutid;
 $(document).ready(function() {
	 
	
	 
	 
	 
	$("#test6").click(function(){
		$.XYTipsWindow({
			___title:"会员登陆",
			___content:"url:get?/login.html",
			___width:"245",
			___height:"155",
			___drag:"___boxTitle",
			___windowBgOpacity:"0.5",
			___boxBdColor:"#666",
			___boxBdOpacity:"0.5",
			___boxWrapBdColor:"#ABABAB"
		});
	});
	
	$("#test7").click(function(){
		$.XYTipsWindow({
			___title:"会员注册",
			___content:"url:get?/reg.html",
			___width:"400",
			___height:"350",
			___drag:"___boxTitle",
			___windowBgOpacity:"0.5",
			___boxBdColor:"#666",
			___boxBdOpacity:"0.5",
			___boxWrapBdColor:"#ABABAB",
			___closeID:"wubiaoti",
			___showbg:true
		});
	});
	
	$("#test8").click(function(){
		$.XYTipsWindow({
			___title:"会员注册",
			___content:"url:get?/reg.html",
			___width:"400",
			___height:"350",
			___drag:"___boxTitle",
			___windowBgOpacity:"0.5",
			___boxBdColor:"#666",
			___boxBdOpacity:"0.5",
			___boxWrapBdColor:"#ABABAB",
			___closeID:"wubiaoti",
			___showbg:true
		});
	});
	
	$("#test1").click(function(){
		$.XYTipsWindow({
			___title:"对话框",
			___content:"text:<div style='width:240px;text-align:left;padding:5px 15px;line-height:25px;'>您已经登陆成功！如想从新登陆请点击退出！</div>",
			___width:"280",
			___height:"60",
			___drag:"___boxTitle",
			___button:["确定","退出"],
		   ___callback:function(val){
				
			}
		});
	});
	
	$("#test62").click(function(){
		$.XYTipsWindow({
			___title:"对话框",
			___content:"text:<div style='width:240px;text-align:left;padding:5px 15px;line-height:25px;'>你登陆后才可以发布信息！</div>",
			___width:"280",
			___height:"60",
			___drag:"___boxTitle",
			___button:["确定"],
		   ___callback:function(val){
				
			}
		});
	});

	 $("#index_oks").click(function(){
		Fk_Users_LoginNames=$("#Fk_Users_LoginNamer").val();
		Fk_Users_LoginPasss=$("#Fk_Users_LoginPassr").val();
		$.post("/Manager/reg.asp?Type=6",{Fk_Users_LoginName:Fk_Users_LoginNames,Fk_Users_LoginPass:Fk_Users_LoginPasss},function(result){
		  $(".alert").html(result);
		});
	  });

	
	$("#tabfirst li").each(function(index){
		$(this).click(function(){	
			var liNode = $(this);
			timoutid = setTimeout(function(){
				//将原来显示的内容区域进行隐藏
				$("div.contentin").removeClass("contentin");
				//对有tabin的class定义的li清除tabin的class
				$("#tabfirst li.tabin").removeClass("tabin");
				//当前标签所对应的内容区域显示出来
				//$("div").eq(index).addClass("contentin");
				$("div.contentfirst:eq(" + index + ")").addClass("contentin");
				liNode.addClass("tabin");	
			});			
		});
	});
	
});
