function DateDifference(date1,date2)
{

	//alert(date1+" "+date2);
	temp_date1=date1.split("-");
	date1=temp_date1[1]+"-"+temp_date1[2]+"-"+temp_date1[0];
	temp_date1=date2.split("-");
	date2=temp_date1[1]+"-"+temp_date1[2]+"-"+temp_date1[0];
	var DATE1=new Date(date1);
	var DATE2=new Date(date2);
	//alert(DATE1.getTime()+" "+DATE2.getTime());
	if (DATE1.getTime() >= DATE2.getTime()) 
		return false;
	else 
		return true;
}

function DateDifference1(date1,date2)
{

	//alert(date1+" "+date2);
	temp_date1=date1.split("-");
	temp_date2=date2.split("-");
	date1=temp_date1[1]+"-"+temp_date1[2]+"-"+temp_date1[0];
	temp_date1=date2.split("-");
	date2=temp_date2[1]+"-"+temp_date2[2]+"-"+temp_date2[0];
	
	if(temp_date1[1] > temp_date2[1])
		dd = temp_date1[1] - temp_date2[1];
	else if(temp_date1[1] < temp_date2[1])
		dd = temp_date2[1] - temp_date1[1];
	else
		dd = temp_date2[1] - temp_date1[1];
	
	if(temp_date1[2] > temp_date2[2])
		dd = temp_date1[2] - temp_date2[2];
	else if(temp_date1[2] < temp_date2[2])
		dd = temp_date2[2] - temp_date1[2];
	else
		dd = temp_date2[2] - temp_date1[2];
	
	if(temp_date1[0] > temp_date2[0])
		dd = temp_date1[0] - temp_date2[0];
	else if(temp_date1[0] < temp_date2[0])
		dd = temp_date2[0] - temp_date1[0];
	else
		dd = temp_date2[0] - temp_date1[0];
	
	alert(dd);
		
	var DATE1=new Date(date1);
	var DATE2=new Date(date2);
	//alert(DATE1.getTime()+" "+DATE2.getTime());
	if (DATE1.getTime() >= DATE2.getTime()) 
		return false;
	else 
		return true;
}



function SelectAllList(CTRL)
{
	CONTROL = document.getElementById(CTRL);
	for(var i = 0;i < CONTROL.length;i++)
	{
		CONTROL.options[i].selected = true;
	}
}
function DeselectAllList(CTRL){
	CONTROL = document.getElementById(CTRL);
	for(var i = 0;i < CONTROL.length;i++){
		CONTROL.options[i].selected = false;
	}
}
function setDropDownValueByText(SelObj,TextVal)
{
	for(i=0;i<SelObj.options.length;i++)
	{
		if(SelObj.options[i].text.indexOf(TextVal) != -1)
			SelObj.options[i].selected=true;
	}

}
function isRadioChecked(obj)
{
	for(i=0;i< obj.length;i++)
	{
		if(obj[i].checked == true)
		return true;
	}
	return false;
}
function getCheckedRadioVal(obj)
{
	for(i=0;i< obj.length;i++)
	{
		if(obj[i].checked == true)
		{
			return obj[i].value;
		}
	}
}

function submenu(fval,tot)
{
	//alert(fval + tot);
	//alert(fval);	
	if(document.getElementById('TabId'))
		document.getElementById('TabId').value=fval;
	for(i=1;i<=tot;i++)
 	{
		var sample="form"+i;
		//alert(sample);
		if(fval==i)
		{
			document.getElementById(sample).style.display='';
		   	document.getElementById("form"+i+"td").background = 'images/tab_enable.gif'
			document.getElementById("form"+i+"font").color = '#000000'			
			if(fval==tot)
			{ document.getElementById("form"+i+"tdright").background = 'images/tab_enable-right.gif' }
			else
			{ document.getElementById("form"+i+"tdright").background = 'images/tab_enable-right.gif'}
		}
		else
		{
			document.getElementById(sample).style.display='none';
			document.getElementById("form"+i+"td").background = 'images/tab_disable.gif'
			document.getElementById("form"+i+"tdright").background = 'images/tab_disable-right.gif'		
			document.getElementById("form"+i+"font").color = '#999999'				
		}
		//alert(document.all(sample).style.display);
	 }
}
function selectCellcolor(e,i)
{
	var r = null;
	if (e.parentNode && e.parentNode.parentNode) 
	{
		r = e.parentNode;
	}
	else if (e.parentElement && e.parentElement.parentElement) 
	{
		r = e.parentElement;
	}
	if(e.checked)
	{
		r.className="raw_selectedcolor";
	}
	else
	{
		if(i%2==0)
			r.className="evenrowbg";
		else
			r.className="oddrowbg";
	}
}

