var is_member=false;var is_validated=false;var ticket_box=null;var reply_box=null;var on_the_fly_box=null;if(!PROCESS){var PROCESS={custom:function(fn){CLEAN.clean_all();if(reply_box)ART.call_later(fn,550);else fn();}};}if(!CLEAN){var CLEAN={clean_all:function(){ART.dimmer('hide');CLEAN.ticket_box();CLEAN.reply_box();CLEAN.on_the_fly_box();return;},ticket_box:function(){if(ticket_box){var _start=ART.absolute_pos(ticket_box).x;var _end=ART.page_width();ART.FX.slide_hor(ticket_box,{from:_start,to:_end,duration:500,on_complete:function(){ART.remove_element(ticket_box);ticket_box=null;ART.dimmer('hide');}});}else{ticket_box=null;ART.dimmer('hide');}return;},reply_box:function(){if(reply_box){ART.FX.set_fade(reply_box,{from:1,to:0,duration:500,on_complete:function(){ART.remove_element(reply_box);reply_box=null;}});}else reply_box=null;return;},on_the_fly_box:function(){if(on_the_fly_box)ART.remove_element(on_the_fly_box);on_the_fly_box=null;return;},details_box:function(){if(ART.GE('details_box'))ART.remove_element(ART.GE('details_box'));}};}if(!LOGIN){var LOGIN={on_the_fly:function(where_to_insert,within_obj,offset_x,offset_y){if(!where_to_insert)var where_to_insert=null;if(!within_obj)var within_obj=ART.get_body();if(!offset_x)var offset_x=((ART.pos_right()-ART.pos_left())/2+ART.pos_left())-185;if(!offset_y)var offset_y=(ART.pos_bottom()-ART.pos_top())/2+ART.pos_top()-20;var _cords=ART.relative_pos(within_obj);var initialize=function(){var login=ART.A({'href':'#'},'login');ART.AEV(login,'click',function(e){LOGIN._top(ART.GE('login_box'));});var signup=ART.A({'href':'##'},'signup');ART.AEV(signup,'click',function(e){SIGNUP.custom();ART.prevent_default(e);});var cls_btn=ART.A({'id':'cls_btn1','href':'#','title':'close.'});ART.AEV(cls_btn,'click',function(e){ART.dimmer('hide');CLEAN.on_the_fly_box();ART.prevent_default(e);});on_the_fly_box=ART.DIV({'id':'on_the_fly'},ART.SPAN('To perform the task, you must login or'),ART.SPAN({'class':'otf'},signup),ART.SPAN({'class':'otf'},'for free.'),cls_btn);if(where_to_insert){if(ART.GE(where_to_insert).firstChild)ART.IB(on_the_fly_box,ART.GE(where_to_insert).firstChild);else ART.ACN(ART.GE(where_to_insert),on_the_fly_box);}else ART.ACN(ART.get_body(),on_the_fly_box);ART.set_left(on_the_fly_box,_cords.x+offset_x);ART.set_top(on_the_fly_box,_cords.y+offset_y);ART.show_element(on_the_fly_box);};CLEAN.on_the_fly_box();initialize();},activate_acct:function(){var msg='!!!!   YOU MUST ACTIVATE YOUR ACCOUNT   !!!!.\n\nYou can activate your account from the "My Home" page of your member section.\n\nPress OK to be redirected to the activation page.';if(confirm(msg))document.location.replace('/members.cfm?section=members');}};}if(!F_PASS){var F_PASS={cancel:function(){var _html='';_html+='<DIV CLASS="regular" STYLE="padding-bottom:0;">username:</DIV>';_html+='<DIV CLASS="regular" STYLE="padding-bottom:7px;"><INPUT ID="username" TYPE="text" NAME="username" VALUE="" MAXLENGTH="25" CLASS="mini_txt"></DIV>';_html+='<DIV CLASS="regular" STYLE="padding-bottom:0;">password:</DIV>';_html+='<DIV CLASS="regular" STYLE="padding-bottom:7px;"><INPUT ID="password" NAME="password" TYPE="password" MAXLENGTH="25" CLASS="mini_txt"></DIV>';_html+='<DIV CLASS="inline" STYLE="margin-right:5px;"><INPUT TYPE="Button" CLASS="btn grey" ID="login_btn" NAME="login_btn" VALUE="login" ONCLICK="XLOGIN.main();return false;" STYLE="font-size:11px;padding:0 5px 0 5px;"></DIV>';_html+='<DIV CLASS="inline" STYLE="margin-right:2px;"><A HREF="#" ONCLICK="F_PASS.show();return false;">lost password?</A></DIV>';ART.GE('login').innerHTML=_html;},show:function(){var _html='';_html+='<DIV CLASS="reguler" STYLE="padding-bottom:0;">email:</DIV>';_html+='<DIV CLASS="reguler" STYLE="padding-bottom:7px;"><INPUT ID="fp_email" TYPE="text" NAME="username" MAXLENGTH="150" CLASS="mini_txt"></DIV>';_html+='<DIV CLASS="inline" STYLE="margin-right:5px;"><INPUT TYPE="Submit" class="btn grey" id="fpemail_btn" NAME="fpemail_btn" VALUE="send" ONCLICK="F_PASS.send();" STYLE="font-size:11px;padding:0 5px 0 5px;"></DIV>';_html+='<DIV CLASS="inline"><A HREF="#" ONCLICK="F_PASS.cancel()">cancel</A></DIV>';ART.GE('login').innerHTML=_html;},validate:function(){var email=ART.GE('fp_email').value;ART.change_color_of_text_vars('fp_email','FFFFFF');if((email=='')||(email==null)||(!ART.val_email(email))){ART.change_color_of_text_vars('fp_email','FFC1C1');ERRORS.show('invalid email format. please try again.');return false;}else return true;},send:function(){if(F_PASS.validate()){var email=ART.GE('fp_email').value;ART.processing('on');var file='/executions/f_password.cfm';var str='email='+email;var req=zXmlHttp.createRequest();req.open("POST",file,true);req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");req.onreadystatechange=function(){if(req.readyState==4){ART.processing('off');if(req.status==200){var x_response=ART.trim(req.responseText);if(x_response<0)ERRORS.show(x_response);else{ART.GE('login').innerHTML='<SPAN STYLE="font-weight:normal;font-size:10px;color:#FF0000;">an email with your username and password has been sent to ['+email+']</SPAN>';setTimeout("F_PASS.cancel();",3000);}}else ERRORS.show('-1000');}};req.send(str);}}};}if(!TICKET){var TICKET={_open:function(){var validate=function(){var message='';var allow_pass=true;var category_id=ART.GE('tk_category_id').options[ART.GE('tk_category_id').selectedIndex].value;var subject=ART.GE('tk_subject').value;var body=ART.GE('tk_body').value;if((category_id==0)){message+='you must select what category your ticket belongs to.\n\n';ART.change_class_of_text_vars('tk_category_id','select_box error');allow_pass=false;}if((subject.length==0)){message+='your must specify a subject.\n\n';ART.change_class_of_text_vars('tk_subject','input_txt error');allow_pass=false;}if((body.length==0)){message+='your must explain your problem.\n\n';ART.change_class_of_text_vars('tk_body','error');allow_pass=false;}if(!allow_pass)ERRORS.show(message);return allow_pass;};var pre_set=function(){ART.change_class_of_text_vars('tk_category_id','select_box');ART.change_class_of_text_vars('tk_subject','input_txt');ART.change_class_of_text_vars('tk_body','');return;};var build_row=function(ticket_id){var category=ART.GE('tk_category_id').options[ART.GE('tk_category_id').selectedIndex].text;var priority=ART.GE('tk_priority').options[ART.GE('tk_priority').selectedIndex].value;var subject=ART.GE('tk_subject').value;if(priority)var priority_img=ART.IMG({'src':'http://images.spicypage.com/flag_red_16x16.gif','width':16,'height':16});else var priority_img=ART.IMG({'src':'http://images.spicypage.com/x.gif','width':16,'height':16});var subject_link=ART.A({'href':'#','style':'FONT-WEIGHT:bold;'},subject);ART.AEV(subject_link,'click',function(){view_details(ticket_id)});var category_link=ART.A({'href':'#','style':'FONT-WEIGHT:bold;'},category);ART.AEV(category_link,'click',function(){view_details(ticket_id)});ART.ACN(ART.GE('tbl_tickets').getElementsByTagName('TBODY')[0],ART.TR(ART.TD({'class':'chart line topline bold'},priority_img),ART.TD({'class':'chart line topline bold'},subject_link),ART.TD({'class':'chart line topline bold'},category_link),ART.TD({'class':'chart line topline bold'},'open'),ART.TD({'class':'chart line topline bold'},ART.get_date('mmm dd,yyyy'))));};var record=function(){pre_set();if(validate()){var category_id=ART.GE('tk_category_id').options[ART.GE('tk_category_id').selectedIndex].value;var priority=ART.GE('tk_priority').options[ART.GE('tk_priority').selectedIndex].value;var subject=ART.GE('tk_subject').value;var body=ART.GE('tk_body').value;ART.processing('on');var file='/executions/tickets.cfm';var str='segment=open&category_id='+category_id+'&priority='+priority+'&subject='+ART.url_encode(subject)+'&body='+ART.url_encode(ART.format_msg(body));var req=zXmlHttp.createRequest();req.open("POST",file,true);req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");req.onreadystatechange=function(){if(req.readyState==4){ART.processing('off');if(req.status==200){var x_response=ART.trim(req.responseText);if(x_response<0)ERRORS.show(x_response);else{var ticket_id=x_response;if(ART.GE('tbl_tickets')){if(ART.GE('no_tickets'))ART.GE('tbl_tickets').deleteRow(1);build_row(ticket_id);}var _html='<DIV ID="ticket_success">submission successful.</DIV>';ART.set_HTML(ticket_box,_html);ART.call_later(function(){CLEAN.ticket_box();return false;},2000);}}else ERRORS.show('-1000');}};req.send(str);}};var initialize=function(){var cls_btn=ART.A({'href':'#'});ART.AEV(cls_btn,'click',function(e){CLEAN.ticket_box();ART.prevent_default(e);});var ticket_hd=ART.DIV({'id':'ticket_hd'},ART.SPAN('Support Ticket'),cls_btn);var cat_select_label=ART.LABEL({'for':'tk_category_id'},'Category');var c_option_0=ART.OPTION({'value':'0','selected':''},'- category -');var c_option_1=ART.OPTION({'value':'1'},'Account Update');var c_option_2=ART.OPTION({'value':'2'},'Errors');var c_option_3=ART.OPTION({'value':'3'},'Inquiry');var c_option_4=ART.OPTION({'value':'4'},'Other');var cat_select=ART.SELECT({'id':'tk_category_id','name':'tk_category_id','class':'select_box'},c_option_0,c_option_1,c_option_2,c_option_3,c_option_4);var _div_cs=ART.DIV({'class':'inline'},cat_select_label,cat_select);var prio_select_label=ART.LABEL({'for':'tk_priority'},'Priority');var p_option_1=ART.OPTION({'value':'0','selected':''},'Low');var p_option_2=ART.OPTION({'value':'1'},'High');var prio_select=ART.SELECT({'id':'tk_priority','name':'tk_priority','class':'select_box'},p_option_1,p_option_2);var _div_pr=ART.DIV({'class':'inline'},prio_select_label,prio_select);var subject_label=ART.LABEL({'for':'tk_subject'},'Subject');var subject=ART.INPUT({'id':'tk_subject','name':'tk_subject','type':'text','class':'input_txt'});var _div_subj=ART.DIV({'class':'regular top'},subject_label,subject);var body_label=ART.DIV({'class':'inline'},ART.LABEL({'for':'tk_body'},'Description'));var swappable=ART.DIV({'id':'swappable'});var body=ART.DIV({'class':'regular'},ART.TEXTAREA({'id':'tk_body','name':'tk_body'}));var _div_body=ART.DIV({'class':'regular'},body_label,swappable,body);var ticket=ART.DIV({'id':'ticket'},_div_cs,_div_pr,_div_subj,_div_subj,_div_body);var create_btn=ART.INPUT({'class':'btn red','type':'button','value':'create'});ART.AEV(create_btn,'click',function(){record();});var _div_create_btn=ART.DIV({'class':'inline'},create_btn);var cancel_btn=ART.INPUT({'class':'btn grey','type':'button','value':'cancel'});ART.AEV(cancel_btn,'click',function(e){CLEAN.ticket_box();ART.prevent_default(e);});var _div_cancel_btn=ART.DIV({'class':'inline'},cancel_btn);var _form=ART.FORM({'class':'normal'},ticket,_div_create_btn,_div_cancel_btn);var ticket_main=ART.DIV({'id':'ticket_main'},ticket_hd,_form);ticket_box=ART.DIV({'id':'ticket_box'},ticket_main);ART.ACN(ART.get_body(),ticket_box);var x_pos=((ART.pos_right()-ART.pos_left())/2+ART.pos_left())-250;var y_pos_start=-490;var y_pos_end=ART.page_height()/2-245;ART.set_left(ticket_box,x_pos);ART.set_top(ticket_box,y_pos_start);if(!ART.GE('rich_txt_edit')){var rich_txt_edit=new spell_check();rich_txt_edit.no_close_btn();rich_txt_edit.deco_textarea('tk_body','swappable');}ART.show_element(ticket_box);ART.FX.slide_vert(ticket_box,{from:y_pos_start,to:y_pos_end,duration:800,on_complete:function(){ART.DD.drag_able(ticket_box,{handler:'ticket_hd'});}});};ART.dimmer('show');initialize();},reply:function(ticket_id,username){var build_history=function(msg){var _date=ART.get_date('mmm dd,yyyy')+' at '+ART.get_time('hh:mm:ss tt');var header=ART.DIV({'class':'regular header'},ART.SPAN({'class':'text dark padded hor'},'posted by '+username+' on '+_date));var body=ART.DIV({'class':'regular'},ART.SPAN({'class':'text padded vert'},msg));ART.IA(header,ART.GE('history').firstChild);ART.IA(body,header);return;};var record=function(){var body=ART.GE('body').value;if(body=='enter message')body='';ART.processing('on');var file='/executions/tickets.cfm';var str='segment=update&ticketID='+ticket_id+'&body='+ART.url_encode(ART.format_msg(body));var req=zXmlHttp.createRequest();req.open("POST",file,true);req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");req.onreadystatechange=function(){if(req.readyState==4){ART.processing('off');if(req.status==200){var x_response=ART.trim(req.responseText);if(x_response<0)ERRORS.show(x_response);else{var _html='<DIV ID="message_success">ticket has been updated. A tech support rep will get back to you within 48 hours.</DIV>';ART.set_HTML(reply_box,_html);build_history(body);ART.call_later(function(){CLEAN.reply_box();return false;},3000);}}else ERRORS.show('-1000');}};req.send(str);};var initialize=function(){var cls_btn=ART.A({'href':'#'});ART.AEV(cls_btn,'click',function(e){CLEAN.reply_box();ART.prevent_default(e);});var message_hd=ART.DIV({'id':'message_hd'},ART.SPAN('response to ticket #'+ticket_id),cls_btn);var swappable=ART.DIV({'id':'swappable'});var body=ART.TEXTAREA({'id':'body','name':'body'},'enter message');ART.AEV(body,'blur',function(){ART.on_focus(body,'enter message',false)});ART.AEV(body,'focus',function(){ART.on_focus(body,'enter message',true)});var message=ART.DIV({'id':'message'},body);var create_btn=ART.INPUT({'class':'btn red','type':'button','value':'post'});ART.AEV(create_btn,'click',function(){record();});var _div_create_btn=ART.DIV({'class':'inline','style':'margin-left:10px;margin-top:7px;'},create_btn);var cancel_btn=ART.INPUT({'class':'btn grey','type':'button','value':'cancel'});ART.AEV(cancel_btn,'click',function(e){CLEAN.reply_box();ART.prevent_default(e);});var _div_cancel_btn=ART.DIV({'class':'inline','style':'margin-top:7px;'},cancel_btn);reply_box=ART.DIV({'id':'reply_box'},ART.FORM({'class':'normal'},message_hd,swappable,message,_div_create_btn,_div_cancel_btn));ART.ACN(ART.get_body(),reply_box);ART.set_width(reply_box,1);ART.set_height(reply_box,10);ART.add_class(reply_box,'absolute solid');var _x=((ART.pos_right()-ART.pos_left())/2+ART.pos_left())-360;var _y=(ART.pos_bottom()-ART.pos_top())/2+ART.pos_top()-160;ART.set_top(reply_box,_y);ART.set_left(reply_box,_x);if(!ART.GE('rich_txt_edit')){var rich_txt_edit=new spell_check();rich_txt_edit.no_close_btn();rich_txt_edit.deco_textarea('body','swappable');}ART.show_element(reply_box);ART.FX.set_width(reply_box,{to:700,duration:800,on_complete:function(){ART.FX.set_height(reply_box,{to:250,on_complete:function(){ART.DD.drag_able(reply_box,{handler:'message_hd'});}})}});};var fn_processing=function(){initialize();};PROCESS.custom(fn_processing);}};}if(!BOX){var BOX={normal:function(w,h,title,_html,dd){var _width1=w||600;var _height1=h||400;var _title=title||'please note';var _dd=dd||0;var _width2=_width1-20;if(!ART.is_ie()){_width1-=20;_width2-=20;}var _height2=_height1-20;if(!ART.is_ie()){_height1-=20;_height2-=20;}var _div=ART.GE('details_box');if(!_div){_div=ART.DIV({'id':'details_box'});ART.ACN(ART.get_body(),_div);var x_pos=(ART.pos_right()-ART.page_width()/2)-(_width1/2);var y_pos=(ART.pos_bottom()-ART.page_height()/2)-(_height1/2);ART.set_left(_div,x_pos);ART.set_top(_div,y_pos);}var _htmlx='';_htmlx+='<DIV CLASS="details_shadow" STYLE="width:'+_width1+'px;height:'+_height1+'px;"></DIV>';_htmlx+='<DIV ID="box_details" CLASS="details" STYLE="width:'+_width2+'px;height:'+_height2+'px;">';_htmlx+='<DIV ID="box_header" CLASS="ceiling movable"><DIV>'+_title.toUpperCase()+'</DIV><A HREF="#" ID="details_box_cls" ONCLICK="CLEAN.details_box();return false;" TITLE="close"></A></DIV>';_htmlx+='<DIV CLASS="mainbody">'+_html+'</DIV></DIV>';ART.set_HTML(_div,_htmlx);if(_dd==1)ART.DD.drag_able(_div,{handler:'box_header'});return _div;}};}activate_account=LOGIN.activate_acct;
