function doPopup(URL, WIDTH, HEIGHT, SCROLLBARS ) 
{
	url = URL;
	width = WIDTH;  // width of window in pixels
	height = HEIGHT; // height of window in pixels
	windowprops = "left=50,top=50,width=" + WIDTH + ",height=" + HEIGHT + "toolbar=no," + "location=no," + "directories=no," + "status=no," + "menubar=no," + "scrollbars=" + SCROLLBARS + "," + "resizable=no,";
	preview = window.open(URL, "preview", windowprops);
}

function openLabel(Path,LabelID) 
{
	doPopup(Path + "BrowseEdit.aspx?module=System&Page=LabelPopup&LabelID=" + LabelID, 500, 500);
}

// function adjustIFrameSize (iframeWindow) {
//     if (iframeWindow.document.height) {
//         var iframeElement = document.getElementById(iframeWindow.name);
//         //var bottomElement = iframeWindow.document.getElementById('bottom_div');
//         iframeElement.style.height = iframeWindow.document.height + 'px';
//         //iframeElement.style.width = iframeWindow.document.width + 'px';
//     }
//     else if (document.all) {
//         var iframeElement = document.all[iframeWindow.name];
//         var bottomElement = iframeWindow.document.all['bottom_div'];
//         if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat') {
//             try {
//                 //var offsetTop = iframeWindow.document.documentElement.scrollHeight
//                 //if (bottomElement) {
//                 //  offsetTop = bottomElement.offsetTop
//                 //}
//                 iframeElement.style.height = iframeWindow.document.documentElement.scrollHeight + 0 + 'px';
//             } catch(e) {}
//             
//         }
//         else {
//             try {
//                 var offsetTop = iframeWindow.document.body.scrollHeight
//                alert('X: ' + offsetTop)
//                 if (bottomElement) {
//                   offsetTop = bottomElement.offsetTop
//                  alert('YYY: ' + offsetTop)
//                 }  
//                 //iframeElement.style.height = iframeWindow.document.body.scrollHeight + 0 + 'px';
//                 iframeElement.style.height = offsetTop + 0 + 'px';
//             } catch(e) {}                
//         }
//     }
// }

function enterPressed() {
    if (event.keyCode == 13)
        return true;
    else
        return false;
}


function biEnterPressed(e) {
	var key=0;
	if(window.event) // IE
    {
        key = e.keyCode
    }
        else if(e.which) // Netscape/Firefox/Opera
        {
            key = e.which
        }
    return (key==13);
}

function getWindowHeight() {
    
    var myHeight = 0;
    
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myHeight = window.innerHeight;
    } else if ( document.documentElement && document.documentElement.clientHeight) {
        //IE 6+ in 'standards compliant mode'
        myHeight = document.documentElement.clientHeight;
    } else if( document.body && document.body.clientHeight) {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
    }
    return myHeight;
    
}


