﻿j=jQuery.noConflict();j(init);function init(){j("#gosearchbtn").bind("mouseover",function(){var A=j(this).offset();j("#searchtype").fadeIn("fast");j("#searchtype").css("top",A.top+20);j("#searchtype").css("left",A.left);j("#searchtype").children().each(function(){var B=RndColor(20);j(this).attr("rel",B);j(this).css("color",B);j(this).hover(function(){j(this).css("color","white");j(this).css("background-color",j(this).attr("rel"));},function(){j(this).css("color",j(this).attr("rel"));j(this).css("background-color","transparent");});});});j("#searchtype").bind("mouseleave",function(){j("#searchtype").fadeOut("fast");});j("#searchtype").children().each(function(B){var A=j(this).attr("type");j(this).bind("click",function(){var C=j("#searchkey").val();window.location.href="/search?searchkey="+C+"&searchtype="+A;});});j("#waitInfo_s").remove();j(".ctrltext img").each(function(){var A=j(this).width();if(A>500){j(this).width(500);}});}j.waitInfoShow=function(){j("#waitInfo").fadeIn("fast");if(j.browser.msie&&j.browser.version.charAt(0)==6){j(window).bind("scroll",moveAjax);moveAjax();}};j.waitInfoHide=function(){j("#waitInfo").fadeOut("fast");if(j.browser.msie&&j.browser.version.charAt(0)==6){j(window).unbind("scroll",moveAjax);}};function moveAjax(){j("#waitInfo").css("top",document.documentElement.scrollTop);}j.fn.wait=function(B,A){B=B||1000;A=A||"fx";return this.queue(A,function(){var C=this;setTimeout(function(){j(C).dequeue();},B);});};j.fn.check=function(A){return this.each(function(){if(A==null){this.checked=!this.checked;}else{this.checked=(A==true);}});};function showIt(A){if(j.browser.msie&&j.browser.version.charAt(0)==6){j(window).bind("scroll",showItAjax);showItAjax();}j("#alertarea").show();j("#alertarea").html(A);j("#alertarea").animate({top:"+=25"},1000).wait(3000).animate({top:"-=25"},1000,function(){j("#alertarea").hide();if(j.browser.msie&&j.browser.version.charAt(0)==6){j(window).unbind("scroll",showItAjax);}});}function showItAjax(){j("#alertarea").css("top",document.documentElement.scrollTop-50);}function insertFace(D,B){var C=document.getElementById(B);var A=C.value.length;C.focus();if(typeof document.selection!="undefined"){document.selection.createRange().text=D;}else{C.value=C.value.substr(0,C.selectionStart)+D+C.value.substring(C.selectionStart,A);}}function randomCss(A){var B=rndArray(14);j("#"+A+" tr:odd").each(function(C){var D=C;while(D>14){D=D-14;}j(this).attr("class","bk"+B[D]);});}function oddCss(){j("#replyDiv > div:odd").each(function(A){j(this).attr("class","reply");});}function bk(A){j("."+A).each(function(B){j(this).css("background-color",RC());});}function RC(){var B=rndArray(11);var A=new Array("#EFF6FF","#FFF8F0","#F7F0F7","#F1FDE9","#E9FDF1","#ECF3FD","#F7F7F7","#FFF8ED","#FEFFED","#EEE9FD","#FEE7F7","#FFF1F1");return A[B[0]];}function RndColor(B){var C=rndArray(B);var A=new Array("Black","#006400","#BC8F8F","#B22222","#708090","#006400","Teal","Navy","#708090","#FF8C00","#483D8B","#4B0082","#6B8E23","#8B008B","#8B4513","#0000CD","#F08080","#708090","#D2691E","#DAA520","Maroon");return A[C[0]];}function SetHeight(){if(j("#content").height()<400){j("#content").height(400);}}function addheight(B){var A=j("#content").height();j("#content").height(A+B);}function rndArray(A){var D=new Array(A);for(i=0;i<A;i++){D[i]=i+1;}for(i=1;i<=A;i++){var C,B;B=Math.round((Math.random()*(A-i)));C=D[B];D[B]=D[A-i];D[A-i]=C;}return D;}function showCursorMessage(A){j.cursorMessage(A,{offsetX:15,offsetY:0,hideTimeout:4000});}function hideCursorMessage(){j("#cursorMessageDiv").hide();}if(jQuery){(function(A){A.cursorMessageData={};A(window).ready(function(B){if(A("#cursorMessageDiv").length==0){A("body").append('<div id="cursorMessageDiv">&nbsp;</div>');A("#cursorMessageDiv").hide();}A("body").mousemove(function(C){A.cursorMessageData.mouseX=C.pageX;A.cursorMessageData.mouseY=C.pageY;if(A.cursorMessageData.options!=undefined){A._showCursorMessage();}});});A.extend({cursorMessage:function(B,C){if(C==undefined){C={};}if(C.offsetX==undefined){C.offsetX=5;}if(C.offsetY==undefined){C.offsetY=5;}if(C.hideTimeout==undefined){C.hideTimeout=1000;}var D=function(){A("#cursorMessageDiv").html(B).hide();};A("#cursorMessageDiv").html(B).show();if(jQuery.cursorMessageData.hideTimoutId!=undefined){clearTimeout(jQuery.cursorMessageData.hideTimoutId);}jQuery.cursorMessageData.hideTimoutId=setTimeout(D,C.hideTimeout);jQuery.cursorMessageData.options=C;A._showCursorMessage();},_showCursorMessage:function(){A("#cursorMessageDiv").css({top:(A.cursorMessageData.mouseY+A.cursorMessageData.options.offsetY)+"px",left:(A.cursorMessageData.mouseX+A.cursorMessageData.options.offsetX)});}});})(jQuery);}function Validator(){this.init=function(){};this.add=function(F,E,G){j(F).submit(function(){return D(this,j(E),G);});};this.validateAjax=function(H,F){var E=true;j("span[id^='msg__']").empty();H["_Action_"]=F;var G=A(H);if(G!=null&&!G.IsValid){E=false;C(G);}return E;};this.validateSubmit=function(G,F,E){j("span[id^='msg__']").empty();j.post(F+"Post",G,function(H){var I=H;if(I.IsValid==undefined){E(H);}else{C(I);}},"json");};function D(H,F,I){var E=true;F.attr("disabled",true);j("span[id^='msg__']").empty();var G=A(B(H,I));if(G!=null&&!G.IsValid){E=false;C(G,H);}F.attr("disabled",false);return E;}function A(F){var E=null;j.ajax({type:"post",url:"validate.aspx",async:false,data:F,dataType:"json",success:function(G){E=G;}});return E;}function B(G,F){var E=new Array();if(F==null){F=encodeURIComponent(G.action);}E.push("_Action_="+F);j(":input[name]",G).each(function(){E.push(this.name+"="+encodeURIComponent(j(this).val()));});return E.join("&");}function C(E,F){var G=j("#msg__"+E.FieldName);if(G.length>0){G.html(E.ErrorMessage);}else{alert(E.ErrorMessage);}j("#"+E.FieldName,F).select().focus();}}j.extend({includePath:"",include:function(I){var G=typeof I=="string"?[I]:I;for(var A=0;A<G.length;A++){var H=G[A].replace(/^\s|\s$/g,"");var C=H.split(".");var J=C[C.length-1].toLowerCase();var E=J=="css";var F=E?"link":"script";var D=E?" type='text/css' rel='stylesheet' ":" language='javascript' type='text/javascript' ";var B=(E?"href":"src")+"='"+j.includePath+H+"'";if(j(F+"["+B+"]").length==0){document.write("<"+F+D+B+"></"+F+">");}}}});String.format=function(){var B=arguments;if(B.length==0){return"";}if(B.length==1){return arguments[0];}var D=/{(\d+)?}/g,A,C;if(B[1] instanceof Array){A=B[1];C=B[0].replace(D,function(F,E){return A[parseInt(E)];});}else{A=B;C=B[0].replace(D,function(F,E){return A[parseInt(E)+1];});}return C;};String.transform=function(A,B){A=A||"";B=B||{};var C=/\$\{([^{}]*)}/g;var D=function(F,E){return typeof B[E]==="string"||typeof B[E]==="number"?B[E]:F;};return A.replace(C,D);};String.prototype.trim=function(){return this.replace(/(^[\s　]*)|([\s　]*$)/g,"");};String.prototype.ltrim=function(){return this.replace(/(^[\s　]*)/g,"");};String.prototype.rtrim=function(){return this.replace(/([\s　]*$)/g,"");};String.prototype.bytelength=function(){var A=this.match(/[^\x00-\xff]/ig);return this.length+(A==null?0:A.length);};String.prototype.isEmpty=function(){return this.trim().length==0;};