function pviiClassNew(obj, new_style)
{
	obj.className = new_style;
}

function changeDiv(the_div,the_change)
{
	var the_style = getStyleObject(the_div);
	if (the_style != false)
	{
		the_style.display = the_change;
	}
}

function getStyleObject(objectId)
{
	if (document.getElementById && document.getElementById(objectId))
	{
		return document.getElementById(objectId).style;
	}
	else if (document.all && document.all(objectId))
	{
		return document.all(objectId).style;
	}
	else
	{
		return false;
	}
}

function browserType()
{

	if(navigator.appName == "Netscape")
	{
	 return "NS";
	}
	 if(navigator.appName == "Microsoft Internet Explorer")
	{
	 return "IE";
	}
}
function handleEnterLogin(event)
{

	 var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
	 if (keyCode == 13)
	 {

	   //document.login.submit.focus();
	 }
}


/*******************/
// Global Functions
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_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 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 tmt_findObj(n){
	var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");
	x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
	}else{x=document.getElementById(n)}return x;
}

function MM_showHideLayers() { //v3.0A Modified by Al Sparber and Massimo Foti for NN6 Compatibility
  var i,p,v,obj,args=MM_showHideLayers.arguments;if(document.getElementById){
   for (i=0; i<(args.length-2); i+=3){ obj=tmt_findObj(args[i]);v=args[i+2];
   v=(v=='show')?'visible':(v='hide')?'hidden':v;
   if(obj)obj.style.visibility=v;}} else{
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }}
}

function MM_setTextOfLayer(objName,x,newText) {//v3.0A Modified by Uncle Massimo and packaged by Uncle Al  for NN6 Compatibility

	  var obj = (document.getElementById) ? tmt_findObj(objName) : MM_findObj(objName);
	    if (obj!=null) with (obj)
	    if (document.layers) {
			alert();
			document.write(unescape(newText));
			document.close();
		}else{
			if(newText==""){
				innerHTML = unescape(newText);
			}else if(innerHTML!=newText ){
				var sep = (innerHTML=="")?"":", ";
				innerHTML = innerHTML +sep+  unescape(newText);
			}
		}
	}
/********************/

function resetErrors(form) {

	for(var i=0;i<form.length;i++) {
		MM_setTextOfLayer(form[i].name+'Errors','','');
	}
}
/*Added by Vidyadhar on Tuesday Oct 07, 2008*/
function getDataFromServer(formName,operation,action){
	//alert("Calling getDataFromServer");
   	eval("document."+formName+".operation").value = operation;
	eval("document."+formName).action = action;
	eval("document."+formName).submit();
}

/*Added by Vidyadhar on Monday Nov 17, 2008*/
function getSelectedRadio(buttonGroup) {
   // returns the array number of the selected radio button or -1 if no button is selected
   if (buttonGroup[0]) { // if the button group is an array (one button is not an array)
      for (var i=0; i<buttonGroup.length; i++) {
         if (buttonGroup[i].checked) {
            return i
         }
      }
   } else {
      if (buttonGroup.checked) { return 0; } // if the one button is checked, return zero
   }
   // if we get to this point, no radio button is selected
   return -1;
} // Ends the "getSelectedRadio" function

function getSelectedRadioValue(buttonGroup) {
   // returns the value of the selected radio button or "" if no button is selected
   var i = getSelectedRadio(buttonGroup);
   if (i == -1) {
      return "";
   } else {
      if (buttonGroup[i]) { // Make sure the button group is an array (not just one button)
         return buttonGroup[i].value;
      } else { // The button group is just the one button, and it is checked
         return buttonGroup.value;
      }
   }
} // Ends the "getSelectedRadioValue" function

function getSelectedCheckbox(buttonGroup) {
   // Go through all the check boxes. return an array of all the ones
   // that are selected (their position numbers). if no boxes were checked,
   // returned array will be empty (length will be zero)
   var retArr = new Array();
   var lastElement = 0;
   if (buttonGroup[0]) { // if the button group is an array (one check box is not an array)
      for (var i=0; i<buttonGroup.length; i++) {
         if (buttonGroup[i].checked) {
            retArr.length = lastElement;
            retArr[lastElement] = i;
            lastElement++;
         }
      }
   } else { // There is only one check box (it's not an array)
      if (buttonGroup.checked) { // if the one check box is checked
         retArr.length = lastElement;
         retArr[lastElement] = 0; // return zero as the only array value
      }
   }
   return retArr;
} // Ends the "getSelectedCheckbox" function

