﻿$.fn.tab=function(options){
	options=options?options:{type:0};
	var css_u,css_s;
	if(options.type==0){css_u="box_2_un",css_s="box_2_s_b";}
	else{css_u="box_2_un",css_s="box_2_s";}
	
	var o=this;
	var t=$("ul:eq(0)>li",o);
	jQuery.each(t,function(i, obj){
		$(obj).click(function(){$("ul:eq(0)>li:not(:eq(" + i + "))",o).removeClass(css_s).addClass(css_u);$(obj).removeClass(css_u).addClass(css_s);o.children(":gt(0):not(:eq(" + i + "))").hide();o.children(":gt(0):eq(" + i + ")").show();});
	});
};

function FlashBox() {
	var focus_width=460;
	var focus_height=150;
	var text_height = 20;
	var swf_height  = focus_height + text_height;
	var temp="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\""+ focus_width +"\" height=\""+ swf_height +"\">";
	temp+=('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="pic/pix.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
	temp+=('<param name="menu" value="false"><param name=wmode value="opaque">');
	temp+=('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
	temp+=('<embed src="pic/pix.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	temp+=('</object>');
	return temp;
}

function chk()
{
    if(document.all.UserName.value==""){alert("请填写用户名！");return false;}
    if(document.all.PassWord.value==""){alert("请填写密码！");return false;}
    alert("小提示：如果要使用高级登录，点击《通行证》登录。");
    return true;
}

$(function(){
	$("#b_flashgame").tab({type:1});
	$("#b_books").tab();
	$("#b_flash").html(FlashBox());
	$("form").bind("submit",chk);
});