function submitNorShippingForm()
{
	equalHeightNorShippingForm();

	if ( obj = $("nor-shipping") )
	{
		obj.reset();
		obj.target = 'frame-nor-shipping';
		obj.onsubmit = function(){
			valid.onSubmit();
			count = 0;

			$$('div.powermail_mandatory_js').each(function(elem){
				if (elem.style.display!='none')	return false;
//				count += (elem.style.display=='none' ? 0 : 1);
			});

			equalHeightNorShippingForm();

//			if ( count ) return false;

			showBox();
		};
		obj.reset();
	}

}

function equalHeightNorShippingForm()
{

	iHeightLeft = $$('.column-left .content')[0].setStyle({'height':'auto'}).getHeight();
	iHeightRight = $$('.column-right .content')[0].setStyle({'height':'auto'}).getHeight()-39;

	iHeightMax = (iHeightLeft < iHeightRight ? iHeightRight : iHeightLeft)-39;
	iHeightMax += Prototype.Browser.IE ? 39 : 0;

	$$('.column-left .content')[0].setStyle({'min-height':iHeightMax+'px'});
	$$('.column-right .content')[0].setStyle({'min-height':(iHeightMax-39)+'px'});

	if ( Prototype.Browser.IE )
	{
		$$('.column-left .content')[0].setStyle({'minHeight':iHeightMax+'px'});
		$$('.column-right .content')[0].setStyle({'minHeight':(iHeightMax-39)+'px'});
	}

}

function showBox(){
    $('overlay').show();
    center('box');
    return false;
}

function hideBox(){
    $('box').hide();
    $('overlay').hide();
    return false;
}

function center(element){
    try{
        element = $(element);
    }catch(e){
        return;
    }

    var my_width  = 0;
    var my_height = 0;

    if ( typeof( window.innerWidth ) == 'number' ){
        my_width  = window.innerWidth;
        my_height = window.innerHeight;
    }else if ( document.documentElement && 
             ( document.documentElement.clientWidth ||
               document.documentElement.clientHeight ) ){
        my_width  = document.documentElement.clientWidth;
        my_height = document.documentElement.clientHeight;
    }
    else if ( document.body && 
            ( document.body.clientWidth || document.body.clientHeight ) ){
        my_width  = document.body.clientWidth;
        my_height = document.body.clientHeight;
    }

    element.style.position = 'absolute';
    element.style.zIndex   = 99;

    var scrollY = 0;

    if ( document.documentElement && document.documentElement.scrollTop ){
        scrollY = document.documentElement.scrollTop;
    }else if ( document.body && document.body.scrollTop ){
        scrollY = document.body.scrollTop;
    }else if ( window.pageYOffset ){
        scrollY = window.pageYOffset;
    }else if ( window.scrollY ){
        scrollY = window.scrollY;
    }

    var elementDimensions = Element.getDimensions(element);

    var setX = ( my_width  - elementDimensions.width  ) / 2;
    var setY = ( my_height - elementDimensions.height ) / 2 + scrollY;

    setX = ( setX < 0 ) ? 0 : setX;
    setY = ( setY < 0 ) ? 0 : setY;

    element.style.left = setX + "px";
//    element.style.top  = setY + "px";

    element.style.display  = 'block';
}