function getSelectedCheckboxValue(buttonGroup) {
   // return an array of values selected in the check box group. if no boxes
   // were checked, returned array will be empty (length will be zero)
   var retArr = new Array(); // set up empty array for the return values
   var selectedItems = getSelectedCheckbox(buttonGroup);
   if (selectedItems.length != 0) { // if there was something selected
      retArr.length = selectedItems.length;
      for (var i=0; i<selectedItems.length; i++) {
         if (buttonGroup[selectedItems[i]]) { // Make sure it's an array
            retArr[i] = buttonGroup[selectedItems[i]].value;
         } else { // It's not an array (there's just one check box and it's selected)
            retArr[i] = buttonGroup.value;// return that value
         }
      }
   }
   return retArr;
} // Ends the "getSelectedCheckBoxValue" function


/*Added by Sai on Friday Nov 19, 2008 */

/**
 * Function used to trim the given string and return the resultant string.
 */
function trim(str){
	return str.replace(/(^\s*)|(\s*$)/g,"");
}

/**
 * Function to enter only numbers .
 * @param e onKeyPress event.
 * @return true/false
 */
function enterNumOnly(e)
{
   var key=0;
	if(window.event || !e.which)
	{
		key = e.keyCode;
   	}
	else
	{
		key = e.which;
	}

	if((key>=48)&&(key<=57)||key==8||key==9){
        key=key;
        return true;
     }else{
       key=0;
       return false;
     }
}

/*Added by Sai on Friday Dec 02, 2008 */
function enter59MinsOnly(e,id){
	var len = document.getElementById(id).value.length;
	var key=0;

	if(window.event || !e.which){
		key = e.keyCode;
   	}else{
		key = e.which;
	}

	if(len==1){
		if((key>=48)&&(key<=57)||key==8||key==9){
			return true;
		}else{
		   return false;
		}

	}else{
		if((key>=48)&&(key<=53)||key==8||key==9){
			return true;
		}else{
		   return false;
		}
	}
}

function addTransparentDiv(){
	var pos = getPositionForTransparentDiv("footerPosImg"); // This method is defined in menu.js.
										   // "footerPosImg" is kept in footer.jsp at right bottom corner.
	// To check with border remove the comment from below line.
	//document.getElementById('popUpTransDiv').style.borderWidth="1px";
	document.getElementById('popUpTransDiv').style.height=(pos.x+29)+"px";
	document.getElementById('popUpTransDiv').style.width=(pos.y-3)+"px";

	// Previously followed the below 2 lines. But not working for IE 7.0.
	//document.getElementById('popUpTransDiv').style.height=document.body.offsetHeight+"px";
	//document.getElementById('popUpTransDiv').style.width=document.body.offsetWidth+"px";

}

function getPositionForTransparentDiv(objId){
	var obj = document.getElementById(objId);
	var top  = 0;
	var left  = 0;
	while (obj.offsetParent){
		top  += obj.offsetTop;
		left  += obj.offsetLeft;
		obj     = obj.offsetParent;
	}
	top  += obj.offsetTop;
	left  += obj.offsetLeft;

	return {x:top,y:left};
}


function removeTransparentDiv(){
	
	document.getElementById('popUpTransDiv').style.height="0px";
	document.getElementById('popUpTransDiv').style.width="0px";
}

//THis function is used for validations in pagination go to field
function validateGoTo(goToValue,numof){
	var result='true';
	if(goToValue==""|| goToValue=='0')
	{
		document.getElementById("pagMsg").innerHTML='<table cellpadding="0" cellspacing="0" border="0" style="padding-top:2px;"><tr><td><img src="./images/common/icon_alert.gif" width="12px" height="12px" /></td><td class="errorClass" style="padding-left:5px">'+Enter_Page_Number+'</td></tr></table>';
		result="false";
		document.getElementById("goTo").value="";
	}
	else{
			if(goToValue.search(/^\d{1,}$/)==-1){
					document.getElementById("pagMsg").innerHTML='<table cellpadding="0" cellspacing="0" border="0" style="padding-top:2px;"><tr><td><img src="./images/common/icon_alert.gif" width="12px" height="12px" /></td><td class="errorClass" style="padding-left:5px">'+Please_enter_numbers_only+'</td></tr></table>';
					result="false";
	                document.getElementById("goTo").value="";
			}
	}
	if(parseInt(goToValue,10)>parseInt(numof,10)){

	     document.getElementById("pagMsg").innerHTML='<table cellpadding="0" cellspacing="0" border="0" style="padding-top:2px;"><tr><td><img src="./images/common/icon_alert.gif" width="12px" height="12px" /></td><td class="errorClass" style="padding-left:5px">'+Pages_are_not_available+'</td></tr></table>';
         result="false";
          document.getElementById("goTo").value="";
	}
	else
	{
		if(parseInt(goToValue,10)==0)
		{
			document.getElementById("pagMsg").innerHTML='<table cellpadding="0" cellspacing="0" border="0" style="padding-top:2px;"><tr><td><img src="./images/common/icon_alert.gif" width="12px" height="12px" /></td><td class="errorClass" style="padding-left:5px">'+Page_is_not_available+'</td></tr></table>';
	         result="false";
	          document.getElementById("goTo").value="";
		}
	}
	return result;
}

