/**
 * City of Kingston Site Script / Sub app: Transit Trip Planner
 * Last edited: APril 26, 2010 - Web Paving / SRB / Switched to MT URI class for link wranging
 * v0.9 
 */


document.addEvent('domready', function() {

    WP_CityUtils = {
        setDownloadLinks: function() {
            $$('a.dl').addEvent('click', function (e) {
                e.stop();
                var myUri = new URI(this.toString());
		        // Make sure scheme is not https
           		myUri.set('scheme', 'http');
                myUri.set('port', '80');
                var newWindow = window.open(myUri.toString(), '_blank', 'toolbar=no,location=no,status=no,menubar=no,directories=no,scrollbars=yes,resizable=yes');
                newWindow.focus();
            });
        },
        init: function() {
            this.setDownloadLinks();
        }
    } 
    // Initialize
    WP_CityUtils.init();

});


////////////////////////////////////////////////////////////
//
// Legacy PDF window popper
//
/////////////
//
function pdfPop(url)
{
  windowWidth = (screen.width - 100);
  windowHeight = (screen.height - 60);
  strResizeState = "yes";
  strScrollState = "yes";
  windowX = 5;
  windowY = 5;
  var random = Math.round(100000*Math.random());
  //
  //
  var strFeatures = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=' + strScrollState + ',resizable=' +  strResizeState + ',width=' + windowWidth + ',height=' + windowHeight;
  //
  PDF=window.open(url, "PDFWindow" + random, strFeatures)
}

if(top.location != location) {
	top.location.href = document.location.href;
}



