﻿var d = document;

function $(id)
{
    return document.getElementById(id);
}

function openWin(url, width, height)
{    
	leftPos = (screen.width)?(screen.width-width)/2:100;
	topPos  = (screen.height)?(screen.height-height)/2:100;
	
	// no Modal
	window.open(url, 'win', 'left='+leftPos+',top='+topPos+',width='+width+',height='+height+',toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes').focus();
}

   
function isEmpty(str)
{
    var cnt = 0;
    var len = str.length; 
    for ( indx = 0; indx < len; indx++)
    {
        if (isWhiteSpaceChar(str.charAt(indx)))
        {
            cnt++;
        }        
    }    
    return (len == cnt); 
}

function isWhiteSpaceChar(letter)
{
    return ((letter == " ") || (letter == "\n") || (letter == "\r") || (letter == "\t"));    
}
