function printit() {
	if (window.print) {
		window.print();
	} else {
    	var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
		document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
		WebBrowser1.ExecWB(6, 2); //Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
	}
}

function selfStatus(message) {
	self.status=message
}

function checkHide() {
	if (mouseState) window.myHide()
}

function handleResize() {
        location.reload()
        return false
}

function method_popup(url,width,height) {
	// default size (method comparison images)
	if (!width) width=420
	if (!height) height=315
	// add factor for edges
	width += 30
	height += 30
	
	/*
	var extra = 'scrollbars=no, toolbar=no, location=no, menubar=no, status=no, resizable=no, directories=no'
	spawnWindow(420,315,url,'methodWindow',150,150,extra)
	*/
	var extra = 'scrollbars=no, toolbar=no, location=no, menubar=no, status=no, resizable=no, directories=no'
	spawnWindow(width,height,url,'methodWindow',150,150,extra)
}

function print_popup(url) {
	var extra = 'scrollbars=yes, toolbar=no, location=no, menubar=no, status=no, resizable=yes, directories=no'
	spawnWindow(700,450,url,'printWindow',150,150,extra)
}

function website_popup(url) {
	var extra = 'scrollbars=yes, toolbar=yes, location=yes, menubar=yes, status=yes, resizable=yes, directories=yes'
	spawnWindow(700,450,url,'websiteWindow',150,150,extra)
}

function launch(url) {
	if(url && url.length) {
		if (parent.sub_body) parent.sub_body.location.href = url
		else location.href = url
	}
	else {
		window.alert('ERROR - URL empty - launch()')
	}
}

function launchSelect(object) {
	url = object.options[object.selectedIndex].value
	if(url && url.length) {
		if (parent.sub_body) parent.sub_body.location.href = url
		else location.href = url
	}
	else {
		//window.alert('ERROR - URL empty - launch()')
		object.selectedIndex = 0
	}
}

function spawnWindow(width,height,url,name,xPos,yPos,extra) {
	// extras = 'scrollbars=yes, toolbar=yes, location=yes, menubar=yes, status=yes, resizable=yes'
	// check for url
	if(url && url.length) {
		// init
		if (!width) width = 600
		if (!height) height = 400
		// build params
		var layout = "height=" + height + ",width=" + width
		if (extra) { layout += "," + extra }
		var newWindow = window.open(url, name, layout)
		//newWindow.location.href = url
		//if (!newWindow.opener) newWindow.opener = self
		newWindow.focus()
		newWindow.moveTo(xPos,yPos)
		return newWindow
	} else {
		window.alert('No url specified in javascript:spawnWindow() call')
	}
}

function loadWindow(destination)	{
	//var newFile = "new.html"
	var newFile = 'destination'
	opener.location = newFile
}

function closeWindow()	{
	window.close()
}

function spawnHelp(title,text) {
	//window.alert(title+'\n\n'+text)
	// init
	var width = 450
	var height = 250
	var url = '/help/popup.php?title='+encodeURI(title)+'&text='+encodeURI(text)+'&width='+width
	var name = 'helpWindow'
	var extra = 'scrollbars=yes, toolbar=no, location=no, menubar=no, status=no, resizable=no'
	// spawn
	spawnWindow(width,height,url,name,extra)
}

function showArch(){

	var strA = document.getElementById('arc_year').value;
	var strB = document.getElementById('arc_month').value;
	var extra = 'scrollbars=yes, toolbar=no, location=no, menubar=no, status=no, resizable=yes'
	var url = './archive/' + strA + '/' + strB;
	spawnWindow('600','400',url,'ArchiveMinutes',150,150,extra);
}

/*
// ** ASLC LEGACY JS *** //

function on(name)   {
	//window.alert('turn '+name+' ON')
	document[name].src = eval(name + "on.src")
}

function off(name)   {
	//window.alert('turn '+name+' OFF')
	document[name].src = eval(name + ".src")
}



*/



/*
// ** CLICKSTREAM LEGACY JS *** //

function terms_popup(){alertwindow = window.open("/terms-popup.html","termswindow","status=no,location=no,menubar=no,toolbar=no,directories=no,scrollbars=yes,resizable=yes,x=0, y=0,width=600,height=450");}

function image_popup(image){alertwindow = window.open(image,"imagewindow","status=no,location=no,menubar=no,toolbar=no,directories=no,scrollbars=no,resizable=no,x=0, y=0,width=400,height=300");}

function demo_popup(page){alertwindow = window.open(page,"demowindow","status=no,location=no,menubar=no,toolbar=no,directories=no,scrollbars=yes,resizable=yes,x=0, y=0,width=600,height=450");}

function case_popup(page){alertwindow = window.open(page,"demowindow","status=no,location=no,menubar=no,toolbar=no,directories=no,scrollbars=yes,resizable=yes,x=0, y=0,width=650,height=350");}

function faq_popup(page){
alertwindow = window.open(page,"faqwindow","status=no,location=no,menubar=no,toolbar=no,directories=no,scrollbars=yes,resizable=yes,x=0, y=0,width=600,height=450");}

function company_popup(id){alertwindow = window.open("/company_details.php?id="+id,"imagewindow","status=no,location=no,menubar=no,toolbar=no,directories=no,scrollbars=no,resizable=no,x=0, y=0,width=400,height=300");}

function display(text) {
	window.alert(text)
}
*/