function selectCheckcolor(e,i)
{
	var r = null;
	if (e.parentNode && e.parentNode.parentNode) 
	{
		r = e.parentNode.parentNode.parentNode;
	}
	else if (e.parentElement && e.parentElement.parentElement) 
	{
		r = e.parentElement.parentElement.parentElement;
	}
	if(e.checked)
	{
		r.className="raw_selectedcolor";
	}
	else
	{
		if(i%2==0)
			r.className="evenrowbg";
		else
			r.className="oddrowbg";
	}
}
function checkRow(val, rs)
{
	for(i=0;i<permission_array.length;i++)
	{
		permission = permission_array[i]+val;
		if(document.all(permission) && !document.all(permission).disabled)
		{
			document.all(permission).checked = rs;
		}	
	}  
}

function RedirectURL(URL)
{
	window.location=URL;
	return false;
}

function Highlight(e)
{
	if(e.className!="raw_selectedbg")
	{
		e.className="mouseover";
	}
}
function UnHighlight(e,classname)
{
//	alert(e.className)
	if(e.className!="raw_selectedbg")
		e.className=classname;
}

function checkString(str, value, length)
{
	for(i=0;i<length;i++)
	{
		ch1=value.charAt(i);
		rtn1=str.indexOf(ch1);
		if(rtn1==-1)
			return false;
	}
	return true;
}

function alphanum(value,length)
{
	chk1="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_\-";
	return checkString(chk1, value, length);
}

function number(value,length)
{
	chk1="1234567890";
	return checkString(chk1, value, length);
}

function phoneformate(value,length)
{
	chk1="+1234567890()- ";
	return checkString(chk1, value, length);
}

function decimalNumber(value,length)
{
	chk1="1234567890.";
	return checkString(chk1, value, length);
}

function smallLetter(value,length)
{
	chk1="abcdefghijklmnopqrstuvwxyz";
	return checkString(chk1, value, length);
}
function capLetter(value,length)
{
	chk1="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	return checkString(chk1, value, length);
}
function letter(value,length)
{
	chk1="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	return checkString(chk1, value, length);
}
function symbol(value,length)
{
	chk1="~`!@#$%^&*()_-+=|\{}[]:;'<>?/,";
	return checkString(chk1, value, length);
}
function btncclick()
{
	if(!checkvalid())
	{
		return false;
	}
	document.frmadd.addmore.value=true;
	return true;
}

function phone_formate(input,length)
{
	chk1="1234567890-";
	if(length!=12)
	{
		return false;
	}
	for(i=0;i<length;i++)
	{
		ch1=input.charAt(i);
		rtn1=chk1.indexOf(ch1);
		if(rtn1==-1)
		{
			return false;
		}
		if(input.charAt(3)!='-')
		{
			return false;
		}
		if(input.charAt(7)!='-')
		{
			return false;
		}
	}
return true;	
}

var bikky = document.cookie;
var today = new Date();
var expiry = new Date(today.getTime() + 28 * 24 * 60 * 60 * 1000); // plus 28 days

function ShowHideCategories(CategoryName,Action)
{
	var layerHidden = eval(getLayer(CategoryName + "LayerHidden"));
	var layer = eval(getLayer(CategoryName + "Layer"));
	if(Action=="Hide")
	{
		if (document.layers) 
		{
			layerHidden.visibility = "show" ;
			layer.visibility = "hide" ;
		}
		else if (document.getElementById) 
		{
			layerHidden.style.display = 'none';
			layer.style.display = '';
		}	
		//setCookie(CategoryName+"Visibility", Action);
	}
	else
	{
		if (document.layers) 
		{
			layerHidden.visibility = "hide" ;
			layer.visibility = "show" ;
		}
		else if (document.getElementById) 
		{
			layerHidden.style.display = '';
			layer.style.display = 'none';
		}
		//setCookie(CategoryName+"Visibility", Action);
	}
}
	
