function do_POST_frd(frm){delete xmlHttp;createXMLHttpRequest();var url=document.getElementById(frm).action;var query=build_form_string(frm)+'&ajx=1'+'&ts='+new Date().getTime();if(!xmlHttp){window.document.form_frd.submit();}else{xmlHttp.open("POST",url,true);xmlHttp.onreadystatechange=handleStateChange_frd;xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp.send(query);}}function handleStateChange_frd(){if(xmlHttp.readyState==4){if(xmlHttp.status==200){grab_elements_frd();}else{alert("Ooops! An error seems to have occured:: Error Code:"+xmlHttp.status);}}}function grab_elements_frd(){var xmlDoc=xmlHttp.responseXML,msgs=xmlDoc.getElementsByTagName("message"),field=xmlDoc.getElementsByTagName("field_id");display_result_frd(msgs,field);}function display_result_frd(msgs,field){var html='',msg='',field_id='';var xml_msg=msgs[0],xml_field_id=field[0];if((xml_msg!==null)&&(xml_msg.childNodes[0]!==null)){msg=xml_msg.childNodes[0].nodeValue;}try{if((xml_field_id!==null)&&(xml_field_id.childNodes[0]!==null)){field_id=xml_field_id.childNodes[0].nodeValue;}}catch(e){}if(msg>''){document.getElementById('msgbox').style.display='';if(msg.substr(0,4)=='PASS'){msg=unescape(msg);var text=msg.substr(6)+' <span style="color:#00f" onmouseover="this.style.cursor=\'pointer\';" onclick="init_frd_form();toggle(\'div_tellfriend\',\'msgbox\');return false">Send another?</span>';update_msgbox('#ffcb15',text);toggle('div_tellfriend');}else if(msg.substr(0,4)=='FAIL'){msg=unescape(msg);text=msg.substr(6);update_msgbox('#f2837c',text);hi_light_off();chgobjbkg(field_id,'box_hilight');try{document.getElementById(field_id).focus();}catch(e){}}}}function update_msgbox(color,message){document.getElementById('msgbox').style.backgroundColor=color;document.getElementById('msgbox').innerHTML=message;}function init_frd_form(){document.getElementById("f_email").value='';hi_light_off();}function hi_light_off(){chgobjbkg('f_email','box_hilight_off');chgobjbkg('v_email','box_hilight_off');chgobjbkg('v_name','box_hilight_off');}