// The problem is that JavaScript 1.0
// does not provide a Char to Numeric value conversion
// Thus we define a map.
// Because there are 64K UniCode characters, this map does not cover all characters.

rot13map = false;

function rot13init()
{
  var map = new Array();
  var s   = "abcdefghijklmnopqrstuvwxyz";
  
  for (i=0; i<s.length; i++)
    map[s.charAt(i)]			= s.charAt((i+13)%26);
  for (i=0; i<s.length; i++)
    map[s.charAt(i).toUpperCase()]	= s.charAt((i+13)%26).toUpperCase();
  return map;
}
 
function rot13(a)
{
  if (!rot13map)
    rot13map=rot13init();
  s = "";
  for (i=0; i<a.length; i++)
    {
      var b = a.charAt(i);
 
      s	+= (b>='A' && b<='Z' || b>='a' && b<='z' ? rot13map[b] : b);
    }
  return s;
}
function getGrandElementOffsets(e) {
	var o = {
		height: e.offsetHeight,
		width: e.offsetWidth
	};
	
	var x = e.offsetLeft;
	var y = e.offsetTop;
	var p = e.offsetParent;
	
	while(p && (p.nodeType != 9)) {
		x += p.offsetLeft;
		y += p.offsetTop;
		p = p.offsetParent;
	}
	o.left = x;
	o.top = y;
	return o;
}
function closeChoiceDiv() {
	var choiceDiv = document.getElementById('choicediv');
	choiceDiv.style.display = 'none';
}
/**
*
*/



function goBack(MovieID,OutputNo,content){

//alert(content);
//alert(unescape(content));
//content = document.getElementById("moviefield_info_" + MovieID).innerHTML





if(OutputNo==1){

BoxID = "moviefield_info_";

}
else if(OutputNo==2){

BoxID = "moviefield_billetter_";

}

 content = decodeURIComponent(content);
 

		document.getElementById(BoxID + MovieID).innerHTML = content;


}


