var count=0, scrw, scrh, prev_set,Set_Status;
var b, bVer, MenuLeft, MenuWidth, note_prev=0, display=0;
var listMenu, prevMenu, prevBox, strFront, strEnd, FeeRate=1;
var loaded = 'false', GalleryListDisplay = 1, NewsDisplay=0, GuestBookDisplay=0;
var XMLHttpRequestObject = false; 

if (window.XMLHttpRequest) 
 {
  XMLHttpRequestObject = new XMLHttpRequest();
 }
else if (window.ActiveXObject) 
 {
  XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
 }

function whichVersion()
{
 scrh = screen.height;
 scrw = screen.width;
  prevMenu="";
 var myBrowser = navigator.userAgent;
 if((myBrowser.lastIndexOf("MSIE")!=-1) && (myBrowser.lastIndexOf("5.0")!=-1)){b = "IE"; bVer=5;}
 if((myBrowser.lastIndexOf("MSIE")!=-1) && (myBrowser.lastIndexOf("4.0")!=-1)){b = "IE"; bVer=4;}
 if((myBrowser.lastIndexOf("MSIE")!=-1) && (myBrowser.lastIndexOf("3.0")!=-1)){b = "IE"; bVer=3;}
 if((myBrowser.lastIndexOf("MSIE")==-1) && (myBrowser.lastIndexOf("2.0")!=-1)){b = "NS"; bVer=2;}
 if((myBrowser.lastIndexOf("MSIE")==-1) && (myBrowser.lastIndexOf("3.0")!=-1)){b = "NS"; bVer=3;}
 if((myBrowser.lastIndexOf("MSIE")==-1) && (myBrowser.lastIndexOf("4.0")!=-1)){b = "NS"; bVer=4;}

 if (b=="IE")
  {
    strFront = "document.all.";
    strEnd = ".style";  }
 else
  {
   strFront = "document.";
   strEnd = "";
  }
}

function setup()
{
 whichVersion();
}

function set_menu()
{
 whichVersion();
 listMenu=eval(strFront + "TOPICMENU" + strEnd);
 //listMenu.left=eval(strFront + "TOPICHOLE" + strEnd).offsetLeft;// + eval(strFront + "BOARDHOLE" + strEnd).offsetLeft;
 listMenu.left=TOPICHOLE.offsetLeft + BOARDMAIN.offsetLeft;
}


function MM_callJS(jsStr)
 { //v2.0
  return eval(jsStr)
 }

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function showTopics(set)
{
 listMenu=eval(strFront + "TOPICMENU" + strEnd);
 if(set)listMenu.visibility = "visible";
 else listMenu.visibility = "hidden";
}

function ShowInfo(set)
{
 var setLeft, setEvent, setWidth;
 if(prevMenu)document.getElementById(prevMenu).style.visibility = "hidden";
 if(set!="")
  {
   setWidth = document.getElementById(set).width;
   setEvent = window.event.clientX;
   setLeft = eval(setEvent);
   document.getElementById(set).style.visibility = "visible";
   document.getElementById(set).style.left = setLeft;
   document.getElementById(set).style.top  = event.clientY;
	}
 prevMenu = set;
}

function AppForm()
{
 var surname, forename, address, pcode, town, county, country, telnum,varconfirm;
 var eme, lsAT, lsDOT, isBlank;
 
 forename  = (APPFORM.FORENAME.value);
 surname   = (APPFORM.SURNAME.value);
 address   = (APPFORM.ADDRESS.value);
 pcode     = (APPFORM.POSTCODE.value);
 town      = (APPFORM.TOWN.value);
 county    = (APPFORM.COUNTY.value);
 country   = (APPFORM.COUNTRY.value);
 telnum    = (APPFORM.TELNUM.value);
 eme       = (APPFORM.EMAIL.value);
 varconfirm= (APPFORM.CONFIRM.value);
 lsAT      = (APPFORM.EMAIL.value.indexOf("@"));
 lsDOT     = (APPFORM.EMAIL.value.indexOf("."));
 lsBlank   = (APPFORM.POSTCODE.value.indexOf(" "));

 if(surname == "" || forename == "" || address == "" || pcode == "" || town == "" || country == "" || telnum == "" || varconfirm == "")
  {
   alert("Please complete all required areas of the form");
 	 return false;
  }
 if (lsAT == -1 || lsDOT == -1)
  {
   alert("Please enter a Valid Email Address");
   APPFORM.EMAIL.select();
   return false;
  }
 return true;
}

