
// popUpWindow
function popupWindow(fileLocation,width,height,scroll) {
	popupWin = window.open(fileLocation, 'popup', "top=50,screeny=50,left=50,screenx=50,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + scroll + ",resizable=0,width=" + width + ",height=" + height)
}

// "ajax" functions
function xmlhttpPost(strURL) {
    var xmlHttpReq = false;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        xmlHttpReq = new XMLHttpRequest();
        // xmlHttpReq.overrideMimeType('text/xml');
    }
    // IE
    else if (window.ActiveXObject) {
        xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlHttpReq.open('POST', strURL, true);
    xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlHttpReq.onreadystatechange = function() {
        if (xmlHttpReq.readyState == 4) {
            updatepage(xmlHttpReq.responseText);
        }
    }
    // xmlHttpReq.send(getquerystring_form());
    xmlHttpReq.send(strURL);
}
function getquerystring() {
    var form     = document.forms['f1'];
    var word = form.word.value;
    qstr = 'w=' + escape(word);  // NOTE: no '?' before querystring
    return qstr;
}
function updatepage(str){
    document.getElementById("content").innerHTML = str;
}

// toggleLayer
function toggleLayer(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display ? "" : "block";
	} else if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display ? "":"block";
	} else if (document.layers) {
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display ? "":"block";
	}
}

// showHideLayer
function layerDisplay(whichLayer, display) {
	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = display;
	} else if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = display;
	} else if (document.layers) {
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = display;
	}
}

function bliBlaBlu(name, domain, tld, link) {
	if (domain.length==0)	domain	= 'styte'; 
	if (tld.length==0)		tld		= 'com'; 
	if (link.length == 0) {
		link = name + '@' + domain + '.' + tld;
	}
	var display_this = '<a href="mailto:' + name + '@' + domain + '.' + tld + '">' + link + '</a>';
	document.write(display_this);
}
