var t;
var errmsgArray=[[1552,"You have successfully been registered. An email with your account details has been sent to your box.<br/><br/>Please contact us on not receiving your personal information."],
		 [1373,"But there has been an error, please re-try registering or contact us with regards to this error. (error-ref:37btsbmtpgreg3)"],
		 [1482,"Your information has been received and processed.<br/><br/>Please contact us in the event of your posted Ad not being visible.<br/>Postings are instant and should be online straight away.<br/><br/><a href=javascript:history.back();><< go back</a>"],
		 [0283,"But there has been an error, please re-try posting or contact us with this error. (error-ref:28fupldex3)"],
		 [1847,"Your posting has been successfully removed.<br/><br/>"],
		 [7291,"Unable to register - User already exists.<br/><br/>Please contact us if you have registered but not yet received your user information.<br/><br/>Allow up to 20min for emails."],
		 [1213,"But there has been an error, please re-try or contact us for further details."],
		 [3085,"Your request has been received.<br/><br/>You will be contacted shortly with regards to your online booking request."],
		 [1858,"Your request has been received. We will contact you shortly."],
		 [2964,"Your login credentials have been <b>successfully</b> sent to your mailbox. <br/><br/>In the case of not receiving your credentials, please allow up to 15min for email delivery.<br/><br/>You will now be able to log in using the new credentials."],
		 [9374,"Unable to process your request. <br/><br/>Un-recognised user."],
		[9372,"You have successfully un-registered from Earthrootz."],
		 [5204,"But there was an error. It is required that you delete all your posted Ads before Un-Registering. If you have removed all your posts and still get this message, then please contact us for un-Registration."],
		 [1859,"But there has been an error, please re-try or contact us for further details."],
		 [2714,"Your Ad has been successfuly bumped up. Please note that your posted Ad expires after 30 days, when which it can be reposted.<br/><br/>"],
		 [5368,"But Unable to bump up your posting. Please note that Ad bump up only allowed 7 days after being posted.<br/><br/>"]];
var infomsgArray=[["By entering the code you see in the box, you help us prevent automated scripts from making use of Earthrootz.\n If no image appears, make sure your browser is set to display images. \n If you are not sure of the code, make your best guess as another will be displayed on the next page."],
		["another info message"]];
function showInfoMsg(index){alert(infomsgArray[index]);}
function closeAll(){
var divs=document.getElementsByTagName('div');
var elements=divs.length;
for(var i=0;i< elements;i++){
var divStyle=divs.item(i);
divStyle.style.display='none';}return;}
function showOne(elementt){
var newelement=document.getElementById(elementt);
newelement.style.display='block';}
function getQueryMsg(){
var element=document.getElementById('default');
var intTotal=location.href.indexOf("?")+1;
if(intTotal>0){
var strString=location.href.substring(location.href.indexOf("?")+1);
var index1=strString.indexOf("=",0);
var index2=strString.indexOf("&",0);
var contactname=strString.substring(index1+1,index2);
index1=strString.indexOf("=",index2);
var strerrorid=strString.substring(index1+1);
//search array
for(var i=0;i< errmsgArray.length;i++){
if(strerrorid==errmsgArray[i][0]){
element.innerHTML+= "<br/><br/>Thanks " + contactname + ",<br/><br/> " + errmsgArray[i][1] + "<br/><br/><span class='sinfoBlack'>You will be redirected in 10 sec</span>";
t=setTimeout("redirect()",18000);
return;}}}else{redirect();}}
function redirect(){
window.location.href='index.html';clearTimeout(t);}
function doUnreg(element1,element2){var isValid=true;
var el1=document.getElementById(element1);
var el2=document.getElementById(element2);
if(el1.value==null || el1.value==""){
alert("Email address required");
el1.focus();isValid=false;return;}
var stremail=el1.value;
if(stremail.indexOf("@")==-1){
isvalid=false;alert("Error!,Invalid email address");el1.focus();return;
}else{
if(stremail.indexOf(".")==-1){isvalid=false;alert("Error!,Invalid email address");el1.focus();return;}}
if(el2.value==null || el2.value==""){
alert("Password required");
el2.focus();isValid=false;return;}
if(isValid){window.location.href="process.aspx?request=9528&em=" + el1.value + "&p=" + el2.value;}}
function valFrm(which){
var isvalid=true;var frmThis=document.forms[which];
var intLength=frmThis.elements.length-1;
for(var i=0;i<intLength;i++){
if(frmThis.elements[i].value==null || frmThis.elements[i].value=="" || frmThis.elements[i].value=="please select"){
isvalid=false;alert("Please complete all fields");frmThis.elements[i].focus();break;
}else{
if(frmThis.elements[i].name=="txtemail"){
var stremail=frmThis.elements[i].value;
if(stremail.indexOf("@")==-1){
isvalid=false;alert("Error!,Invalid email address");frmThis.elements[i].focus();break;
}else{
if(stremail.indexOf(".")==-1){isvalid=false;alert("Error!,Invalid email address");frmThis.elements[i].focus();break;}}}}}
if(isvalid){
frmThis.method="post";
frmThis.action="process.aspx?request=6192";
frmThis.submit();}}
function doRequest(request){
var anotherdecision=window.confirm("Sure to delete/bump posting?");
if(anotherdecision){
window.location.href=request;}}
var si=new Array("ed9c2u8u", "oz5f7q4e", "a39qe5k6", "np2yx8g7", "5hi3j6w1", "y2u5td84");
var gblint;
function rndsimg(imgId){
var rnum= Math.floor(Math.random()*6);
document.getElementById(imgId).src="sh/s" + (rnum+1) + ".gif";
gblint=rnum+1;}
function dovalidate(val){
if(val==si[gblint-1]){
return true;}
return false;}