function showBuyOrRes(dateno,timeno,buyLink,resLink,OutputNo,buyLinkNotActive,resLinkNotActive,MovieID) {
	
		//alert(buyLinkNotActive);
		//alert(resLinkNotActive);
		
		if(buyLinkNotActive==1 && resLinkNotActive==1){
		return;
		}
	
	
	
	//Content = unescape(document.getElementById("moviefield_info_" + MovieID).innerHTML);
	if(OutputNo==1){
	
	BoxID = "moviefield_info_";
	
	/*var el=document.getElementById("posterimage_" + MovieID);
	el.trueheight=el.scrollHeight;
	
	var el2=document.getElementById("movietop_" + MovieID);
	el2.trueheight=el2.scrollHeight;
	
	BoxHeight = (el.trueheight - el2.trueheight)*/
	
	}
	else if(OutputNo==2){
	
	BoxID = "moviefield_billetter_";
	
	/*var el=document.getElementById("posterimage_" + MovieID);
	el.trueheight=el.scrollHeight;
	
	var el2=document.getElementById("movietop_" + MovieID);
	el2.trueheight=el2.scrollHeight;
	
	BoxHeight = (el.trueheight - el2.trueheight)*/
	
	}
	else if(OutputNo==3){
	BoxID = "moviefield_info_";
	
	
	/*var el=document.getElementById("site_container" + MovieID);
	el.trueheight=el.scrollHeight;
	
	BoxHeight = el.trueheight;*/
	

	}
	else if(OutputNo==4){
	
	BoxID = "moviefield_billetter_";
	
	
	/*var el=document.getElementById("site_container" + MovieID);
	el.trueheight=el.scrollHeight;
	
	BoxHeight = el.trueheight;*/
	
	}
		
	
BoxHeight = 200;
	
	
	
var backContent = encodeURIComponent(document.getElementById(BoxID + MovieID).innerHTML);

    hideTimeInfo();
     
     
     	if(OutputNo>=3){
     
    document.getElementById(BoxID + MovieID).innerHTML="<div class='billet_week_load' style='margin-bottom:122px'><img src='/_images/icons/loadicon.gif' /></div>";
		    }
		    else{
		    
    document.getElementById(BoxID + MovieID).innerHTML="<div class='billet_week_load'><img src='/_images/icons/loadicon.gif' /></div>";		    
		    
		    }
		    
	
	  var url = "_php_blocks/buyRes.php";
var requestValue = "dateno=" + dateno + "&timeno=" + timeno + "&buyLink=" + buyLink + "&resLink=" + resLink + "&buyLinkNotActive=" + buyLinkNotActive + "&resLinkNotActive=" + resLinkNotActive + "&MovieNo=" + MovieID + "&OutputNo=" + OutputNo + "&movieBoxHeight=" + BoxHeight + "&backContent=" + backContent; 
 	  
	
	if (window.XMLHttpRequest)
	  {// code for IE7+, Firefox, Chrome, Opera, Safari
	  http=new XMLHttpRequest();
	  }
	else
	  {// code for IE6, IE5
	  http=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	
	http.open("POST", url, true);
	
	//Send the proper header information along with the request
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", requestValue.length);
	http.setRequestHeader("Connection", "close");
	
	http.onreadystatechange = function() {//Call a function when the state changes.
		if(http.readyState == 4 && http.status == 200) {
			
			document.getElementById(BoxID + MovieID).innerHTML = http.responseText;
		}
	}
	http.send(requestValue);
	
		
	}
/**
*
*/
function movieSelected(movieName,movieID) {
	moviewhenselect = document.getElementById('moviewhenselect_' + movieID);

	for(var i=0;i<movies.length;i++) {
		document.getElementById('moviewhenselect_' + movies[i]).style.display = 'none';
	}
	if (moviewhenselect) {
		moviewhenselect.style.display = 'block';
	}
}
/**
*
*/
function movieTimeSelected(datename,datevalue) {
	document.location.href = 'http://www.secure.ebillet.dk/bpw/den/listarr.asp?orgno=108&sysno=3&movieno=' + datevalue + '&catno=2&grpno=-1&typno=-1&dateno=0';
}
/**
*
*/
function movieSelectTab(tabElement,movieID,selectedTab,trailerID) {
	var tab1 = document.getElementById('moviemenu_info_' + movieID);
	var tab2 = document.getElementById('moviemenu_billetter_' + movieID);
	var tab3 = document.getElementById('moviemenu_credits_' + movieID);
	var tab4 = document.getElementById('moviemenu_trailer_' + movieID);
	
	var content1 = document.getElementById('moviefield_info_' + movieID);
	var content2 = document.getElementById('moviefield_billetter_' + movieID);
	var content3 = document.getElementById('moviefield_credits_' + movieID);
	var content4 = document.getElementById('moviefield_trailer_' + movieID);

	tab1.className = 'moviemenu';
	tab2.className = 'moviemenu';
	if (tab3) {
		tab3.className = 'moviemenu';
	}
	if (tab4) {
		tab4.className = 'moviemenu';
	}
	
	content1.style.display = 'none';
	content2.style.display = 'none';
	content3.style.display = 'none';
	if (content3) {
		content3.style.display = 'none';
	}
	if (content4) {
		content4.style.display = 'none';
	}
	
	var tab_selected = document.getElementById('moviemenu_' + selectedTab + '_' + movieID);
	var content_selected = document.getElementById('moviefield_' + selectedTab + '_' + movieID);
	
	tab_selected.className = 'moviemenu moviemenuselected';
	content_selected.style.display = 'block';
	
	/*
	var trailerFields = $(".moviefield_trailer");
	for(var i=0;i<trailerFields.length;i++) {
		trailerFields[i].innerHTML = '';
	}
	*/
	if (content4) {
		if (tab_selected == tab4) {
			content4.innerHTML = '<iframe src="_php_blocks/trailer.php?movieno=' + trailerID + '" frameborder="0" style="width:480px;height:290px;"></iframe>';
		}
		else {
			content4.innerHTML = '';
		}
	}
}
var timeInfoElement = false;

/**
*
*/

function showPopInfo(linkElement,InfoElementContent) {

	if (!timeInfoElement) {
		timeInfoElement = document.createElement('DIV');
		timeInfoElement.style.padding = '8px';
		timeInfoElement.style.backgroundColor = '#000000';
		timeInfoElement.style.border = '1px solid #999999';
		timeInfoElement.style.color = '#FFFFFF';
		timeInfoElement.style.position = 'absolute';
		document.body.appendChild(timeInfoElement);
	}
	timeInfoElement.style.display = 'block';
	
			
		
	timeInfoElement.innerHTML = InfoElementContent;
	
	var linkOffsets = getGrandElementOffsets(linkElement);
	
	timeInfoElement.style.top = (linkOffsets.top + 20) + 'px';
	timeInfoElement.style.left = (linkOffsets.left) + 'px';
	
	}

function showTimeInfo(linkElement,locationName, typename, typeno, salesopening, seatsfreecount) {
InfoElementContent = '';
	if (!timeInfoElement) {
		timeInfoElement = document.createElement('DIV');
		timeInfoElement.style.padding = '8px';
		timeInfoElement.style.backgroundColor = '#000000';
		timeInfoElement.style.border = '1px solid #999999';
		timeInfoElement.style.color = '#FFFFFF';
		timeInfoElement.style.position = 'absolute';
		document.body.appendChild(timeInfoElement);
	}
	timeInfoElement.style.display = 'block';
	
	
	
	
	
	
	
	if (typeno == null || typeno == '' || typeno == 0){
	
	
	}
	else if(typeno == 90){
	InfoElementContent = '<span style="color:#FF9900;">' + typename + '</span><br/>';
	}
	else if(typeno == 1){
	InfoElementContent = '<span style="color:#99FF33;">' + typename + '</span><br/>';
	}
	else{
	InfoElementContent = '<span style="color:#0099FF;">' + typename + '</span><br/>';
		}
		
	if (!(salesopening == '')){ 
		
	InfoElementContent = InfoElementContent + '<span style="color:#b71e32;">'
		 + salesopening + '</span><br/>';
		
	}
		
	InfoElementContent = InfoElementContent + locationName;		
		
	if(!(seatsfreecount == null) && salesopening == ''){
	InfoElementContent = InfoElementContent + '<br/>Ledige pladser: ' + seatsfreecount;
	}
		
		
	timeInfoElement.innerHTML = InfoElementContent;
	
	var linkOffsets = getGrandElementOffsets(linkElement);
	
	timeInfoElement.style.top = (linkOffsets.top + 20) + 'px';
	timeInfoElement.style.left = (linkOffsets.left) + 'px';
	
}



function hideTimeInfo() {
	timeInfoElement.style.display = 'none';
}




function showFirstResult(dateno)
{
document.getElementById("searchContent").innerHTML='<div class="billet_program_load"><img src="/_images/icons/loadicon.gif" /></div>';


if(window.location.hash){

requestValue = window.location.hash.replace("#","");

datestartslice = requestValue.indexOf('dateno=') + 7;
dateendslice = requestValue.indexOf('&movieno=');

moviestartslice = requestValue.indexOf('movieno=') + 8;
movieendslice = requestValue.indexOf('&typeno=');

typestartslice = requestValue.indexOf('typeno=') + 7;
typeendslice = requestValue.length;

datesetvalue = requestValue.slice(datestartslice,dateendslice)

moviesetvalue = requestValue.slice(moviestartslice,movieendslice);

typesetvalue = requestValue.slice(typestartslice,typeendslice);


selectedRequestValue = '/_php_functions/returnSelectOptions.php?movieno='+moviesetvalue+'&typeno='+typesetvalue;



if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  
  xmlhttp2=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  
  
  
  xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp2.onreadystatechange=function()
  {
  if ((xmlhttp2.readyState==4) && xmlhttp2.status==200)
    {


document.getElementById("dateSelectContainer").innerHTML = 'Vælg dato: <select name="selectDate" class="select_tag" id="selectDate" onchange="dateSelected(selectDate.value,selectMovie.value);">' + xmlhttp2.responseText + '</select>';

        
    }

  }

xmlhttp2.open("POST",selectedRequestValue,false);


xmlhttp2.send();

Select_Value_Set('movieOrDateSelectorForm.selectDate', datesetvalue);

if(typesetvalue == 0){

Select_Value_Set('movieOrDateSelectorForm.selectMovie', moviesetvalue);
}
else{

Select_Value_Set('movieOrDateSelectorForm.selectMovie', moviesetvalue + " " + typesetvalue);

}

	//alert(document.getElementById("selectDate").innerHTML);
	
	//document.getElementById("selectDate").innerHTML = '';



}
else{
//alert('Hash is NOT used');

requestValue = '?dateno=0&movieno=0&typeno=0'
datesetvalue = 0;

moviesetvalue = 0;

typesetvalue = 0;
}

//alert(requestValue);






if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    
    
        document.getElementById("searchContent").innerHTML=xmlhttp.responseText;
        
        
   
          changeUpcomingMovieBox(datesetvalue, moviesetvalue);  

       
    }
  }
  
