HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/verrassendveel.komma.pro/wwwroot/admin/js/mo-main.js
// JavaScript Document

/*
	MO-main.js
	
	Mike Ontwerpt 2012
	www.mikeontwerpt.nl	

*/

var popOpen = new Array();
var discountOpen = new Array();

$(document).ready(function(){
	
	//init dropdown menu
	initDropDown();

	// Qnd
	if($('.multi-select').size())
	{
		$('.multi-select').select2();
	}
});


/* 
	function called in media.php 
	change form when you add some media from different types
	
*/
function changeAddMediaForm(value){
	switch(value){
		case '1':
			var php = './php/js_mediaformImage.php';
		break;
		case '2':
			var php = './php/js_mediaformVimeo.php';
		break;
		case '3':
			var php = './php/js_mediaformYoutube.php';
		break;	
		case '4':
			var php = './php/js_mediaformDocs.php';
		break;	
		case '5':
			var php = './php/js_mediaformImageCrop.php';
		break;			
	}	
	
	$('#addmedia-form-loader').load(php,function() {
	});
	
}

function showHoverImageUpload(id){
	$('#'+id).animate({ height: '24px' },100);
}
function hideHoverImageUpload(id){
	$('#'+id).animate({ height: '0' },100);
}
function cp_mediahoverover(id){
	$('#'+id).css({ top: '0' });
}
function cp_mediahoverout(id){
	$('#'+id).css({ top: '88px' });
}

/* 
	checks all checkboxes
	
*/
function check_all(iam)
{ 
    var node_list = document.getElementsByTagName('input'); 
    for (var i = 0; i < node_list.length; i++)
    { 
        var node = node_list[i]; 
        if (node.getAttribute('type') == 'checkbox')
        { 
		    if (iam.checked == 1)
		   {
				node.checked = 1;
		   }
			else
		   {
				node.checked = 0;
		   }
        } 
    } 
}

function showLoading(){ 
	document.getElementById('loading').style.display = 'block';
}


function togglePop(id){
	if(!popOpen[id] || popOpen[id] == null || popOpen[id] == 'undefined'){
		popOpen[id] = true;
		$('#poprow'+id).css({ height : '96px' });	
	//	$(this).css({backgroundPosition: '-416px -16px'});
	}
	else{
		popOpen[id] = false;
		$('#poprow'+id).css({ height : '0' });	
	//	$(this).css({backgroundPosition: '-416px -40px'});
	}
}

function toggleDiscount(id){
	if(!discountOpen[id] || discountOpen[id] == null || discountOpen[id] == 'undefined'){
		discountOpen[id] = true;
		$('#discountbox'+id).css({ height : '40px' });	
	//	$(this).css({backgroundPosition: '-416px -16px'});
	}
	else{
		discountOpen[id] = false;
		$('#discountbox'+id).css({ height : '0' });	
	//	$(this).css({backgroundPosition: '-416px -40px'});
	}
}

/* LANGSTRAAT */
function  toggleInterview(){
	if( $('#interview-name').height() > 0){
		$('#interview-name').animate({height: 0},100);
	}
	else{
		$('#interview-name').animate({height: '48px'},100);
	}
			
}

function initJCrop(target, minW, minH, maxW, maxH){
	
	var ratio = minW / minH;
	if(minW == 0 && minH == 0){ var minSize = 0; } else{ var minSize = [minW,minH];	}
	if(maxW == 0 && maxH == 0){ var maxSize = 0; } else{ var maxSize = [maxW,maxH];	}
	
	$('#'+target).Jcrop({
		onSelect: function(c){ showCoords(c,target) },
		onRelease: function(c){ showCoords(c ,target) },
		bgOpacity:   .4,
		setSelect:   [ 0, minW, 0, minH ],
		aspectRatio: ratio,
		minSize:	minSize,
		maxSize:	maxSize
	});
}

function showCoords(c, target)
  {
      	// variables can be accessed here as
      	// c.x, c.y, c.x2, c.y2, c.w, c.h
		var key = target.substring(11);
	  	//update session
	  	$('#jsbox').load('./php/js_updateCropSession.php?action=update&sessionname=cropvalues&key='+key+'&x='+c.x+'&y='+c.y+'&x2='+c.x2+'&y2='+c.y2+'&w='+c.w+'&h='+c.h,function() {
		});
  };