/* Global vars */

var gJumpURL = ""; // als savecard is gelukt, moet ie naar deze URL springen


/* function to stop and start the Movie when viewing detail */
function thisMovie(movieName) {
	if(isIE()){
		return window[movieName]
 } else {
		return document[movieName]
	}
}

function isIE() {
	return navigator.appName.indexOf ("Microsoft") != -1;
	}

function makeCall(str) {
	thisMovie("homepagedozen").fromJS(str);
	}


	
/* function to call the Lightbox for editin card */
function showCard(id) {
	$('kaartid').value = id;
	$('kaart_bg').show();
	$('kaart').show();
	$('verhuisdozen').hide();
	$('bg_fake').show();
	saveCard();
}


/* function to set the hidden kaartid field & previews with card content*/
function setKaartId(id) {
	$('kaartid').value = id;
	saveCard();
	}


function upload(){
		window.parent.document.getElementById('previewfield').innerHTML = '<img src="images/indicator.gif" /> moment geduld....';
		window.parent.document.getElementById('previewfield').style.display = 'block';
   		document.uploadform.submit();
}
	
/* functie voor na upload, hashid word bij de velden geplaatst en preview wordt getoond */	
function uploadCallback(filename,hashid){
	document.uploadform.hashid.value = hashid;
	window.parent.document.getElementById('uploadframe').style.display = 'none';
	window.parent.document.getElementById('hashid').value = hashid;
	previewFile = '<img src="footage/'+filename+'" class="fotopreview" /><a href="javascript:changeFile();">Wijzig</a><br class="clear" />';
	window.parent.document.getElementById('previewfield').innerHTML = previewFile;

	}
	
	
function changeFile() {
	window.parent.document.getElementById('previewfield').innerHTML = '';
	window.parent.document.getElementById('uploadframe').style.display = 'block' ;
	}
	
function hideIndicator() {
	window.parent.document.getElementById('previewfield').innerHTML = '';
	}
	

function close() {
	if($('player')) $('player').update('');
	$('kaart_bg').hide();	
	$('kaart').hide();	
	$('bg_fake').hide();
	
	/* remove classnames borange from thumbs */
	$('thumb_mobiel').removeClassName('borange');
	$('thumb_postduif').removeClassName('borange');
	$('thumb_verkeersbord').removeClassName('borange');
	$('thumb_politiebericht').removeClassName('borange');
	$('thumb_billboard').removeClassName('borange');
	$('verhuisdozen').show();

	//makeCall();
	}
	

function setActByIndex(indexIn) {
	if (indexIn == 1) { 
		$('thumb_mobiel').addClassName('borange');
	}
	if (indexIn == 2) { 
		$('thumb_postduif').addClassName('borange');
	}
	if (indexIn == 3) { 
		$('thumb_verkeersbord').addClassName('borange');
	}
	if (indexIn == 4) { 
		$('thumb_politiebericht').addClassName('borange');
	}
	if (indexIn == 5) { 
		$('thumb_billboard').addClassName('borange');
	}
}


	
function setAct(id) {
	$('thumb_mobiel').removeClassName('borange');
	$('thumb_postduif').removeClassName('borange');
	$('thumb_verkeersbord').removeClassName('borange');
	$('thumb_politiebericht').removeClassName('borange');
	$('thumb_billboard').removeClassName('borange');
	$(id).addClassName('borange');
}


function hyvesuitleg() {
	$tmpMessage = 'Houd rekening met bij het koppelen aan Hyves adressen: \n\n'+
	'- Zorg dat je popup blocker uit staat voor fundaverhuisbericht.nl, Hyves opent in een nieuw venster\n'+
	'- Dat er vrienden met e-mail adressen gekoppeld zijn aan jouw Hyves profiel.\n'+
	'- Zorg dat je je Hyves inloggegevens bij de hand hebt.\n'+
	'- In het Hyves popup moet je na het inloggen nogmaals bevestigen.\n';
	alert($tmpMessage);
	}

var sluitknopRules = {
	'#sluitknop' : function(el) {
			el.onclick = function() {
					close();
			}
	} ,
			
	'#hyvesknop' : function(el) {
			el.onchange = function() {
				if ($('hyvesknop').checked == true) {
					//hyvesuitleg();
				}
			}
	  }

	}
	
Behaviour.register(sluitknopRules);
    