function cms_chooseImg(img,fid) {
  if (opener && opener.cms_processimg) {
    opener.cms_processimg(img,fid);
  }
  self.close();
}

function cms_popupImgChooser(fieldId) {
  document.getElementById(fieldId).focus();
  n=window.open("ImageDB/admin_popup/?fid="+fieldId,"NewWindow","innerHeight=600, innerWidth=580, location=no, menubar=no, resizable=no, status=no, toolbar=no, scrollbars=yes");
  n.focus();
}

function cms_processimg(img,fieldId){
  document.getElementById(fieldId).value=img;
  if(document.imagePreview){
    imagePreview();
  }
  else if( document.getElementById('fImageP') && document.getElementById('fImage') ) {
    document.getElementById('fImageP').src='ImageDB/viewimage/'+document.getElementById('fImage').value;
  }
}

function cms_popupVidChooser(id,type) {
  n=window.open("Actor/admin_video_edit/"+id+"/?type="+type,"","innerHeight=400, innerWidth=550, location=no, menubar=no, resizable=no, status=no, toolbar=no, scrollbars=yes");
  n.focus();
}

function cms_openPrint() {
  var printEx=(location.href.indexOf("?")==-1)?"?":"&";
  printEx+="print=1";
  window.open(location.href+printEx, 'print', 'width=550,height=600,scrollbars=yes');
  return false;
}

function cms_doPrint() {
  document.getElementById('print1').style.visibility="hidden";
  document.getElementById('print2').style.visibility="hidden";
  window.print();
}

function cms_popupWindow (url,w,h) {
  wind=window.open(url,"CMSPopUp"+url,"Height="+h+", Width="+w+", location=no, menubar=no, resizable=no, status=no, toolbar=no, scrollbars=yes");
  wind.focus();
  
}
