
// 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)
}

// createPlayer
function createPlayer(layerId, file) {
	var FO = {	
		movie:"mp3player.swf", width:"320", height:"20",
		majorversion:"7",build:"0",bgcolor:"#FFFFFF", 
		flashvars:"file=" + file + "&autostart=true"
	};
	UFO.create(	FO, layerId);
}

// 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;
	}
}
// "ajax" functions
function xmlhttpPost(strURL, targetLayerId) {
    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, targetLayerId);
        }
    }
    xmlHttpReq.send();
}
function getquerystring() {
	//var form = document.forms['f1'];
	//var word = form.word.value;
	var word = "test";
	qstr = 'w=' + escape(word);  // NOTE: no '?' before querystring
	return qstr;
}
function updatepage(str, layerId){
	document.getElementById(layerId).innerHTML = str;
	// toggleLayer(layerId);
}
function updateLayer(content, layerId){
	document.getElementById(layerId).innerHTML = content;
}
function setTitle(content) {
	updateLayer("<b>Title:</b> " + content, "title");
}
// toggleLayer
function toggleLayer(whichLayer) {
	var lastLayerWhich = 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";
	}
}
