
// -----------------------------------------------------------------------------
//pop up

// this will center the window within the browser and bring the window to focus
//javascript:popUpProps('test.html','winName','400','300',',menubar=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0');
var winProps;
function popUpProps(url, windowName, width, height, props)
{
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	var propsCentered = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + props;

	if(winProps == null || winProps.closed) {
		winProps = window.open(url, windowName, propsCentered);
		winProps.focus();
	} else {	
		winProps.close();
		winProps = window.open(url, windowName, propsCentered);
		winProps.focus();
	}
}
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
//open window blank
function openWindowBlank(url) {
	var windowprops = 'top=0,left=0,toolbar=yes,location=yes,directories=no,status=yes,scrollbars=yes,menubar=yes,resizable=yes';
	var popup = window.open(url,'Mazda3WindowBlank',windowprops);
	var intWidth = screen.availWidth? screen.availWidth : screen.width;
	var intHeight = screen.availHeight? screen.availHeight: screen.height-30;
    if(popup == null){
        alert("Please disable your popup blocker to view this link."); 
    }else{
	    //popup.resizeTo(intWidth, intHeight);
        //popup.outerWidth = intWidth;
	    //popup.outerHeight = intHeight;
		popup.focus();
    }
}
// -----------------------------------------------------------------------------


// -----------------------------------------------------------------------------
//live chat
function bannerChatClick(bannerLinkName, bannerEVar2){
	alert(bannerLinkName + " " + bannerEVar2);
}
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
//other
function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
	return "";
  else
	return results[1];
}
// -----------------------------------------------------------------------------
