var xmlHttp

function mlSignUp(email) {
    xmlHttp=GetXmlHttpObject()
    var url="includes/_subscribe.php?add="+ email;
    xmlHttp.onreadystatechange=stateChanged 
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)
}

function stateChanged()  { 
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
 	document.getElementById("ml_result").innerHTML = xmlHttp.responseText;
    } 
}

function GetXmlHttpObject() {
    var xmlHttp=null;
    try {
 	// Firefox, Opera 8.0+, Safari
 	xmlHttp=new XMLHttpRequest();
    } catch (e) {
	//Internet Explorer
	try {
 	    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  	} catch (e) {
  	    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  	}
    }
    return xmlHttp;
}

function changeGallery(sid, page, stype, total) {
    for (var loop = 1; loop <= total; loop++) {
  	changeDivDisplay(stype+'s'+sid+'p'+loop, 'none');
    }
    changeDivDisplay(stype+'s'+sid+'p'+page, 'block');
}

function changeDivDisplay(layer_ref, force) {
    state = force;
    if (document.all) {
  	eval( 'document.all.'+ layer_ref +'.style.display = state');
    }
    if (document.layers) {
  	document.layers[layer_ref].display = state;
    }
    if (document.getElementById && !document.all) {
  	whatever = document.getElementById(layer_ref);
  	whatever.style.display = state;
    }
 }