xmlhttp.open("POST", '_php_blocks/programfinder.php' + requestValue,true);
xmlhttp.send();



}


function movieAndTypeSelected(datePicked, movieAndTypePicked){


selectedRequestValue = null;

document.getElementById("dateSelectContainer").innerHTML = ''; 

document.getElementById("searchContent").innerHTML='<div class="billet_program_load"><img src="/_images/icons/loadicon.gif" /></div>';

var film_array=movieAndTypePicked.split(" ");

if (film_array[0] == 0)
{
    
    //requestValue = "_php_blocks/programfinder.php?dateno=" + datePicked + "&movieno=0&typeno=0";
    requestValue = "?dateno=X&movieno=X&typeno=0";
    
  	window.location.hash = requestValue ;
  	//alert(requestValue);
  	
   selectedRequestValue = "_php_functions/returnSelectOptions.php?movieno=X";
  	
  	
}
else if (!(film_array[0] == 0) && film_array[1] == null){

    requestValue = "?dateno=" + datePicked + "&movieno=" + movieAndTypePicked + "&typeno=0" ;
  	window.location.hash = requestValue ;
  	
  	selectedRequestValue = "_php_functions/returnSelectOptions.php?movieno="+film_array[0];
  	//alert(requestValue);
  }

else if (!(film_array[0] == 0) && !(film_array[1] == null)){
    requestValue = "?dateno=" + datePicked + "&movieno=" + film_array[0] + "&typeno=" + film_array[1];
    
    selectedRequestValue = "_php_functions/returnSelectOptions.php?movieno="+film_array[0]+"&typeno="+film_array[1];
    
    }
   /* else{
    
    requestValue = "_php_blocks/programfinder.php?dateno=" + datePicked + "&movieno=" + film_array[0] + "&typeno=0";
      	
    selectedRequestValue = "_php_functions/returnSelectOptions.php?movieno="+film_array[0];
    
    
    }
	window.location.hash = requestValue ;
	
}*/
	window.location.hash = requestValue ;


if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  
  xmlhttp2=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp2.onreadystatechange=function()
  {
  if (xmlhttp2.readyState==4 && xmlhttp2.status==200)
    {

//document.getElementById("selectDate").innerHTML= '<option>ttt</option>';//xmlhttp2.responseText ;
document.getElementById("dateSelectContainer").innerHTML = 'Vælg dato: <select name="selectDate" class="select_tag" id="selectDate" onchange="dateSelected(selectDate.value,selectMovie.value);">' + xmlhttp2.responseText + '</select>';

if(!(film_array[0]==0)){

document.getElementById("searchContent").innerHTML='<div class="billet_program_load">Vælg en dato...</div>';
    }
        
    }
  }
  
//(selectedRequestValue == null) ? xmlhttp.open("POST",requestValue,true) : xmlhttp.open("POST",selectedRequestValue,true)  ;

if(!(film_array[0]==0)){

xmlhttp2.open("POST",selectedRequestValue,true);

}
else{

xmlhttp2.open("POST",selectedRequestValue,false);


}


xmlhttp2.send();

if(film_array[0]==0){

Select_Value_Set('movieOrDateSelectorForm.selectDate', datePicked);



dateSelected(datePicked, movieAndTypePicked);
}


}

