function prth_system_navigationform(orderby,cpage)
{
	frm=document.prth_system_frmnev;
	frm.sortby.value=orderby;
	frm.prth_cpage.value=cpage;
	frm.submit();
}
/*
function prth_system_fnc_pagelimit(orderby,pagelimit,cpage)
{
	location.replace("?prth_system_pagelimit="+pagelimit+"&sortby="+orderby+"&prth_cpage=1");
}
function prth_system_fnc_checkbox(orderby,pagelimit,cpage,chkstatus)
{
	location.replace("?prth_system_pagelimit="+pagelimit+"&sortby="+orderby+"&prth_cpage=1&archive="+chkstatus);
}*/
function prth_system_fnc_archive(orderby,pagelimit,cpage,chkstatus,setarchive,rowid)
{
	location.replace("?prth_system_pagelimit="+pagelimit+"&sortby="+orderby+"&prth_cpage=1&archive="+chkstatus+"&setarchive="+setarchive+"&archive_rowid="+rowid);
}
function prth_system_pagelimit(oderby,pagelimit)
{
	location.replace("?prth_system_pagelimit="+pagelimit+"&sortby="+orderby+"&prth_cpage=1");
}
//Blank field validation
function NotBlank(obj,cap)
{
	if(obj.value=="")
	{
		alert(cap + " is mandatory");
		obj.focus();
		return false;
	}
	return true;
}

function IsNumeric(obj,cap)
{
	if(isNaN(obj.value) || obj.value=="")
	{
		alert("Please Enter Valid " + cap);
		obj.focus();
		return false;
	}
	return true;
}

function IsDecimal(obj,cap)
{
	if(isNaN(obj.value) || obj.value=="")
	{
		alert("Please Enter Valid " + cap);
		obj.focus();
		return false;
	}
	return true;
}