function BDForm(set)
{
 var name, address, pcode, town, county, country, telnum, user, password;
 var lsAT, lsDOT, isBlank;
 
 user      = (BDFORM.BD_USERNAME.value);
 password  = (BDFORM.BD_PASSWORD.value);
 name      = (BDFORM.BD_NAME.value);
 address   = (BDFORM.BD_ADD1.value);
 pcode     = (BDFORM.BD_POSTCODE.value);
 town      = (BDFORM.BD_TOWN.value);
 county    = (BDFORM.BD_COUNTY.value);
// country   = (BDFORM.COUNTRY.value);
 telnum    = (BDFORM.BD_TELNUM.value);
 lsAT      = (BDFORM.BD_USERNAME.value.indexOf("@"));
 lsDOT     = (BDFORM.BD_USERNAME.value.indexOf("."));
 lsBlank   = (BDFORM.POSTCODE.value.indexOf(" "));
 if(user == "" && pass=="")
  {
   if(name == "" || address == "" || pcode == "" || town == "" || county == "" || telnum == "" || user == ""  || password == "")
    {
     alert("Please complete all required areas of the form");
 	   return false;
    }
   if (lsAT == -1 || lsDOT == -1)
    {
     alert("Please enter a Valid Email Address");
     BDFORM.BD_USERNAME.select();
     return false;
    }
	}
 else return false;
 return true;
}


function ContactForm(set)
{
 var name, telnum, eme;
 var eme, lsAT, lsDOT, isBlank;
 
 name      = (CONTACT.NAME.value);
 telnum    = (CONTACT.TELNUM.value);
 eme       = (CONTACT.EMAIL.value);
 lsAT      = (CONTACT.EMAIL.value.indexOf("@"));
 lsDOT     = (CONTACT.EMAIL.value.indexOf("."));

 if(name == "" || telnum == "")
  {
   alert("Please complete all required areas of the form");
 	 return false;
  }
 if(eme!="" && (lsAT == -1 || lsDOT == -1))
  {
   alert("Please enter a Valid Email Address");
   APPFORM.EMAIL.select();
   return false;
  }
 return true;
}

function AlphaSearch(alpha)
{
 document.SEARCHFORM.ALPHA.value = alpha;
 document.SEARCHFORM.CAT.value = "";
 document.SEARCHFORM.GOSEARCH.value = "";
 document.SEARCHFORM.PAGE.value = 1;
 document.SEARCHFORM.submit();
}

function CatSearch(cat)
{
 document.SEARCHFORM.ALPHA.value = "";
 document.SEARCHFORM.CAT.value = cat;
 document.SEARCHFORM.GOSEARCH.value = ""; 
 document.SEARCHFORM.PAGE.value = 1;
 document.SEARCHFORM.submit();
}

function SetPage()
{
 document.SEARCHFORM.PAGE.value = 1;
}

function StemUpdate(val)
{
 document.SEARCHFORM.STEM.value = val;
}

function SearchUpdate()
{
 document.SEARCHFORM.submit();
}

function ShowTopDomains(set)
{
 document.getElementById("TOPDOMAINS").style.top  = 100;
 document.getElementById("TOPDOMAINS").style.left = (scrw/2)-150;
 switch(set)
  {
	 case 0: document.getElementById("TOPDOMAINS").style.visibility = "hidden";break;
	 case 1: document.getElementById("TOPDOMAINS").style.visibility = "visible";break;
	}
}

function goForth(totpage)
{
 var nachos = parseInt(document.SEARCHFORM.PAGE.value);
 document.SEARCHFORM.PAGE.value = nachos + 1;
 if(document.SEARCHFORM.PAGE.value > totpage)document.SEARCHFORM.PAGE.value = totpage; 
// else document.SEARCHFORM.PAGE.value = 1;
 document.SEARCHFORM.submit();
}