//
function dateSelected(datePicked, movieAndTypePicked){

document.getElementById("news_container").innerHTML = '';
document.getElementById("news_container").style.height = '0px';
     // document.getElementById("kommendefilmbox").style.height = '0px';

  
var film_array=movieAndTypePicked.split(" ");

if (datePicked== 'X'){
return 0;
}

document.getElementById("searchContent").innerHTML='<div class="billet_program_load"><img src="/_images/icons/loadicon.gif" /></div>';

if (film_array[0] == 0)
{
    
    requestValue = "?dateno=" + datePicked + "&movieno=0&typeno=0";
  	window.location.hash = requestValue ;
  	//(requestValue);
  	
  	
}
else if (!(film_array[0] == 0) && film_array[1] == null)
 {

    requestValue = "?dateno=" + datePicked + "&movieno=" + film_array[0] + "&typeno=0";
  	window.location.hash = requestValue ;
  	
  	
  }
else
{

//if (film_array[1] >0 ){
    requestValue = "?dateno=" + datePicked + "&movieno=" + film_array[0] + "&typeno=" + film_array[1];
        
/*    }
    else{
    
    requestValue = "_php_blocks/programfinder.php?dateno=" + datePicked + "&movieno=" + film_array[0] + "&typeno=0";
    }*/
	window.location.hash = requestValue ;
}



if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    
    document.getElementById("searchContent").innerHTML=xmlhttp.responseText;
    
        
        //find site_container højde 
       /* var el=document.getElementById("site_container")
        el.trueheight=el.scrollHeight;
                document.getElementById("kommendefilmbox").style.height = (el.trueheight - 175) +'px';
                
                alert('GO');*/
               
                //find site_container højde 
                
                
                //el.trueheight=el.scrollHeight               
               // document.getElementById("kommendefilmbox").style.height = (el.scrollHeight - 170) +'px';
                
                changeUpcomingMovieBox(datePicked, film_array[0]);      
                
        
    }
  }
  