//Validation for pagination GOTo field
function goFunction(){
	var res="true";
	var num=document.buyerDetailsForm.goTo.value;
	var numof='${numberOfPages}';
	  if(num==""|| parseInt(num)=='0'){
		document.getElementById("message").innerHTML=Enter_Page_Number;
		res="false";
		document.buyerDetailsForm.goTo.value="";
	  }else{
			if(num.search(/^\d{1,}$/)==-1){

				document.getElementById("message").innerHTML=Please_enter_numbers_only;
				res="false";
	             document.buyerDetailsForm.goTo.value="";
			}
	   }
	   if(parseInt(num,10)>parseInt(numof,10)){
				document.getElementById("message").innerHTML=Page_not_available;
			     res="false";
	             document.buyerDetailsForm.goTo.value="";
	   }
		if(res=="true"){
			document.buyerDetailsForm.submit()
		}

}
//THis function is used for validations in pagination go to field
function validateGoToWithContext(goToValue,numof,contextPath){

	var result='true';
	if(goToValue==""|| goToValue=='0')
	{
		document.getElementById("pagMsg").innerHTML='<table cellpadding="0" cellspacing="0" border="0" style="padding-top:2px;"><tr><td><img src="'+contextPath+'/images/common/icon_alert.gif" width="12px" height="12px" /></td><td class="errorClass" style="padding-left:5px">'+Enter_Page_Number+'</td></tr></table>';
		result="false";
		document.getElementById("goTo").value="";
	}
	else{
			if(goToValue.search(/^\d{1,}$/)==-1){
					document.getElementById("pagMsg").innerHTML='<table cellpadding="0" cellspacing="0" border="0" style="padding-top:2px;"><tr><td><img src="'+contextPath+'/images/common/icon_alert.gif" width="12px" height="12px" /></td><td class="errorClass" style="padding-left:5px">'+Please_enter_numbers_only+'</td></tr></table>';
					result="false";
	                document.getElementById("goTo").value="";
			}
	}
	if(parseInt(goToValue,10)>parseInt(numof,10)){

	     document.getElementById("pagMsg").innerHTML='<table cellpadding="0" cellspacing="0" border="0" style="padding-top:2px;"><tr><td><img src="'+contextPath+'/images/common/icon_alert.gif" width="12px" height="12px" /></td><td class="errorClass" style="padding-left:5px">'+Pages_are_not_available+'</td></tr></table>';
         result="false";
          document.getElementById("goTo").value="";
	}
	else
	{
		if(parseInt(goToValue,10)==0)
		{
			document.getElementById("pagMsg").innerHTML='<table cellpadding="0" cellspacing="0" border="0" style="padding-top:2px;"><tr><td><img src="'+contextPath+'/images/common/icon_alert.gif" width="12px" height="12px" /></td><td class="errorClass" style="padding-left:5px">'+Page_is_not_available+'</td></tr></table>';
	         result="false";
	          document.getElementById("goTo").value="";
		}
	}
	return result;
}

function openRssPage(operation, action){
  mywindow=window.open("rssnews.do?operation=getRssAndNewsPage&status=active", "mywindow","menubar=1,resizable=1,width=993,height=520,status=1,toolbar=1" );
  mywindow.moveTo(10,110);
}

function openHonor(url){
  mywindow=window.open(url, "mywindow","menubar=1,resizable=1,width=993,height=520,status=1,toolbar=1,scrollbars=1" );
  mywindow.moveTo(10,110);
}





