function awesm_share(channel,url,title,content){var awesm_api_key='21a4f98a4ae3826df510157f62bf6003366fd340d38c879368be4c7876666dca';var linkedin_source='';var awesm_tool='awesm-share-js'
var getUrlVars=function(){var vars=[],hash;var hashes=window.location.href.slice(window.location.href.indexOf('?')+1).split('&');for(var i=0;i<hashes.length;i++){hash=hashes[i].split('=');vars.push(hash[0]);vars[hash[0]]=hash[1];}
return vars;}
if(typeof(url)=='undefined'||url==''){url=encodeURIComponent(location.href);}else{url=encodeURIComponent(url);}
if(typeof(title)=='undefined'||title==''){title=encodeURIComponent(document.title);}else{title=encodeURIComponent(title);}
if(typeof(content)=='undefined'||content==''){content=title;}else{content=encodeURIComponent(content);}
switch(channel){case'twitter':var awesm_channel='twitter';if(decodeURIComponent(content).length>'120'){content=decodeURIComponent(content).substring(0,117)+'...';content=encodeURIComponent(content);}
var awesm_destination='http://twitter.com/home?status='+content+'+AWESM_TARGET';var window_specs='height=570,width=810,resizable=1';break;case'facebook':var awesm_channel='facebook-share';var awesm_destination='http://www.facebook.com/sharer.php?u=AWESM_TARGET&t='+title;var window_specs='toolbar=0, status=0, width=626, height=436';break;case'gbuzz':var awesm_channel='googlebuzz';var awesm_destination='http://www.google.com/buzz/post?url=AWESM_TARGET&message='+content;var window_specs='resizable=0, scrollbars=0, width=690, height=415';break;case'myspace':var awesm_channel='myspace';var awesm_destination='http://www.myspace.com/index.cfm?fuseaction=postto&u=AWESM_TARGET&t='+title+'&c='+content;var window_specs='toolbar=0, status=0, width=825, height=725';break;case'linkedin':var awesm_channel='linkedin';var awesm_destination='http://www.linkedin.com/shareArticle?mini=true&url=AWESM_TARGET&title='+title+'&summary='+content;if(linkedin_source!=''){awesm_destination+='&source='+encodeURIComponent(linkedin_source);}
var window_specs='toolbar=0, status=0, width=550, height=400';break;case'email':var awesm_channel='mailto';var awesm_destination='mailto:?subject='+title+'&body='+content+'%20AWESM_TARGET';var window_specs='toolbar=0, status=0, width=300, height=200';break;}
var awesmShareIt='http://create.awe.sm/url/share?version=1&api_key='+awesm_api_key+'&target='+url+'&share_type='+awesm_channel+'&create_type='+awesm_tool+'&destination='+encodeURIComponent(awesm_destination);var pageParams=getUrlVars();if(pageParams['awesm']){awesmShareIt+='&awesm_parent='+pageParams['awesm'];}
if(typeof(awesm_notes)!='undefined'&&awesm_notes!=null){awesmShareIt+='&notes='+awesm_notes;}
switch(channel){case'email':var newWin=window.open(awesmShareIt,'_blank',window_specs);setTimeout(function(){newWin.close();},3000)
break;default:window.open(awesmShareIt,'_blank',window_specs);}};var showWindown=true;var templateSrc="http://www.kijubi.com/";function tipsWindown(title,content,width,height,drag,time,showbg,cssName){$("#windown-box").remove();if(width=='100%'){var width=($(document).width()-30);alert(width);}
var width=width>=1440?this.width=1440:this.width=width;if(height=='100%'){var height=($(document).height()-30);}
var height=height>=900?this.height=900:this.height=height;if(showWindown==true){var simpleWindown_html=new String;simpleWindown_html="<div id=\"windownbg\" style=\"height:"+$(document).height()+"px;filter:alpha(opacity=0);opacity:0;z-index: 999901\"></div>";simpleWindown_html+="<div id=\"windown-box\">";simpleWindown_html+="<div id=\"windown-title\"><h2></h2><span id=\"windown-close\">关闭</span></div>";simpleWindown_html+="<div id=\"windown-content-border\"><div id=\"windown-content\"></div></div>";simpleWindown_html+="</div>";$("body").append(simpleWindown_html);show=false;}
contentType=content.substring(0,content.indexOf(":"));content=content.substring(content.indexOf(":")+1,content.length);switch(contentType){case"frame":$("#windown-content").html(content);break;case"text":$("#windown-content").html(content);break;case"id":$("#windown-content").html($("#"+content+"").html());break;case"img":$("#windown-content").ajaxStart(function(){$(this).html("<img src='"+templateSrc+"images/loading.gif' class='loading' />");});$.ajax({error:function(){$("#windown-content").html("<p class='windown-error'>加载数据出错...</p>");},success:function(html){$("#windown-content").html("<img src="+content+" alt='' />");}});break;case"url":var content_array=content.split("?");$("#windown-content").ajaxStart(function(){$(this).html("<img src='"+templateSrc+"images/loading.gif' class='loading' />");});$.ajax({type:content_array[0],url:content_array[1],data:content_array[2],error:function(){$("#windown-content").html("<p class='windown-error'>加载数据出错...</p>");},success:function(html){$("#windown-content").html(html);}});break;case"iframe":$("#windown-content").ajaxStart(function(){$(this).html("<img src='"+templateSrc+"images/loading.gif' class='loading' />");});$.ajax({error:function(){$("#windown-content").html("<p class='windown-error'>加载数据出错...</p>");},success:function(html){$("#windown-content").html("<iframe src=\""+content+"\" width=\"100%\" height=\""+parseInt(height)+"px"+"\" scrolling=\"auto\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\"></iframe>");}});}
$("#windown-title h2").html(title);if(showbg=="true"){$("#windownbg").show();}else{$("#windownbg").remove();};$("#windownbg").animate({opacity:"0.5"},"normal");$("#windown-box").show();if(height>=900){$("#windown-title").css({width:(parseInt(width)+22)+"px"});$("#windown-content").css({width:(parseInt(width)+17)+"px",height:height+"px"});}else{$("#windown-title").css({width:(parseInt(width)+10)+"px"});$("#windown-content").css({width:width+"px",height:height+"px"});}
var cw=document.documentElement.clientWidth,ch=document.documentElement.clientHeight,est=document.documentElement.scrollTop;var _version=$.browser.version;if(_version==6.0){$("#windown-box").css({left:"50%",top:(parseInt((ch)/2)+est)+"px",marginTop:-((parseInt(height)+53)/2)+"px",marginLeft:-((parseInt(width)+32)/2)+"px",zIndex:"999999"});}else{$("#windown-box").css({left:"50%",top:"50%",marginTop:-((parseInt(height)+53)/2)+"px",marginLeft:-((parseInt(width)+32)/2)+"px",zIndex:"999999"});};var Drag_ID=document.getElementById("windown-box"),DragHead=document.getElementById("windown-title");var moveX=0,moveY=0,moveTop,moveLeft=0,moveable=false;if(_version==6.0){moveTop=est;}else{moveTop=0;}
var sw=Drag_ID.scrollWidth,sh=Drag_ID.scrollHeight;DragHead.onmouseover=function(e){if(drag=="true"){DragHead.style.cursor="move";}else{DragHead.style.cursor="default";}};DragHead.onmousedown=function(e){if(drag=="true"){moveable=true;}else{moveable=false;}
e=window.event?window.event:e;var ol=Drag_ID.offsetLeft,ot=Drag_ID.offsetTop-moveTop;moveX=e.clientX-ol;moveY=e.clientY-ot;document.onmousemove=function(e){if(moveable){e=window.event?window.event:e;var x=e.clientX-moveX;var y=e.clientY-moveY;if(x>0&&(x+sw<cw)&&y>0&&(y+sh<ch)){Drag_ID.style.left=x+"px";Drag_ID.style.top=parseInt(y+moveTop)+"px";Drag_ID.style.margin="auto";}}}
document.onmouseup=function(){moveable=false;};Drag_ID.onselectstart=function(e){return false;}}
$("#windown-content").attr("class","windown-"+cssName);var closeWindown=function(){$("#windownbg").remove();$("#windown-box").fadeOut("slow",function(){$(this).remove();});}
if(time==""||typeof(time)=="undefined"){$("#windown-close").click(function(){$("#windownbg").remove();$("#windown-box").fadeOut("slow",function(){$(this).remove();});});}else{setTimeout(closeWindown,time);}}
function tipsWindown(title,content,width,height,drag,time,showbg,cssName,closeFunction){$("#windown-box").remove();if(width=='100%'){var width=($(window).width()-60);}
var width=width>=1440?this.width=1440:this.width=width;if(height=='100%'){var height=($(window).height()-100);}
var height=height>=900?this.height=900:this.height=height;if(showWindown==true){var simpleWindown_html=new String;simpleWindown_html="<div id=\"windownbg\" style=\"height:"+$(document).height()+"px;filter:alpha(opacity=0);opacity:0;z-index: 999901\"></div>";simpleWindown_html+="<div id=\"windown-box\">";simpleWindown_html+="<div id=\"windown-title\"><h2></h2><span id=\"windown-close\">关闭</span></div>";simpleWindown_html+="<div id=\"windown-content-border\"><div id=\"windown-content\"></div></div>";simpleWindown_html+="</div>";$("body").append(simpleWindown_html);show=false;}
contentType=content.substring(0,content.indexOf(":"));content=content.substring(content.indexOf(":")+1,content.length);switch(contentType){case"frame":$("#windown-content").html(content);break;case"text":$("#windown-content").html(content);break;case"id":$("#windown-content").html($("#"+content+"").html());break;case"img":$("#windown-content").ajaxStart(function(){$(this).html("<img src='"+templateSrc+"images/loading.gif' class='loading' />");});$.ajax({error:function(){$("#windown-content").html("<p class='windown-error'>加载数据出错...</p>");},success:function(html){$("#windown-content").html("<img src="+content+" alt='' />");}});break;case"url":var content_array=content.split("?");$("#windown-content").ajaxStart(function(){$(this).html("<img src='"+templateSrc+"images/loading.gif' class='loading' />");});$.ajax({type:content_array[0],url:content_array[1],data:content_array[2],error:function(){$("#windown-content").html("<p class='windown-error'>加载数据出错...</p>");},success:function(html){$("#windown-content").html(html);}});break;case"iframe":$("#windown-content").ajaxStart(function(){$(this).html("<img src='"+templateSrc+"images/loading.gif' class='loading' />");});$.ajax({error:function(){$("#windown-content").html("<p class='windown-error'>加载数据出错...</p>");},success:function(html){$("#windown-content").html("<iframe src=\""+content+"\" width=\"100%\" height=\""+parseInt(height)+"px"+"\" scrolling=\"auto\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\"></iframe>");}});}
$("#windown-title h2").html(title);if(showbg=="true"){$("#windownbg").show();}else{$("#windownbg").remove();};$("#windownbg").animate({opacity:"0.5"},"normal");$("#windown-box").show();if(height>=900){$("#windown-title").css({width:(parseInt(width)+22)+"px"});$("#windown-content").css({width:(parseInt(width)+17)+"px",height:height+"px"});}else{$("#windown-title").css({width:(parseInt(width)+10)+"px"});$("#windown-content").css({width:width+"px",height:height+"px"});}
var cw=document.documentElement.clientWidth,ch=document.documentElement.clientHeight,est=document.documentElement.scrollTop;var _version=$.browser.version;if(_version==6.0){$("#windown-box").css({left:"50%",top:(parseInt((ch)/2)+est)+"px",marginTop:-((parseInt(height)+53)/2)+"px",marginLeft:-((parseInt(width)+32)/2)+"px",zIndex:"999999"});}else{$("#windown-box").css({left:"50%",top:"50%",marginTop:-((parseInt(height)+53)/2)+"px",marginLeft:-((parseInt(width)+32)/2)+"px",zIndex:"999999"});};var Drag_ID=document.getElementById("windown-box"),DragHead=document.getElementById("windown-title");var moveX=0,moveY=0,moveTop,moveLeft=0,moveable=false;if(_version==6.0){moveTop=est;}else{moveTop=0;}
var sw=Drag_ID.scrollWidth,sh=Drag_ID.scrollHeight;DragHead.onmouseover=function(e){if(drag=="true"){DragHead.style.cursor="move";}else{DragHead.style.cursor="default";}};DragHead.onmousedown=function(e){if(drag=="true"){moveable=true;}else{moveable=false;}
e=window.event?window.event:e;var ol=Drag_ID.offsetLeft,ot=Drag_ID.offsetTop-moveTop;moveX=e.clientX-ol;moveY=e.clientY-ot;document.onmousemove=function(e){if(moveable){e=window.event?window.event:e;var x=e.clientX-moveX;var y=e.clientY-moveY;if(x>0&&(x+sw<cw)&&y>0&&(y+sh<ch)){Drag_ID.style.left=x+"px";Drag_ID.style.top=parseInt(y+moveTop)+"px";Drag_ID.style.margin="auto";}}}
document.onmouseup=function(){moveable=false;};Drag_ID.onselectstart=function(e){return false;}}
$("#windown-content").attr("class","windown-"+cssName);var closeWindown=function(){$("#windownbg").remove();$("#windown-box").fadeOut("slow",function(){$(this).remove();});}
if(time==""||typeof(time)=="undefined"){$("#windown-close").click(function(){$("#windownbg").remove();$("#windown-box").fadeOut("slow",function(){$(this).remove();});if(closeFunction){eval("var obj = "+closeFunction+";");}});}else{setTimeout(closeWindown,time);}}
function tipsWindown_local(title,content,width,height,drag,time,showbg,cssName){$("#windown-box-local").remove();if(width=='100%'){var width=($(document).width()-30);}
var width=width>=1440?this.width=1440:this.width=width;if(height=='100%'){var height=($(document).height()-30);}
var height=height>=900?this.height=900:this.height=height;if(showWindown==true){var simpleWindown_html=new String;simpleWindown_html="<div id=\"windownbg\" style=\"height:"+$(document).height()+"px;filter:alpha(opacity=0);opacity:0;z-index: 999901\"></div>";simpleWindown_html+="<div id=\"windown-box-local\">";simpleWindown_html+="<div id=\"windown-content-border-local\"><div id=\"windown-content\"></div></div>";simpleWindown_html+="</div>";$("body").append(simpleWindown_html);show=false;}
contentType=content.substring(0,content.indexOf(":"));content=content.substring(content.indexOf(":")+1,content.length);switch(contentType){case"frame":$("#windown-content").html(content);break;case"text":$("#windown-content").html(content);break;case"id":$("#windown-content").html($("#"+content+"").html());break;case"img":$("#windown-content").ajaxStart(function(){$(this).html("<img src='"+templateSrc+"images/loading.gif' class='loading' />");});$.ajax({error:function(){$("#windown-content").html("<p class='windown-error'>加载数据出错...</p>");},success:function(html){$("#windown-content").html("<img src="+content+" alt='' />");}});break;case"url":var content_array=content.split("?");$("#windown-content").ajaxStart(function(){$(this).html("<img src='"+templateSrc+"images/loading.gif' class='loading' />");});$.ajax({type:content_array[0],url:content_array[1],data:content_array[2],error:function(){$("#windown-content").html("<p class='windown-error'>加载数据出错...</p>");},success:function(html){$("#windown-content").html(html);}});break;case"iframe":$("#windown-content").ajaxStart(function(){$(this).html("<img src='"+templateSrc+"images/loading.gif' class='loading' />");});$.ajax({error:function(){$("#windown-content").html("<p class='windown-error'>加载数据出错...</p>");},success:function(html){$("#windown-content").html("<iframe src=\""+content+"\" width=\"100%\" height=\""+parseInt(height)+"px"+"\" scrolling=\"auto\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\"></iframe>");}});}
$("#windown-title h2").html(title);if(showbg=="true"){$("#windownbg").show();}else{$("#windownbg").remove();};$("#windownbg").animate({opacity:"0.5"},"normal");$("#windown-box-local").show();var cw=document.documentElement.clientWidth,ch=document.documentElement.clientHeight,est=document.documentElement.scrollTop;var _version=$.browser.version;if(_version==6.0){$("#windown-box-local").css({left:"50%",top:(parseInt((ch)/2)+est)+"px",marginTop:-((parseInt(height)+53)/2)+"px",marginLeft:-((parseInt(width)+32)/2)+"px",zIndex:"999999"});}else{$("#windown-box-local").css({left:"50%",top:"50%",marginTop:-((parseInt(height)+53)/2)+"px",marginLeft:-((parseInt(width)+32)/2)+"px",zIndex:"999999"});};var Drag_ID=document.getElementById("windown-box-local"),DragHead=document.getElementById("windown-content-border-local");var moveX=0,moveY=0,moveTop,moveLeft=0,moveable=false;if(_version==6.0){moveTop=est;}else{moveTop=0;}
$("#windown-content").attr("class","windown-"+cssName);var closeWindown=function(){$("#windownbg").remove();$("#windown-box-local").fadeOut("slow",function(){$(this).remove();});}
if(time==""||typeof(time)=="undefined"){$("#windown-close").click(function(){$("#windownbg").remove();$("#windown-box-local").fadeOut("slow",function(){$(this).remove();});});}else{setTimeout(closeWindown,time);}};window.onerror=function(desc,page,line,chr){}
$(function(){$('a').focus(function(){this.blur();});SI.Files.stylizeAll();slider.init();$('input.text-default').each(function(){$(this).attr('default',$(this).val());}).focus(function(){if($(this).val()==$(this).attr('default'))
$(this).val('');}).blur(function(){if($(this).val()=='')
$(this).val($(this).attr('default'));});$('input.text,textarea.text').focus(function(){$(this).addClass('textfocus');}).blur(function(){$(this).removeClass('textfocus');});var popopenobj=0,popopenaobj=null;$('a.popup').click(function(){var pid=$(this).attr('rel').split('|')[0],_os=parseInt($(this).attr('rel').split('|')[1]);var pobj=$('#'+pid);if(!pobj.length)
return false;if(typeof popopenobj=='object'&&popopenobj.attr('id')!=pid){popopenobj.hide(50);$(popopenaobj).parent().removeClass(popopenobj.attr('id').split('-')[1]+'-open');popopenobj=null;}
return false;});$('p.images img').click(function(){var newbg=$(this).attr('src').split('bg/bg')[1].split('-thumb')[0];$(document.body).css('backgroundImage','url('+_siteRoot+'images/bg/bg'+newbg+'.jpg)');$(this).parent().find('img').removeClass('on');$(this).addClass('on');return false;});$('div.sc-large div.img:has(div.tml)').each(function(){$('div.tml',this).hide();$(this).append('<a href="#" class="tml_open">&nbsp;</a>').find('a').css({left:parseInt($(this).offset().left)+540,top:parseInt($(this).offset().top)+1}).click(function(){$(this).siblings('div.tml').slideToggle();return false;}).focus(function(){this.blur();});});});var slider={num:-1,cur:0,cr:[],al:null,at:10*1000,ar:true,init:function(){if(!slider.data||!slider.data.length)
return false;var d=slider.data;slider.num=d.length;var pos=Math.floor(Math.random()*1);for(var i=0;i<slider.num;i++){$('#'+d[i].id).css({left:((i-pos)*540)});$('#slide-nav').append('<a id="slide-link-'+i+'" href="#" onclick="slider.slide('+i+');return false;" onfocus="this.blur();">'+(i+1)+'</a>');}
$('img,div#slide-controls',$('div#slide-holder')).fadeIn();slider.text(d[pos]);slider.on(pos);slider.cur=pos;window.setTimeout('slider.auto();',slider.at);},auto:function(){if(!slider.ar)
return false;var next=slider.cur+1;if(next>=slider.num)next=0;slider.slide(next);},slide:function(pos){if(pos<0||pos>=slider.num||pos==slider.cur)
return;window.clearTimeout(slider.al);slider.al=window.setTimeout('slider.auto();',slider.at);var d=slider.data;for(var i=0;i<slider.num;i++)
$('#'+d[i].id).stop().animate({left:((i-pos)*540)},1000,'swing');slider.on(pos);slider.text(d[pos]);slider.cur=pos;},on:function(pos){$('#slide-nav a').removeClass('on');$('#slide-nav a#slide-link-'+pos).addClass('on');},text:function(di){slider.cr['a']=di.client;slider.cr['b']=di.desc;slider.ticker('#slide-client span',di.client,0,'a');slider.ticker('#slide-desc',di.desc,0,'b');},ticker:function(el,text,pos,unique){if(slider.cr[unique]!=text)
return false;ctext=text.substring(0,pos)+(pos%2?'-':'_');$(el).html(ctext);if(pos==text.length)
$(el).html(text);else
window.setTimeout('slider.ticker("'+el+'","'+text+'",'+(pos+1)+',"'+unique+'");',30);}};if(!window.SI){var SI={};};SI.Files={htmlClass:'SI-FILES-STYLIZED',fileClass:'file',wrapClass:'cabinet',fini:false,able:false,init:function(){this.fini=true;},stylize:function(elem){if(!this.fini){this.init();};if(!this.able){return;};elem.parentNode.file=elem;elem.parentNode.onmousemove=function(e){if(typeof e=='undefined')e=window.event;if(typeof e.pageY=='undefined'&&typeof e.clientX=='number'&&document.documentElement){e.pageX=e.clientX+document.documentElement.scrollLeft;e.pageY=e.clientY+document.documentElement.scrollTop;};var ox=oy=0;var elem=this;if(elem.offsetParent){ox=elem.offsetLeft;oy=elem.offsetTop;while(elem=elem.offsetParent){ox+=elem.offsetLeft;oy+=elem.offsetTop;};};};},stylizeAll:function(){if(!this.fini){this.init();};if(!this.able){return;};}};;var isIE=document.all?true:false;var isNS=document.layers?true:false;function onlyDigits(e,decReq){var key=(isIE)?window.event.keyCode:e.which;var obj=(isIE)?event.srcElement:e.target;var isNum=(key>47&&key<58)?true:false;var dotOK=(key==46&&decReq=='decOK'&&(obj.value.indexOf(".")<0||obj.value.length==0))?true:false;e.which=(!isNum&&!dotOK&&isNS)?0:key;return(isNum||dotOK);}
function nullToZero(theField){if(!theField.value)
theField.value="0";return true;}
function validate_date(date_field,desc){if(!date_field.value)
return true;var in_date=stripCharString(date_field.value," ");in_date=in_date.toUpperCase();var date_is_bad=0;if(!allowInString(in_date,"/0123456789T+-"))
date_is_bad=1;if(!date_is_bad){var has_rdi=0;if(in_date.indexOf("T")>=0){has_rdi=1;}
if(!date_is_bad&&has_rdi&&(in_date.indexOf("T")!=0)){date_is_bad=2;}
if(!date_is_bad&&has_rdi&&(in_date.length==1)){var d=new Date();var return_month=parseInt(d.getMonth()+1).toString();return_month=(return_month.length==1?"0":"")+return_month;var return_date=parseInt(d.getDate()).toString();return_date=(return_date.length==1?"0":"")+return_date;in_date=return_month+"/"+return_date+"/"+get_full_year(d);has_rdi=0;}
if(!date_is_bad&&has_rdi&&(in_date.length>1)&&!(in_date.charAt(1)=="+"||in_date.charAt(1)=="-")){date_is_bad=3;}
if(!date_is_bad&&has_rdi&&isNaN(parseInt(in_date.substring(2,in_date.length),10))){date_is_bad=4;}
if(!date_is_bad&&has_rdi&&(parseInt(in_date.substring(2,in_date.length),10)<0)){date_is_bad=5;}
if(!date_is_bad&&has_rdi){var d=new Date();ms=d.getTime();offset=parseInt(in_date.substring(2,in_date.length),10);if(in_date.charAt(1)=="+"){ms+=(86400000*offset);}else{ms-=(86400000*offset);}
d.setTime(ms);var return_month=parseInt(d.getMonth()+1).toString();return_month=(return_month.length==1?"0":"")+return_month;var return_date=parseInt(d.getDate()).toString();return_date=(return_date.length==1?"0":"")+return_date;in_date=return_month+"/"+return_date+"/"+get_full_year(d);has_rdi=0;}}
if(!date_is_bad){var date_pieces=new Array();date_pieces=in_date.split("/");if(date_pieces.length==2){var d=new Date();in_date=in_date+"/"+get_full_year(d);date_pieces=in_date.split("/");}
if(date_pieces.length!=3||parseInt(date_pieces[0],10)<1||parseInt(date_pieces[0],10)>12||parseInt(date_pieces[1],10)<1||parseInt(date_pieces[1],10)>31||(date_pieces[2].length!=2&&date_pieces[2].length!=4)){date_is_bad=6;}}
if(date_is_bad){alert(desc+" must be in the format of mm/dd/yy, mm/dd/yyyy, t, t+n or t-n.");date_field.focus();return(false);}
var ms=Date.parse(in_date);var d=new Date();d.setTime(ms);var return_date=d.toLocaleString();var return_month=parseInt(d.getMonth()+1).toString();return_month=(return_month.length==1?"0":"")+return_month;var return_date=parseInt(d.getDate()).toString();return_date=(return_date.length==1?"0":"")+return_date;return_date=return_month+"/"+return_date+"/"+get_full_year(d);date_field.value=return_date;return true;}
function validate_date_inGrid(date_field,desc){var getValue=date_field.getValue()
if(getValue==" ")
return true;var in_date=stripCharString(date_field.getValue()," ");in_date=in_date.toUpperCase();var date_is_bad=0;if(!allowInString(in_date,"/0123456789T+-"))
date_is_bad=1;if(!date_is_bad){var has_rdi=0;if(in_date.indexOf("T")>=0){has_rdi=1;}
if(!date_is_bad&&has_rdi&&(in_date.indexOf("T")!=0)){date_is_bad=2;}
if(!date_is_bad&&has_rdi&&(in_date.length==1)){var d=new Date();var return_month=parseInt(d.getMonth()+1).toString();return_month=(return_month.length==1?"0":"")+return_month;var return_date=parseInt(d.getDate()).toString();return_date=(return_date.length==1?"0":"")+return_date;in_date=return_month+"/"+return_date+"/"+get_full_year(d);has_rdi=0;}
if(!date_is_bad&&has_rdi&&(in_date.length>1)&&!(in_date.charAt(1)=="+"||in_date.charAt(1)=="-")){date_is_bad=3;}
if(!date_is_bad&&has_rdi&&isNaN(parseInt(in_date.substring(2,in_date.length),10))){date_is_bad=4;}
if(!date_is_bad&&has_rdi&&(parseInt(in_date.substring(2,in_date.length),10)<0)){date_is_bad=5;}
if(!date_is_bad&&has_rdi){var d=new Date();ms=d.getTime();offset=parseInt(in_date.substring(2,in_date.length),10);if(in_date.charAt(1)=="+"){ms+=(86400000*offset);}else{ms-=(86400000*offset);}
d.setTime(ms);var return_month=parseInt(d.getMonth()+1).toString();return_month=(return_month.length==1?"0":"")+return_month;var return_date=parseInt(d.getDate()).toString();return_date=(return_date.length==1?"0":"")+return_date;in_date=return_month+"/"+return_date+"/"+get_full_year(d);has_rdi=0;}}
if(!date_is_bad){var date_pieces=new Array();date_pieces=in_date.split("/");if(date_pieces.length==2){var d=new Date();in_date=in_date+"/"+get_full_year(d);date_pieces=in_date.split("/");}
if(date_pieces.length!=3||parseInt(date_pieces[0],10)<1||parseInt(date_pieces[0],10)>12||parseInt(date_pieces[1],10)<1||parseInt(date_pieces[1],10)>31||(date_pieces[2].length!=2&&date_pieces[2].length!=4)){date_is_bad=6;}}
if(date_is_bad){return(false);}
var ms=Date.parse(in_date);var d=new Date();d.setTime(ms);var return_date=d.toLocaleString();var return_month=parseInt(d.getMonth()+1).toString();return_month=(return_month.length==1?"0":"")+return_month;var return_date=parseInt(d.getDate()).toString();return_date=(return_date.length==1?"0":"")+return_date;return_date=return_month+"/"+return_date+"/"+get_full_year(d);date_field.setValue(return_date);return true;}
function get_full_year(d){var y=""
if(d.getFullYear()!=null)
{y=d.getFullYear();if(y<1930)y+=100;}else
{y=d.getYear();if(y>69&&y<100)y+=1900;if(y<1000)y+=2000;}
return y;}
function stripCharString(InString,CharString){var OutString="";for(var Count=0;Count<InString.length;Count++){var TempChar=InString.substring(Count,Count+1);var Strip=false;for(var Countx=0;Countx<CharString.length;Countx++){var StripThis=CharString.substring(Countx,Countx+1)
if(TempChar==StripThis){Strip=true;break;}}
if(!Strip)
OutString=OutString+TempChar;}
return(OutString);}
function allowInString(InString,RefString){if(InString.length==0)return(false);for(var Count=0;Count<InString.length;Count++){var TempChar=InString.substring(Count,Count+1);if(RefString.indexOf(TempChar,0)==-1)
return(false);}
return(true);};(function($){$.tools=$.tools||{};$.tools.overlay={version:'1.1.2',addEffect:function(name,loadFn,closeFn){effects[name]=[loadFn,closeFn];},conf:{top:'10%',left:'center',absolute:false,speed:'normal',closeSpeed:'fast',effect:'default',close:null,oneInstance:true,closeOnClick:true,closeOnEsc:true,api:false,expose:null,target:null}};var effects={};$.tools.overlay.addEffect('default',function(onLoad){this.getOverlay().fadeIn(this.getConf().speed,onLoad);},function(onClose){this.getOverlay().fadeOut(this.getConf().closeSpeed,onClose);});var instances=[];function Overlay(trigger,conf){var self=this,$self=$(this),w=$(window),closers,overlay,opened,expose=conf.expose&&$.tools.expose.version;var jq=conf.target||trigger.attr("rel");overlay=jq?$(jq):null||trigger;if(!overlay.length){throw"Could not find Overlay: "+jq;}
if(trigger&&trigger.index(overlay)==-1){trigger.click(function(e){self.load(e);return e.preventDefault();});}
$.each(conf,function(name,fn){if($.isFunction(fn)){$self.bind(name,fn);}});$.extend(self,{load:function(e){if(self.isOpened()){return self;}
var eff=effects[conf.effect];if(!eff){throw"Overlay: cannot find effect : \""+conf.effect+"\"";}
if(conf.oneInstance){$.each(instances,function(){this.close(e);});}
e=e||$.Event();e.type="onBeforeLoad";$self.trigger(e);if(e.isDefaultPrevented()){return self;}
opened=true;if(expose){overlay.expose().load(e);}
var top=conf.top;var left=conf.left;var oWidth=overlay.outerWidth({margin:true});var oHeight=overlay.outerHeight({margin:true});if(typeof top=='string'){top=top=='center'?Math.max((w.height()-oHeight)/2,0):parseInt(top,10)/100*w.height();}
if(left=='center'){left=Math.max((w.width()-oWidth)/2,0);}
if(!conf.absolute){top+=w.scrollTop();left+=w.scrollLeft();}
overlay.css({top:top,left:left,position:'absolute'});e.type="onStart";$self.trigger(e);eff[0].call(self,function(){if(opened){e.type="onLoad";$self.trigger(e);}});if(conf.closeOnClick){$(document).bind("click.overlay",function(e){if(!self.isOpened()){return;}
var et=$(e.target);if(et.parents(overlay).length>1){return;}
$.each(instances,function(){this.close(e);});});}
if(conf.closeOnEsc){$(document).unbind("keydown.overlay").bind("keydown.overlay",function(e){if(e.keyCode==27){$.each(instances,function(){this.close(e);});}});}
return self;},close:function(e){if(!self.isOpened()){return self;}
e=e||$.Event();e.type="onBeforeClose";$self.trigger(e);if(e.isDefaultPrevented()){return;}
opened=false;effects[conf.effect][1].call(self,function(){e.type="onClose";$self.trigger(e);});var allClosed=true;$.each(instances,function(){if(this.isOpened()){allClosed=false;}});if(allClosed){$(document).unbind("click.overlay").unbind("keydown.overlay");}
return self;},getContent:function(){return overlay;},getOverlay:function(){return overlay;},getTrigger:function(){return trigger;},getClosers:function(){return closers;},isOpened:function(){return opened;},getConf:function(){return conf;},bind:function(name,fn){$self.bind(name,fn);return self;},unbind:function(name){$self.unbind(name);return self;}});$.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(i,ev){self[ev]=function(fn){return self.bind(ev,fn);};});if(expose){if(typeof conf.expose=='string'){conf.expose={color:conf.expose};}
$.extend(conf.expose,{api:true,closeOnClick:conf.closeOnClick,closeOnEsc:false});var ex=overlay.expose(conf.expose);ex.onBeforeClose(function(e){self.close(e);});self.onClose(function(e){ex.close(e);});}
closers=overlay.find(conf.close||".close");if(!closers.length&&!conf.close){closers=$('<div class="close"></div>');overlay.prepend(closers);}
closers.click(function(e){self.close(e);});}
$.fn.overlay=function(conf){var el=this.eq(typeof conf=='number'?conf:0).data("overlay");if(el){return el;}
if($.isFunction(conf)){conf={onBeforeLoad:conf};}
var globals=$.extend({},$.tools.overlay.conf);conf=$.extend(true,globals,conf);this.each(function(){el=new Overlay($(this),conf);instances.push(el);$(this).data("overlay",el);});return conf.api?el:this;};})(jQuery);