function getLayer(layerName)
{
	if (document.layers) 
		return window.document.layers[layerName]
	else if (document.getElementById)
		return document.getElementById(layerName)
}

function HighlightBoxWithBorder(Name,Highlight)
{
	if(Highlight=="true")
	{
		Name.style.background = "#f0f0f0";
		Name.style.cursor="hand";
	}
	else
	{
		Name.style.background = "#ffffff";
	}
}

function Highlight(e)
{
	if(e.className!="raw_selectedbg")
		e.className="mouseover";
}
function UnHighlight(e,classname)
{
//	alert(e.className)
	if(e.className!="raw_selectedbg")
		e.className=classname;
}
function ShowHelp(div, title, desc)
{
	div.style.display = 'inline';
	div.style.position = 'absolute';
	div.style.width = '170';
	div.style.backgroundColor = 'lightpink';
	div.style.border = 'dashed 2px red';
	div.style.padding = '10px';
	div.innerHTML = '<b>' + title + '</b><br><div style="padding-left:10; padding-top:5; 						padding-right:5">' + desc + '</div>';
}
function HideHelp(div)
{
	div.style.display = 'none';
}

function checkValidNull(obj, msg)
{
	if(obj)
	{
		if(Trim(obj.value)=="")
		{
			alert(msg);
			obj.focus();
			return false;
		}
	}
	else
		return false;	
	return true;	
}

function getCookie(name)
{
	var cname = name + "=";
	var dc = document.cookie;
	if (dc.length > 0)
	{
		begin = dc.indexOf(cname);
		if (begin != -1)
		{
			begin += cname.length;
			end = dc.indexOf(";", begin);
			if (end == -1) end = dc.length;
				return unescape(dc.substring(begin, end));
		}
	}
	return null;
}

// Set the value into Cookie by Name
function setCookie(name, value) 
{
	var now = new Date();
	var then = new Date(now.getTime() + 31536000000);
	document.cookie = name + "=" + escape(value) + "; expires=" + then.toGMTString() + "; path=/";
}
//******************************************************************************************//
//********************* functions  for email-id validation ****************************//
//******************************************************************************************//

function isValidEmail(emailStr) {
	var checkTLD=1;
	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
	var emailPat=/^(.+)@(.+)$/;
	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
	var validChars="\[^\\s" + specialChars + "\]";
	var quotedUser="(\"[^\"]*\")";
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	var atom=validChars + '+';
	var word="(" + atom + "|" + quotedUser + ")";
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
	var matchArray=emailStr.match(emailPat);
	if (matchArray==null) {
		alert(" ( "+ emailStr +" ) Email address seems incorrect (check @ and .'s)");
		return false;
	}
	var user=matchArray[1];
	var domain=matchArray[2];
	// Start by checking that only basic ASCII characters are in the strings (0-127).
	for (i=0; i<user.length; i++) {
		if (user.charCodeAt(i)>127) {
			alert(" ( "+ emailStr +" ) Ths username contains invalid characters.");
			return false;
		}
	}
	for (i=0; i<domain.length; i++) {
		if (domain.charCodeAt(i)>127) {
			alert(" ( "+ emailStr +" ) Ths domain name contains invalid characters.");
			return false;
		}
	}
	if (user.match(userPat)==null) {
		alert(" ( "+ emailStr +" ) The username doesn't seem to be valid.");
		return false;
	}
	var IPArray=domain.match(ipDomainPat);
	if (IPArray!=null) {
		for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				alert(" ( "+ emailStr +" ) Destination IP address is invalid!");
				return false;
	   		}
		}
		return true;
	}
	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	for (i=0;i<len;i++) {
		if (domArr[i].search(atomPat)==-1) {
			alert(" ( "+ emailStr +" ) The domain name does not seem to be valid.");
			return false;
	   }	
	}
	if (checkTLD && domArr[domArr.length-1].length!=2 && 
		domArr[domArr.length-1].toLowerCase().search(knownDomsPat)==-1) {
		alert(" ( "+ emailStr +" ) The address must end in a well-known domain or two letter " + "country.");
		return false;
	}