function goBack()
{
 document.SEARCHFORM.PAGE.value = document.SEARCHFORM.PAGE.value - 1;
 if(document.SEARCHFORM.PAGE.value < 1) document.SEARCHFORM.PAGE.value = 1;
 document.SEARCHFORM.submit();
}

function firstPage()
{
 document.SEARCHFORM.PAGE.value = 1;
 document.SEARCHFORM.submit();
}

function lastPage(totpage)
{
 document.SEARCHFORM.PAGE.value = totpage;
 document.SEARCHFORM.submit();
}

function AddLogo(inProp)
{
 var PicWin;
 PicWin = window.open("prop_pictures.asp?prop_id=" + inProp, "Pictures", "width=600,height=600,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=5,screenY=5");
 PicWin.focus();
}

function CheckEmail(mailad) 
{
 if(!ValidEmail(mailad)) 
  {
   alert("Please enter a Valid Email Address");
   return false;
  }
 return true;
}

function ValidEmail(item) 
{
 var lsAT;
 var lsDOT;
 lsAT = item.value.indexOf("@");
 lsDOT = item.value.indexOf(".");
 if (lsAT == -1 || lsDOT == -1 || item.value.indexOf(" ") != -1 )return false;
 return true;
}

function showANY(set)
{
 document.getElementById("VILLAGE").style.display = "none";
 document.getElementById("BUSINESS").style.display = "none";
 document.getElementById("WEB").style.display = "none";
 document.getElementById("MAIL").style.display = "none";
 document.getElementById(set).style.display = "block"; 
 prev_set = set;
}

function ShowCountyList()
{
// document.getElementById("COUNTYLIST").style.display = "none";
 document.getElementById("COUNTYLIST").style.display = "block";
// prev_set = set;
}

function SetStatus(set)
{
 window.status = set;
 return true;
}

function bd_display(set)
{
 var rExp = /%20/gi;
 if(set!="")
  {
	 set = set.replace(rExp," ");
	 set = set.replace("_"," ");
	 window.status = "go to " + set;
	}
 else window.status = "";
 return true;
}