//(selectedRequestValue == null) ? xmlhttp.open("POST",requestValue,true) : xmlhttp.open("POST",selectedRequestValue,true)  ;

xmlhttp.open("POST",'_php_blocks/programfinder.php' + requestValue,true);


xmlhttp.send();


}




/*

function showResult(datePicked, movieAndTypePicked)
{
selectedRequestValue = null;

document.getElementById("searchContent").innerHTML='<div class="billet_week_load"><img src="/_images/icons/loadicon.gif" /></div>';

var film_array=movieAndTypePicked.split(" ");


if (film_array[0] == 0)
{
    
    requestValue = "_php_blocks/programfinder.php?dateno=" + datePicked + "&movieno=0&typeno=0";
  	window.location.hash = requestValue ;
  	//alert(requestValue);
  	
  	
}
else if (!(film_array[0] == 0) && film_array[1] == null)
 {

    requestValue = "_sites/film.php?dateno=" + datePicked + "&movieno=" + movieAndTypePicked + "&typeno=0" ;
  	window.location.hash = requestValue ;
  	
  	selectedRequestValue = "_php_functions/returnSelectOptions.php?movieno="+film_array[0];
  	//alert(requestValue);
  }
else
{

if (film_array[1] >0 ){
    requestValue = "_php_blocks/programfinder.php?dateno=" + datePicked + "&movieno=" + film_array[0] + "&typeno=" + film_array[1];
    
    selectedRequestValue = "_php_functions/returnSelectOptions.php?movieno="+film_array[0];
    
    }
    else{
    
    requestValue = "_php_blocks/programfinder.php?dateno=" + datePicked + "&movieno=" + film_array[0] + "&typeno=0";
      	
    selectedRequestValue = "_php_functions/returnSelectOptions.php?movieno="+film_array[0];
    
    
    }
	window.location.hash = requestValue ;
	//alert(requestValue);
}

if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {


document.getElementById("selectDate").innerHTML=xmlhttp.responseText ;
    
    changeUpcomingMovieBox();      
        
    }
  }
  
//(selectedRequestValue == null) ? xmlhttp.open("POST",requestValue,true) : xmlhttp.open("POST",selectedRequestValue,true)  ;

xmlhttp.open("POST",selectedRequestValue,true);


xmlhttp.send();






if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
 
     (selectedRequestValue == null) ? document.getElementById("searchContent").innerHTML=xmlhttp.responseText : document.getElementById("selectDate").innerHTML=xmlhttp.responseText ;
    
        
        //find site_container højde 
    
                document.getElementById("kommendefilmbox").style.height = '0px';
                //find site_container højde 
                var el=document.getElementById("site_container")
                
                
                //el.trueheight=el.scrollHeight
                 
                                 
                
                document.getElementById("kommendefilmbox").style.height = (el.scrollHeight - 170) +'px';
        
    }
  }
  
//(selectedRequestValue == null) ? xmlhttp.open("POST",requestValue,true) : xmlhttp.open("POST",selectedRequestValue,true)  ;
requestValue =   (selectedRequestValue == null) ? requestValue : selectedRequestValue ;

xmlhttp.open("POST",requestValue,true);


xmlhttp.send();

}
*/