// Make sure there's a host name preceding the domain.

	if (len<2) {
		alert(" ( "+ emailStr +" ) This address is missing a hostname!");
		return false;
	}	
	return true;
}

function checkValidNumber()
{  
	val = event.keyCode;
   	if(val<48)
	{
	  event.keyCode=0;
	 
	  }
	if(val>57)
	{
	  event.keyCode=0;
	 
	  }
	return true;
}

function date_time_check(Month,Day,Hour)
{
	var mm = (new Date()).getMonth()+1;
	var dd = (new Date()).getDate();
	var hh = (new Date()).getHours();
	
	if(Month < mm)
	{
		alert("Month is Lower Than Current Month");
		return false;
	}
	if((Month==mm) && (Day<dd))
	{
		alert("Day is Less Than Current Day");
		return false;
	}
	if((Month==mm) && (Day==dd) && (Hour<=hh))
	{
		alert("Hour is Must Greater than Current Hour");
		return false;
	}
	return true;
}
function Trim(s) 
{
  // Remove leading spaces and carriage returns

  while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r'))
  {
    s = s.substring(1,s.length);
  }

  // Remove trailing spaces and carriage returns

  while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r'))
  {
    s = s.substring(0,s.length-1);
  }
  return s;
}

function pollwin(w, h)
{

	pollwindow=window.open('','pollwindow','top=50,left=50,status=no,toolbars=no,scrollbars=yes,width='+w+',height='+h+',maximize=no,resizable');
	pollwindow.focus();
}
// check the (a...z) + (A...Z) + (.) + (space) + (_) +(') on key press event
function checkAlphabetic()
{  
	val = event.keyCode;
	if (val=13)
		return true;
	if(val<65 && val!=32 && val!=46 && val!=39)
	  event.keyCode=0;
	else if(val >90 && val!=95 && val <97)
		event.keyCode=0;
	else if(val>122)
		event.keyCode=0;
	return true;
}

// check the only alpahabet + Underscore on key press event
function checkAlphaWithUnderscore()
{  
	val = event.keyCode;
	if(val<65)
	  event.keyCode=0;
	else if(val>90 && val!=95 && val<97)
		event.keyCode=0;
	else if(val>122)
		event.keyCode=0;
	return true;
}

// check the  alpahabet + Digit on key press event
function checkAlphaNumeric()
{
	val = event.keyCode;
	//alert(val);
   	if(val<48)
		event.keyCode=0;
	else if(val>57 && val<65)
		event.keyCode=0;
	else if(val >90 && val <97)
		event.keyCode=0;
	else if(val>122)
		event.keyCode=0;
	return true;
}
function isValidFile(file1)
	{
		var file2;
		file2 = file1.substring(file1.length-3,file1.length);
		if(file2 == 'pdf' || file2 == 'PDF')
		{
			return true;
		}
		return false;
	}
	

function date_check(Year,Month,Day)
{
	thetime = new Date();
	var mm = thetime.getMonth()+1;
	var dd = thetime.getDate();
	var yy = thetime.getYear();
	if(Year < yy)
	{

		return false;
	}
	else if((Year==yy) && Month < mm)
	{
		//alert("Month must be Greater OR Equal Current Month");
		return false;
	}
	else if((Year==yy) && (Month==mm) && (Day<dd))
	{
		//alert("Day must be Greater OR Equal Current Day");
		return false;
	}
	else
	{
		return true;		
	}
}
function permute( str, len ){
    var key = len-1;
    var newkey = len-1;
    var temp;

    while( ( key > 0 ) && ( str[ key ] <= str[ key-1 ] ) ){
        key--;
    }
    key--;

    if( key < 0 ){
        return false;
    }

    while( ( newkey > key ) && ( str[ newkey ] <= str[ key ] ) ){
        newkey--;
    }

    temp = str[key];
    str[key] = str[newkey];
    str[newkey] = temp;

    len--;
    key++;

    while( len > key ){
        temp = str[len];
        str[len] = str[key];
        str[key] = temp;
        key++;
        len--;
    }
    return true;
}

