function mw_FixInnerHTML(source,destination){if(document.getElementById(source)!=null&&document.getElementById(destination)!=null&&document.getElementById(source).innerHTML!=''){var s=document.getElementById(source);var d=document.getElementById(destination);var _html=s.innerHTML;s.innerHTML='';changeInnerHTML(destination,_html);s.style.display='none';}
else if(document.getElementById(destination)!=null){}}function registerMenu(){var i;for(i=1;i<10;i++){var menu=document.getElementsByName("mwmenu"+i);if(menu!=null&&menu.length!=0){var j;for(j=0;j<menu.length;j++){addEvent(menu[j],'mouseover',function(e){mwsetdropmenulayer(this,this.name.replace("mwmenu",""));});addEvent(menu[j],'mouseout',function(e){mwclosedropdownlayer();});}}
else{}}}function MeworksaddLoadEvent(func){var oldonload=window.onload;if(typeof window.onload !='function'){window.onload=func;}
else{window.onload=function(){if(oldonload){oldonload();}func();}}}function changeInnerHTML(divId,html){var e=null;if(document.getElementById){e=document.getElementById(divId);if(!e)return false;if("innerHTML" in e){try{e.innerHTML=html;}catch(eee){e.innerHTML='';var _div=document.createElement("div");_div.innerHTML=html;e.appendChild(_div);}}
else if("firstChild" in e&&"data" in e.firstChild){e.firstChild.data=html;return true;}
else{return false;}}
else if(document.layers){e=document.layers[divId];if(typeof e=="undefined"||!e){e=document[divId];if(typeof e=="undefined"||!e)return false;}e.document.open();e.document.write(html);e.document.close();return true;}
else if(document.all){e=document.all[divId];if(typeof e=="undefined"||!e)return false;e.innerHTML=html;return true;}return false;}function mw_Fix(){mw_FixInnerHTML("DIV1","mbig");mw_FixInnerHTML("DIV2","mbig1");}try{MeworksaddLoadEvent(registerMenu);MeworksaddLoadEvent(mw_Fix);}catch(e){}function getruleno(x){}var menuvertical=false;if(typeof addEvent !='function'){var addEvent=function(o,t,f,l){var d='addEventListener',n='on'+t,rO=o,rT=t,rF=f,rL=l;if(o[d]&&!l)return o[d](t,f,false);if(!o._evts)o._evts={};if(!o._evts[t]){o._evts[t]=o[n] ?{b:o[n]}:{};o[n]=new Function('e','var r=true,o=this,a=o._evts["'+t+'"],i;for(i in a){'+'o._f=a[i];r=o._f(e||window.event)!=false&&r;o._f=null;'+'}return r');if(t !='unload')addEvent(window,'unload',function(){removeEvent(rO,rT,rF,rL);});}if(!f._i)f._i=addEvent._i++;o._evts[t][f._i]=f;};addEvent._i=1;var removeEvent=function(o,t,f,l){var d='removeEventListener';if(o[d]&&!l)return o[d](t,f,false);if(o._evts&&o._evts[t]&&f._i)delete o._evts[t][f._i];};}function cancelEvent(e,c){e.returnValue=false;if(e.preventDefault)e.preventDefault();if(c){e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();}}; function checkMaxLength(e,el){switch(e.keyCode){case 37:return true;case 38:return true;case 39:return true;case 40:return true;case 8:return true;case 46:return true;case 27:el.value='';return true;}return(el.value.length<el.getAttribute("MWMaxLength"));}function mwsetdropmenulayer(x,no){var layer=document.getElementById("mwdropdownmenu"+no);if(layer!=null&&layer.className.indexOf('mc99fhidden')==-1){if(typeof(menuvertical)==undefined){layer.style.left=(mwgetObjectX(x))+'px';layer.style.top=(mwgetObjectY(x)+x.offsetHeight)+'px';}
else if(menuvertical==false){layer.style.left=(mwgetObjectX(x))+'px';layer.style.top=(mwgetObjectY(x)+x.offsetHeight)+'px';}
else{layer.style.left=(mwgetObjectX(x)+x.offsetWidth)+'px';layer.style.top=(mwgetObjectY(x))+'px';}mwshowdropmenulayer(no);}}function GetAbsoluteLocationEx(element){if(arguments.length !=1||element==null){return null;}var elmt=element;var offsetTop=elmt.offsetTop;var offsetLeft=elmt.offsetLeft;var offsetWidth=elmt.offsetWidth;var offsetHeight=elmt.offsetHeight;if(document.documentElement["getBoundingClientRect"]){if(!element)return;var box=element.getBoundingClientRect(),doc=element.ownerDocument,body=document.body,docElem=document.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,offsetTop=box.top+(self.pageYOffset||body.scrollTop)-clientTop,offsetLeft=box.left+(self.pageXOffset||body.scrollLeft)-clientLeft;}
else{while(elmt=elmt.offsetParent){if(elmt.style.position=='absolute'||elmt.style.position=='relative'||(elmt.style.overflow !='visible'&&elmt.style.overflow !='')){break;}offsetTop+=elmt.offsetTop;offsetLeft+=elmt.offsetLeft;}}return{absoluteTop:offsetTop,absoluteLeft:offsetLeft,offsetWidth:offsetWidth,offsetHeight:offsetHeight};}function mwshowdropmenulayer(no){document.getElementById("mwdropdownmenu"+no).style.display="inline";}function mwclosedropdownlayer(){var i;for(i=1;i<10;i++){if(document.getElementById("mwdropdownmenu"+i)!=null){document.getElementById("mwdropdownmenu"+i).style.display="none";}}}function mwgetObjectX(x){return GetAbsoluteLocationEx(x).absoluteLeft;var y=0;while(x){y+=x.offsetLeft;x=x.offsetParent;}return y;}function mwgetObjectY(x){return GetAbsoluteLocationEx(x).absoluteTop;var y=0;while(x){y+=x.offsetTop;x=x.offsetParent;}return y;}function mwruncodeall(){var htmllayer=document.getElementById("htmllayer");var span_list=document.getElementsByTagName("textarea");for(x=0;x<span_list.length;x++){var tname=span_list[x].id;if(tname.substr(0,6)=="mycode"){tno=tname.substr(6,tname.length-6);mwruncode(tno);}}}MeworksaddLoadEvent(mwruncodeall);function mwruncode(x){var myifrm=document.getElementById("mycodeif"+x);var myift=document.frames ? document.frames["mycodeif"+x].document:myifrm.contentDocument;myift.open();myift.clear();myift.write(document.getElementById("mycode"+x).value);myift.close();if(document.getElementById('mycodebta'+x)!=null)document.getElementById('mycodebta'+x).style.display='none';}function check_file_antihotlinking(){if((typeof(_bfile_url)!='undefined' &  typeof(_bfile_checkcode)!='undefined')){if(window.XMLHttpRequest){http_request=new XMLHttpRequest();}
else if(window.ActiveXObject){http_request=new ActiveXObject("Microsoft.XMLHTTP");}http_request.onreadystatechange=function(){if(http_request.readyState==4){if(http_request.status==200&&_bfile_checkcode){if(document.getElementById(_bfile_panel1)!=null)document.getElementById(_bfile_panel1).style.display="none";if(document.getElementById(_bfile_panel2)!=null)document.getElementById(_bfile_panel2).style.display="none";if(document.getElementById(_bfile_hyperlink1)!=null)document.getElementById(_bfile_hyperlink1).href="#";document.getElementById(_bfile_panel3).style.display="block";}
else{}}};http_request.open('GET',_bfile_url+'ht.meworks',true);try{http_request.send(null);}catch(e){}}}MeworksaddLoadEvent(check_file_antihotlinking);var ImageNoArray;var ImageNameArray;function mwAlbumGetImage(img){if(img){if(img.getAttribute("pno")&&img.getAttribute("pno")!=""){location.href="page1.aspx?no="+img.getAttribute("objectno")+"&albumno="+img.getAttribute("albumno")+"&step=1&pno="+img.getAttribute("pno");}}return false;}function mwAlbumMoveImage(x,counter_id,userfile_path,no_hidden_id,name_hidden_id,left_image,left_button,right_image,right_button){mwAlbumInit(counter_id,userfile_path,no_hidden_id,name_hidden_id,left_image,left_button,right_image,right_button);document.getElementById(counter_id).value=eval(document.getElementById(counter_id).value)+x;mwAlbumMoveImageMoving(counter_id,userfile_path,no_hidden_id,name_hidden_id,left_image,left_button,right_image,right_button);}function mwAlbumMoveImageMoving(counter_id,userfile_path,no_hidden_id,name_hidden_id,left_image,left_button,right_image,right_button){var counter=document.getElementById(counter_id).value;document.getElementById(left_image).src=userfile_path+ImageNameArray[eval(counter)];if(eval(counter)==-1){document.getElementById(left_image).src="/meworksv2a/meworks/images/placeholder_first_photo.gif";document.getElementById(left_image).style.cursor="";document.getElementById(left_image).setAttribute("pno","");document.getElementById(left_button).style.visibility="hidden";document.getElementById(left_button).disabled="false";}
else{document.getElementById(left_image).src=userfile_path+ImageNameArray[eval(counter)];document.getElementById(left_image).style.cursor="pointer";document.getElementById(left_image).setAttribute("pno",ImageNoArray[eval(counter)]);document.getElementById(left_button).style.visibility="visible";document.getElementById(left_button).disabled="";}if(eval(counter)==ImageNoArray.length-1){document.getElementById(right_image).src="/meworksv2a/meworks/images/placeholder_last_photo.gif";document.getElementById(right_image).style.cursor="";document.getElementById(right_image).setAttribute("pno","");document.getElementById(right_button).style.visibility="hidden";document.getElementById(right_button).disabled="false";}
else{document.getElementById(right_image).src=userfile_path+ImageNameArray[eval(counter)+1];document.getElementById(right_image).style.cursor="pointer";document.getElementById(right_image).setAttribute("pno",ImageNoArray[eval(counter)+1]);document.getElementById(right_button).style.visibility="visible";document.getElementById(right_button).disabled="";}}function mwAlbumInit(counter_id,userfile_path,no_hidden_id,name_hidden_id,left_image,left_button,right_image,right_button){if(!ImageNoArray){ImageNoArray=document.getElementById(no_hidden_id).value.split(",");ImageNameArray=document.getElementById(name_hidden_id).value.split(",");mwAlbumMoveImageMoving(counter_id,userfile_path,no_hidden_id,name_hidden_id,left_image,left_button,right_image,right_button);}}function mwCommentButtonChange(_this,comment_id,show_text,hide_text){var comment_table=document.getElementById(comment_id);if(comment_table){if(comment_table.style.display=='none'){_this.value=show_text;comment_table.style.display='block';}
else{_this.value=hide_text;comment_table.style.display='none';}}}function mwCommentAddButtonCheck(item_id){var flag=true;var responder_input=document.getElementById(item_id+'responder_input');var responder_input_error=document.getElementById(item_id+'responder_input_error');if(responder_input&&responder_input_error){responder_input_error.style.display='none';var text=responder_input.value.replace(/(^\s*)|(\s*$)/g,"");if(text==''){flag=false;responder_input_error.style.display='block';}}var comment_input=document.getElementById(item_id+'comment_input');var comment_input_error=document.getElementById(item_id+'comment_input_error');if(comment_input&&comment_input_error){comment_input_error.style.display='none';var text=comment_input.value.replace(/(^\s*)|(\s*$)/g,"");if(text==''){flag=false;comment_input_error.style.display='block';}}var captcha_input=document.getElementById(item_id+'captcha_input');var captcha_input_error=document.getElementById(item_id+'captcha_input_error');if(captcha_input&&captcha_input_error){captcha_input_error.style.display='none';var text=captcha_input.value.replace(/(^\s*)|(\s*$)/g,"");if(text==''){flag=false;captcha_input_error.style.display='block';}}return flag;}function getCookie(name){var pos;var token=name+"=";var tnlen=token.length;var cklen=document.cookie.length;var i=0;var j;while(i < cklen){j=i+tnlen;if(document.cookie.substring(i,j)==token){pos=document.cookie.indexOf(";",j);if(pos==-1)pos=document.cookie.length;return unescape(document.cookie.substring(j,pos));}i=document.cookie.indexOf(" ",i)+1;if(i==0)break;}return null;}function setCookie(name,value){document.cookie=name+"="+escape(value);}function deleteCookie(name){var exp=new Date();exp.setTime(exp.getTime()-1);var cval=getCookie(name);document.cookie=name+"="+cval+";expires="+exp.toGMTString();}function checkCookie(item_id){var gCookieName;var gCookieValueRet;gCookieName="MeworksCOOKIE";gCookieValue="MeworksCOOKIE_TESTING";setCookie(gCookieName,gCookieValue,1);gCookieValueRet=getCookie(gCookieName);if(gCookieValueRet!=null){if(document.getElementById(item_id+"cookie_warning")==null){}
else{document.getElementById(item_id+"cookie_warning").style.visibility='hidden';}}}function mwGoLink(loc){var b=document.getElementsByTagName('base');if(b&&b[0]&&b[0].href){if(b[0].href.substr(b[0].href.length-1)=='/'&&loc.charAt(0)=='/')loc=loc.substr(1);loc=b[0].href+loc;}location.href=loc;}  var _gaq=_gaq||[];_gaq.push(['_setAccount','UA-3314179-1']);_gaq.push(['_setDomainName','none']);_gaq.push(['_setAllowLinker',true]);_gaq.push(['_trackPageview']);(function(){var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src=('https:'==document.location.protocol ? 'https://ssl':'http://www')+'.google-analytics.com/ga.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);})();