function bd_click(set,dom)
{
 var xWin;
 if(set!="")xWin = window.open("http://www.any-village.com/bd_clickthrough.aspx?bid=" + set + "&page_id=" + dom, "AdWin","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
 xWin.focus();
 return true;
}

function GoogleLink(set,county,town,params)
{
 var content, searchPhrase, tracker;
 var rExp = /%20/gi;
 params = params.replace(rExp," ");
 rExp = /&/gi;
 params = params.replace(rExp," ");
 rExp = /,/gi;
 params = params.replace(rExp," ");
 searchPhrase = town + " " + county + " " + params;
// searchPhrase = Trim(searchPhrase);
 switch(set)
  {
	 case 0:document.getElementById("GOOGLELINK").style.display = "none";break;
	 case 1:document.getElementById("GOOGLELINK").style.display = "block";
	        content = "<IFRAME SRC='http://www.google.com/search?hl=en&lr=lang_en&q=" + searchPhrase + "' WIDTH='100%' HEIGHT='400' frameborder='0'></IFRAME>";
					tracker = "<IFRAME SRC='tracker.asp?county=" + county + "&town=" + town + "&params=" + params + "' WIDTH='1' HEIGHT='1' frameborder='0'></IFRAME>";
	        document.getElementById("FRAMELOC").innerHTML = content;
					//document.getElementById("FRAMETRACK").innerHTML = tracker;
					break;
	}
}

function FeeSelect(opt,fee)
{
 var content, newFee, oldFee, endMon, endDay, endYear, months;
 var endDate=new Date();
 var nowDate=new Date();
 var nowMon = nowDate.getMonth();
 var nowDay = nowDate.getDate();
 var nowYear= nowDate.getFullYear();
 oldFee = document.BDFORM.ADFEE.value;
// document.getElementById("ENTRYFEE").innerHTML = "TEST";
 switch(opt)
  {
	 case 1: newFee = fee * FeeRate;break;
	 case 2: newFee = fee * FeeRate;break;
	 case 3: newFee = fee * FeeRate;break;
	 case 4: FeeRate = 0; newFee = document.BDFORM.ADFEE.value * FeeRate;break;
	 case 5: FeeRate = 0.5; newFee = document.BDFORM.ADFEE.value * FeeRate;break;
	 case 6: FeeRate = 1; newFee = document.BDFORM.ADFEE.value * FeeRate;break;
	}
 months = 365 * FeeRate;
 endDate.setDate(endDate.getDate()+months);	
 var endMon = endDate.getMonth();
 var endDay = endDate.getDate();
 var endYear= endDate.getFullYear();
 document.getElementById("ENTRYFEE").innerHTML = "&pound; " + newFee;
 document.getElementById("ENTRYPERIOD").innerHTML = "From " + nowDay + "/" + nowMon + "/" + nowYear + " to " + endDay + "/" +  endMon + "/" + endYear;
 if(fee!=0)document.BDFORM.ADFEE.value = fee;
}

function Loaded()
{
// document.getElementById("POSSUM").innerHTML = "Trussocks";
}

function ChatBox(set)
{
 document.getElementById("TOPICBOX").style.display = "none";
 document.getElementById("CHATBOX").style.display = "none";
 switch(set)
  {
	 case 1: document.getElementById("TOPICBOX").style.display = "block";break;
	 case 2: document.getElementById("CHATBOX").style.display = "block";break;
	} 
}

function PrintInvoice()
{
 var content;
// stuff = document.getElementById("INVOICE").innerHTML;
 content = "<html>";
 content = content + "<head>";
 content = content + "<title>ANY-Web Invoice</title>";
 content = content + "<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>";
 content = content + "<LINK REL=STYLESHEET TYPE='text/css' HREF='http://www.any-village.com/css/bd_invoice.css'>";
 content = content + "</head>";
 content = content + "<body>";
 content = content + "<table width='100%' border='0' cellspacing='30' cellpadding='0'>"
 content = content + "<tr><td>"
 content = content + document.getElementById("INVOICE").innerHTML;
 content = content + "</td></tr></table>"
 content = content + "</body>";
 content = content + "</html>";
// content = document.getElementById("INVOICE").innerHTML;
 var WinPrint = window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
 WinPrint.document.write(content);
 WinPrint.document.close();
 WinPrint.focus();
 WinPrint.print();
 WinPrint.close();
}

function MoreInfo(cus_id,page)
{
 var InfoWin;
 InfoWin = window.open("bd_Info.asp?bid=" + cus_id + "&pid=" + page, "Pictures", "width=420,height=420,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=5,screenY=5");
 InfoWin.focus();
}

function PW_Reminder()
{
 var eme, lsAT, lsDOT, GoProcess;
 GoProcess = 1;
 eme       = (BDFORM.USER.value);
 lsAT      = (BDFORM.USER.value.indexOf("@"));
 lsDOT     = (BDFORM.USER.value.indexOf("."));
 if(eme == "")
  {
   alert("Please enter the email address that you registered with");
	 BDFORM.USER.select();
	 GoProcess = 0;
 	 return false;
  }
 if(eme!="" && (lsAT == -1 || lsDOT == -1))
  {
   alert("Please enter a Valid Email Address");
   BDFORM.USER.select();
	 GoProcess = 0;
   return false;
  }
 if(GoProcess == 1)
  {
   document.BDFORM.REMINDER.value = "R";
   document.BDFORM.submit();
  }
}

function ShowLinks(set)
{
 switch(set)
  {
	 case 0: document.getElementById("RELLINKS").style.display = "none";
	         document.getElementById("LINKSET").innerHTML = "more ...";
					 document.getElementById("LINKSET").href = "JavaScript:ShowLinks(1);";break;
	 case 1: document.getElementById("RELLINKS").style.display = "block";
	         document.getElementById("LINKSET").innerHTML = "less ...";
					 document.getElementById("LINKSET").href = "JavaScript:ShowLinks(0);";break;
	}
}

function ShowSecurity()
{
 var identity;
 identity=document.getElementById("SECURITY");
 identity.className='showRow';
}

function SearchToggle()
{
 if(display)
  {
	 document.getElementById("SEARCHBOX").className='hideRow';
	 display=0;
	}
 else
  {
	 document.getElementById("SEARCHBOX").className='showRow';
	 display=1;
	}
}

function SetLinks(vCounty,vTown,vSearch)
{
/*
 if(XMLHttpRequestObject) 
  {
   switch(vSearch)
	  {
		 case "home": window.location="http://www.any-village.co.uk/main.asp?SiteID=AVUK&SpecID=" + vTown;
		 case "CCTV": XMLHttpRequestObject.open("GET", "http://www.any-village.co.uk/local_avuk.asp?SiteID=AVUK&SpecID=" + vTown + "&CatID=" + vSearch);break;
		 case "Community": XMLHttpRequestObject.open("GET", "http://www.any-village.co.uk/home_community.asp?SiteID=AVUK&SpecID=" + vTown + "&CatID=" + vSearch);break;
		 case "AddLink": XMLHttpRequestObject.open("GET", "http://www.any-village.co.uk/local_avuk.asp?SiteID=AVUK&SpecID=" + vTown + "&CatID=" + vSearch);break;
		 case "LinkToUs": XMLHttpRequestObject.open("GET", "http://www.any-village.co.uk/AVUK_LinkToUs.asp?SiteID=AVUK&SpecID=" + vTown + "&CatID=" + vSearch);break;
		 case "LocalGovt": break;
		 case "Maps": break;
		 default: XMLHttpRequestObject.open("GET", "http://www.any-village.co.uk/linksmaster.asp?SiteID=AVUK&SpecID=" + vTown + "&CatID=" + vSearch);break;
//		 default: XMLHttpRequestObject.open("GET", "http://ramrod/any-village/linksmaster.asp?SiteID=AVUK&SpecID=" + vTown + "&CatID=" + vSearch);break;
		}
//	 if(vSearch=="home")XMLHttpRequestObject.open("GET", "http://www.any-village.co.uk/home.asp?SiteID=AVUK&SpecID=" + vTown);
//	 else XMLHttpRequestObject.open("GET", "http://www.any-village.co.uk/linksmaster.asp?SiteID=AVUK&SpecID=" + vTown + "&CatID=" + vSearch); 
   XMLHttpRequestObject.onreadystatechange = function() 
    { 
      if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) 
			 { 
        document.getElementById("LINKS2").innerHTML = XMLHttpRequestObject.responseText;
       } 
    } 
   XMLHttpRequestObject.send(null); 
  }
*/
}

/*
function ShowPic_ORIG(img)
{
 var pTop, pLeft;
 pTop = eval(document.documentElement.scrollTop+130);
pLeft = ((screen.width-600)/2);
 if(img)
  {
	 if(XMLHttpRequestObject) 
    {
     XMLHttpRequestObject.open("GET", "http://www.any-village.com/fs_PG_Show.aspx?img=" + img);
     //XMLHttpRequestObject.open("GET", "http://www.any-village.co.uk/PG_Show.asp?img=" + img);
     XMLHttpRequestObject.onreadystatechange = function() 
      { 
       if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) 
	    { 
         document.getElementById("GOLARGE").innerHTML = XMLHttpRequestObject.responseText;
        } 
      } 
     XMLHttpRequestObject.send(null); 
    }
	document.getElementById("GOLARGE").style.top  = eval("'" + pTop + "px'");
	document.getElementById("GOLARGE").style.left = eval("'" + pLeft + "px'");
	document.getElementById("GOLARGE").style.visibility = "visible";
	}
 else document.getElementById("GOLARGE").style.visibility = "hidden";
}*/

function ShowPic(img)
{
 var pTop, pLeft;
 pTop = eval(document.documentElement.scrollTop+100);
 pLeft = ((screen.width-600)/2);
 if(img)
 {
  document.getElementById("GOLARGE").style.top = pTop + "px";
  document.getElementById("GOLARGE").style.left = pLeft + "px";
  fasmx_InfoService.PictureGalleryDisplay(img, ShowPicCallBack);
 }
 else document.getElementById("GOLARGE").style.visibility = "hidden";
}

function ShowPicCallBack(result)
{
 document.getElementById("GOLARGE").innerHTML=result;
 document.getElementById("GOLARGE").style.visibility = "visible"; 
}


function EditPic(img)
{
 var pTop, pLeft;
 pTop = eval(document.documentElement.scrollTop+100);
 pLeft = ((screen.width-600)/2);
 if(img)
 {
  document.getElementById("GOLARGE").style.top = pTop + "px";
  document.getElementById("GOLARGE").style.left = "10px";
  document.getElementById("GOLARGE_CONTENT").innerHTML="<iframe src ='fs_PictureEditor.aspx?pic_id=" + img + "' width='100%' height='275px' frameborder='0'><p>Your browser does not support iframes.</p></iframe>";
  document.getElementById("GOLARGE").style.visibility = "visible"; 
 }
 else document.getElementById("GOLARGE").style.visibility = "hidden";
}

function picture_delete()
{
  if (confirm("Are you sure you want to delete the selected picture?")==true)
    return true;
  else
    return false;
}

function MapLink(town)
{
 var mapWin;
 mapWin = window.open("http://www.multimap.com/map/places.cgi?client=europe&quicksearch=" + town, "MapWin","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
 mapWin.focus();
}

function GoogleMap(town,county)
{
 var reg, loc
 reg = /\^/g;
// reg  =  new RegExp(/o/,"g");
 loc = town.replace(reg,"'");
// document.q_form.q_d.value = town + ", " + county;
 document.GOOGLEFORM.q.value = loc + ", " + county;
 document.q_form.submit();
}

function PG_SelectVillage(set)
{
 var town, i;
 town = set.value;
 do
  {
	 i = town.indexOf("^");
	 town = town.replace("^"," ");
	}while(i>0);
 document.PICSEL.Town.value = town; 
 document.PICSEL.submit();
}

function GalleryList()
{
 if(GalleryListDisplay == 1)GalleryListDisplay = 0;
 else GalleryListDisplay = 1; 
 switch(GalleryListDisplay)
  {
	 //case 0: document.getElementById("listbox").style.display = "none";break;
	 //case 1: document.getElementById("listbox").style.display = "block";break;
	 case 0: document.getElementById("Listbox").style.display = "none";break;
	 case 1: document.getElementById("Listbox").style.display = "block";break; 
	 
	}
}

function LeaseRequest(dom)
{
 var leaseWin;
 if(dom=="close")leaseWin.close();
 else
  {   
   leaseWin = window.open("http://www.any-domains.com/lease/default.asp?domain=" + dom, "LeaseWin","width=600,height=600,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=5,screenY=5");
   leaseWin.focus();
	}
}

function Popup(name,set)
{
 switch(set)
  {
	 case 0: document.getElementById(name).style.visibility = "hidden";break;
	 case 1: document.getElementById(name).style.visibility = "visible";break;
	}
}

function AddPictures(ptgid, town, county)
{
 var PicWin, inProp;
 //PicWin = window.open("pg_picupload.asp", "Pictures", "width=600,height=600,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=5,screenY=5");
 PicWin = window.open("pgupload2.aspx?ptgid=" + ptgid + "&town=" + town + "&county=" + county, "Pictures", "width=600,height=600,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=5,screenY=5");
 PicWin.focus();
}

function FileUpload(ptgid, town, county,op)
{
 var PicWin, inProp;
 //PicWin = window.open("pg_picupload.asp", "Pictures", "width=600,height=600,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=5,screenY=5");
 PicWin = window.open("http://www.any-village.com/fs_contributorupload.aspx?op=" + op + "&ptgid=" + ptgid + "&town=" + town + "&county=" + county, "Pictures", "width=600,height=600,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=5,screenY=5");
 PicWin.focus();
}

function FileUpdate(set,img,op)
{
 var content; 
 if(set)
  {
	 document.getElementById("PICUPDATE").style.top  = document.body.scrollTop+130;
	 document.getElementById("PICUPDATE").style.left = (screen.width-600)/2;
	 content = "<a href=\"JavaScript:FileUpdate(0," + img + ",'" + op + "');\" class='pg_control'>Close</a><br />";
         content += "This facility is currently under re-development and will be available again shortly"; //"<iframe SRC='PG_Update.asp?op=" + op + "&img=" + img + "' WIDTH='100%' HEIGHT='100%' frameborder='0'></iframe>";
   document.getElementById("PICUPDATE").innerHTML = content;
	 document.getElementById("PICUPDATE").style.visibility = "visible";
	} 
 else document.getElementById("PICUPDATE").style.visibility = "hidden";   
}


function AddMagazine()
{
 var MagWin;
 MagWin = window.open("MagUpload.asp", "Magazine", "width=600,height=300,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=5,screenY=5");
 MagWin.focus();
}


function BD_Admin(dom, town)
{
 var bdWin
 bdWin = window.open("http://www.any-village.com/fs_bd_main.aspx?dom=" + dom + "&town=" + town, "Pictures", "width=600,height=600,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=5,screenY=5");
 bdWin.focus();
}


function Check_Profile()
{
 var pass, conf, name, telnum, eme, lsAT, lsDOT, isBlank;
 
 pass      = (document.PROFILE_FORM.password.value);
 conf      = (document.PROFILE_FORM.passconf.value);
 if(pass=="")
  {
	 alert("You must enter your password to make changes");
	 document.PROFILE_FORM.password.select();
 	 return false;
	}
 if(pass!=conf)
  {
	 alert("Your passwords must match");
	 document.PROFILE_FORM.password.select();
 	 return false;
	}
/* telnum    = (CONTACT.TELNUM.value);
 eme       = (CONTACT.EMAIL.value);
 lsAT      = (CONTACT.EMAIL.value.indexOf("@"));
 lsDOT     = (CONTACT.EMAIL.value.indexOf("."));

 if(name == "" || telnum == "")
  {
   alert("Please complete all required areas of the form");
 	 return false;
  }
 if(eme!="" && (lsAT == -1 || lsDOT == -1))
  {
   alert("Please enter a Valid Email Address");
   APPFORM.EMAIL.select();
   return false;
  }
	*/
 return true; 
}


function SetMainContent(set)
{
/*
 if(XMLHttpRequestObject) 
  {
   switch(set)
	  {
		 case 1: XMLHttpRequestObject.open("GET", "http://noodle/avuk/avuk_visitor.asp");break;
		 case 2: XMLHttpRequestObject.open("GET", "http://noodle/avuk/avuk_resident.asp");break;
		 case 3: XMLHttpRequestObject.open("GET", "http://noodle/avuk/avuk_research.asp");break;

		}
//	 if(vSearch=="home")XMLHttpRequestObject.open("GET", "http://www.any-village.co.uk/home.asp?SiteID=AVUK&SpecID=" + vTown);
//	 else XMLHttpRequestObject.open("GET", "http://www.any-village.co.uk/linksmaster.asp?SiteID=AVUK&SpecID=" + vTown + "&CatID=" + vSearch); 
   XMLHttpRequestObject.onreadystatechange = function() 
    { 
      if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) 
			 { 
        document.getElementById("maincontent").innerHTML = XMLHttpRequestObject.responseText;
       } 
    } 
   XMLHttpRequestObject.send(null); 
  }
*/
}

function ShowNews(set)
{
 var vAction;
 if(NewsDisplay == set)
  {
	 NewsDisplay = 0;
	 vAction = "none";
	}
 else 
  {
	 NewsDisplay = set;
	 vAction = "block";
	}
 document.getElementById("local_news").style.display = "none";
 document.getElementById("local_weather").style.display = "none";
 if(NewsDisplay)
  { 
   switch(set)
    {
	   case 1: document.getElementById("local_news").style.display = "block";break;
	   case 2: document.getElementById("local_weather").style.display = "block";break; 
	  }
	}
}

function ShowNewsDetail(newsitem)
{
 var NewsWin;
 NewsWin = window.open(newsitem, "NewsWin","width=600,height=600,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=5,screenY=5");
 NewsWin.focus();
}

function GuestbookEntry()
{
 if(GuestBookDisplay==0) GuestBookDisplay=1;
 else GuestBookDisplay=0;
 switch(GuestBookDisplay)
    {
	   case 0: document.getElementById("gbEntry").style.display = "none";break;
	   case 1: document.getElementById("gbEntry").style.display = "block";break; 
	  
	}
}


function ShowLatestAdditions_ORIG(op,lType, lID, evt)
{
 var xpo, ypo;
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
evt = (evt) ? evt : ((event) ? event : null);
xpo = evt.clientX;
ypo = evt.clientY;

 switch(op)
  {
   case 0: document.getElementById("laCallOut").style.visibility = "hidden";break;
   case 1: document.getElementById("laCallOut").style.top = ypo + "px";
           document.getElementById("laCallOut").style.left = xpo + "px";
           document.getElementById("laCallOut").style.visibility = "visible";break;           
  }

}

function ShowLatestAdditions(op,lType,lID, evt)
{
 var xpo, ypo;
 var iCallID;
 var node = (evt.target) ? evt.target : ((evt.srcElement)
 ?evt.srcElement : null );
 evt = (evt) ? evt : ((event) ? event : null);
 xpo = evt.clientX + 5;
 ypo = document.documentElement.scrollTop + evt.clientY + 5;
 switch(op)
   {
     case 0: document.getElementById("laCallOut").style.visibility = "hidden"; break;
     case 1: document.getElementById("laCallOut").style.top = ypo + "px";
             document.getElementById("laCallOut").style.left = xpo + "px";
             switch(lType)
              {
               case "G": fasmx_InfoService.GetGuestBookEntry(lID, laCallBack); 
                         document.getElementById("laCallOut").style.width = "200px"; break;
               case "L": fasmx_InfoService.GetLinkEntry(lID, laCallBack);
                         document.getElementById("laCallOut").style.width = "200px"; break;
               case "P": fasmx_InfoService.GetPictureGalleryEntry(lID, laCallBack); 
                         document.getElementById("laCallOut").style.width = "";break;
               case "E": fasmx_InfoService.GetPostingEntry(lID, laCallBack); 
                         document.getElementById("laCallOut").style.width = "200px"; break;
               case "S": fasmx_InfoService.GetSurveyEntry(lID, laCallBack); 
                         document.getElementById("laCallOut").style.width = "200px"; break;
              }break;
   }
}

function laCallBack(result)
{
 document.getElementById("laCallOut").innerHTML=result;
 document.getElementById("laCallOut").style.visibility = "visible"; 
}

function ShowSurveyForm(tid)
{
 var SurveyWin;
 SurveyWin = window.open("http://www.any-village.com/fs_survey.aspx?tid=" + tid, "SurveyWin","width=620,height=600,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=5,screenY=5");
 SurveyWin.focus();
}

function PicMaint(pid)
{
 var PicMaintWin;
 if(pid>1)
  {
   PicMaintWin = window.open("http://www.any-village.com/fs_picturemanager.aspx?pid=" + pid, "PicMaintWin","width=750,height=600,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=5,screenY=5");
   PicMaintWin.focus();
  }
}

function PasswordReminder(op)
{
 var pwrWin;
 pwrWin = window.open("http://www.any-village.com/passwordreminder.aspx?sys=" + op, "pwrWin","width=650,height=200,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=5,screenY=5");
 pwrWin.focus();
}

function GeoUpdate(tid)
{
 var GeoWin;
 GeoWin = window.open("http://www.any-village.com/GeoUpdate.aspx?tid=" + tid, "SurveyWin","width=400,height=500,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=5,screenY=5");
 GeoWin.focus();
}


function ShowClassifiedInfo(id)
{
}

loaded = 'true'
