function OpenWindow()
{
window.open()
}

function Start(page) {
OpenWin = this.open(page, "CtrlWindow", "toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes");
}

function getonme() {
el = event.srcElement ;
if (el.getAttribute("litUp1") != null) {
el.className = "onme1" ;
}
}

function getoffme() {
el = event.srcElement ;
if (el.getAttribute("litUp1") != null) {
el.className = "offme";
}
}

document.onmouseover = getonme ;
document.onmouseout = getoffme ;

var url = "http://www.rochester-lettings.co.uk";
var title = "The premier choice for Property Management in The Medway Towns";

function addbookmark()
{
bookmarkurl="http://www.rochester-lettings.co.uk"
bookmarktitle="Welcome To Rochester Lettings Website"
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function RemoveDot()
{
for (a in document.links) document.links[a].onfocus = document.links[a].blur;
}
if (document.all)
{
document.onmousedown = RemoveDot;
}
function no_error()
{ return true; }
window.onerror=no_error;

var ie = document.all ? 1 : 0
function Start(page) {
OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
}


function img_popup(imagename,title,pic_height,pic_width) 
  {
  var popup_cfg = "TOOLBAR=NO,SCROLLBARS=NO,width="+pic_width+",height="+pic_height;
  var popup =  window.open('','popup',popup_cfg);
  popup.document.open();
  popup.document.write('<HTML><HEAD><TITLE>' + title + '</TITLE></HEAD><BODY leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">');
  popup.document.write('<CENTER><a href="javascript:self.close()"><IMG SRC="' + imagename + '" border=0 alt="Click here to close window" height=' + pic_height + ' width=' + pic_width + '></a></center>');
  popup.document.write('</BODY></HTML>');
  popup.document.close();
  }

 function closeWindow() {top.self.close();}
function isReady(form)
{
if (document.theform.name.value == "")
{
window.alert('Please fill in Full Name');
result = false;
document.theform.name.focus();

return result;
}

if (document.theform.email.value == "")
{
window.alert('Please fill in your e-mail address');
result = false;
document.theform.email.focus();

return result;
}

var invalid = "@";
var sPeriod = ".";

if ((document.theform.email.value.indexOf(invalid) < 0) || (document.theform.email.value.indexOf(sPeriod) < 0))
{
window.alert("Invalid e-mail address, please re-enter.");
document.theform.email.focus();
result = false;
return result;

}
if (document.theform.invest.value == "" )
{
window.alert('Please fill as much information as possible');
result = false;
document.theform.invest.focus();

return result;
}

if (document.theform.area.value == "" )
{
window.alert('It would help if we knew what area you were intered in');
result = false;
document.theform.area.focus();

return result;

}

if (document.theform.type.value == "" )
{
window.alert('Also what type of property');
result = false;
document.theform.type.focus();

return result;

}

if (document.theform.budget.value == "" )
{
window.alert('Do you have a budget?');
result = false;
document.theform.budget.focus();

return result;

}

}

 fader();
function fader1(a,id){
i=a;i+=19;
document.getElementById(id).style.letterSpacing=i/9;
document.getElementById(id).style.filter='alpha(opacity='+i+')';
if (i<90){setTimeout('fader1('+i+','+id+')',1)}return(i)}

function fader2(a,id){
i=a;i-=5;
document.getElementById(id).style.letterSpacing=i/13
document.getElementById(id).style.filter='alpha(opacity='+i+')';

if (i>50){setTimeout('fader2('+i+','+id+')',1)}}
function fader(){
for (z=1;z<=5;z++){
document.getElementById(z).style.filter='alpha(opacity=70)';
document.getElementById(z).style.letterSpacing=2;
}
}


function changecolor(code) {
   document.bgColor=code
   }
function changecolor2(mode){
   document.fgColor=mode
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

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_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

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_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_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 setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}
function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}
function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}
function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}
window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
}
window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}
var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

