var pupupBlockedMessage='Ca sa puteti asculta RadioZu Live, va rugam, dezactivati popup-up blocker-ul.';

function newPopup(popupHref, popupWidth, popupHeight, props) {

    
    if (!popupWidth)
        popupWidth=900;
    if (!popupHeight)
        popupHeight=660;

    popupStatus="no";
    popupResizable="no";
    popupScroll="no";
    popupLocation="no";
    popupMenubar="no";
    popupModal="no";

    if (props) {
        // popup status
        if (props.status) popupStatus='yes';
        // resizable window
        if (props.resizable) popupResizable='yes';
        // scrollbar
        if (props.scrollbars) popupScroll='yes';
        // location
        if (props.location) popupLocation='yes';
        // menubar
        if (props.menuBar) popupMenubar='yes';
        // modal window
        if (props.modal) popupModal='yes';
    }

    // position window
    popupLeft=Math.abs(screen.width-popupWidth)/2;
    popupTop=Math.abs(screen.height-popupHeight)/2;


    //////////////////////////////////////////////////////////////////////////////////////////////////////
    // SET REAL WINDOW PROPERTIES ////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////

    // handle properties
    popupProps="width=" + popupWidth + ", height=" + popupHeight;
    popupProps+=", status="+popupStatus+", resizable="+popupResizable+", scrollbars="+popupScroll+", location="+popupLocation+", menubar="+popupMenubar;
    popupProps+=", top="+popupTop+", left="+popupLeft;
    popupProps+=", modal="+popupModal;

    // handle window name
    if (!props.name) {
        thisPopupUniqueId=Math.random().toString();
        thisPos=thisPopupUniqueId.indexOf(".");
        randomNumber=thisPopupUniqueId.substr(thisPos+1);

        windowName="newPopupWindow_"+randomNumber;
    }
    else
        windowName=props.name;

    //////////////////////////////////////////////////////////////////////////////////////////////////////
    // CREATE NEW WINDOW (MODAL - if the case) ///////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////
    if (window.showModalDialog && popupModal=='yes') {
        thisPopup=window.showModalDialog(popupHref, windowName, "dialogWidth:"+popupWidth+"px; dialogHeight:"+popupHeight+"px");

        if (thisPopup==null || typeof(thisPopup)=="undefined") {
            alert(pupupBlockedMessage)
        }
    }
    else {
        thisPopup=window.open(popupHref, windowName, popupProps);
        if (thisPopup==null || typeof(thisPopup)=="undefined") {
            alert(pupupBlockedMessage)
        }else{
            thisPopup.focus();

            if (!thisPopup.opener)
            thisPopup.opener = self;
        }
    }

    return thisPopup;

}

function zuPopup() {
	newPopup('http://live.radiozu.ro/',900,665,{
	            name:'radiozulive',
	            scrollbars:false
	        }
	    )
}	
