function showPaymentWin(_url) {


   posX = (screen.width - 550) / 2;
   posY = (screen.height - 530) / 2;


   var height = screen.height;
   var width  = screen.width;



     win2 = window.open(_url, "", "menubar,dependant=1,resizable=1,height="+ height +",width="+ width +",scrollbars,status,left="+posX+',top='+posY);

	return false;
}

function showWin(_url, _width, _height, _scroll) {

    if (_scroll == 1) {
	    win2 = window.open(_url, "", "dependant=1,resizable=1,height="+_height+",width="+_width+",scrollbars,status=1");
	} else {
	    win2 = window.open(_url, "", "dependant=1,resizable=1,height="+_height+",width="+_width+",status=1");
	}

	win2.resizeTo(_width,_height);

	return false;
}

/*
function showWin(_url, _width, _height ) {
    showWin(_url,_width,_height,0);
}
*/

var payWin;

function startOrder(pFilmId, pSessId) {
    var orderStart = "ordre_start_gcp.php?p_filmId="+pFilmId+"&"+pSessId;

   if ( payWin ) {
       if ( ! payWin.closed ) payWin.close();
   }

   posX = (screen.width - 550) / 2;
   posY = (screen.height - 530) / 2;


   var height = screen.height;
   var width  = screen.width;

    //payWin = window.open(orderStart, "", "menubar,dependant=1,resizable=1,height=530,width=767,scrollbars,status,left="+posX+',top='+posY);
    payWin = window.open(orderStart, "", "menubar,dependant=1,resizable=1,height="+ height +",width="+ width +",scrollbars,status,left="+posX+',top='+posY);
   
    return false;
}

function chkPayForm(pForm) {
    if ( pForm.ExpireMonth.value.length == 2 &&
         pForm.ExpireYear.value.length == 2 &&
         pForm.CardNumber.value.length == 16 ) {
        return true;
    } else {
         alert ('Udfyld venligst betalingsoplysninger.');
        return false;    
    }
}
function showMovie(p_testfilm) {

   w_url = 's1_biograf.php?p_testfilm=' + p_testfilm;

   if ( pWin )
       if ( !pWin.closed) {
            pWin.focus();
            // alert( pWin.location +':'+ 'http://'+document.domain+'/'+p_url );
            if ( pWin.location != 'http://'+document.domain+'/'+w_url ) {
                pWin.location = w_url;
            }
       } else {
            pWin = null;
       }

   if (!pWin) {
        pWin = window.open(w_url ,'dsmwin','resizable=1,width=800,height=600,scrollbars=0,dependent=1');
   }
   return false;
}

