function raw_ask_account_add_bus()
{var tmpstr='';document.getElementById("add_bus_container").innerHTML='';var newdivcont="";newdivcont+='<form name="accountyesno">';newdivcont+='<input type="radio" name="account" value="yes" checked="checked" onClick = "remove_account_fields();"> <span class="itemlabel">I Don'+"'"+'t have a account </span>';newdivcont+='<br>';newdivcont+='<input type="radio" name="account" value="no" onClick = "login_account_fields(';newdivcont+="'login_fields'";newdivcont+=');"> <span class="itemlabel">I have an account </span>';newdivcont+='</form>';newdivcont+='<div id ="login_fields"><a href="javascript:raw_load_newbus_form_defults(1);">Go</a></div>';document.getElementById("add_bus_container").innerHTML=newdivcont;}
function raw_reload_secimg()
{var currentDate=new Date();var varmilli=currentDate.getMilliseconds();document.getElementById("frmlog_check").value="";document.getElementById("secimg").innerHTML='<img src="include/security_image.php?time='+varmilli+'" id="Security Image" alt="Security Image" title = "Security Image">';}
function raw_print_main_fields(type)
{var tmpstr='';var newdivcont="";newdivcont+='<form name="raw_addcomp" action="process_form.php" method="post" onsubmit="submitForm(this,type); return false;" onreset="resetMessage(this)" enctype="multipart/form-data">';newdivcont+='<p><label for="frmbus_name" id ="frmnamelab" class="itemlabel">Business Name  </label><input type="text" name="frmbus_name" size="40" maxlength="60" value="" id="frmname"/>&nbsp;<'+helpiconadd+' id="ctl41_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl41_HelpLayer'+"',"+''+"'"+'<p><strong>Business Name</strong></p><p>Type your Business Name Here e.g. Acme Industries (this is a required field) </p>'+"'"+');" />&nbsp;<span id="errorname" class="errortext">&nbsp; </span><div id="ctl41_HelpLayer"></div> </p>';newdivcont+='		<p><label for="frmaddline1" id ="frmaddline1lab" class="itemlabel">Address Line 1 </label>&nbsp;<input type="text" name="frmaddline1" size="40" maxlength="50" value="" id="frmaddline1"/>&nbsp;<'+helpiconadd+' id="ctl42_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl42_HelpLayer'+"',"+''+"'"+'<p><strong>Address Line 1</strong></p><p>Type the First line of your address here e.g. 1 Acme Road (this is a required field)</p>'+"'"+');" />&nbsp;<span id="erroraddline1" class="errortext">&nbsp; </span><div id="ctl42_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmaddline2" id ="frmaddline2lab" class="itemlabel">Address Line 2 </label>&nbsp;<input type="text" name="frmaddline2" size="40" maxlength="50" value="" id="frmaddline2"/>&nbsp;<'+helpiconadd+' id="ctl422_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl422_HelpLayer'+"',"+''+"'"+'<p><strong>Address Line 2</strong></p><p>Type the Second line of your address here e.g. Acme Industrial Estate </p>'+"'"+');" />&nbsp;<span id="erroraddline2" class="errortext">&nbsp; </span><div id="ctl422_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmtowncity" id ="frmtowncitylab" class="itemlabel">Town/City     </label><input type="text" name="frmtowncity" size="40" maxlength="40" value="" id="frmtowncity"/>&nbsp;<'+helpiconadd+' id="ctl43_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl43_HelpLayer'+"',"+''+"'"+'<p><strong>Town/City</strong></p><p>Type the City or Town that your Business resides in here e.g. Acme City  (this is a required field)</p>'+"'"+');" />&nbsp;<span id="errortowncity" class="errortext">&nbsp; </span><div id="ctl43_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmcounty" id ="frmcountylab" class="itemlabel">County </label>&nbsp;';newdivcont+='<select name="frmcounty" id="frmcounty" class="selectclass">';newdivcont+='</select>&nbsp;<'+helpiconadd+' id="ctl44_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl44_HelpLayer'+"',"+''+"'"+'<p><strong>County / State</strong></p><p>Select the County or State that your Business resides in. If you cannot see the County / State that you require check that you have selected the correct country. e.g. Acme State (this is a required field)</p>'+"'"+');" />&nbsp;<span id="errorcounty" class="errortext">&nbsp; </span><div id="ctl44_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmcountry" id ="frmcountrylab" class="itemlabel">Country </label>';newdivcont+='<select name="frmcountry" id="frmcountry" onchange = "raw_loadstates();" class="selectclass">';newdivcont+='</select>&nbsp;<'+helpiconadd+' id="ctl46_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl46_HelpLayer'+"',"+''+"'"+'<p><strong>Country</strong></p><p>Select the country that your Business resides in. If your country is not available it means we have not activated it yet please contact us. e.g. Acme Land (this is a required field)</p>'+"'"+');" />&nbsp;<span id="errorcountry">&nbsp; </span><div id="ctl46_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmpc" id ="frmpclab" class="itemlabel">Post/Zip code </label><input type="text" name="frmpc" size="15" maxlength="15" value="" id="frmpc" onblur="dealwithpostcode('+"'"+'frmpc'+"',"+''+"'"+'frmcountry'+"'"+');change_css_style('+"'"+'conf-map-container'+"'"+','+"'"+'top'+"'"+',((pageHeight() / 2)) + '+"'"+'px'+"'"+');window.scroll(0,(pageHeight() / 2)-22);" />&nbsp;<'+helpiconadd+' id="ctl45_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl45_HelpLayer'+"',"+''+"'"+'<p><strong>Post / Zip Code</strong></p><p>Type the Post / Zip code of your address here (this is a required field)</p>'+"'"+');" />&nbsp;<span id="errorpc" class="errortext">&nbsp; </span><div id="ctl45_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmcontactname" id ="frmcontactnamelab" class="itemlabel">Contact Name       </label><input type="text" name="frmcontactname" size="25" maxlength="25" value="" id="frmcontactname"/>&nbsp;<'+helpiconadd+' id="ctl47_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl47_HelpLayer'+"',"+''+"'"+'<p><strong>Contact Name</strong></p><p>Type the name of the main business contact here e.g. Your sales executive (this is a required field)</p>'+"'"+');" />&nbsp;<span id="errorcontactname" class="errortext">&nbsp; </span><div id="ctl47_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmtel1" id ="frmtel1lab" class="itemlabel">Telephone Number 1 </label><input type="text" name="frmtel1" size="20" maxlength="20" value="" id="frmtel1"/>&nbsp;<'+helpiconadd+' id="ctl48_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl48_HelpLayer'+"',"+''+"'"+'<p><strong>Main Telephone Number</strong></p><p>Type Your businesses main contact telephone number here e.g. 555 555 555 (this is a required field) </p>'+"'"+');" />&nbsp;<span id="errortel1" class="errortext">&nbsp; </span><div id="ctl48_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmtel2" id ="frmtel2lab" class="itemlabel">Telephone Number 2 </label><input type="text" name="frmtel2" size="20" maxlength="20" value="" id="frmtel2"/>&nbsp;<'+helpiconadd+' id="ctl60_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl60_HelpLayer'+"',"+''+"'"+'<p><strong>Secondary Telephone Number</strong></p><p>Type Your businesses secondary telephone number here e.g. 555 555 556 </p>'+"'"+');" />&nbsp;<span id="errortel2" class="errortext">&nbsp; </span><div id="ctl60_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmfax1" id ="frmfax1lab" class="itemlabel">Fax Number          </label><input type="text" name="frmfax1" size="20" maxlength="20" value="" id="frmfax1"/>&nbsp;<'+helpiconadd+' id="ctl49_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl49_HelpLayer'+"',"+''+"'"+'<p><strong>Fax Number</strong></p><p>Type Your businesses main Fax telephone number here e.g. 555 555 557</p>'+"'"+');" />&nbsp;<span id="errorfax1" class="errortext">&nbsp; </span><div id="ctl49_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmemail" id ="frmemaillab" class="itemlabel">Email       </label><input type="text" name="frmemail" size="40" maxlength="50" value="" id="frmemail"/>&nbsp;<'+helpiconadd+' id="ctl50_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl50_HelpLayer'+"',"+''+"'"+'<p><strong>Email Address</strong></p><p>Type Your businesses main Email Address here e.g. info@yourcompany.com</p>'+"'"+');" />&nbsp;<span id="erroremail" class="errortext">&nbsp; </span><div id="ctl50_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmwww" id ="frmwwwlab" class="itemlabel">Web Address </label><input type="text" name="frmwww" size="40" maxlength="50" value="http://" id="frmwww"/>&nbsp;<'+helpiconadd+' id="ctl51_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl51_HelpLayer'+"',"+''+"'"+'<p><strong>Business Description</strong></p><p>Type Your businesses main Website details here e.g. http://www.yourcompany.com </p>'+"'"+');" />&nbsp;<span id="errorwww" class="errortext">&nbsp; </span><div id="ctl51_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmdesc" id ="frmdesclab" class="itemlabel">Description </label><textarea name="frmdesc" id="frmdesc" rows="5" cols="28" onkeyup = "descchanged(this,'+222+')" value=""></textarea>&nbsp;<'+helpiconadd+' id="ctl52_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl52_HelpLayer'+"',"+''+"'"+'<p><strong>Help window</strong></p><p>Type your businesses Description here e.g. My business sells the best hats in the state! (this is a required field) Note: Limit of 222 Characters</p>'+"'"+');" />&nbsp;<span id="errordesc" class="errortext">&nbsp; </span><span id="desccount" class="chrleft"></span><div id="ctl52_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmkeywords" id ="frmkeywordslab" class="itemlabel">Keywords </label><input type="text" name="frmkey1" size="10" maxlength="12" value="" id="frmkey1" onkeyup = "raw_keywordchanged(this)"/>&nbsp;<input type="text" name="frmkey2" size="10" maxlength="12" value="" id="frmkey2" onkeyup = "raw_keywordchanged(this)"/>&nbsp;<input type="text" name="frmkey3" size="10" maxlength="12" value="" id="frmkey3" onkeyup ="raw_keywordchanged(this)""/><p></p>';newdivcont+='<label for="frmkeywords2" id ="frmkeywordslab2" class="itemlabel">More Keywords  </label><input type="text" name="frmkey4" size="10" maxlength="12" value="" id="frmkey4" onkeyup = "raw_keywordchanged(this)"/>&nbsp;<input type="text" name="frmkey5" size="10" maxlength="12" value="" id="frmkey5" onkeyup = "raw_keywordchanged(this)"/>&nbsp;<input type="text" name="frmkey6" size="10" maxlength="12" value="" id="frmkey6" onkeyup = "raw_keywordchanged(this)"/>&nbsp;<'+helpiconadd+' id="ctl53_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl53_HelpLayer'+"',"+''+"'"+'<p><strong>Keywords</strong></p><p>Type Your businesses main Keywords here. You must enter at least one keyword e.g. Hats (this is a required field)</p>'+"'"+');" />&nbsp;<span id="errorkeywords" class="errortext">&nbsp; </span><div id="ctl53_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmdist" id ="frmdistlab" class="itemlabel">Area you cover </label>&nbsp;';newdivcont+='	<select name="frmdist" id="frmdist" class="selectclass">';newdivcont+='</select>&nbsp;Miles&nbsp;<'+helpiconadd+' id="ctl61_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl61_HelpLayer'+"',"+''+"'"+'<p><strong>Area you Cover</strong></p><p>Select the Maximum distance from your Business address that you would be willing to travel or that a customer would travel to you. (this is a required field) </p>'+"'"+');" />&nbsp;<span id="errortype" class="errortext">&nbsp; </span><div id="ctl61_HelpLayer"></div></p>';newdivcont+='<p><label for="frmtype" id ="frmtypelab" class="itemlabel">Type of Business </label>&nbsp;';newdivcont+='<select name="frmtype" id="frmtype" class="selectclass">';newdivcont+='</select>&nbsp;<'+helpiconadd+' id="ctl54_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl54_HelpLayer'+"',"+''+"'"+'<p><strong>Business Type</strong></p><p>Select the category that best describes your business. If you would like to have another category added please contact us (this is a required field) </p>'+"'"+');" />&nbsp;<span id="errortype" class="errortext">&nbsp; </span><div id="ctl54_HelpLayer"></div> </p>';if(type==1)
{newdivcont+='<p><label for="frmsiteusername" id ="frmsiteusernamelab" class="itemlabel">Site User Name </label><input type="text" name="frmsiteusername" size="30" maxlength="30" value="" id="frmsiteusername" onkeyup="check_duplicate('+"'"+'namecheck'+"'"+',this.value,'+"'"+'name'+"'"+')"/>&nbsp;<img src="images/ok.gif" id="namecheck" alt="Ok" title="Ok" class="clickimg" />&nbsp;<'+helpiconadd+' id="ctl100_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl100_HelpLayer'+"',"+''+"'"+'<p><strong>User Name</strong></p><p>Enter A User Name Here. This is used to identify you on this site. E.g. coolman2002 (this is a required field) </p>'+"'"+');" />&nbsp;<span id="errorsiteusername" class="errortext">&nbsp; </span><div id="ctl100_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmusername" id ="frmusernamelab" class="itemlabel">Your Name </label><input type="text" name="frmusername" size="40" maxlength="50" value="" id="frmusername"/>&nbsp;<'+helpiconadd+' id="ctl63_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl63_HelpLayer'+"',"+''+"'"+'<p><strong>Your Name</strong></p><p>Enter Your Name Here. This is needed to identify you. E.g. John Doe (this is a required field) </p>'+"'"+');" />&nbsp;<span id="errorusername" class="errortext">&nbsp; </span><div id="ctl63_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmuseremail" id ="frmuseremaillab" class="itemlabel">Your email address </label><input type="text" name="frmuseremail" size="40" maxlength="50" value="" id="frmuseremail" onkeyup="check_duplicate('+"'"+'emailcheck'+"'"+',this.value,'+"'"+'email'+"'"+')"/>&nbsp;&nbsp;<img src="images/ok.gif" id="emailcheck" alt="Ok" title="Ok" class="clickimg" />&nbsp;<'+helpiconadd+' id="ctl58_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl58_HelpLayer'+"',"+''+"'"+'<p><strong>User Email</strong></p><p>Enter an Email address Here. This is needed to allow you to make alterations to your details in the future. (this is a required field) </p>'+"'"+');" />&nbsp;<span id="erroruseremail" class="errortext">&nbsp; </span><div id="ctl58_HelpLayer"></div> </p>';newdivcont+='<p><label for="frmpass1" id ="frmpass1lab" class="itemlabel">Password </label><input type="password" name="frmpass1" size="22" maxlength="35" value="" id="frmpass1" onkeyup="passwordcheck(this.value)"/>&nbsp;<'+helpiconadd+' id="ctl56_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl56_HelpLayer'+"',"+''+"'"+'<p><strong>Password</strong></p><p>Enter a Password Here. This is needed to allow you to make alterations to your details in the future. (this is a required field) </p>'+"'"+');" />&nbsp;<span id="errorpass1" class="errortext">&nbsp; </span><div id="ctl56_HelpLayer"></div></p>';newdivcont+='<p><label for="passwordstrength" id ="passwordstrengthlab" class="itemlabel">Password Strength </label><div id="passwordstrength" class="strength0"></div><span id="passwordspare" class="spare0"></span><br></p>';newdivcont+='<p><label for="frmpass2" id ="frmpass2lab" class="itemlabel">Password check </label><input type="password" name="frmpass2" size="22" maxlength="35" value="" id="frmpass2"/>&nbsp;<'+helpiconadd+' id="ctl57_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl57_HelpLayer'+"',"+''+"'"+'<p><strong>Password Check</strong></p><p>This password must match the password entered above. (this is a required field) </p>'+"'"+');" />&nbsp;<span id="errorpass2" class="errortext">&nbsp; </span><div id="ctl57_HelpLayer"></div> </p>';}
newdivcont+='<br/>';newdivcont+='	<center><img src="security_image.php?time=" id="Security Image" alt="Security Image" title = "Security Image"></center>';newdivcont+='				<br/>';newdivcont+='			<div class = "inputbox">';newdivcont+='				<label class="extlabel" for="frm_contact_check">Security Text</label>';newdivcont+='				<input name="frm_contact_check" size="10" maxlength="10" id="frm_contact_check"/><span style="color: rgb(255,255,255);"><span style=" color: rgb(56,198,240);"> Please enter the Characters above here</span>';newdivcont+='			</div>	';newdivcont+='				<br/>';newdivcont+='	<div id="formbuttons">';newdivcont+='<input type="hidden" name="frmkeywordsall" value=""/>';newdivcont+='<input type="hidden" id="frmlng" name="frmlng" value="-0.627781"/>';newdivcont+='<input type="hidden" id="frmlat" name="frmlat" value="51.393"/>';newdivcont+='<input type="hidden" name="add_new" value="TRUE"/>';newdivcont+='</div>';newdivcont+='</form>';variframename='upload_target'+getrandomnum();newdivcont+='<form name="file_upload_form"  target="'+variframename+'" id="file_upload_form" method="post" enctype="multipart/form-data" action="upload-file.php" onsubmit="submitForm(this,type); return false;">';newdivcont+='<p><label for="frmlogo" id ="frmlogolab" class="itemlabel">Business Logo </label><input type="file" name="frmlogo" size="22" maxlength="30" value="" id="frmlogo" onchange = "checkimage(this.value);"/>&nbsp;<'+helpiconadd+' id="ctl55_HelpIcon" alt="Help" title="Help window" class="clickimg"  onclick="toggleHelp('+"'"+'ctl55_HelpLayer'+"',"+''+"'"+'<p><strong>Business Logo</strong></p><p>Upload your business logo or a picture of your premises </p>'+"'"+');" />&nbsp;<span id="errorlogo" class="errortext">&nbsp; </span><div id="ctl55_HelpLayer"></div> </p>';newdivcont+='<iframe id="'+variframename+'" name="'+variframename+'" value ="" onload="javascript:raw_deal_incomming_data()" src="" style="width:0;height:0;border:0px solid #fff;"></iframe>';newdivcont+='</form>';varbuttoncontents='<a href="javascript:raw_uploadnewbus('+type+');">Add your Business</a>';maketermsandcontext();newdivcont+=termsandconditionscheck;newdivcont+='<span id="buttons"></span>';document.getElementById("add_bus_container").innerHTML=newdivcont;document.getElementById('frmname').focus();}
var scrollcount=100;function raw_keywordchanged(tmpid)
{var vartext="";if(tmpid.form.frmkey1.value!="")
{tmpid.form.frmkey1.value=checkforvalidkeyword(tmpid.form.frmkey1.value);}
if(tmpid.form.frmkey2.value!="")
{tmpid.form.frmkey2.value=checkforvalidkeyword(tmpid.form.frmkey2.value);}
if(tmpid.form.frmkey3.value!="")
{tmpid.form.frmkey3.value=checkforvalidkeyword(tmpid.form.frmkey3.value);}
if(tmpid.form.frmkey4.value!="")
{tmpid.form.frmkey4.value=checkforvalidkeyword(tmpid.form.frmkey4.value);}
if(tmpid.form.frmkey5.value!="")
{tmpid.form.frmkey5.value=checkforvalidkeyword(tmpid.form.frmkey5.value);}
if(tmpid.form.frmkey6.value!="")
{tmpid.form.frmkey6.value=checkforvalidkeyword(tmpid.form.frmkey6.value);}}
function raw_loadcountries()
{var IntPath=document.raw_addcomp.frmcountry;var TheOptions=IntPath.options.length;document.raw_addcomp.frmcountry.options.length=0;GDownloadUrl("include/getcountrysxml.php",function(data){var xml=GXml.parse(data);var country=xml.documentElement.getElementsByTagName("country");var tmpselectholder=0;for(var i=0;i<country.length;i++)
{var abv=country[i].getAttribute("abv");var name=country[i].getAttribute("name");if(abv.toLowerCase()==varlocalcountry)
{IntPath.options[IntPath.options.length]=new Option(name,abv,true,true);tmpselectholder=i;}
else
{IntPath.options[IntPath.options.length]=new Option(name,abv,false,false);}}
if(tmpselectholder!=0){document.raw_addcomp['frmcountry'].options[tmpselectholder].selected=true;}});}
function raw_loadcountries2(varctrychr)
{var IntPath=document.raw_addcomp.frmcountry;var TheOptions=IntPath.options.length;document.raw_addcomp.frmcountry.options.length=0;GDownloadUrl("include/getcountrysxml.php",function(data){var xml=GXml.parse(data);var country=xml.documentElement.getElementsByTagName("country");var tmpselectholder=0;for(var i=0;i<country.length;i++)
{var abv=country[i].getAttribute("abv");var name=country[i].getAttribute("name");if(varctrychr==0)
{if(abv.toLowerCase()==varlocalcountry)
{IntPath.options[IntPath.options.length]=new Option(name,abv,true,true);}
else
{IntPath.options[IntPath.options.length]=new Option(name,abv,false,false);}}else
{if(abv.toLowerCase()==varctrychr.toLowerCase())
{IntPath.options[IntPath.options.length]=new Option(name,abv,true,true);tmpselectholder=i;}
else
{IntPath.options[IntPath.options.length]=new Option(name,abv,false,false);}}}
if(tmpselectholder!=0){document.raw_addcomp['frmcountry'].options[tmpselectholder].selected=true;}});}
function raw_raw_loadstates2(varopt,varstatecode,selectedcountry)
{var IntPath=document.raw_addcomp.frmcounty;var TheOptions=IntPath.options.length;document.raw_addcomp.frmcounty.options.length=0;if(varopt!=3)
{if(varopt=="2")
{selectedcountry=varlocalcountry;}else
{selectedcountry=document.raw_addcomp.frmcountry.options[document.raw_addcomp.frmcountry.selectedIndex].value;}}
var tmpurl="include/getstatesxml.php?ctry="+selectedcountry;GDownloadUrl(tmpurl,function(data){var xml=GXml.parse(data);var county=xml.documentElement.getElementsByTagName("countys");var tmpselectholder=0;for(var i=0;i<county.length;i++)
{var vid=county[i].getAttribute("id");var vctry_abv=county[i].getAttribute("ctry_abv");var vname=county[i].getAttribute("name");var vcty_abv=county[i].getAttribute("cty_abv");var valt_name=county[i].getAttribute("alt_name");if((varopt==3)&&(varstatecode==vid))
{if(valt_name=="")
{IntPath.options[IntPath.options.length]=new Option(vname,vid,true);tmpselectholder=i;}else
{var tmpvar=vname+" ("+valt_name+")";IntPath.options[IntPath.options.length]=new Option(tmpvar,vid,true);tmpselectholder=i;}}else
{if(valt_name=="")
{IntPath.options[IntPath.options.length]=new Option(vname,vid);}else
{var tmpvar=vname+" ("+valt_name+")";IntPath.options[IntPath.options.length]=new Option(tmpvar,vid);}}}
if(tmpselectholder!=0){document.raw_addcomp['frmcounty'].options[tmpselectholder].selected=true;}});}
function raw_raw_loadtypes2(vartypenum)
{var IntPath=document.raw_addcomp.frmtype;var TheOptions=IntPath.options.length;document.raw_addcomp.frmtype.options.length=0;GDownloadUrl("include/gettypexml.php",function(data){var xml=GXml.parse(data);var vtype=xml.documentElement.getElementsByTagName("type");var tmpselectholder=0;for(var i=0;i<vtype.length;i++)
{var tid=vtype[i].getAttribute("id");var name=vtype[i].getAttribute("name");if(vartypenum==tid)
{IntPath.options[IntPath.options.length]=new Option(name,tid,true,true);tmpselectholder=i;}else
{IntPath.options[IntPath.options.length]=new Option(name,tid);}}
if(tmpselectholder!=0){document.raw_addcomp['frmtype'].options[tmpselectholder].selected=true;}});}
function raw_loadstates(varopt)
{var IntPath=document.raw_addcomp.frmcounty;var TheOptions=IntPath.options.length;document.raw_addcomp.frmcounty.options.length=0;if(varopt=="2")
{var selectedcountry=varlocalcountry;}else
{var selectedcountry=document.raw_addcomp.frmcountry.options[document.raw_addcomp.frmcountry.selectedIndex].value;}
var tmpurl="include/getstatesxml.php?ctry="+selectedcountry;GDownloadUrl(tmpurl,function(data){var xml=GXml.parse(data);var county=xml.documentElement.getElementsByTagName("countys");for(var i=0;i<county.length;i++)
{var vid=county[i].getAttribute("id");var vctry_abv=county[i].getAttribute("ctry_abv");var vname=county[i].getAttribute("name");var vcty_abv=county[i].getAttribute("cty_abv");var valt_name=county[i].getAttribute("alt_name");if(valt_name=="")
{IntPath.options[IntPath.options.length]=new Option(vname,vid);}else
{var tmpvar=vname+" ("+valt_name+")";IntPath.options[IntPath.options.length]=new Option(tmpvar,vid);}}});}
function raw_loadtypes()
{var IntPath=document.raw_addcomp.frmtype;var TheOptions=IntPath.options.length;document.raw_addcomp.frmtype.options.length=0;GDownloadUrl("include/gettypexml.php",function(data){var xml=GXml.parse(data);var vtype=xml.documentElement.getElementsByTagName("type");for(var i=0;i<vtype.length;i++)
{var tid=vtype[i].getAttribute("id");var name=vtype[i].getAttribute("name");IntPath.options[IntPath.options.length]=new Option(name,tid);}});}
function raw_getcounty(ctyid,divid)
{if(ctyid!="")
{var tmpstr="";var altstr="";GDownloadUrl("include/get_single_state_xml.php?cty="+ctyid,function(data){var xml=GXml.parse(data);var vtype=xml.documentElement.getElementsByTagName("county");for(var i=0;i<vtype.length;i++)
{tmpstr=vtype[i].getAttribute("name");altstr=vtype[i].getAttribute("alt_name");if(altstr!="")
{if(document.getElementById(divid))document.getElementById(divid).innerHTML=tmpstr+" | "+altstr;}else
{if(document.getElementById(divid))document.getElementById(divid).innerHTML=tmpstr;}
return tmpstr;}});}else
{if(document.getElementById(divid))document.getElementById(divid).innerHTML="Problem Loading";}
return loadinganismlleft;}
function raw_getcountry(ctryid,divid)
{if(ctryid!="")
{var tmpstr="";var altstr="";GDownloadUrl("include/get_single_country_xml.php?ctry="+ctryid,function(data){var xml=GXml.parse(data);var vtype=xml.documentElement.getElementsByTagName("country");for(var i=0;i<vtype.length;i++)
{tmpstr=vtype[i].getAttribute("name");altstr=vtype[i].getAttribute("alt_name");if(altstr!="")
{if(document.getElementById(divid))document.getElementById(divid).innerHTML=tmpstr+" | "+altstr;}else
{if(document.getElementById(divid))document.getElementById(divid).innerHTML=tmpstr;}
return tmpstr;}});}else
{if(document.getElementById(divid))document.getElementById(divid).innerHTML="Problem Loading";}
return loadinganismlleft;}
function raw_getsinglecounty(ctyid,divid)
{if(ctyid!="")
{var tmpstr="";var altstr="";GDownloadUrl("include/get_single_state_xml.php?cty="+ctyid,function(data){var xml=GXml.parse(data);var vtype=xml.documentElement.getElementsByTagName("county");for(var i=0;i<vtype.length;i++)
{tmpstr=vtype[i].getAttribute("name");altstr=vtype[i].getAttribute("alt_name");if(altstr!="")
{if(document.getElementById(divid))document.getElementById(divid).innerHTML=tmpstr+" | "+altstr;}else
{if(document.getElementById(divid))document.getElementById(divid).innerHTML=tmpstr;}
return tmpstr;}});}else
{if(document.getElementById(divid))document.getElementById(divid).innerHTML="Problem Loading";}
return loadinganismlleft;}
function raw_displaynewdetails(busid)
{toggle_waiting_box();Scrolltotopofpage();GDownloadUrl("include/retrieve_bus.php?id="+busid,function(data){var xml=GXml.parse(data);var vtype=xml.documentElement.getElementsByTagName("business");var temp=new Array();var temp2=new Array();var newlayout="";for(var i=0;i<vtype.length;i++)
{var b_message=vtype[i].getAttribute("message");temp=b_message.split(':');if(trimwhitespace(temp[0])=="Ok")
{var b_bid=vtype[i].getAttribute("id");var b_user_id=vtype[i].getAttribute("user_acc");var b_name=vtype[i].getAttribute("name");var b_addressline1=vtype[i].getAttribute("addressline1");var b_addressline2=vtype[i].getAttribute("addressline2");var b_town_city=vtype[i].getAttribute("town_city");var b_county=raw_getcounty(vtype[i].getAttribute("county"),"newcty");var b_post_code=vtype[i].getAttribute("post_code");var b_country=raw_getcountry(vtype[i].getAttribute("country"),"newctry");var b_contact_name=vtype[i].getAttribute("contact_name");var b_tel_1=vtype[i].getAttribute("tel_1");var b_tel_2=vtype[i].getAttribute("tel_2");var b_fax_1=vtype[i].getAttribute("fax_1");var b_email=vtype[i].getAttribute("email");var b_www=vtype[i].getAttribute("www");var b_lng=vtype[i].getAttribute("lng");var b_lat=vtype[i].getAttribute("lat");var b_desc=vtype[i].getAttribute("desc");var b_keywords=vtype[i].getAttribute("keywords");var b_dist=vtype[i].getAttribute("dist");var b_advertlevel=vtype[i].getAttribute("advertlevel");var b_subtype=vtype[i].getAttribute("subtype");var b_spare=vtype[i].getAttribute("spare");var b_date=vtype[i].getAttribute("date");var b_user_email=vtype[i].getAttribute("user_email");var b_logo=vtype[i].getAttribute("logo");temp2=b_keywords.split(',');newlayout+='<center><p class = "itemlabel"><center><b>New Business</b><center></p><br/><br/>';newlayout+='<p class = "itemlabel">Business Name: <span class="data">'+b_name+'</span></p>';newlayout+='<p class = "itemlabel">Address Line 1: <span class="data">'+b_addressline1+'</span></p>';newlayout+='<p class = "itemlabel">Address Line 2: <span class="data">'+b_addressline2+'</span></p>';newlayout+='<p class = "itemlabel">Town / City: <span class="data">'+b_town_city+'</span></p>';newlayout+='<p class = "itemlabel">County: '+'<span id="newcty" class="data">Loading....</span>'+'</span></p>';newlayout+='<p class = "itemlabel">Post/Zip Code: <span class="data">'+b_post_code+'</span></p>';newlayout+='<p class = "itemlabel">Country: '+'<span id="newctry" class="data">Loading....</span>'+'</span></p>';newlayout+='<p class = "itemlabel">Contact Name: <span class="data">'+b_contact_name+'</span></p>';newlayout+='<p class = "itemlabel">Telephone 1: <span class="data">'+b_tel_1+'</span></p>';newlayout+='<p class = "itemlabel">Telephone 2: <span class="data">'+b_tel_2+'</span></p>';newlayout+='<p class = "itemlabel">Fax: <span class="data">'+b_fax_1+'</span></p>';newlayout+='<p class = "itemlabel">Email Address: <span class="data">'+b_email+'</span></p>';newlayout+='<p class = "itemlabel">Web Address: <span class="data">'+b_www+'</span></p>';newlayout+='<p class = "itemlabel">Description: <span class="data">'+b_desc+'</span></p>';newlayout+='<p class = "itemlabel">Keywords: <span class="data">';for(var x=0;x<temp2.length;x++)
{newlayout+=" "+temp2[x];}
newlayout+='</span></p>';newlayout+='<p class = "itemlabel">Coverage: <span class="data">'+b_dist+' Miles</span></p>';newlayout+='<p class = "itemlabel">Account Details</p>';newlayout+='<p class = "itemlabel">temp: <span class="data">'+b_user_id+'</span></p>';newlayout+='<p class = "itemlabel">Your Name: <span id = "acc_your_name" class="data"></span></p>';newlayout+='<p class = "itemlabel">Your email: <span id = "acc_your_email" class="data"></span></p>';if(b_logo=="true")
{newlayout+='<p><center><p class = "itemlabel"><center>Uploaded Image<center></p><img src="include/imageresize.php?name=../images/user_logos/'+b_bid+'&ext=98&id='+getrandomnum()+'" id="Your_Uploaded_Picture" alt="Your Uploaded Picture" title = "Your Uploaded Picture"></center></p>';}
newlayout+='<br/><br/><center><p class = "itemlabel"><center><b>Congratulations Business added</b><center></p>';newlayout+='<script type="text/javascript"> /* <![CDATA[ */ var google_conversion_id = 1013739552; var google_conversion_language = "en"; var google_conversion_format = "2"; var google_conversion_color = "ffffff"; var google_conversion_label = "hkZYCNCu4QEQoOCx4wM"; var google_conversion_value = 0; /* ]]> */ </script> <script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js"> </script> <noscript> <div style="display:inline;"> <img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1013739552/?label=hkZYCNCu4QEQoOCx4wM&amp;guid=ON&amp;script=0"/> </div> </noscript> ';document.getElementById("add_bus_container").innerHTML=newlayout;}else
{alert("error"+temp[1]);}}});}
function raw_preview(filename)
{image=document.getElementById('raw_previewIMG');path='file://'+filename;path=path.replace(/\\/,'/');image.src=path;image.style.display='block';image.style.width="200px";image.style.height="150px";}
function raw_deal_incomming_data()
{var temp=new Array();var arrayspaces=new Array();var arraydots=new Array();var tmpstr=document.getElementById("divmessages").innerHTML;c=trimwhitespace(tmpstr);if(tmpstr=='Please wait Uploading File....')
{showmessage(window[variframename].document.body.innerHTML);tmpstr=document.getElementById("divmessages").innerHTML;tmpstr=trimwhitespace(tmpstr);temp=tmpstr.split(':');if(temp[0]=="Ok")
{arrayspaces=tmpstr.split(' ');arraydots=arrayspaces[2].split('.');raw_displaynewdetails(arraydots[0]);}
if(temp[0]=="Error")
{alert("error"+temp[1]);}}}
function raw_uploadnewbus(type)
{var tmp=submitForm(document.raw_addcomp,type);}
function raw_load_newbus_form_defults(type)
{loadgooglegeocoder();varbuttoncontents='<a href="javascript:raw_uploadnewbus(1);">CLICK HERE TO ADD YOUR BUSINESS</a>';variframename='upload_target0987654321';raw_loadcountries();raw_loadstates("2");raw_loadtypes();raw_loaddistance(10,"frmdist");document.getElementById("desccount").innerHTML="222 Chrs left";document.getElementById('frmname').focus();}
function raw_getusername(usrid,divid)
{if(usrid!="")
{var tmpstr="";var altstr="";GDownloadUrl("include/get_single_user_xml.php?usr="+usrid,function(data){var xml=GXml.parse(data);var vtype=xml.documentElement.getElementsByTagName("user");for(var i=0;i<vtype.length;i++)
{tmpstr=vtype[i].getAttribute("user_name");if(document.getElementById(divid))document.getElementById(divid).innerHTML=tmpstr;return tmpstr;}});}else
{if(document.getElementById(divid))document.getElementById(divid).innerHTML="Problem Loading";}
return loadinganismlleft;}
function raw_loaddistance(vardist,varspan)
{var newdivcont="";var IntPath=document.raw_addcomp.frmdist;var TheOptions=IntPath.options.length;var tmpselectholder=0;if(vardist==2){IntPath.options[IntPath.options.length]=new Option("2","2",true,true);tmpselectholder=0;}
else
{IntPath.options[IntPath.options.length]=new Option("2","2");}
if(vardist==3){IntPath.options[IntPath.options.length]=new Option("3","3",true,true);tmpselectholder=1;}
else
{IntPath.options[IntPath.options.length]=new Option("3","3");}
if(vardist==4){IntPath.options[IntPath.options.length]=new Option("4","4",true,true);tmpselectholder=2;}
else
{IntPath.options[IntPath.options.length]=new Option("4","4");}
if(vardist==5){IntPath.options[IntPath.options.length]=new Option("5","5",true,true);tmpselectholder=3;}
else
{IntPath.options[IntPath.options.length]=new Option("5","5");}
if(vardist==8){IntPath.options[IntPath.options.length]=new Option("8","8",true,true);tmpselectholder=4;}
else
{IntPath.options[IntPath.options.length]=new Option("8","8");}
if(vardist==10){IntPath.options[IntPath.options.length]=new Option("10","10",true,true);tmpselectholder=5;}
else
{IntPath.options[IntPath.options.length]=new Option("10","10");}
if(vardist==15){IntPath.options[IntPath.options.length]=new Option("15","15",true,true);tmpselectholder=6;}
else
{IntPath.options[IntPath.options.length]=new Option("15","15");}
if(vardist==20){IntPath.options[IntPath.options.length]=new Option("20","20",true,true);tmpselectholder=7;}
else
{IntPath.options[IntPath.options.length]=new Option("20","20");}
if(vardist==25){IntPath.options[IntPath.options.length]=new Option("25","25",true,true);tmpselectholder=8;}
else
{IntPath.options[IntPath.options.length]=new Option("25","25");}
if(vardist==50){IntPath.options[IntPath.options.length]=new Option("50","50",true,true);tmpselectholder=9;}
else
{IntPath.options[IntPath.options.length]=new Option("50","20");}
if(vardist==75){IntPath.options[IntPath.options.length]=new Option("75","75",true,true);tmpselectholder=10;}
else
{IntPath.options[IntPath.options.length]=new Option("75","75");}
if(vardist==100){IntPath.options[IntPath.options.length]=new Option("100","100",true,true);tmpselectholder=11;}
else
{IntPath.options[IntPath.options.length]=new Option("100","100");}
if(vardist==200){IntPath.options[IntPath.options.length]=new Option("200","200",true,true);tmpselectholder=12;}
else
{IntPath.options[IntPath.options.length]=new Option("200","200");}
if(vardist==250){IntPath.options[IntPath.options.length]=new Option("250","250",true,true);tmpselectholder=13;}
else
{IntPath.options[IntPath.options.length]=new Option("250","250");}
if(vardist==500){IntPath.options[IntPath.options.length]=new Option("500","500",true,true);tmpselectholder=14;}
else
{IntPath.options[IntPath.options.length]=new Option("500","500");}
if(vardist==1000){IntPath.options[IntPath.options.length]=new Option("1000","1000",true,true);tmpselectholder=15;}
else
{IntPath.options[IntPath.options.length]=new Option("1000","1000");}
if(tmpselectholder!=0){document.raw_addcomp['frmdist'].options[tmpselectholder].selected=true;}}
