/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 4.0.0
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2000-2009 vBulletin Solutions Inc. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
function vB_AJAX_BlogCalendar(B,C,E,D,A){this.xml_sender=null;this.month=E;this.year=D;this.calobj=C;this.varname=B;this.userid=A;this.init=function(){if(AJAX_Compatible&&(typeof vb_disable_ajax=="undefined"||vb_disable_ajax<2)&&C){if(nextmonth=fetch_object("vb_blogcalendar_nextmonth")){nextmonth.style.cursor=pointer_cursor;YAHOO.util.Event.on("vb_blogcalendar_nextmonth","click",this.next_month,this,true)}if(prevmonth=fetch_object("vb_blogcalendar_prevmonth")){prevmonth.style.cursor=pointer_cursor;YAHOO.util.Event.on("vb_blogcalendar_prevmonth","click",this.prev_month,this,true)}}};this.handle_ajax_response=function(G){if(G.responseXML){var I=fetch_object(this.objid);var F=G.responseXML.getElementsByTagName("error");if(F.length){alert(F[0].firstChild.nodeValue)}else{var H=G.responseXML.getElementsByTagName("calendar")[0].firstChild.nodeValue;if(H!=""){fetch_object(this.calobj).innerHTML=H;this.init()}}}};this.prev_month=function(G){YAHOO.util.Event.stopEvent(G);var F=this.month;this.month=(this.month==1)?12:this.month-1;this.year=(F==1)?(this.year==1970?2037:this.year-1):this.year;this.swap_month();return false};this.next_month=function(G){YAHOO.util.Event.stopEvent(G);var F=this.month;this.month=(this.month==12)?1:this.month+1;this.year=(F==12)?(this.year==2037?1970:this.year+1):this.year;this.swap_month();return false};this.swap_month=function(){YAHOO.util.Connect.asyncRequest("POST","blog_ajax.php?do=calendar",{success:this.handle_ajax_response,failure:vBulletin_AJAX_Error_Handler,timeout:vB_Default_Timeout,scope:this},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&do=calendar&m="+this.month+"&ajax=1&y="+this.year+(typeof this.userid!="undefined"?"&u="+this.userid:""))};this.init()};