var showImageOnLoad = false;

function correctPNGBackground( divId, imgURL ) // correctly handle PNG transparency in Win IE 5.5 , 6 & 7.
{
	var arVersion = navigator.appVersion.split("MSIE")
	var version = parseFloat(arVersion[1])
	if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
	{
		var div = document.getElementById( divId );
		div.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+imgURL+"', sizingMethod='image')";
		div.style.background = '';
	}    
}
function inputBoxFocus( input, defaultText, passwordField ) {
	if( typeof( passwordField ) != 'undefined' ) {
		document.getElementById( passwordField ).style.display = '';
		document.getElementById( passwordField+'_text' ).style.display = 'none';
		document.getElementById( passwordField ).focus();
	} else {
		if( input.value == defaultText ) {
				input.value = '';
		} else {
		}
	}
}
function inputBoxBlur( input, defaultText, passwordField ) {
	if( input.value == '' ) {
		if( typeof( passwordField ) != 'undefined' ) {
			document.getElementById( passwordField ).style.display = 'none';
			document.getElementById( passwordField+'_text' ).style.display = '';
		} else {
			input.value = defaultText;
		}
	}
}
function showTerms(){
	window.open( '/popup/terms', 'mywindow', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=509, height=500');
}

function initImage() {
	// Initialize the temporary Panel to display while waiting for external content to load
	document.getElementById('imagePopup').style.display = '';
	imageBox = 
			new YAHOO.widget.Panel("imagePopup",  
											{ width:"840px", 
											  height:"572px", 
											  fixedcenter:true, 
											  close:false, 
											  draggable:false, 
											  modal:true,
											  visible:false,
											  underlay:"none",
											  effect:{effect:YAHOO.widget.ContainerEffect.FADE, duration:0.5} 
											} 
										);

	imageBox.render(document.body);
	if( showImageOnLoad )
		imageBox.show();
}

function hideImage() {
	// Show the Panel
	if( typeof imageBox != "undefined" )
		imageBox.hide();
}

function showImage( image ) {
	// clear the image
	document.getElementById('imageTheImage').src = '/custom/images/blank.gif';
	if( image != '' ) {
		// clear the password field
		document.getElementById('imageTheImage').src = image;
		// Show the Panel
		if( typeof imageBox != "undefined" )
			imageBox.show();
		else
			showImageOnLoad = true
	}
}

function viewMoreNews() {
	document.getElementById('moreNews').style.display = 'block';
}
