function redirect(url){
	window.location = url;
}
function loaddefaule(loadleft,loadright){
	window.onload = loadleft;
	window.onload = loadright;
}
function is_number(number){
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;								
 
   for (i = 0; i < number.length && IsNumber == true; i++) 
	  { 
	  Char = number .charAt(i); 
	  if (ValidChars.indexOf(Char) == -1) 
		 {
			IsNumber = false;											
		 }
	  }
   return IsNumber;
   
 }
function is_email(str)
{
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z])?)$/i
	if (filter.test(str)){
		return true;
	}else{
		return false
	}
}

function check_all(obj, checked) {
		var _checked = (checked == 0) ? false : true;
		
		num_item = (obj).length;
		if (num_item > 1) {
			for (i = 0; i < num_item; i++) {
				obj[i].checked = _checked;
			}
		}
		else {
			obj.checked = _checked;
		}
}


function do_search() {
		document.frm_list.op.value = 'search';
		document.frm_list.submit();
}

function do_reset() {
		document.frm_list.op.value = 'reset';
		document.frm_list.submit();
}

function do_update_orders() {
		document.frm_list.op.value = 'orders';
		document.frm_list.submit();
}
	
function do_publish(_id) {			
		document.frm_list.op.value = 'publish';
		document.frm_list.id.value = _id;
		document.frm_list.submit();
}

function do_publishs() {
		document.frm_list.op.value = 'publishs';
		document.frm_list.submit();
}

function do_un_publish(_id) {
		document.frm_list.op.value = 'un_publish';
		document.frm_list.id.value = _id;
		document.frm_list.submit();
}

function do_un_publishs() {
		document.frm_list.op.value = 'un_publishs';
		document.frm_list.submit();
}
function do_delete(_id,message) {
	var _confirm = confirm(message);
	if (_confirm) {
		document.frm_list.op.value = 'del';
		document.frm_list.id.value = _id;
		document.frm_list.submit();
	}
}
function do_deletes(message) {
	var _confirm = confirm(message);
	if (_confirm) {
		document.frm_list.op.value = 'dels';
		document.frm_list.submit();
	}
}

function popup(url,width,height)
 {	
   mywindow = window.open (url,"mywindow","location=0,status=0,scrollbars=1,width=" + width + ",height=" +height);
   mywindow.moveTo('','');
 } 
 
 function disableRightClick(e)
	{
		if(!news.rightClickDisabled) // initialize
		{
			if(news.layers)
			{
				news.captureEvents(Event.MOUSEDOWN);
				news.onmousedown = disableRightClick;
			}
			else news.oncontextmenu = disableRightClick;
			return news.rightClickDisabled = true;
		}
		if(news.layers || (document.getElementById && !news.all))
		{
			if (e.which==2||e.which==3)
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}
	
	function disableSelection(target)
	{
	if (typeof target.onselectstart!="undefined") //IE route
		target.onselectstart=function(){return false}
	else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
		target.style.MozUserSelect="none"
	else //All other route (ie: Opera)
		target.onmousedown=function(){return false}
	target.style.cursor = "default"
	}		