
// get URL
function getURL() {
	return window.document.location.toString();
}


// Window trackers to keep site tidy & always opens pages in the SAME browser window.
// Using different winNames can allow different popOpen 'groups'.

window.onerror=goOnError;

function goOnError() {
   // Supress 'some' errors from user
   return true }

sDomain = "http://www.bianco.com.au";
sProtocol = "http://";

function popOpen(thisURL,winName) {
//
// Used to popOpen external webpages. Only opens 1 window at a time.
// Detect previous window & closes it to keep desktop tidy.
//
// Mod: July 2003; Sometime database content 'might' be sending a page to Replace rather than Popup in a new window.
//
if (winName != "replace") {
	
		// popOpenWin defined either when page loaded, or when last popOpen opened
		if (popOpenWin) {
			if (!outsideWin.closed) {
				// The window should still be open
				// Close the window
				commstring = 'outsideWin = null'; // in case already closed
				setTimeout(commstring,500);	  // 
				outsideWin.close();		 // try closing it
				}
			}
	
	
		// Any window should now be closed
	
		// Set features for external webpages
		// Features available = "status=0,scrollbars=0,menubar=0,resizable=0,titlebar=0,toolbar=0";
		features = "width=720,height=500,left=60,top=60, status=1,scrollbars=1,menubar=1,resizable=1,titlebar=1,toolbar=1";
		// Later: If multiple 'winNames', can set features based on winName.
	
		// Open a New popOpen window
		// Delay to allow Macs to run close above
		if (thisURL.substr(0,4) == "http") {
			commstring = 'outsideWin = window.open("'+thisURL+'","'+winName+'","'+features+'")';
		} else {
			commstring = 'outsideWin = window.open("'+sProtocol+thisURL+'","'+winName+'","'+features+'")';
		}
		setTimeout(commstring,600);
		// FOCUS here is safe, in case window is still open & minimised
		commstring2 = 'outsideWin.focus()';
		setTimeout(commstring2,700);
		popOpenWin = true;

	} else {

		//Replace current page
		// location.href = thisURL;
		top.location.href = thisURL;
	}
}

// Display URL to user, so they know where links will take them
function roll(thisURL) {
	window.defaultStatus=" ";
	if (thisURL.substr(0,4) == "http") {
		window.status=thisURL;
	} else {
		window.status=sDomain+thisURL;
	}
}


// Catch undefined errors - This must be LAST js code, as it may halt execution
// Is outsideWin null, or have we opened a popOpen?
popOpenWin = false;
//alert("popOpenWin initialised to false");
//alert(outsideWin);
if (outsideWin != null) {
	popOpenWin = true;
	//alert("popOpenWin is starting with a value");
}

// Functions to control window placements

function gotoGH() {
    adr ="www.groundhog.com.au"; features = "width=770,height=430,left=0,top=0, status=1,scrollbars=1,menubar=1,resizable=1,titlebar=1,toolbar=1"; loc =  "http://" + adr; winName = "OtherWin";
	outsideWin = window.open(loc,winName,features);
}

function gotoAcro() {
    adr ="www.adobe.com/products/acrobat/readstep2.html"; features = "width=770,height=430,left=0,top=0, status=1,scrollbars=1,menubar=1,resizable=1,titlebar=1,toolbar=1"; loc =  "http://" + adr; winName = "OtherWin";
	outsideWin = window.open(loc,winName,features);
}

function gotoFlsh() {
    adr ="www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"; features = "width=770,height=430,left=0,top=0, status=1,scrollbars=1,menubar=1,resizable=1,titlebar=1,toolbar=1"; loc =  "http://" + adr; winName = "OtherWin";
	outsideWin = window.open(loc,winName,features);
}

                  