function writeFlash(url,w,h,id,bg,trans) {
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="' + w + '" height="' + h + '" id="'+ id + '">\n');
document.write('<param name="movie" value="' + url + '" />\n');
document.write('<param name="quality" value="high" />\n');
document.write('<param name="bgcolor" value="' + bg + '" />\n');
if (trans == 1) {document.write('<param name="wmode" value="transparent" />\n');}
document.write('<!--[if !IE]> <-->\n');
document.write('<object data="' + url + '" width="' + w + '" height="' + h + '" type="application/x-shockwave-flash" name="'+ id + '">\n');
document.write('<param name="quality" value="high" />\n');
document.write('<param name="bgcolor" value="' + bg + '" />\n');
document.write('<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer" />\n');
if (trans == 1) {document.write('<param name="wmode" value="transparent" />\n');}
else {document.write('<param name="wmode" value="window" />\n');}
document.write(' FAIL (the browser should render some flash content, not this).\n');
document.write(' </object>\n');
document.write('<!--> <![endif]-->\n');
document.write('</object>\n');
}

function visit(newURL) {
  var site = window.open(newURL, 'website','scrollbars=1, location=1, menubar=1, status=1, toolbar=1, height=768, width=1024');
  site.window.focus();
}

function popup(newURL, w, h) {
  var atts = 'scrollbars=1, location=1, menubar=1, status=1, toolbar=1, height=' + h + ', width=' + w;
  var site = window.open(newURL, 'website', atts);
  site.window.focus();
}

// Maillist Funciton
function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}

var http = createRequestObject();

function trim(str)
{
  return str.replace(/^\s+|\s+$/g, '')
};

//EMAIL HANDLER
function emailReq() {
	email = document.getElementById( 'email' ).value;
	name = document.getElementById( 'name' ).value;
	email = trim(email);
	name = trim(name);
	var chk = /^[^@]+@[^@.]+\.[^@]*\w\w$/
	if (!chk.test(email)) {
		alert("Your email is invalid");
	}
	else{
		http.open('get', 'maillist/maillist432b.html?action=subscribe&amp;email='+email+'&name='+name);
		http.onreadystatechange = emailResponse;
		http.send(null);
	}
}

function emailResponse() {
    if(http.readyState == 4){
        var response = http.responseText;
        document.getElementById("maillist").innerHTML = response;

    }
}

//GALLERY HANDLER
function getPiece(file) {
	document.getElementById("puthere").innerHTML = "<img src='http://www.angelossalonandspa.com/_images/gallery/"+file+"' alt='' />";
}

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;