﻿// JScript File

function openCalendarDialog(sUrl)
{
    return openModalDialog(sUrl,'Kalendarz..',230,215);
}

function openModalDialog(sURL,title,width,height) 
{
    var arrTemp = new Array();
	arrTemp[0]=title; 
	arrTemp[1]=sURL;
	//arrTemp[2]=dataObject;
		
	var sFeatures = 'status:no;resizable:yes;scroll:no;center:yes;';
    sFeatures += 'dialogWidth:'+width+'px;';			
    sFeatures += 'dialogHeight:'+height+'px;';
	
	var retVal = window.showModalDialog('/js/modalDlg.html',arrTemp,sFeatures);
	return retVal;
}

function openListWindow(url,name)
{
    openPopupWindow(url,name,700,600);
}

function openPopupWindow(url,name,width,height,posX,posY)
{
    var sFeatures = 'status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=0,width='+width+',height='+height;
    
    if(posX==null)
    {
        var leftPos = (screen.width - width) / 2;
        var topPos = (screen.height - height) / 2;
       
        sFeatures += ',left='+leftPos+',top='+topPos;
    }
    else
        sFeatures += ',left='+posX+',top='+posY;
        
    return window.open(url,name,sFeatures,true);
}


function isEmpty(str)
{
	if(str==null) return true;
	if(str.length==0) return true;	

	for(var i=0;i<str.length;i++)
	{			
		if(str.charAt(i)!=' ')
			return false;
	}
	
	return true;
}