function btnCancel(val)
{
	window.location=val;
}

function round_decimals(original_number, decimals) {
    var result1 = original_number * Math.pow(10, decimals)
    var result2 = Math.round(result1)
    var result3 = result2 / Math.pow(10, decimals)
    return pad_with_zeros(result3, decimals)
}

function pad_with_zeros(rounded_value, decimal_places) {

    var value_string = rounded_value.toString()
    var decimal_location = value_string.indexOf(".")

    if (decimal_location == -1) {
        
        decimal_part_length = 0
        
        value_string += decimal_places > 0 ? "." : ""
    }
    else {

        decimal_part_length = value_string.length - decimal_location - 1
    }
    
    var pad_total = decimal_places - decimal_part_length
    
    if (pad_total > 0) {
        
        for (var counter = 1; counter <= pad_total; counter++) 
            value_string += "0"
        }
    return value_string
}


//window.captureEvents(Event.CLICK);
//document.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP);
function ValidateURL(URL) 
{ 

	if(Trim(URL)!='')
	{
    	var v = new RegExp();  
	    v.compile("^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$");  
    	if (!v.test(URL))
        	return false;  
	}
	return true;
} 


function formatCurrency(num, decPlaces, decPoint, thousandPoint) {
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
		num = "0";
	if(decPlaces=='')
		decPlaces=2;
	sign = (num == (num = Math.abs(num)));
	num = num.toString();
	if(num.indexOf(".")==-1)
		cents = "0";
	else
	{
		cents = num.substring(num.indexOf(".")+1,num.length);
		num = num.substring(0, num.indexOf("."));
	}
	while(cents.length<decPlaces)
	{
		cents = cents + "0";
	}
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3)) + thousandPoint + num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + num + decPoint + cents.substring(0,decPlaces));
}


function displayCurrency(num, prefix, postfix)
{
	return prefix+" "+num + postfix;
}

function checkValidChar(e)
{
	/*	
	8	backspace
	13	enter
	46
	9	tab
	16	shift
	18	alt
	48 - 57	(0 - 9)
	97 - 105	Numlok on then
	27	esc
	20	CAPS
	144	NUMLOCK
	45	INSERT
	37 - 40  (up, down, left, right arrow)
	*/
	if(e==8 || e==13 || e==46 || e==9 || e==16 || e==18 || e==27 || e==20 || e==144 || e==45 || (e>=48 && e<=57) || (e>=35 && e<=40) || (e>=97 && e<=105))
		return true;
	else
		return false;
}
function todayStr() 
{
var today=new Date()
return today.getMonth()+1+"/"+today.getDate()+"/"+today.getYear() 
}

function formatDateStr(today) 
{
datearr=today.split('-');
if(datearr.length == 3)
return datearr[1]+"/"+datearr[2]+"/"+datearr[0];
else
return todayStr();
}


function DaysDifference(date1,date2)
{
	var DATE1=new Date(date1);
	//alert(DATE1);
	var DATE2=new Date(date2);
//	if (DATE1.getTime()>=DATE2.getTime()) return false;
//	else return true;
	return Math.ceil((DATE1.getTime()-DATE2.getTime())/(1000*3600*24));
//alert(DaysDifference('12-10-2005', '12-2-2005'));
}

function changeSelectedRawColor(e,i)
{
	var r = null;
	if (e.parentNode && e.parentNode.parentNode) 
	{
		r = e.parentNode.parentNode.parentNode;
	}
	else if (e.parentElement && e.parentElement.parentElement) 
	{
		r = e.parentElement.parentElement.parentElement;
	}
	if(e.checked)
	{
		r.className="raw_selectedbg";
	}
	else
	{
		if(i%2==0)
			r.className="evenrowbg";
		else
			r.className="oddrowbg";
	}
}

function openWindow(destination,height, width) {
	var targetWindow = destination;
	var x = Math.random();
	x = x * 1000;
	x = Math.round(x);
	var wind = "window" + x
	temp = window.open(targetWindow, wind, config='height=' + height + ',width=' + width + ',toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no, directories=no,status=yes,left=50,top=50');
}

