
var first_visit=true;var sessiontrack=new Class({implements:[Options],options:{size:2000,track:{}},initialize:function(tracker,options){try{if(top.name!=''){this.options.track=JSON.decode(top.name);}}catch(e){}},read:function(t){var templateValue=undefined;try{templateValue=JSON.decode(top.name)[t]}catch(e){}
return templateValue;},write:function(key,value){this.options.track[key]=value;try{top.name=JSON.encode(this.options.track);}catch(e){}},remove:function(t){this.options.track[t]=undefined;try{top.name=JSON.encode(this.options.track);}catch(e){}},clear:function(){try{top.name=undefined;}catch(e){}}});window.addEvent('domready',function(){try{if(typeof(supportTracker)=='undefined')
supportTracker=new sessiontrack();}catch(e){}});window.addEvent('load',function(){try{if(typeof(supportTracker)=='undefined')
supportTracker=new sessiontrack();}catch(e){}
try{if(supportTracker.read('hp_supp_open_results')!='null'){first_visit=true;}}catch(e){}});function DoSearchFormAjaxable(form,submitButton,validationFunction,onCompleteHandler,document,extraParamsForRequestFunction){if(!document){var submit=$(submitButton);var form=$(form);var submits;var textsubmits;if(submit!=null){submits=[submit];}else{submits=$$('form#'+form.id+' input[type=submit]');textsubmits=$$('form#'+form.id+' input[type=text]');}}
else{form=$(document.getElementById(form));submits=form.getElements('input[type=submit]');textsubmits=form.getElements('input[type=text]');}
form.action=unescape(form.action);addHiddenFieldToForm(window.document,form.id,"postFormId",form.id);submits.each(function(submit){if((submit)&&(form)){if(typeof(extraParamsForRequestFunction)=='function'){extraParamsForRequestFunction(form,submit);}
submit.addEvent('click',function(evt){new Event(evt).stop();var preloader=new Element('div',{'class':'loading_screen'});preloader.adopt(new Element('div',{'class':'loading_image'}));if(typeof(onCompleteHandler)=='function'){form.set('send',{onRequest:function(){$('body').adopt(preloader);},onSuccess:function(){preloader.destroy();},onFailure:function(){preloader.destroy();},onException:function(){preloader.destroy();},onComplete:onCompleteHandler});}
if(typeof(validationFunction)=='string'){if(supportTracker.read('hp_supp_open_results')!='null'||first_visit==false){if(supportTracker.read('hp_supp_open_results')!="js_rollup"&&supportTracker.read('hp_supp_open_results')!="js_querylessthan"){supportTracker.remove('hp_supp_search_query');supportTracker.remove('hp_supp_search_query');try{if(form.get('id')=='search_drivers'){supportTracker.write('searchterm',$$('#drivers_search_box')[0].value);}
if(form.get('id')=='search_products'){supportTracker.write('searchterm',$$('#products_troubleshooting_search_box')[0].value);}}catch(e){}}
if(supportTracker.read('searchterm')!=undefined&&supportTracker.read('searchterm')!=$$('#drivers_search_box')[0].value&&$$('.js_drivers_field_value')[0].innerHTML!=$$('#drivers_search_box')[0].value){try{if(form.get('id')=='search_drivers'){supportTracker.write('searchterm',$$('#drivers_search_box')[0].value);}
if(form.get('id')=='search_products'){supportTracker.write('searchterm',$$('#products_troubleshooting_search_box')[0].value);}}catch(e){}}
first_visit=false;drivers_field=$$('.js_drivers_field_value');drivers_input=$$('#drivers_search_box');drivers_error_msg=$$('.js_drivers_error_msg');products_troubleshooting_field=$$('.js_products_troubleshooting_field_value');products_troubleshooting_input=$$('#products_troubleshooting_search_box');products_troubleshooting_error_msg=$$('.js_products_troubleshooting_error_msg');var blank_spaces=/^\s{1,}$/g;if(form.get('id')=="search_drivers"){if(drivers_input[0].value==""||drivers_input[0].value==null||drivers_input[0].value.length==0||((drivers_input[0].value.search(blank_spaces))>-1)){alert(drivers_error_msg.get('html'));formValidated=false;}else if(drivers_input[0].value==drivers_field.get('html')){alert(drivers_error_msg.get('html'));formValidated=false;}else{formValidated=true;}}else if(form.get('id')=="search_products"){if(products_troubleshooting_input[0].value==""||products_troubleshooting_input[0].value==null||products_troubleshooting_input[0].value.length==0||((products_troubleshooting_input[0].value.search(blank_spaces))>-1)){alert(products_troubleshooting_error_msg.get('html'));formValidated=false;}else if(products_troubleshooting_input[0].value==products_troubleshooting_field.get('html')){alert(products_troubleshooting_error_msg.get('html'));formValidated=false;}else{formValidated=true;}}else{formValidated=true;}}else{formValidated=true;first_visit=false;}}else{formValidated=true;}
if(formValidated){addHiddenFieldToForm(window.document,form.id,"postButtonId",submit.id);form.send();}});}});textsubmits.each(function(submit){if((submit)&&(form)){if(typeof(extraParamsForRequestFunction)=='function'){extraParamsForRequestFunction(form,submit);}
submit.addEvent('keypress',function(event){if(event.key=='enter'){new Event(event).stop();var preloader=new Element('div',{'class':'loading_screen'});preloader=new Element('div',{'class':'loading_image'});if(typeof(onCompleteHandler)=='function'){form.set('send',{onRequest:function(){$('body').adopt(preloader);},onSuccess:function(){preloader.destroy();},onFailure:function(){preloader.destroy();},onException:function(){preloader.destroy();},onComplete:onCompleteHandler});}
if(typeof(validationFunction)=='string'){if(supportTracker.read('hp_supp_open_results')!='null'||first_visit==false){if(supportTracker.read('hp_supp_open_results')!="js_rollup"&&supportTracker.read('hp_supp_open_results')!="js_querylessthan"){supportTracker.remove('hp_supp_search_query');supportTracker.remove('hp_supp_search_query');try{if(form.get('id')=='search_drivers'){supportTracker.write('searchterm',$$('#drivers_search_box')[0].value);}
if(form.get('id')=='search_products'){supportTracker.write('searchterm',$$('#products_troubleshooting_search_box')[0].value);}}catch(e){}}
if(supportTracker.read('searchterm')!=undefined&&supportTracker.read('searchterm')!=$$('#drivers_search_box')[0].value&&$$('.js_drivers_field_value')[0].innerHTML!=$$('#drivers_search_box')[0].value){try{if(form.get('id')=='search_drivers'){supportTracker.write('searchterm',$$('#drivers_search_box')[0].value);}
if(form.get('id')=='search_products'){supportTracker.write('searchterm',$$('#products_troubleshooting_search_box')[0].value);}}catch(e){}}
first_visit=false;drivers_field=$$('.js_drivers_field_value');drivers_input=$$('#drivers_search_box');drivers_error_msg=$$('.js_drivers_error_msg');products_troubleshooting_field=$$('.js_products_troubleshooting_field_value');products_troubleshooting_input=$$('#products_troubleshooting_search_box');products_troubleshooting_error_msg=$$('.js_products_troubleshooting_error_msg');var blank_spaces=/^\s{1,}$/g;if(form.get('id')=="search_drivers"){if(drivers_input[0].value==""||drivers_input[0].value==null||drivers_input[0].value.length==0||((drivers_input[0].value.search(blank_spaces))>-1)){alert(drivers_error_msg.get('html'));formValidated=false;}else if(drivers_input[0].value==drivers_field.get('html')){alert(drivers_error_msg.get('html'));formValidated=false;}else{formValidated=true;}}else if(form.get('id')=="search_products"){if(products_troubleshooting_input[0].value==""||products_troubleshooting_input[0].value==null||products_troubleshooting_input[0].value.length==0||((products_troubleshooting_input[0].value.search(blank_spaces))>-1)){alert(products_troubleshooting_error_msg.get('html'));formValidated=false;}else if(products_troubleshooting_input[0].value==products_troubleshooting_field.get('html')){alert(products_troubleshooting_error_msg.get('html'));formValidated=false;}else{formValidated=true;}}else{formValidated=true;}}else{formValidated=true;first_visit=false;}}else{formValidated=true;}
if(formValidated){addHiddenFieldToForm(window.document,form.id,"postButtonId",submit.id);form.send();}}});}});}

/*
Date: 11/10/2011 11:42:25 AM
All images published
*/
