<!--//
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function update_checkboxes(ctrl) 
{
    if (ctrl.name=="checker")
    {

    len = ctrl.form.elements.length;
    var i=0;
    for(i=0; i < len; i++) 
    {
	if (ctrl.form.elements[i].name.substr(0,2)=="m[")
	{
		
	      ctrl.form.elements[i].checked=ctrl.checked;
	}
    }
    }
    else
    {
	ctrl.form.checker.checked=false;		
    }

}

function redraw(ctrl)
{      
	count=ctrl.value.length;
	ctrl.form.count.value=count;

}

function max_retype()
{
	document.send.f_max_select.selectedIndex=0;
	document.send.f_campaigns_select.selectedIndex=0;
	document.send.f_choices_select.selectedIndex=0;
}

function max_reselect()
{
	if (document.send.f_max_select.selectedIndex!=0)
		document.send.f_max_messages.value="";

	if (document.send.f_campaigns_select.selectedIndex!=0)
		document.send.f_campaigns.value="";

	if (document.send.f_choices_select.selectedIndex!=0)
		document.send.f_choices.value="";
}


function date_change(ctrl,d,m,y,hour,min,datectrl)
{
	var code=ctrl.options[ctrl.selectedIndex].value;
	
	if (code=="0" || code=="-1")
	{
		d.selectedIndex=0;
		m.selectedIndex=0;
		y.selectedIndex=0;
		hour.selectedIndex=0;
		min.selectedIndex=0;
	}
	else
	if (code=="1") 
	{
		d.selectedIndex=0;
		m.selectedIndex=0;
		y.selectedIndex=0;
		if (hour.selectedIndex!=1)
			hour.selectedIndex=1;
		if (min.selectedIndex!=1)
			min.selectedIndex=1;
	}	
	else
	if (code=="2") 
	{
		d.selectedIndex=0;
		m.selectedIndex=0;
		y.selectedIndex=0;
		if (hour.selectedIndex!=1)
			hour.selectedIndex=1;
		if (min.selectedIndex!=1)
			min.selectedIndex=1;
	}	
	else
	if (code=="")
	{
		var date=datectrl.value;
		var id,im,iy,ihour,imin;
		today=new Date();

		if (date!="0000-00-00 00:00:00")
		{
			iy=parseInt(date.substr(0,4))+1-today.getYear();
			im=parseInt(date.substr(6,3));
			id=parseInt(date.substr(8,3));
			ihour=parseInt(date.substr(11,3))+1;
			imin=parseInt(date.substr(14,3))+1;
		}
		else
		{
			id=today.getDate();
			im=today.getMonth()+1;
			iy=1;
			ihour=today.getHours()+1;
			imin=today.getMinutes()+1;
		}

		if (d.selectedIndex!=id)
			d.selectedIndex=id;
		if (m.selectedIndex!=im)
			m.selectedIndex=im;
		if (y.selectedIndex!=iy)
			y.selectedIndex=iy;
		if (hour.selectedIndex!=ihour)
			hour.selectedIndex=ihour;
		if (min.selectedIndex!=imin)
			min.selectedIndex=imin;
	}		
}

function day_change(type,ctrl,value)
{
	var code=type.options[type.selectedIndex].value;
	if (code!="") ctrl.selectedIndex=0; else
	if (ctrl.selectedIndex==0) ctrl.selectedIndex=value;
}
function month_change(type,ctrl,value)
{
	var code=type.options[type.selectedIndex].value;
	if (code!="") ctrl.selectedIndex=0; else
	if (ctrl.selectedIndex==0) ctrl.selectedIndex=value;	
}

function year_change(type,ctrl,value)
{
	var code=type.options[type.selectedIndex].value;
	if (code!="") ctrl.selectedIndex=0; else
	if (ctrl.selectedIndex==0) ctrl.selectedIndex=value;	
}

function hour_change(type,ctrl,value)
{
	var code=type.options[type.selectedIndex].value;
	if (code=="0" || code=="-1") ctrl.selectedIndex=0; else
	if (ctrl.selectedIndex==0) ctrl.selectedIndex=value;	
}                               	

function min_change(type,ctrl,value)
{
	var code=type.options[type.selectedIndex].value;
	if (code=="0" || code=="-1") ctrl.selectedIndex=0; else
	if (ctrl.selectedIndex==0) ctrl.selectedIndex=value;
}

function validate_selected(obj)
{
	len = obj.form.elements.length;

	count=0;

	for(i=0; i < len; i++) 
	{
		if (obj.form.elements[i].name.substr(0,2)=="m[")
		{
		      if (obj.form.elements[i].checked) count++;
		}
    	}


	if (count>0) 
		return confirm("Are you sure to delete "+count+" selected record(s)?"); 

	
	if (count==0) { alert("No records selected"); return false; }

	else return true;	
}





//-->