function openNamedWindow(name, destination,height, width) {
    var targetWindow = destination;
    temp = window.open(targetWindow, name, config='height=' + height + ',width=' + width + ',toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no, directories=no,status=yes');
}

function checkValidNull(obj, msg)
{
	if(obj)
	{
		if(Trim(obj.value)=="")
		{
			alert(msg);
			obj.focus();
			return false;
		}
	}
	else
		return false;	
	return true;	
}


function checkValidZero(obj, msg)
{
	if(obj)
	{
		if(Trim(obj.value)=="" || Trim(obj.value)=="0")
		{
			alert(msg);
			obj.focus();
			return false;
		}
	}
	else
		return false;	
	return true;	
}

function getIntegerString(strIn) {
	return strIn.replace(/[^0-9]/g, "");
}

function getInteger(vNum) {
	vNum = getIntegerString(vNum.toString());
	if (vNum == "") { vNum = 0; }
	return Number(vNum);
}
/*	END */


function openPopupImageWindow(ImageName,ImagePath)
{
	s=window.open('popup.php?page=enlarge&pid=1&amp;h=700&amp;w=700&amp;popup=1&amp;vImage='+ImageName+'&amp;vImagepath='+ImagePath,'enlarged_view','toolbar=no,resizable=yes,scrollbars=yes,width=700, height=700'); 
	s.focus();
	return false;
}

function setFrmAction(frm,frmaction,modeVal)
{
	//alert(frm+' '+frmaction+' '+modeVal);
	//alert(modeVal);
	if(frm)
	{
		if(frmaction != '')
		{
			frm.action=frmaction;
		}
		
		if(modeVal != '')	
		{
			frm.mode.value=modeVal;
		}
	}
	
		
}

function gEBI(objName)
{
	return document.getElementById(objName);
}
function gEBIV(objName)
{
	return document.getElementById(objName).value;
}

function findPosX(obj)
{
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
}

function findPosY(obj)
{
    var curtop = 0;
    if(obj.offsetParent){
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
	}
    else if(obj.y){
        curtop += obj.y;
	}
    return curtop;
}

function checkStatus(actionType, keyword_val, extra_para)
{
	location_url='index.php?page='+ js_page +'&sorton='+js_sorton+'&start='+js_start;
	frmObj = document.frmlist;
	if(actionType=="Search"){
		if(typeof(keyword_val)=="undefined" || keyword_val==''){
			keyword_val = document.frmlist.keyword.value;
		}
		if(keyword_val !="")
			location_url +='&option='+frmObj.option.value + '&keyword=' + keyword_val;
	}
	if(typeof(extra_para)!="undefined")
	{
		location_url +=	extra_para;
	}

	if(document.getElementById("TotalRecords"))
		location_url +='&TotalRecords='+document.getElementById("TotalRecords").value;
	window.location = location_url;
}

function checkAll()
{
	var rs = (document.frmlist.abc.checked)?true:false;
	
	for(i=0;i<document.frmlist.elements.length;i++)
	{
	  	if(document.frmlist.elements[i].id == 'listid')
  		{
			document.frmlist.elements[i].checked = rs;
		}

	}  
}
function sub_checkAll()
{
	var rs = (document.frm_subcription_list.abc.checked)?true:false;
	
	for(i=0;i<document.frm_subcription_list.elements.length;i++)
	{
	  	if(document.frm_subcription_list.elements[i].id == 'listid')
  		{
			document.frm_subcription_list.elements[i].checked = rs;
		}

	}  
}

function getCheckCount()
{	var x=0;

	for(i=0;i < document.frmlist.elements.length;i++)
	{	if (document.frmlist.elements[i].id == 'listid' && document.frmlist.elements[i].checked == true) 
			{x++;}
	}
	return x;
}

function checkAction(act)
{
	var y=0; var ans;
	y = getCheckCount();
	if(y>0)
	{	
		if(act=="Delete")
			ans = confirm("Confirm Deletion of Selected Record(s) ?");
		else
			ans = confirm("Confirm "+act+" Status of Selected Record(s) ?");
		if(ans == true)
		{	
			document.frmlist.mode.value=act;	
			return true;
		}
		else
		{	return false;	}
	}
	else
	{	alert("Please Select a Record(s) to "+act+".");	return false;	}
}
