function CMS_OpenHEX(h) { top.location.href='mailto:'+CMS_DecodeHEX(h); }
function CMS_DecodeHEX(h) {
  var c=new Array(2); var s='';
  for(var i=0;i<h.length;i++) {
	  var n=i%2;
    c[n]=h.charCodeAt(i)-48;
    if(c[n]>9) c[n]-=7;
    if(n==1) s+=String.fromCharCode(c[0]*16+c[1]);
  }
  return(s); 
}

function CheckTextField(frm,fld) {
  var obj = eval('document.' + frm + '.' + fld)
  if (obj) {
	  var c = '';
    var s = obj.value;
		do { c = s; s = c.replace(/\'/,"&#8217;"); } while (c != s)
    do { c = s; s = c.replace(/\"/,"&quot;"); } while (c != s)
    obj.value = s;
	}
}

function CheckNumField(frm,fld) {
  var obj = eval('document.' + frm + '.' + fld)
  if (obj) {
	  var c = '';
    var s = obj.value;
    if (isNaN(s)==true) do { c = s; s = c.replace(/\D/,""); } while (c != s);
		if (s.length==0) s = '0';
    obj.value = s;
	}
}

function CheckPasswordField(frm,fld) {
  var obj = eval('document.' + frm + '.' + fld)
  if (obj) {
	  var c = '';
    var s = obj.value.toLowerCase();
		do { c = s; s = c.replace(/\s/,""); } while (c != s)
		do { c = s; s = c.replace(/\W/,""); } while (c != s)
		if (s.length==0) s = '0';
    obj.value = s;
	}
}

function CheckNTextFields(frm,fld) {
  var frmobj = eval('document.' + frm)
  if (frmobj) {
    for(var i=0; i<frmobj.length; ++i) {
      if (frmobj.elements[i].name.indexOf(fld)==0) {
        var s = frmobj.elements[i].value;
        do { c = s; s = c.replace(/\'/,"&#8217;"); } while (c != s)
        do { c = s; s = c.replace(/\"/,"&quot;"); } while (c != s)
        frmobj.elements[i].value = s;
      }
		}
  }
}

function CheckAllTextFields(frm) {
  var frmobj = eval('document.' + frm)
  if (frmobj) {
    for(var i=0; i<frmobj.length; ++i) {
      if (frmobj.elements[i].type=='text') {
        var s = frmobj.elements[i].value;
        do { c = s; s = c.replace(/\'/,"&#8217;"); } while (c != s)
        do { c = s; s = c.replace(/\"/,"&quot;"); } while (c != s)
        frmobj.elements[i].value = s;
      }
		}
  }
}
   
function OpenWindow(target,name,width,height,posx,posy,scroll,resize) {
	var it, wo, px, py
	it = target;
	wo = "location=no,toolbar=no,status=no,statusbar=no,scrollbars="+scroll+",resizable="+resize+",dependent=yes";
	px = py = 0;
	if (typeof posx != "undefined") px = posx;
	if (typeof posy != "undefined") py = posy;

	if(typeof new_window != "undefined") {
		if(new_window.closed != true) {
			new_window.close();
		}
	}
	new_window = window.open(it,name,"width="+width+",height="+height+","+wo);
	new_window.moveTo(px,py);
	new_window.location.replace(target);
	new_window.focus();
}

function OpenMedia(fid,file) {
}

function OpenMediaModal(fid,file) {
}

function OpenRedFox(path,title,w,h,resize,scroll) {
}

function OpenRedFoxModal(path,title,w,h,resize,scroll) {
}

function OpenRedFoxEdit(path,title,w,h,resize,scroll) {
}

