
// 
// Some sample functions for customization
//

$.extend(PM.Custom,
{
    // Sample Hyperlink function for result window
    openHyperlink: function(layer, fldName, fldValue) {
        switch(layer) {
            case 'casse':
                //if (fldName == 'cod_art') {
                    window.open('http://mapgis.bassnet.it/sancascianops/normative/' + fldValue + '.pdf');
                //}
                break;
            case 'Subsist_amb':
                //if (fldName == 'cod_art') {
                    window.open('http://mapgis.bassnet.it/sancascianops/normative/' + fldValue + '.pdf');
                //}
                break;	
            case 'Utoe':
                //if (fldName == 'cod_art') {
                    window.open('http://mapgis.bassnet.it/sancascianops/normative/' + fldValue + '.pdf');
                //}
                break;	
            case 'Sist_amb':
                //if (fldName == 'cod_art') {
                    window.open('http://mapgis.bassnet.it/sancascianops/normative/' + fldValue + '.pdf');
                //}
                break;	
            case 'Per_geo':
                //if (fldName == 'cod_art') {
                    window.open('http://mapgis.bassnet.it/sancascianops/normative/' + fldValue + '.pdf');
                //}
                break;
            case 'Per_idr':
                //if (fldName == 'cod_art') {
                    window.open('http://mapgis.bassnet.it/sancascianops/normative/' + fldValue + '.pdf');
                //}
                break;	
            case 'ambiti':
                //if (fldName == 'cod_art') {
                    window.open('http://mapgis.bassnet.it/sancascianops/normative/' + fldValue + '.pdf');
                //}
                break;	
            case 'centri':
                //if (fldName == 'cod_art') {
                    window.open('http://mapgis.bassnet.it/sancascianops/normative/' + fldValue + '.pdf');
                //}
                break;		
            case 'aree_preg':
                //if (fldName == 'cod_art') {
                    window.open('http://mapgis.bassnet.it/sancascianops/normative/' + fldValue + '.pdf');
                //}
                break;	
            case 'aree_edif':
                //if (fldName == 'cod_art') {
                    window.open('http://mapgis.bassnet.it/sancascianops/normative/' + fldValue + '.pdf');
                //}
                break;	
            case 'edif_pregio':
                //if (fldName == 'cod_art') {
                    window.open('http://mapgis.bassnet.it/sancascianops/normative/' + fldValue + '.pdf');
                //}
                break;	
            case 'acque':
                //if (fldName == 'cod_art') {
                    window.open('http://mapgis.bassnet.it/sancascianops/normative/' + fldValue + '.pdf');
                //}
                break;	
            case 'reti':
                //if (fldName == 'cod_art') {
                    window.open('http://mapgis.bassnet.it/sancascianops/normative/' + fldValue + '.pdf');
                //}
                break;
            case 'patr_edi':
                //if (fldName == 'scheda') {
                    window.open('http://mapgis.bassnet.it/sancascianops/schedatura/' + fldValue + '.pdf');
                //}
                break;				
            default:
                alert ('See function openHyperlink in custom.js: ' + layer + ' - ' + fldName + ' - ' + fldValue);
		  break;
        }
    },

    showCategoryInfo: function(catId) {
        var catName = catId.replace(/licat_/, '');
        alert('Info about category: ' + catName);
    },

    showGroupInfo: function(groupId) {
        var groupName = groupId.replace(/ligrp_/, '');
        alert('Info about layer/group: ' + groupName);
    },
	
	openDisciplina: function() {
	window.open('http://mapgis.bassnet.it/sancascianops/normative/disciplina.pdf');
    },

    openRelGeol: function() {
	window.open('http://mapgis.bassnet.it/sancascianops/normative/relazione_geologico_tecnica.pdf');
    }
});

$.extend(PM.Dlg,
{
    /** opzioni per il dialog box delle tavole */
    tavoleDlgOptions: {width:350, height:500, left:100, top:50, resizeable:true, newsize:true, container:'pmDlgContainer', name:"tavole"},
    openTavole: function() {
	this.createDnRDlg(this.tavoleDlgOptions, 'Scarica le tavole', 'tavole.phtml?'+SID);
    },

    /** opzioni per il dialog box delle normative */
    normativaDlgOptions: {width:350, height:500, left:100, top:50, resizeable:true, newsize:true, container:'pmDlgContainer', name:"normativa"},
    openNormativa: function() {
	this.createDnRDlg(this.normativaDlgOptions, 'Scarica le normative', 'normativa.phtml?'+SID);
    }
});