﻿
//Norton Internet Security workaround - reclaim control over windows.open       
var SymRealWinOpen;
if(SymRealWinOpen) window.open = SymRealWinOpen ;   


function PopUpWindow(url, wName, wWidth, wHeight, wScroll, wToolbar, wLocation, wStatus, leftPos, topPos) {
	if (wWidth == null){ wWidth = 350;}
	if (wHeight == null){wHeight = 500;}
	if (wScroll == null || wScroll != 'no'){wScroll = 'yes';}
	if (wToolbar == null || wToolbar != 'no'){wToolbar = 'yes';}
	if (wLocation == null || wLocation != 'no'){wLocation = 'yes';}
	if (wStatus == null || wStatus != 'no') {wStatus = 'yes';}
	
    attribs = "height="+wHeight+",width="+wWidth +",scrollbars="+wScroll;   
    attribs += ",toolbar="+wToolbar +",location="+wLocation+",status="+wStatus+",resizable=yes" ;

	if (leftPos != null && topPos != null) {
		attribs += ", left = " + leftPos + ", top = " + topPos + " " ;
	}

	
	var myWin = window.open(url,wName,attribs);
	myWin.focus();

    return void(0);
}




function OpenGoogleMap(fromAddress, toAddress) {
	var url = 'http://maps.google.com/maps?saddr=' + Url.encode(fromAddress) + '&daddr=' + Url.encode(toAddress)
	PopUpWindow(url, 'GoogleMap', 800, 600, 'yes', 'yes', 'no', 'yes');
	return void(0);
}


function OpenMap(tbFromID, tbToID) {
	var from = document.getElementById(tbFromID).value;
	var to = document.getElementById(tbToID).value;
	return OpenGoogleMap(from, to);
}

