//comment

// cvs is great !!!

function swap(image,imagefile)
{
  document.images[image].src = imagefile
}

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;scrolling:no;status:no;';

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

	return ret;
}

function show_scrolling_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:auto;scrolling:auto;status:no;';

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

	return ret;
}

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

	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;
}

var pwidth = "795";
var pheight = "590";

function openPreview(purl)
{
    PoppURL=purl;
    if(!PoppWin || PoppWin.closed){
        PoppWin=PoppWinOpen(pwidth,pheight);
    }
    else {
        PoppWin.close();
        PoppWin=null;
        PoppWin=PoppWinOpen(pwidth,pheight);
    }
}
var PoppURL="";
var PoppWin=null;
var openpoppwin=null;
function PoppWinOpen(pwidth,pheight){
    var x =(screen.availWidth-pwidth)/2;
    var y =(screen.availHeight-pheight)/2;
	var pwinfeatures="width="+pwidth+",height="+pheight+",top="+y+",left="+x+",status=no,toolbar=no,menubar=no,location=no,resizable,scrollbars=1";
	openpoppwin=null;
	openpoppwin=window.open(PoppURL,"ibpreview",pwinfeatures);
	return openpoppwin;
}