File: D:/HostingSpaces/SBogers10/deensekroon.komma-mediadesign.nl/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();
});
/*
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;
}
$('#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($('#poprow'+id).height() == 0){
$('#poprow'+id).css({ display: 'block'});
$('#poprow'+id).stop().animate({ height : '96px' },200);
$('#option-'+id).attr('checked', true);
// $(this).css({backgroundPosition: '-416px -16px'});
}
else{
$('#poprow'+id).stop().animate({ height : '0' },200, function(){ $('#poprow'+id).css({ display: 'none'}); });
$('#option-'+id).attr('checked', false);
// $(this).css({backgroundPosition: '-416px -40px'});
}
}
function toggleDiscount(id){
if($('#discountbox'+id).height() == 0){
$('#discountbox'+id).css({ display: 'block'});
$('#discountbox'+id).stop().animate({ height : '136px' },200);
$('#option-'+id).attr('checked', true);
// $(this).css({backgroundPosition: '-416px -16px'});
}
else{
$('#discountbox'+id).stop().animate({ height : '0' },200, function(){ $('#discountbox'+id).css({ display: 'none'}); });
$('#option-'+id).attr('checked', false);
// $(this).css({backgroundPosition: '-416px -40px'});
}
}
function changeDivHeight(obj, targetH){
if($('#'+obj).height() != targetH){
$('#'+obj).stop().animate({ height : targetH+'px' },400);
}
else{
$('#'+obj).stop().animate({ height : 0 },400);
}
}