﻿/*
 *  Copyright (c) 2009 iPow(www.iPow.cn)
 */
var status=0;function cnb(A,B){lmp("leftMenu","87");jQuery("#leftNavigation li:eq("+A+")").attr("class","current");window.onresize=function(){lmp("leftMenu","87")}}function lmp(C,B){var A=document.documentElement.clientWidth;if(A>1003){A=parseInt((A-880)/2+25);jQuery("#"+C).css({"margin-left":""+A+"px"})}else jQuery("#"+C).css({"margin-left":""+B+"px"})}function openDialog(B,D,A,C){dialog(""+B+"","iframe:"+D+"",""+A+"px",""+C+"px","iframe")}jQuery.fn.adBottomShow=function(A){A=jQuery.extend({width:280,height:166},A);return this.each(function(){$local=$(this);$local.animate({opacity:"toggle",width:A.width},1000).animate({left:"0px"},"fast");var D=function(A){$local.toggle("slow")},C=function(C){$(C).unbind("click");$local.find("div.adContent").animate({width:"0px",height:A.height},1000);$local.animate({width:"34px",height:A.height},1000).animate({left:"-10px"},"fast");$(C).bind("click",function(){B(C)});$(C).text("\u5f00")},B=function(B){$(B).unbind("click");$local.find("div.adContent").animate({width:A.width-34,height:A.height},1000);$local.animate({width:A.width,height:A.height},1000).animate({left:"0px"},"fast");$(B).bind("click",function(){C(B)});$(B).text("\u5173")};$local.find("a.Min").bind("click",function(){C(this)})})};jQuery.fn.billBoard=function(A){A=jQuery.extend({width:640,height:450,top:100},A);return this.each(function(){$local1=$(this);var D=[],E=function(){D=B($local1);var E=parseInt(D.scrTop),F=parseInt(parseInt(D.offWidth-A.width)/2);$local1.css({"left":F,"top":-410});$local1.animate({top:A.top+100},100).animate({top:A.top},400,function(){$("#bClose").bind("click",function(){C()})})},C=function(){D=B($local1);var A=parseInt(parseInt(D.offWidth-200)/2)+300;$("#billBody").fadeIn("fast",function(){$local1.animate({top:-100},500,function(){$("#billboard").hide()})})},B=function(C){var A=[],D=$(C).offset();A.offLeft=D.left;A.offTop=D.top;A.offWidth=document.documentElement.clientWidth;A.offHeight=document.documentElement.clientHeight;var B;if(typeof window.pageYOffset!="undefined")B=window.pageYOffset;else if(typeof document.compatMode!="undefined"&&document.compatMode!="BackCompat")B=document.documentElement.scrollTop;else if(typeof document.body!="undefined")B=document.body.scrollTop;A.scrTop=B;return A};setTimeout(function(){E()},4000)})};jQuery.fn.showWin=function(A){A=jQuery.extend({width:650,height:400,url:"",type:"url",objID:""},A);return this.each(function(){$local=$(this);var H=A.objID,E=[],F=function(J){E=B(J);var G=parseInt(E.scrTop),C=0;if(!$("#"+H).is(":hidden")){var I=parseInt((E.offWidth-A.width)/2),F=parseInt((E.offHeight-A.height)/2)+parseInt(E.scrTop);$("#msgWin").animate({width:A.width,height:A.height,left:I,top:F},300,function(){D(J)})}else{D(J);$("#"+H).css({"left":E.offLeft,"top":E.offTop});if(E.offWidth>A.width)C=parseInt((E.offWidth-A.width)/2);if(E.offHeight>A.height)G=G+parseInt((E.offHeight-A.height)/2);$("#"+H).animate({opacity:"show",width:A.width,height:A.height,top:G,left:C},500)}},D=function(B){switch(A.type){case"url":G();break;case"ajax":var C=B.title;I(C);break;default:break}},G=function(){$("#"+H).load(A.url+"?tmp="+Math.random(),function(){$("#msgTitle").find("a.close").click(function(){C()})})},I=function(B){var D="<div id=\"msgTitle\">\t\t\t<h2>\u6807\u9898\uff1a"+B+"</h2>\t\t\t<a href=\"javascript:;\" id=\"closeWin\" class=\"close\" title=\"\u5173\u95ed\"></a>\t\t\t</div>\t\t\t<div id=\"msgContainer\" style=\"height:"+parseInt(A.height-35)+"px\"></div>";$("#"+H).html(D);$("#msgTitle").find("a.close").click(function(){C()})},C=function(){var B=0;if(E.offWidth>A.width)B=parseInt((E.offWidth-A.width)/2);var C=parseInt(E.offTop);$("#"+H).animate({opacity:"hide",width:0,height:0,left:E.offLeft,top:C},500)},B=function(C){var A=[],D=$(C).offset();A.offLeft=D.left;A.offTop=D.top;A.offWidth=document.documentElement.clientWidth;A.offHeight=document.documentElement.clientHeight;var B;if(typeof window.pageYOffset!="undefined")B=window.pageYOffset;else if(typeof document.compatMode!="undefined"&&document.compatMode!="BackCompat")B=document.documentElement.scrollTop;else if(typeof document.body!="undefined")B=document.body.scrollTop;A.scrTop=B;return A};$local.click(function(){F(this)})})};function transferFocus(){var A=event.keyCode;if(A==13)event.keyCode=9}function onlyDate(){var A=window.event.srcElement;if(event.keyCode<48||event.keyCode>57)return false;if(A.value.length>4&&A.value.indexOf("-")<1)A.value="";if(A.value.length==4||A.value.length==7)A.value=A.value+"-";if(A.value.length==10&&A.maxLength!=10)A.value=A.value+" ";if(A.value.length==13)A.value=A.value+":"}function checkCardID(E){var G=new Array("\u9a8c\u8bc1\u901a\u8fc7","\u8eab\u4efd\u8bc1\u53f7\u7801\u4f4d\u6570\u4e0d\u5bf9!","\u8eab\u4efd\u8bc1\u53f7\u7801\u51fa\u751f\u65e5\u671f\u8d85\u51fa\u8303\u56f4\u6216\u542b\u6709\u975e\u6cd5\u5b57\u7b26!","\u8eab\u4efd\u8bc1\u53f7\u7801\u9519\u8bef!","\u8eab\u4efd\u8bc1\u53f7\u7801\u9519\u8bef!"),B={11:"\u5317\u4eac",12:"\u5929\u6d25",13:"\u6cb3\u5317",14:"\u5c71\u897f",15:"\u5185\u8499\u53e4",21:"\u8fbd\u5b81",22:"\u5409\u6797",23:"\u9ed1\u9f99\u6c5f",31:"\u4e0a\u6d77",32:"\u6c5f\u82cf",33:"\u6d59\u6c5f",34:"\u5b89\u5fbd",35:"\u798f\u5efa",36:"\u6c5f\u897f",37:"\u5c71\u4e1c",41:"\u6cb3\u5357",42:"\u6e56\u5317",43:"\u6e56\u5357",44:"\u5e7f\u4e1c",45:"\u5e7f\u897f",46:"\u6d77\u5357",50:"\u91cd\u5e86",51:"\u56db\u5ddd",52:"\u8d35\u5dde",53:"\u4e91\u5357",54:"\u897f\u85cf",61:"\u9655\u897f",62:"\u7518\u8083",63:"\u9752\u6d77",64:"\u5b81\u590f",65:"\u65b0\u7586",71:"\u53f0\u6e7e",81:"\u9999\u6e2f",82:"\u6fb3\u95e8",91:"\u56fd\u5916"},E,F,A,C,D,H=new Array();H=E.split("");if(B[parseInt(E.substr(0,2))]==null)return G[4];switch(E.length){case 15:if((parseInt(E.substr(6,2))+1900)%4==0||((parseInt(E.substr(6,2))+1900)%100==0&&(parseInt(E.substr(6,2))+1900)%4==0))ereg=/^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}$/;else ereg=/^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}$/;if(ereg.test(E))return true;else{alert(G[2]);return false}break;case 18:if(parseInt(E.substr(6,4))%4==0||(parseInt(E.substr(6,4))%100==0&&parseInt(E.substr(6,4))%4==0))ereg=/^[1-9][0-9]{5}19[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}[0-9Xx]$/;else ereg=/^[1-9][0-9]{5}19[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}[0-9Xx]$/;if(ereg.test(E)){C=(parseInt(H[0])+parseInt(H[10]))*7+(parseInt(H[1])+parseInt(H[11]))*9+(parseInt(H[2])+parseInt(H[12]))*10+(parseInt(H[3])+parseInt(H[13]))*5+(parseInt(H[4])+parseInt(H[14]))*8+(parseInt(H[5])+parseInt(H[15]))*4+(parseInt(H[6])+parseInt(H[16]))*2+parseInt(H[7])*1+parseInt(H[8])*6+parseInt(H[9])*3;F=C%11;D="F";A="10X98765432";D=A.substr(F,1);if(D==H[17])return true;else{alert(G[3]);return false}}else{alert(G[2]);return false}break;default:alert(G[1]);return false;break}return true}function checkInt(A){if(!isInt(A)){alert("\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u5f20\u6570\uff01");return false}return true}function isInt(B){var A=/^-?\d+$/;if(B.search(A)!=0)return false;return true}function onSubmit(){var A="",C=$.trim($("#txtName").val()),H=$("input[@name=radSex][@checked]").val(),B=$.trim($("#txtBirthDate").val()),D=$.trim($("#txtCardNo").val()),G=$.trim($("#txtCompany").val()),J=$.trim($("#txtTel").val()),I=$.trim($("#txtAddress").val()),K=$.trim($("#txtZip").val()),E=$("input[@name=radActivity][@checked]").val(),F=$.trim($("#txtTicketCount").val());if(C==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u59d3\u540d\uff01");$("#txtName").focus();return false}if(H==undefined){alert("\u8bf7\u9009\u62e9\u60a8\u7684\u6027\u522b\uff01");return false}if(B==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u51fa\u751f\u5e74\u6708\uff01");$("#txtBirthDate").focus();return false}if(D==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u8eab\u4efd\u8bc1\u53f7\uff01");$("#txtCardNo").focus();return false}else{var M=checkCardID(D);if(!M){$("#txtCardNo").focus();return false}}if(J==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u8054\u7cfb\u7535\u8bdd\uff01");$("#txtTel").focus();return false}else if(isNaN(J.replace("-",""))){alert("\u8054\u7cfb\u7535\u8bdd\u683c\u5f0f\u9519\u8bef\uff01");$("#txtTel").focus();return false}if(I==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u901a\u8baf\u5730\u5740\uff01");$("#txtAddress").focus();return false}if(K==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u90ae\u653f\u7f16\u7801\uff01");$("#txtZip").focus();return false}if(!checkInt(F)){alert("\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u5f20\u6570\uff01");$("#txtTicketCount").focus();return false}else if(parseInt(F)==0){alert("\u8bf7\u8f93\u5165\u5e74\u5361\u8ba2\u8d2d\u5f20\u6570\uff01");$("#txtTicketCount").focus();return false}if(E==undefined){alert("\u8bf7\u9009\u62e9\u4f1a\u5458\u6d3b\u52a8\uff01");return false}if(status>0){alert("\u6570\u636e\u6b63\u5728\u63d0\u4ea4\u4e2d\u6216\u60a8\u5df2\u7ecf\u63d0\u4ea4\u4e86\uff01");return false}else{status=parseInt(status+1);G=$("#txtCompany").text();var L={Name:C,Sex:H,BirthDay:B,IdentityID:D,Phone:J,Address:I,PostCode:K,CompanyName:G,ActivityChoiceID:E,Type:"Register",TicketCount:F};jQuery.ajax({type:"post",url:"/Webmanage/Member/Register.aspx",data:L,dataType:"json",success:function(A){if(A.Type=="OK"){status=0;alert("\u60a8\u7684\u4fe1\u606f\u5df2\u7ecf\u63d0\u4ea4\u6210\u529f\uff01\u8c22\u8c22\uff01");$("#msgWin").hide()}}})}}function getAllPosition(D){var A=[];if(D!=undefined&&D!=""){var E=$(D).offset();A.offLeft=E.left;A.offTop=E.top}A.offWidth=document.documentElement.clientWidth;A.offHeight=document.documentElement.clientHeight;var C,B,F;if(typeof window.pageYOffset!="undefined")C=window.pageYOffset;else if(typeof document.compatMode!="undefined"&&document.compatMode!="BackCompat"){C=document.documentElement.scrollTop;B=document.documentElement.scrollLeft}else if(typeof document.body!="undefined"){C=document.body.scrollTop;B=document.body.scrollLeft}if(A.offWidth>1003)F=parseFloat(A.offWidth-1003)/2;else F=0;A.scrTop=C;A.scrLeft=B;A.offsetLeft=F;return A}$(document).ready(function(){var C=getAllPosition(document.getElementById("rb"));if(C.offTop<=465)$("#rb").css("top","465px");var A=C.offWidth;if(A>=1003){var B=(A-810)/2+810;$("#rb").css("left",""+B+"px")}else $("#rb").css("left","906px");$("#rb").show();$(window).scroll(function(){C=getAllPosition(document.getElementById("rb"));if(C.scrTop>=100){var A=C.scrTop+265;$("#rb").css("top",""+A+"px");if(A<=465)$("#rb").css("top","465px")}});$(window).resize(function(){C=getAllPosition(document.getElementById("rb"));var B=C.offWidth;if(B>=1003){var A=(B-810)/2+810;$("#rb").css("left",""+A+"px")}else $("#rb").css("left","906px")});$("#rb ul li").mouseover(function(){$(this).children("ul").show()});$("#rb ul li").mouseout(function(){$(this).children("ul").hide()});iRainbow()});function getWeather(){$.get("/api/weather.php?temp="+Math.random(),function(A){$("#weatherCon").html(A)})}function iRainbow(){getWeather();$("#iRainToolQuick").quickMenu({});$("#iRainToolQQ").quickMenu({})}jQuery.fn.quickMenu=function(A){A=jQuery.extend({index:0},A);return this.each(function(){var A=$(this);A.click(function(){jQuery(".quicklinks").css("background-position","0px -29px");A.find("span").fadeIn("500")});A.mouseleave(function(){A.find("span").fadeOut("500",function(){jQuery(".quicklinks").css("background-position","-22px -77px")})})})};function indexUi(){this.developer="\u6df1\u5733\u5e02\u4e92\u52a8\u529b\u79d1\u6280\u6709\u9650\u516c\u53f8\uff08http://www.ipow.cn\uff09"}indexUi.prototype={init:function(){var A=this;A.resize();$(window).resize(function(){A.resize()})},resize:function(){var D=document.documentElement.clientWidth,B=document.getElementById("mainContainer").scrollWidth>document.getElementById("mainContainer").offsetWidth?document.getElementById("mainContainer").scrollWidth:document.getElementById("mainContainer").offsetWidth;if(D>1280){var A=parseInt((D-1280)/2),E=0,C=0;if(A>236){E=parseInt(A-236);C=A+B;$("#indexLeft").css({"left":E+"px"});$("#indexRight").css({"left":C+"px"})}else{E=0;C=A+B;$("#indexLeft").css({"width":A+"px","left":E+"px"});$("#indexRight").css({"width":A+"px","left":C+"px"})}$("#indexLeft").show();$("#indexRight").show()}else{$("#indexLeft").hide();$("#indexRight").hide()}}}