
function openWindow(mypage, myname, w, h, scroll) {
	
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable,menubar=yes'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

}

function openModal(file,width,height) {
	
	mymodal = dhtmlmodal.open("modalbox", "iframe", file, "Modal Window", "width="+width+"px,height="+height+"px,resize=0,scrolling=1,center=1", "recal");

}

function changeImage( imagename, imagefile ) {
	document.getElementById(imagename).src = imagefile; 

}

function setCookie( name, value, expires, path, domain, secure )
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct
expires time, the current script below will set
it for x number of days, to make it for hours,
delete * 24, for minutes, delete * 60 * 24

Set_Cookie( 'mycookie', 'visited 9 times', 30, '/', '', '' );

*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}
	
	
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable,menubar=yes'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function hideElement (elementId) {
var element;
if (document.all)
element = document.all[elementId];
else if (document.getElementById)
element = document.getElementById(elementId);
if (element && element.style)
element.style.display = 'none';
}

function showElement (elementId) {
var element;
if (document.all)
element = document.all[elementId];
else if (document.getElementById)
element = document.getElementById(elementId);
if (element && element.style)
element.style.display = '';
}