﻿function showhide(p_a,p_n){if(p_n.style.display=='none'){p_n.style.display='block';p_a.style.display='none';if((p_a.id=='PI_txtOtherStation'||p_a.id=='MDL_txtOtherStation')&&document.getElementById(aOtherStation)){document.getElementById(aOtherStation).innerText='(Other)';};if((p_a.id=='PI_txtOtherArea'||p_a.id=='MDL_txtOtherArea')&&document.getElementById(aOtherArea)){document.getElementById(aOtherArea).innerText='(Other)';};}else{p_n.style.display='none';p_a.style.display='block';if((p_a.id=='PI_txtOtherStation'||p_a.id=='MDL_txtOtherStation')&&document.getElementById(aOtherStation)){document.getElementById(aOtherStation).innerText='(List)';};if((p_a.id=='PI_txtOtherArea'||p_a.id=='MDL_txtOtherArea')&&document.getElementById(aOtherArea)){document.getElementById(aOtherArea).innerText='(List)';};};return false;};function p_u(p_m,p_l){var p_z=document.getElementById("lblPrice1"),p_y=document.getElementById("lblPrice2"),p_x=document.getElementById("sup1"),p_v=document.getElementById("sup2");if(p_m==true){document.forms[0].PI_txtPrice1.style.display='inline';p_z.style.display='inline';p_x.style.display='inline';if(p_l==false){document.forms[0].PI_txtPrice2.style.display='none';document.forms[0].PI_txtPrice2.value='';p_y.style.display='none';p_v.style.display='none';};};if(p_l==true){document.forms[0].PI_txtPrice2.style.display='inline';p_y.style.display='inline';p_v.style.display='inline';if(p_m==false){document.forms[0].PI_txtPrice1.style.display='none';document.forms[0].PI_txtPrice1.value='';p_z.style.display='none';p_x.style.display='none';};};};function togglePriceInput(p_s){if(document.getElementById(p_s).style.display=='none'){document.getElementById(p_s).style.display='block';}else{document.getElementById(p_s).style.display='none';};};if(document.getElementById(FuelType1).checked){document.getElementById('divFuelType1').style.display='block';}else{document.getElementById('divFuelType1').style.display='none';};if(document.getElementById(FuelType2).checked){document.getElementById('divFuelType2').style.display='block';}else{document.getElementById('divFuelType2').style.display='none';};if(document.getElementById(FuelType3).checked){document.getElementById('divFuelType3').style.display='block';}else{document.getElementById('divFuelType3').style.display='none';};if(document.getElementById(FuelType4).checked){document.getElementById('divFuelType4').style.display='block';}else{document.getElementById('divFuelType4').style.display='none';};function Validate(){var p_j=document.getElementById(ss_price1).value,p_i=document.getElementById(ss_price2).value,p_h=document.getElementById(ss_price3).value,p_g=document.getElementById(ss_price4).value,p_c=document.getElementById(ss_gstation_nm_other).value,p_f=document.getElementById(ss_garea_other).value,p_o=document.getElementById(ss_gaddress).value,p_r=document.getElementById(ss_gstation_nm),p_t=document.getElementById(ss_garea),p_=document.getElementById('diverror'),p_b=true;p_j=p_k(p_j);p_i=p_k(p_i);p_h=p_k(p_h);p_g=p_k(p_g);p_c=p_k(p_c);p_f=p_k(p_f);p_o=p_k(p_o);if(p_o.length<=0){p_.innerHTML='Please enter a Street Location.<br>Tip: Try to use cross streets, i.e. - 5th Ave & Main St.<br>You can also use an exact address.<br><br>';p_.style.display='block';p_b=false;};if((p_f.length<=0)&&(p_t.selectedIndex<=0)){p_.innerHTML='Please enter an Area, or if it does not<br>appear in the list, specify an Other Area.<br><br>';p_.style.display='block';p_b=false;};if((p_c.length<=0)&&(p_r.selectedIndex<=0)){p_.innerHTML='Please enter a Station, or if it does not appear in the list, specify an Other Station.<br><br>';p_.style.display='block';p_b=false;};if((isNaN(p_g)&&p_g.length>0)){p_.innerHTML='A valid current price for this gas station is required if you wish to report a price to the web site.<br>To search for gas prices, <a href=GasPriceSearch.aspx>click here</a><br><br>';p_.style.display='block';p_b=false;};if((isNaN(p_h)&&p_h.length>0)){p_.innerHTML='A valid current price for this gas station is required if you wish to report a price to the web site.<br>To search for gas prices, <a href=GasPriceSearch.aspx>click here</a><br><br>';p_.style.display='block';p_b=false;};if((isNaN(p_i)&&p_i.length>0)){p_.innerHTML='A valid current price for this gas station is required if you wish to report a price to the web site.<br>To search for gas prices, <a href=GasPriceSearch.aspx>click here</a><br><br>';p_.style.display='block';p_b=false;};if((isNaN(p_j)&&p_j.length>0)){p_.innerHTML='A valid current price for this gas station is required if you wish to report a price to the web site.<br>To search for gas prices, <a href=GasPriceSearch.aspx>click here</a><br><br>';p_.style.display='block';p_b=false;};if(p_j.length==0&&p_i.length==0&&p_h.length==0&&p_g.length==0){p_.innerHTML='A valid current price for this gas station is required if you wish to report a price to the web site.<br>To search for gas prices, <a href=GasPriceSearch.aspx>click here</a><br><br>';p_.style.display='block';p_b=false;};if(p_b){WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("btnSubmit2","",false,"","Post_Price.aspx",false,false))};return p_b;};function p_k(p_w){while(p_w.substring(0,1)==' '){p_w=p_w.substring(1,p_w.length);}while(p_w.substring(p_w.length-1,p_w.length)==' '){p_w=p_w.substring(0,p_w.length-1);};return p_w;};function chooseList(p_q){document.getElementById('divFavLists').style.top=(getElementPosition(p_q).top+22)+'px';document.getElementById('divFavLists').style.left=(getElementPosition(p_q).left)+'px';GasBuddy_ASPX.StationMasterNotValidated.getFavLists('','','',0,0,0,p_e);};function p_e(p_p){if(p_p.value){if(p_p.value.Tables.length>0&&p_p.value.Tables[0].Rows.length>1){var p_d='<b>Add station to favorite list:</b><br />';p_d+='<select id="ddlFavLists">';var p_aa=0;while(p_aa<p_p.value.Tables[0].Rows.length){p_d+='<option value='+p_p.value.Tables[0].Rows[p_aa].id;if(p_p.value.Tables[0].Rows[p_aa].default_yn){p_d+=' selected';};p_d+='>'+p_p.value.Tables[0].Rows[p_aa].list_nm+'</option>';p_aa++;};p_d+='</select><p />';p_d+='<input type="button" onclick="document.getElementById(txtFavListID).value = document.getElementById(\'ddlFavLists\').options[document.getElementById(\'ddlFavLists\').selectedIndex].value; closeDivFavList();" value="OK" style="font-size:10px;"> <input type="button" onclick="cancelFavList();" value="Cancel" style="font-size:10px;">';document.getElementById('divFavLists').innerHTML=p_d;document.getElementById('divFavLists').style.display='block';};};};function closeDivFavList(){document.getElementById('divFavLists').style.display='none';};function cancelFavList(){document.getElementById(txtFavListID).value='';closeDivFavList();};