function show_modal_window(loc, width, height, args)
{
	width += 20;
	height += 20;

	var props = 'center:yes;status:no;resizable:no;dialogWidth:' + width + 'px;dialogHeight:' + height + 'px;help:no;scroll:no;status:no;';

	var ret = window.showModalDialog(loc, args, props);

	return ret;
}

function openWindow(url,width,height,status)
{
	//width -= 12;
	//height -= 31;
    PopURL=url;
    if(!PopWin || PopWin.closed){
        PopWin=PopWinOpen(width,height,status);
    }
    else {
        PopWin.close();
        PopWin=null;
        PopWin=PopWinOpen(width,height,status);
    }
}
var PopURL="";
var PopWin=null;
var openpopwin=null;
var calendar_span;
function PopWinOpen(width,height,status){
    var x =(screen.availWidth-width)/2;
    var y =(screen.availHeight-height)/2;
	var status_st = '';
	if(status)
	{
		status_st = ',status';
	}

	var date_obj = new Date();
	var date_st = '' + date_obj.getTime();

  var winfeatures="width="+width+",height="+height+",top="+y+",left="+x+",resizable=yes,scrollbars=0" + status_st;
	openpopwin=null;
	openpopwin=window.open(PopURL,"wkapp" + date_st,winfeatures);
	return openpopwin;
}

function toggleSpan(span)
{
	var display = 'inline';
	
	if(span.style.display == 'inline')
	{
		display = 'none';
	}
	
	span.style.display = display;
}