function ConfirmMsg(newurl,message) {
	if (confirm( message ) )
	{
		parent.location=newurl;

	}

}

function openPopup( link, name, width, height, oLink ) {
	if ( !width ) { width = 510; }
	if ( !height ) { height = 510; }

	if ( oLink && oLink.getAttribute('_popup_window_width') ) {
		width = oLink.getAttribute('_popup_window_width');
	}

	if ( oLink && oLink.getAttribute('_popup_window_height') ) {
		height = oLink.getAttribute('_popup_window_height');
	}

	var left = Math.floor( screen.availWidth / 2 ) - Math.floor( width / 2 );
	var top = Math.floor( screen.availHeight / 2 ) - Math.floor( height / 2 );
	prop = 'toolbar=0,directories=0,menubar=0,status=yes,resizable=1,location=0,scrollbars=1,copyhistory=0'

	var win = window.open( link, name, 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',' + prop );

	if ( win ) win.focus();

	return win;
}

function closeWindow() {
	window.opener = window.self;
	window.close();
}

function findForm ( oObj ) {
	var notFound = true;
	var oForm = null;

	while ( notFound ) {
		if ( !oObj ) {
			notFound = false;
			continue;
		}

		if ( !oObj.parentNode ) {
			notFound = false;
			continue;
		}

		if ( oObj.tagName.toLowerCase() == 'form' ) {
			oForm = oObj;
			notFound = false;
			continue;
		}
		oObj = oObj.parentNode;
	}

	return oForm;
}

function submitForm ( oImage, sName, sValue, sValue2, sSubmitUrl ) {
	var oForm = findForm ( oImage );

	if ( oForm == null ) {
		return false;
	}

	var oInput = document.createElement ( 'input' );
	oInput.type = 'hidden';
	oInput.value = sValue;
	oInput.name = sName;
	oForm.appendChild ( oInput );

	var oInput = document.createElement ( 'input' );
	oInput.type = 'hidden';
	oInput.value = sValue2;
	oInput.name = sName+'_val';
	oForm.appendChild ( oInput );

	if ( sSubmitUrl && sSubmitUrl.length ) {
		oForm.action = sSubmitUrl;
	}

	if ( oForm.onsubmit ) {
		oForm.onsubmit();
	}

	oForm.submit();
	return true;

}

function showHide(id){
	ID = document.getElementById(id);

	if(ID.style.display == "")
	ID.style.display = "none";
	else
	ID.style.display = "";
}
