function ShowDialog(url, modal, dialogFeatures)
{
    if(navigator.appName == 'Netscape')
    {    
        window.open(url, '', dialogFeatures);       
    }
    else
    {    
        if(modal)
            window.showModalDialog(url, '', dialogFeatures);
        else
            window.showModelessDialog(url, '', dialogFeatures);
    }
}

function ShowDialogWithExtent(url, width, height, modal, resizable)
{
    if(navigator.appName == 'Netscape')
    {    
        dialogFeatures = 'width=' + width + ',height=' + height + ',,toolbar=no,directories=no,status=no,menubar=no,modal=yes,scrollbars=' + (resizable ? 'yes,': 'no,') + 'resizable=' + (resizable ? 'yes': 'no');
    }
    else
    {   
        dialogFeatures = 'dialogWidth:' + width + 'px; dialogHeight: ' + height + 'px; help: no; scroll: ' + (resizable ? 'yes; ': 'no; ') + 'resizable: ' + (resizable ? 'yes': 'no');         
    }
        
    ShowDialog(url, modal, dialogFeatures);    
}

function ShowHelp(url)
{
    ShowDialogWithExtent(url, 380, 220, false, false);
}

function ShowTouristServiceSelector(id, pricekey)
{
    ShowDialogWithExtent('turistServicesDialog.aspx?id=' + id + '&priceKey=' + pricekey, 450, 250, true, true);
}

function ShowEditor(id, pricekey)
{
    var browser=navigator.appName;
    //MEG00019964 Антон 20.01.2009
    //в FireFox нельзя закрыть окно window.Close, если оно было открыто как модальное
    if(browser == 'Netscape' || browser == 'Opera')
    {
    	    window.open ('ServiceEditor.aspx?id=' + id + '&priceKey=' + pricekey,'','height=540,width=740,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes','');
    }
    else
    {				        
	        if(window.showModalDialog('ServiceEditorDialog.aspx?id=' + id + '&priceKey=' + pricekey,'','dialogHeight: 540px; dialogWidth: 740px; scroll: no; resizable: yes; help: no') > 0) 
	            window.location.reload(false);
	}		
}