//for dollor Number format
function NumberFormat(num, inputDecimal)
{
this.VERSION = 'Number Format v1.5.4';
this.COMMA = ',';
this.PERIOD = '.';
this.DASH = '-';
this.LEFT_PAREN = '(';
this.RIGHT_PAREN = ')';
this.LEFT_OUTSIDE = 0;
this.LEFT_INSIDE = 1;
this.RIGHT_INSIDE = 2;
this.RIGHT_OUTSIDE = 3;
this.LEFT_DASH = 0;
this.RIGHT_DASH = 1;
this.PARENTHESIS = 2;
this.NO_ROUNDING = -1
this.num;
this.numOriginal;
this.hasSeparators = false;
this.separatorValue;
this.inputDecimalValue;
this.decimalValue;
this.negativeFormat;
this.negativeRed;
this.hasCurrency;
this.currencyPosition;
this.currencyValue;
this.places;
this.roundToPlaces;
this.truncate;
this.setNumber = setNumberNF;
this.toUnformatted = toUnformattedNF;
this.setInputDecimal = setInputDecimalNF;
this.setSeparators = setSeparatorsNF;
this.setCommas = setCommasNF;
this.setNegativeFormat = setNegativeFormatNF;
this.setNegativeRed = setNegativeRedNF;
this.setCurrency = setCurrencyNF;
this.setCurrencyPrefix = setCurrencyPrefixNF;
this.setCurrencyValue = setCurrencyValueNF;
this.setCurrencyPosition = setCurrencyPositionNF;
this.setPlaces = setPlacesNF;
this.toFormatted = toFormattedNF;
this.toPercentage = toPercentageNF;
this.getOriginal = getOriginalNF;
this.moveDecimalRight = moveDecimalRightNF;
this.moveDecimalLeft = moveDecimalLeftNF;
this.getRounded = getRoundedNF;
this.preserveZeros = preserveZerosNF;
this.justNumber = justNumberNF;
this.expandExponential = expandExponentialNF;
this.getZeros = getZerosNF;
this.moveDecimalAsString = moveDecimalAsStringNF;
this.moveDecimal = moveDecimalNF;
this.addSeparators = addSeparatorsNF;
if (inputDecimal == null) {
this.setNumber(num, this.PERIOD);
} else {
this.setNumber(num, inputDecimal);
}
this.setCommas(true);
this.setNegativeFormat(this.LEFT_DASH);
this.setNegativeRed(false);
this.setCurrency(false);
this.setCurrencyPrefix('$');
this.setPlaces(2);
}
function setInputDecimalNF(val)
{
this.inputDecimalValue = val;
}
function setNumberNF(num, inputDecimal)
{
if (inputDecimal != null) {
this.setInputDecimal(inputDecimal);
}
this.numOriginal = num;
this.num = this.justNumber(num);
}
function toUnformattedNF()
{
return (this.num);
}
function getOriginalNF()
{
return (this.numOriginal);
}
function setNegativeFormatNF(format)
{
this.negativeFormat = format;
}
function setNegativeRedNF(isRed)
{
this.negativeRed = isRed;
}
function setSeparatorsNF(isC, separator, decimal)
{
this.hasSeparators = isC;
if (separator == null) separator = this.COMMA;
if (decimal == null) decimal = this.PERIOD;
if (separator == decimal) {
this.decimalValue = (decimal == this.PERIOD) ? this.COMMA : this.PERIOD;
} else {
this.decimalValue = decimal;
}
this.separatorValue = separator;
}
function setCommasNF(isC)
{
this.setSeparators(isC, this.COMMA, this.PERIOD);
}
function setCurrencyNF(isC)
{
this.hasCurrency = isC;
}
function setCurrencyValueNF(val)
{
this.currencyValue = val;
}
function setCurrencyPrefixNF(cp)
{
this.setCurrencyValue(cp);
this.setCurrencyPosition(this.LEFT_OUTSIDE);
}
function setCurrencyPositionNF(cp)
{
this.currencyPosition = cp
}
function setPlacesNF(p, tr)
{
this.roundToPlaces = !(p == this.NO_ROUNDING);
this.truncate = (tr != null && tr);
this.places = (p < 0) ? 0 : p;
}
function addSeparatorsNF(nStr, inD, outD, sep)
{
nStr += '';
var dpos = nStr.indexOf(inD);
var nStrEnd = '';
if (dpos != -1) {
nStrEnd = outD + nStr.substring(dpos + 1, nStr.length);
nStr = nStr.substring(0, dpos);
}
var rgx = /(\d+)(\d{3})/;
while (rgx.test(nStr)) {
nStr = nStr.replace(rgx, '$1' + sep + '$2');
}
return nStr + nStrEnd;
}
function toFormattedNF()
{
var pos;
var nNum = this.num;
var nStr;
var splitString = new Array(2);
if (this.roundToPlaces) {
nNum = this.getRounded(nNum);
nStr = this.preserveZeros(Math.abs(nNum));
} else {
nStr = this.expandExponential(Math.abs(nNum));
}
if (this.hasSeparators) {
nStr = this.addSeparators(nStr, this.PERIOD, this.decimalValue, this.separatorValue);
} else {
nStr = nStr.replace(new RegExp('\\' + this.PERIOD), this.decimalValue);
}
var c0 = '';
var n0 = '';
var c1 = '';
var n1 = '';
var n2 = '';
var c2 = '';
var n3 = '';
var c3 = '';
var negSignL = (this.negativeFormat == this.PARENTHESIS) ? this.LEFT_PAREN : this.DASH;
var negSignR = (this.negativeFormat == this.PARENTHESIS) ? this.RIGHT_PAREN : this.DASH;
if (this.currencyPosition == this.LEFT_OUTSIDE) {
if (nNum < 0) {
if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n1 = negSignL;
if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n2 = negSignR;
}
if (this.hasCurrency) c0 = this.currencyValue;
} else if (this.currencyPosition == this.LEFT_INSIDE) {
if (nNum < 0) {
if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n0 = negSignL;
if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n3 = negSignR;
}
if (this.hasCurrency) c1 = this.currencyValue;
}
else if (this.currencyPosition == this.RIGHT_INSIDE) {
if (nNum < 0) {
if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n0 = negSignL;
if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n3 = negSignR;
}
if (this.hasCurrency) c2 = this.currencyValue;
}
else if (this.currencyPosition == this.RIGHT_OUTSIDE) {
if (nNum < 0) {
if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n1 = negSignL;
if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n2 = negSignR;
}
if (this.hasCurrency) c3 = this.currencyValue;
}
nStr = c0 + n0 + c1 + n1 + nStr + n2 + c2 + n3 + c3;
if (this.negativeRed && nNum < 0) {
nStr = '<font color="red">' + nStr + '</font>';
}
return (nStr);
}
function toPercentageNF()
{
nNum = this.num * 100;
nNum = this.getRounded(nNum);
return nNum + '%';
}
function getZerosNF(places)
{
var extraZ = '';
var i;
for (i=0; i<places; i++) {
extraZ += '0';
}
return extraZ;
}
function expandExponentialNF(origVal)
{
if (isNaN(origVal)) return origVal;
var newVal = parseFloat(origVal) + '';
var eLoc = newVal.toLowerCase().indexOf('e');
if (eLoc != -1) {
var plusLoc = newVal.toLowerCase().indexOf('+');
var negLoc = newVal.toLowerCase().indexOf('-', eLoc);
var justNumber = newVal.substring(0, eLoc);
if (negLoc != -1) {
var places = newVal.substring(negLoc + 1, newVal.length);
justNumber = this.moveDecimalAsString(justNumber, true, parseInt(places));
} else {
if (plusLoc == -1) plusLoc = eLoc;
var places = newVal.substring(plusLoc + 1, newVal.length);
justNumber = this.moveDecimalAsString(justNumber, false, parseInt(places));
}
newVal = justNumber;
}
return newVal;
}
function moveDecimalRightNF(val, places)
{
var newVal = '';
if (places == null) {
newVal = this.moveDecimal(val, false);
} else {
newVal = this.moveDecimal(val, false, places);
}
return newVal;
}
function moveDecimalLeftNF(val, places)
{
var newVal = '';
if (places == null) {
newVal = this.moveDecimal(val, true);
} else {
newVal = this.moveDecimal(val, true, places);
}
return newVal;
}
function moveDecimalAsStringNF(val, left, places)
{
var spaces = (arguments.length < 3) ? this.places : places;
if (spaces <= 0) return val;
var newVal = val + '';
var extraZ = this.getZeros(spaces);
var re1 = new RegExp('([0-9.]+)');
if (left) {
newVal = newVal.replace(re1, extraZ + '$1');
var re2 = new RegExp('(-?)([0-9]*)([0-9]{' + spaces + '})(\\.?)');
newVal = newVal.replace(re2, '$1$2.$3');
} else {
var reArray = re1.exec(newVal);
if (reArray != null) {
newVal = newVal.substring(0,reArray.index) + reArray[1] + extraZ + newVal.substring(reArray.index + reArray[0].length);
}
var re2 = new RegExp('(-?)([0-9]*)(\\.?)([0-9]{' + spaces + '})');
newVal = newVal.replace(re2, '$1$2$4.');
}
newVal = newVal.replace(/\.$/, '');
return newVal;
}
function moveDecimalNF(val, left, places)
{
var newVal = '';
if (places == null) {
newVal = this.moveDecimalAsString(val, left);
} else {
newVal = this.moveDecimalAsString(val, left, places);
}
return parseFloat(newVal);
}
function getRoundedNF(val)
{
val = this.moveDecimalRight(val);
if (this.truncate) {
val = val >= 0 ? Math.floor(val) : Math.ceil(val);
} else {
val = Math.round(val);
}
val = this.moveDecimalLeft(val);
return val;
}
function preserveZerosNF(val)
{
var i;
val = this.expandExponential(val);
if (this.places <= 0) return val;
var decimalPos = val.indexOf('.');
if (decimalPos == -1) {
val += '.';
for (i=0; i<this.places; i++) {
val += '0';
}
} else {
var actualDecimals = (val.length - 1) - decimalPos;
var difference = this.places - actualDecimals;
for (i=0; i<difference; i++) {
val += '0';
}
}
return val;
}
function justNumberNF(val)
{
newVal = val + '';
var isPercentage = false;
if (newVal.indexOf('%') != -1) {
newVal = newVal.replace(/\%/g, '');
isPercentage = true;
}
var re = new RegExp('[^\\' + this.inputDecimalValue + '\\d\\-\\+\\(\\)eE]', 'g');
newVal = newVal.replace(re, '');
var tempRe = new RegExp('[' + this.inputDecimalValue + ']', 'g');
var treArray = tempRe.exec(newVal);
if (treArray != null) {
var tempRight = newVal.substring(treArray.index + treArray[0].length);
newVal = newVal.substring(0,treArray.index) + this.PERIOD + tempRight.replace(tempRe, '');
}
if (newVal.charAt(newVal.length - 1) == this.DASH ) {
newVal = newVal.substring(0, newVal.length - 1);
newVal = '-' + newVal;
}
else if (newVal.charAt(0) == this.LEFT_PAREN
&& newVal.charAt(newVal.length - 1) == this.RIGHT_PAREN) {
newVal = newVal.substring(1, newVal.length - 1);
newVal = '-' + newVal;
}
newVal = parseFloat(newVal);
if (!isFinite(newVal)) {
newVal = 0;
}
if (isPercentage) {
newVal = this.moveDecimalLeft(newVal, 2);
}
return newVal;
}