function blank(obj)
{
	if(obj.value=="")
	{
		alert("All fields are mandatory");
		obj.focus();
		return false;
	}
	return true;
}
function check_blankval(obj)
{
	if(obj.value=="")
	{
		alert("All fields are mandatory");
		obj.focus();
		return false;
	}
	return true;
}
//Compare Two values which is greater
function comparetwovalues(obj1,obj2)
{
	if(parseInt(obj1.value)>parseInt(obj2.value))
	{
		alert("Between textbox value is not greater To textbox value");
		obj2.focus();
		return false;
	}
	return true;
}
//Number and decimal only enter
function checknum_decimal(obj)
{
	key=window.event.keyCode;
	if((key < 48 || key > 57) && key!=46)
	{
		alert("Enter only Number and Decimal Point");
		return false;
		obj.focus();
	}		
}
function check_radioval(obj1,obj2)
{
	if(!obj1.checked && !obj2.checked)
	{
		alert("Fields with * are mandatory");
		obj1.focus();
		return false;
	}
	return true;
}
function check_checkboxval(obj,cap)
{
	if(!obj.checked)
	{
		alert("You must be agree with Terms and Conditions");
		obj.focus();
		return false;
	}
	return true;
}
/*function check_emailval(obj,cap)
{
	var em=obj.value;
	if(obj.value=="")
	{
		alert("Email Address is mandatory");
		obj.focus();
		return false;
	}
	atspos=em.indexOf('@') + 1;
	dtspos=em.lastIndexOf('.');
	len=em.length-3;
	if(atspos < 2 || dtspos < 3  ||dtspos <= atspos || len<dtspos)
	{
		alert("Enter Valid E-mail Address");
		obj.focus();
		return false;
	}
	return true;
}*/
function check_emailval(obj,cap)
{
	if(obj.value=="")
	{
		alert("Email Address is mandatory");
		obj.focus();
		return false;
	}
	var str = obj.value;
    var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;    
    if (!str.match(re))
	{
        alert("Enter Valid E-mail Address");
		obj.focus();
        return false;
    }
	else
	{
		dtspos=str.lastIndexOf('.');
		if(dtspos > 0)
		{
			if(str.substring(dtspos).length > 4)
			{
				alert("Enter Valid E-mail Address");
				obj.focus();
				return false;
			}
		}
        return true;
    }
	return true;
}
function check_blankcountry(obj)
{
	if(obj.value==0)
	{
		alert("Fields with * color are mandatory");
		obj.focus();
		return false;
	}
	return true;
}
function check_country(obj,cobj,eobj)
{
	if(obj.value=="United States")
	{
		eobj.value="";
		if(cobj.value==0)
		{
			alert("please Select State from List Box(just for USA)");
		}
		else
		{
			cobj.value;
			return true;
		}
		cobj.focus();
		return false;
	}
	else
	{
		cobj.value=0;
		if(eobj.value=="")
		{
			alert("Please enter State in text(other) box");
		}
		else
		{
			eobj.value;
			return true;
		}	
		eobj.focus();
		return false;
	}	
}
function check_confirm_password(mobj,cobj)
{
	if(mobj.value!=cobj.value)
	{
		alert("Your Password does not match with the Confirm Password")
		mobj.value="";
		cobj.value="";
		mobj.focus();
		return false;
	}
	return true;
}
function check_length(obj,leng)
{
    var objlen=obj.value.length
	if( objlen < leng )
	{
		alert("Length must be less than limited characters");
		obj.focus();
		return false;
	}
	return true;
}
//Used for checking valid amount >0
function validamount_nozero(obj,msg)
{
	if(obj.value == "" || isNaN(obj.value))
	{
		alert("Please enter valid "+msg)
		obj.value="0.00"
		obj.focus()
		return false;
	}
	else if(obj.value <=0)
	{
	 	alert("Please enter amount greater then 0")
		obj.value="0.00"
		obj.focus()
		return false;
	}
		return true;
}   
function open_preview_sizable(path,width,height)
{	
	var w = 480, h = 340;
	if (document.all || document.layers)
	{
		w = screen.availWidth;
		h = screen.availHeight;
	}
	var topPos = (h-height)/2, leftPos = (w-width)/2;
	objwndsize=window.open(path,"objwndsize","munubar=0,statusbar=yes,resizable=yes,scrollbars=yes,width="+(width)+",height="+(height)+",left="+ leftPos +",top="+ topPos +",screenX="+ leftPos +",screenY="+ topPos);	
	objwndsize.focus();
}
function open_preview_sizable_feedback(path,width,height)
{	
	var w = 480, h = 340;
	if (document.all || document.layers)
	{
		w = screen.availWidth;
		h = screen.availHeight;
	}
	var topPos = (h-height)/2, leftPos = (w-width)/2;
	objwndsize=window.open(path,"objwndsize","munubar=0,statusbar=yes,resizable=no,scrollbars=yes,width="+(width)+",height="+(height)+",left="+ leftPos +",top="+ topPos +",screenX="+ leftPos +",screenY="+ topPos);	
	objwndsize.focus();
}
function open_preview(path,width,height)
{	
	var w = 480, h = 340;
	if (document.all || document.layers)
	{
		w = screen.availWidth;
		h = screen.availHeight;
	}
	var topPos = (h-height)/2, leftPos = (w-width)/2;
	objwnd=window.open(path,"objwnd","munubar=0,statusbar=yes,resizable=no,scrollbars=yes,width="+(width)+",height="+(height)+",left="+ leftPos +",top="+ topPos +",screenX="+ leftPos +",screenY="+ topPos);	
	objwnd.focus();
}
function open_prev(path)
{	
	var w = 480, h = 340;
	var width=700,height=500;
	if (document.all || document.layers)
	{
		w = screen.availWidth;
		h = screen.availHeight;
	}
	var topPos = (h-height)/2, leftPos = (w-width)/2;
	objwnd=window.open(path,"objwnd","munubar=0,statusbar=yes,resizable=no,scrollbars=yes,width="+(width)+",height="+(height)+",left="+ leftPos +",top="+ topPos +",screenX="+ leftPos +",screenY="+ topPos);	
	objwnd.focus();
}
function selotherstate(objfrm)
{	
	//alert(objfrm.country.value);
	if(objfrm.country.value=="US")
	{
		objfrm.state.value=0;
	}
	else
	{
		objfrm.state.value =1;
	}
	
}
function seluscountry(objfrm)
{	
	if(objfrm.state.value!=0 || objfrm.state.value!=1)
	{
		objfrm.country.value="US";
	}
}
function sendselected(actflag,selval)
{
	if(selval != "")location.replace("?prth_act=" + actflag + "&prth_rowid=" + selval);
}
function CheckScreenName(frm)
{
	if (frm.screen_name.value=="")
	{
		alert("Please Enter Screen Name")
		frm.screen_name.focus();
		return false;
	}
	frm.prth_act.value='TestScreenName';
	frm.submit();
}
function valid_screenname(obj)
{
	if(!NotBlank(obj,"Requester Screen Name"))return false;
	var tempstr;
	tempstr = obj.value;
	var reg = /[^A-Za-z0-9-._]/g;
	result = tempstr.match(reg);
	if(result != null)
	{
		obj.focus();	
		alert("Please enter valid Screen Name. \n\n Only alpha-numeric and the ., - and _ characters are allowed.")
		return false;
	}
	else
		return true;
}
function ViewSortBy()
{

}


