function redirReserves ( estab, lang, params ) { var url = "/openres.php?info=0&id=" + estab + "&lang=" + lang; window.open( url + parseParams( params ), 'res', popupProperties() ); } function redirInfo ( estab, lang, params ) { var url = "/openres.php?info=1&id=" + estab + "&lang=" + lang; window.open( url + parseParams( params ), 'res', popupProperties() ); } function openReserves ( estab, lang, params ) { var url = "https://masterbooking.masterasp.com/pas1.php?id=" + estab + "&lang=" + lang; window.open( url + parseParams( params ), 'res', popupProperties() ); } function openReservesFilter ( estab, lang, filter, rc ) { var url = "https://masterbooking.masterasp.com/pas1.php?id=" + estab + "&lang=" + lang; if ( typeof rc != 'undefined' ) url += '&rc=' + rc; window.open( url + '&filter=' + filter, 'res', popupProperties() ); } function openNEWReserves ( estab, lang, params ) { estab = 10 var url = "https://bookings.masterasp.com/?estab=" + estab + "&lang=" + lang; window.open( url + parseParams( params ), 'res', popupNEWProperties() ); } function openReservesAnalytics () { var query = window.location.search.substring(1); var page = query.match( /info=0/ ) ? 'pas1.php' : 'info.php'; var url = "https://www.masterasp.com/res/" + page + "?" + query; try { //window.location = url; __utmLinker( url ); } catch(e) { window.location = url; } } function redirReservesRegistered ( estab, lang, c ) { url = "/openres.php?info=0&id=" + estab + "&lang=" + lang; if ( typeof( c ) != 'undefined' && c != null ) url += '&c=' + c; window.open( url, 'res', popupProperties() ); } function openReservesRegistered ( estab, lang, c ) { url = "https://masterbooking.masterasp.com/pas1.php?id=" + estab + "&lang=" + lang; if ( typeof( c ) != 'undefined' && c != null ) url += '&c=' + c; window.open( url, 'res', popupProperties() ); } function openInfo ( estab, lang, params ) { url = "https://www.masterasp.com/res/info.php?id=" + estab + "&lang=" + lang; window.open( url + parseParams( params ), 'res', popupProperties() ); } function openVideos ( estab, lang, w, h ) { if ( typeof( w ) == 'undefined' ) w = 470; if ( typeof( h ) == 'undefined' ) h = 344; url = "http://www.masterasp.com/video/plugins.php?id=" + estab + "&lang=" + lang; window.open( url, 'video_' + estab, popupPropertiesWH( w, h ) ); } function openPopup ( estab, url, w, h ) { if ( typeof( w ) == 'undefined' ) w = 470; if ( typeof( h ) == 'undefined' ) h = 344; window.open( url, 'popup_' + estab, popupPropertiesWH( w, h ) ); } function popupPropertiesWH ( w, h ) { props = 'width=' + w + ',height=' + h; props += ',left=' + ( screen.width/2 - w/2 ) + ',top=' + ( screen.height/2 - h/2 ); return props + ',scrollbars=no,status=yes'; } function popupNEWProperties () { w = 570; h = 590; props = 'width=' + w + ',height=' + h; props += ',left=' + ( screen.width/2 - w/2 ) + ',top=' + ( screen.height/2 - h/2 ); return props + ',scrollbars=yes,status=yes'; } function popupProperties () { w = 670; h = 470 props = 'width=' + w + ',height=' + h; props += ',left=' + ( screen.width/2 - w/2 ) + ',top=' + ( screen.height/2 - h/2 ); return props + ',scrollbars=yes,status=yes'; } function parseParams ( s ) { var aa = 0; var aa_id = 0; var rc = 0; var ra = ''; var filter = 0; s = ( typeof( s ) == 'undefined' ) ? '' : '' + s; a = s.split( ',' ); for ( i = 0; i < a.length; i++ ) { b = a[i].split( '=' ); if ( b.length == 2 ) { switch ( b[0] ) { case 'rc': rc = parseInt( b[1], 10 ); break; case 'ra': ra = b[1]; break; //case 'aa': aa = 1; aa_id = parseInt( b[1], 10 ); break; case 'aa': aa = 1; aa_id = b[1]; break; //case 'filter': filter = 1; aa_id = parseInt( b[1], 10 ); break; case 'filter': filter = 1; aa_id = b[1]; break; } } else if ( b.length == 1 ) { if ( ! isNaN( parseInt( b[0], 10 ) ) ) { aa = 1; aa_id = parseInt( b[0], 10 ); } else { ra = b[0]; } } } p = ''; if ( rc ) p += '&rc=' + rc; if ( ra.length > 0 ) p += '&ra=' + ra; if ( filter ) p += '&aa=' + aa_id; if ( aa ) p += '#aa_' + aa_id; return p; }