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');}
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, resizable=1, location=1, menubar=1, status=1, toolbar=1, height=768, width=1024');
  site.window.focus();
}

function popup(newURL) {
  var popuper = window.open(newURL, 'popup','scrollbars=0, resizeable=0, width=425, height=550');
  popuper.window.focus();
}

function startList() {
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", "");
   }
   }
  }
 }
}

// AJAX REQUEST 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;
	email = trim(email);
	var chk = /^[^@]+@[^@.]+\.[^@]*\w\w$/
	if (!chk.test(email)) {
		alert("Your email is invalid");
	}
	else{
		http.open('get', '/maillist/maillist.php?action=subscribe&email='+email);
		http.onreadystatechange = emailResponse;
		http.send(null);
	}
}

function emailResponse() {
    if(http.readyState == 4){
        var response = http.responseText;
        document.getElementById("newsletter").innerHTML = response;

    }
}
function getCookie(c_name){
	if (document.cookie.length>0)
	  {
	  c_start=document.cookie.indexOf(c_name + "=");
	  if (c_start!=-1)
	    { 
	    c_start=c_start + c_name.length+1; 
	    c_end=document.cookie.indexOf(";",c_start);
	    if (c_end==-1) c_end=document.cookie.length;
	    return unescape(document.cookie.substring(c_start,c_end));
	    } 
	  }
	return "";
}

function setCookie(c_name,value,expiredays){
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function checkCookie(){
	
	var html = "<div id='disclaimer'><a href='javascript:closeDisclaimer();'><img src='/_images/disclaimer-2.gif' usemap='#map1' alt='' /></a></div>";
	
	var cValue=getCookie('disclaimer');
	if (cValue==null || cValue==""){
		document.write(html);
		var xT = setTimeout(closeDisclaimer,15000);
	}
}
function closeDisclaimer(){
	document.getElementById('disclaimer').style.display = "none";
	setCookie('disclaimer','disclaimed',1);
}