function _newWindow( page, name ) {
	var newWindow = window.open( "http://" + page, name, 'scrollbars=yes,resizable=yes' );
	newWindow.focus();
}

$( document ).ready ( function () {
	if ( buttonLoad ) show_button ();

	$( window ).resize ( function () {
		if ( buttonLoad ) show_button ();
	});
});

function show_button () {
	headerWidth = $( "div#header" ).width ();
	headerHeight = $( "div#header" ).height ();
	headerOffset = $( "div#header" ).offset ();
	buttonWidth = $( "div#inquiryListButton" ).width ();
	buttonHeight = $( "div#inquiryListButton" ).height ();
	buttonPadding = parseInt ( $( "div#inquiryListButton" ).css ( "padding-left" ));
	$( "div#inquiryListButton" ).css (
		{
			top: ( headerOffset['top'] + headerHeight - buttonHeight - 20 ) + "px",
			left: ( headerOffset['left'] + headerWidth - 27 - buttonWidth - ( 2 * buttonPadding )) + "px"
		}
	);
	buttonLoad = true;
	xajax_cleanInquiryList ();
}

function _msie_replace_png_imgs() {
	var i, elements;

	elements = document.getElementsByTagName( "img" );
	for ( i = 0; i < elements.length; i++ ) {
		var img = elements[i];
		if ( img.src.toLowerCase().search(/\.png$/ ) < 0 ) continue;

		img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + img.src	+ "', sizingMethod='image')";
		img.src = "img/spacer.gif";
	}
}

if ( window.attachEvent && navigator.appName == "Microsoft Internet Explorer" ) window.attachEvent ( "onload", _msie_replace_png_imgs );
