// CRUELLA.com
// Javascript functions

function validateCheckBoxes(form) {
  for (var i=0;i<form.elements.length;i++) {
    var e = form.elements[i];
    if (e.checked) {
      return true;
    }
  }
  return null;
}

function confirmMessage(txt) {
  var confirmSub = confirm(txt);
  if (confirmSub) { 
    return true;
  } else {
    return false;
  }
}

// Check/uncheck array of checkboxes..
function selectAll() {
  for (var i=0;i<document.MyForm.elements.length;i++) {
    var e = document.MyForm.elements[i];
    if ((e.name != 'log') && (e.type=='checkbox')) {
      e.checked = document.MyForm.log.checked;
    }
  }
}

function toggleDiv(area,div1,div2) {
  var e = document.getElementById(div1);
  var f = document.getElementById(div2);
  if (area=='picture') {
    f.style.display = 'block';
    e.style.display = 'none';
  } else {
    e.style.display = 'block';
    f.style.display = 'none';
  }
}

function hideFlash(div) {
  var e = document.getElementById(div);
  document.getElementById(div).innerHTML = '<span style="background:#000;display:block;width:320px;height:236px;color:#fff;padding-top:20px;text-align:center"><img src="templates/images/closing.gif" alt="" title="" /></span>';
  //e.style.display = 'none';
}

function showFlash(div,movie) {
  var e = document.getElementById(div);
  e.style.display = 'block';
  var so = new SWFObject("preview.swf?source_file=clip-trailers/"+movie+"&amp;preview_image=templates/images/flash_bg.jpg&amp;auto_start=false", "sotester", "320", "256", "9", "#000000");
	so.addParam("allowFullScreen", "false");
	so.write(div);

}