// sorting coloumns in page should not greaterthan 7
function setGoToPageValues(coloumnId,orderId){
var order;
var coloumn;
if(document.URL.indexOf(orderId+'=1')!=-1){
order='1';
}else{
order='2';
}

if(document.URL.indexOf(coloumnId+'=0')!=-1){
coloumn='0';
}else if(document.URL.indexOf(coloumnId+'=1')!=-1){
coloumn='1';
}else if(document.URL.indexOf(coloumnId+'=2')!=-1){
coloumn='2';
}else if(document.URL.indexOf(coloumnId+'=3')!=-1){
coloumn='3';
}else if(document.URL.indexOf(coloumnId+'=4')!=-1){
coloumn='4';
}else if(document.URL.indexOf(coloumnId+'=5')!=-1){
coloumn='5';
}else if(document.URL.indexOf(coloumnId+'=6')!=-1){
coloumn='6';
}else if(document.URL.indexOf(coloumnId+'=7')!=-1){
coloumn='7';
}else if(document.URL.indexOf(coloumnId)==-1 ){
coloumn='0';
}

	document.getElementById('order').value=order;
	document.getElementById('coloumn').value=coloumn;

}

function loginPopup(){
	var popupDiv=document.getElementById('modulePopup');
	if(popupDiv){
		  var url = document.location.href;
		  document.location.href = url.substring(0,url.lastIndexOf("/"))+"/";
	}

}
