function namosw_exchange_src(name, rpath, nsdoc)
{
  str = (navigator.appName == 'Netscape') ? nsdoc+'.'+name : 'document.all.'+name;
  img = eval(str);
  if (img) {
    if (img.altsrc == null) {
      img.altsrc = img.src;
      img.src    = rpath;
    } else {
      var temp   = img.src;
      img.src    = img.altsrc;
      img.altsrc = temp;
    }
  }
}

function namosw_preload_img()
{
  var img_list = namosw_preload_img.arguments;
  if (document.preloadlist == null)
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i]     = new Image;
    document.preloadlist[top+i].src = img_list[i];
  }
}

function protect(evt)
{
  if (navigator.appName != 'Microsoft Internet Explorer')
  {
    if (evt.which != 3)
  alert("Sorry, you don't have permission to right-click.");
      return true;
  };
  return false;
}


function trap()
{
  if(document.images)
  {
    if(navigator.appName != 'Microsoft Internet Explorer')
    {
      for(i=0;i<document.images.length;i++)
        document.images[i].onmousedown = protect;
    }
    else
    {
      for(i=0;i<document.images.length;i++)
        document.images[i].oncontextmenu = protect;
    }
  }
}

function VersionNavigateur(Netscape, Explorer) {
  if ((navigator.appVersion.substring(0,3) >= Netscape && navigator.appName == 'Netscape') ||
      (navigator.appVersion.substring(0,3) >= Explorer && navigator.appName.substring(0,9) == 'Microsoft'))
    return true;
else return false;
}

var posBan4=0, ban4, delayBan4, msgBan4;
function banner4(delay) {
  delayBan4 = delay;
  if (posBan4 >= msgBan4.length)
    posBan4 = 0;
  else if (posBan4 == 0) {
    msgBan4 = '        ' + msgBan4;
    while (msgBan4.length < 100)
      msgBan4 += '        ' + msgBan4;
  }
  window.status = msgBan4.substring(posBan4,posBan4+msgBan4.length);
  posBan4++;
  ban4 = setTimeout("banner4(delayBan4)",delay);
}


function checkrequired(which) {
var pass=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
if (tempobj.name.substring(0,8)=="required") {
if (((tempobj.type=="text"||tempobj.type=="textarea")&&
tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
tempobj.selectedIndex==0)) {
pass=false;
break;
         }
      }
   }
}
if (!pass) {
shortFieldName=tempobj.name.substring(8,30).toUpperCase();
alert("Please make sure the "+shortFieldName+" field is completed.");
return false;
}
else
return true;
}



function changeCase(frmObj) {
var index;
var tmpStr;
var tmpChar;
var preString;
var postString;
var strlen;
tmpStr = frmObj.value.toLowerCase();
strLen = tmpStr.length;
if (strLen > 0)  {
for (index = 0; index < strLen; index++)  {
if (index == 0)  {
tmpChar = tmpStr.substring(0,1).toUpperCase();
postString = tmpStr.substring(1,strLen);
tmpStr = tmpChar + postString;
}
else {
tmpChar = tmpStr.substring(index, index+1);
if (tmpChar == " " && index < (strLen-1))  {
tmpChar = tmpStr.substring(index+1, index+2).toUpperCase();
preString = tmpStr.substring(0, index+1);
postString = tmpStr.substring(index+2,strLen);
tmpStr = preString + tmpChar + postString;
         }
      }
   }
}
frmObj.value = tmpStr;
}



function emailCheck() {
  txt=document.form.requiredEmail.value;
  if (txt!=""){
  if (txt.indexOf("@")<3){
   alert("I'm sorry. This email address seems wrong.");
   return false;
    }
  }
  return true;
 }



var nr=0;
 function numericCheck(){
  nr1=document.form.txt_Book_Tel.value;
  flg=0;
  str="";
  spc="";
  arw="";
  for (var i=0;i<nr1.length;i++){
   cmp="0123456789,/";
   tst=nr1.substring(i,i+1);
   if (cmp.indexOf(tst)<0){
    flg++;
    str+=" "+tst;
    spc+=tst;
    arw+="^";
   }
   else{arw+="_";}
  }
  if (flg!=0){
   if (spc.indexOf(" ")>-1) {
    str+=" and a space";
    }
   alert(nr1+"\r"+arw+"\rI'm sorry. Entry must "
   +"be a number. Can use ',' or '/' as separators "
   + "but no spaces.");
   return false;
  }
  return true;
 }




function submitonceonly(theform){

if (document.all||document.getElementById){
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")

tempobj.disabled=true
}
}
}


function na_change_img_src(name, nsdoc, rpath, preload)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  }
}

function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  }
}

function disableselect(e){
return false;
}
function reEnable(){
return true;
}
document.onselectstart=new Function ("return false");
if (window.sidebar){
document.onmousedown=disableselect;
document.onclick=reEnable;
}

function jsopen_win(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';

  cookie_str = document.cookie;
  cookie_str.toString();

  pos_start  = cookie_str.indexOf(name);
  pos_end    = cookie_str.indexOf('=', pos_start);

  cookie_name = cookie_str.substring(pos_start, pos_end);

  pos_start  = cookie_str.indexOf(name);
  pos_start  = cookie_str.indexOf('=', pos_start);
  pos_end    = cookie_str.indexOf(';', pos_start);

  if (pos_end <= 0) pos_end = cookie_str.length;
  cookie_val = cookie_str.substring(pos_start + 1, pos_end);
  if (cookie_name == name && cookie_val  == "done")
    return;

  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}



closetime = 3; // Close window after __ number of seconds?

function Start(URL, WIDTH, HEIGHT) {
windowprops = "left=350,top=350,width=" + WIDTH + ",height=" + HEIGHT;
preview = window.open(URL, "preview", windowprops);
if (closetime) setTimeout("preview.close();", closetime*1000);
}

function doPopup() {
url = "http://www.magic-maids.co.uk/SpringClean.html";
width = 250;  // width of window in pixels
height = 270; // height of window in pixels
delay = 2;    // time in seconds before popup opens
timer = setTimeout("Start(url, width, height)", delay*1000);
}

closetime = 0; // Close window after __ number of seconds?
// 0 = do not close, anything else = number of seconds

function Start(URL, WIDTH, HEIGHT) {
windowprops = "left=250,top=100,scrollbars=1,width=" + WIDTH + ",height=" + HEIGHT;
preview = window.open(URL, "preview", windowprops);
if (closetime) setTimeout("preview.close();", closetime*1000);
}

function doPopup(Lname) {
if (Lname == "a1") {
url = "http://www.allabouthome.com/directories/dir_cleaning.html";
}
else if (Lname == "a2") {
url = "http://www.tellmehowto.net/cleaning/";
}
else if (Lname == "a3") {
url = "http://kitchen.robbiehaf.com/CleaningTips.html";
}
else if (Lname == "a4") {
url = "http://www.channel4.com/life/microsites/H/how_clean_is_your_house/tips.html";
}
else if (Lname == "a5") {
url = "http://www.debra4homes.com/f/spring_cleaning_tips.htm";
}
else if (Lname == "a6") {
url = "http://www.queenofclean.com/tips/";
}
else if (Lname == "a7") {
url = "http://www.essortment.com/in/Home.Cleaning/";
}
else if (Lname == "a8") {
url = "http://www.thefunplace.com/house/tips/clean.html";
}
else if (Lname == "a9") {
url = "http://www.cleaning.com/";
}
width = 800;  // width of window in pixels
height = 800; // height of window in pixels
delay = .1;    // time in seconds before popup opens
timer = setTimeout("Start(url, width, height)", delay*1000);
}

