
function addBookmark(url,title){
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
if (document.all);
window.external.AddFavorite(url,title);}
else {
if(navigator.appName == "Netscape");
alert("You are using Netscape! Please press CTRL+D");
}
}

function printWindow() {
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print();
}


// Right Click Copyright Alert

function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("All Website Content & Images\nCopyright © 2009\nEllen Thompson, Elegance In Draperies     ");
return false;
}
return true;
}
document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;


// Button Image Rollover

button1 = new Image();
button1.src = "btn_home_rd.gif";

button2 = new Image();
button2.src = "btn_design_rd.gif";

button3 = new Image();
button3.src = "btn_fabric_rd.gif";

button4 = new Image();
button4.src = "btn_accessories_rd.gif";

button5 = new Image();
button5.src = "btn_faqs_rd.gif";

button6 = new Image();
button6.src = "btn_gallery_rd.gif";

button7 = new Image();
button7.src = "btn_profile_rd.gif";

button8 = new Image()
button8.src = "btn_contact_rd.gif";

// Open Window by Clark Formaniak (http://www.futurewebdevelopment.com)

function sampleWin(URL) {
sampleWindow = window.open(URL, 'sampleWin', 'menubar=yes,toolbar=yes,location=no,status=yes,scrollbars=yes,width=550,height=400,left=50,top=50')}

function popWin(URL) {
popupWindow = window.open(URL, 'popWin', 'toolbar=no,location=no,scrollbars=no,width=390,height=445,left=20,top=0')}

function pfpWin(URL) {
pfpWindow = window.open(URL, 'pfpWin', 'menubar=yes,toolbar=yes,location=no,status=yes,scrollbars=yes,width=600,height=400,left=50,top=50')}


// Validate Contact Us Form by Clark Formaniak (http://www.futurewebdevelopment.com)

function validEmail(email) {
  invalidChars = " /:,;"
  
  if (email == "") {
      return false;
  }
  for (i=0; i<invalidChars.length; i++) {
      badChar = invalidChars.charAt(i);
      if (email.indexOf(badChar,0) > -1) {
      return false;
      }
  }
  atPos = email.indexOf("@",1);
  if (atPos == -1) {
      return false;
  }
  if (email.indexOf("@",atPos+1) > -1) {
      return false;
  }
  periodPos = email.indexOf(".",atPos)
  if (periodPos == -1) {
      return false;
  }
  if (periodPos+3 > email.length) {
      return false;
  }
  return true;
}

function checkContactForm(contact) {
  // check for name field
  if (contact.realname.value.length < 1) {
      alert("Please enter your full name.");
      contact.realname.focus();
      contact.realname.select();
      return false;
  }

   // check for email field
  if (contact.realemail.value.length < 1) {
     alert("Please enter your email address.");
     contact.realemail.focus();
     contact.realemail.select();
     return false;
  }

  // check to see if email is valid
  if (!validEmail(contact.realemail.value)) {
      alert("Invalid email address!\nPlease enter your email address.");
      contact.realemail.focus();
      contact.realemail.select();
      return false;
  }

  // check for city field
  if (contact.x_City.value.length < 1) {
      alert("Please enter your city.");
      contact.x_City.focus();
      contact.x_City.select();
      return false;
  }

  // check for state field
  if (contact.x_State.value.length < 1) {
      alert("Please enter your state.");
      contact.x_State.focus();
      contact.x_State.select();
      return false;
  }

  // check for phone field
  if (contact.x_Phone.value.length < 1) {
      alert("Please enter your phone number.");
      contact.x_Phone.focus();
      contact.x_Phone.select();
      return false;
  }

  // check for subject field
  if (contact.subject.value.length < 1) {
      alert("Please enter the subject of your message.");
      contact.subject.focus();
      contact.subject.select();
      return false;
  }

  // check for message field
  if (contact.message.value.length < 1) {
      alert("Please enter your message.");
      contact.message.focus();
      contact.message.select();
      return false;
  }

  return true;
}


// SafeEmail by Clark Formaniak (http://www.futuremarketing.org)
// Designed to help prevent email harvesting programs from 
// scraping your mailto: links.

function ellenEmail() {
var name = "Ellen";
var domain = "EleganceInDraperies&#46;com";
var subject = "Re:%20EleganceInDraperies.com";
var over = "onmouseover=\"window.status='Email Your Questions Or Comments'; return true\"";
var out = "onmouseout=\"window.status=''\"";
document.write('<a ' + over + ' ' + out + ' href=\"&#109;a&#105;lt&#111;&#58;' + name + '&#64;' + domain + '&#63;&#115;&#117;bje&#99;&#116;&#61;' + subject + '\">');
document.write(name + '&#64;' + domain + '</a>');
}

function supportEmail() {
var name = "Support";
var domain = "EleganceInDraperies&#46;com";
var subject = "Re:%20EleganceInDraperies.com";
var over = "onmouseover=\"window.status='Email Your Questions Or Comments'; return true\"";
var out = "onmouseout=\"window.status=''\"";
document.write('<a ' + over + ' ' + out + ' href=\"&#109;a&#105;lt&#111;&#58;' + name + '&#64;' + domain + '&#63;&#115;&#117;bje&#99;&#116;&#61;' + subject + '\">');
document.write(name + '&#64;' + domain + '</a>');
}


function addEmail(name,domain,subject,showtext) {
var over = "onmouseover=\"window.status='Send An Email For More Information'; return true\"";
var out = "onmouseout=\"window.status=''\"";
document.write('<a ' + over + ' ' + out + ' href=\"&#109;a&#105;lt&#111;&#58;' + name + '&#64;' + domain + '&#63;&#115;&#117;bje&#99;&#116;&#61;' + subject + '\">');
document.write(showtext + '</a>');
}


function webmasterEmail() {
var name = "Webmaster";
var domain = "EleganceInDraperies&#46;com";
var subject = "Re:%20EleganceInDraperies.com";
var over = "onmouseover=\"window.status='Email Questions Or Problems About This Website'; return true\"";
var out = "onmouseout=\"window.status=''\"";
document.write('<a ' + over + ' ' + out + ' href=\"&#109;a&#105;lt&#111;&#58;' + name + '&#64;' + domain + '&#63;&#115;&#117;bje&#99;&#116;&#61;' + subject + '\">');
document.write(name + '&#64;' + domain + '</a>');
}