function getNextDays(datePicked, movieAndTypePicked, typeno)
{

    MovieID = movieAndTypePicked;

        document.getElementById("billet_week_" + MovieID).innerHTML='<div class="billet_week_load"><img src="/_images/icons/loadicon.gif" /></div>';



    requestValue = "?dateno=" + datePicked + "&movieno=" + movieAndTypePicked + "&typeno=" + typeno;
            

if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
        document.getElementById("billet_week_" + MovieID).innerHTML=xmlhttp.responseText;
    }
  }
  
xmlhttp.open("POST","_php_blocks/changeBilletWeek.php" + requestValue,true);
xmlhttp.send();
}



function Select_Value_Set(SelectName, Value) {
  eval('SelectObject = document.' + 
    SelectName + ';');
  for(index = 0; 
    index < SelectObject.length; 
    index++) {
   if(SelectObject[index].value == Value)
     SelectObject.selectedIndex = index;
   }
}





function PopupCenter(pageURL, title,w,h) {


var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);

var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+'px, height='+h+'px, top='+top+', left='+left);
} 


function changeUpcomingMovieBox(mindate, selectedmovie){

if (mindate == null){

mindate = 0;
}

if (selectedmovie == null){

selectedmovie = 0;
}
 
  var el= document.getElementById("site_container");
   
   if(document.getElementById("nyheder")){ 
   var eb= document.getElementById("nyheder");
   
  maxHeigth = el.scrollHeight - eb.scrollHeight - 285;
  
  }
  else{
    maxHeigth = el.scrollHeight - 285;
  
  }
  
  numberOfMovies = maxHeigth / 260;
  
  if(numberOfMovies >= 1){
      
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {

   document.getElementById("news_container").innerHTML=xmlhttp.responseText;   
   document.getElementById("kommendefilmbox").style.height = ((Math.floor(numberOfMovies) * 260)+30) +'px';
    
    var el=document.getElementById("upcoming_movies_front_6245")
    
    //alert(el.scrollHeight);  
        
   }
   
   
   }
    
xmlhttp.open("POST","_php_blocks/kommendefilm.php?maxsize=" + Math.floor(numberOfMovies) + "&mindate=" + mindate + "&selectedmovie=" + selectedmovie,true);

xmlhttp.send();


}
}


function helloWorld(){

alert('Hello World');

}

