// This contains the functions to open new windows and encrypt data


var screenH;
var screenW;

function encrypt(value)
{
var characterSetString = "<<A9E8I7O6U5B!C:D0F@G+H1J#K?L$M=N2P%Q-R&S*T3VWZ4YX>";
var encryptedString = "";
var randomnumber = Math.floor(Math.random()*10);
var length_str = value.length; 
var chrVal1 = " ";
var chrVal2 = " ";
var pinCodeChar = "";
var pinCodeIndex = 0;
var x = 0;
pinCodeIndex = randomnumber + 2 ;
encryptedString = characterSetString.charAt(pinCodeIndex);
	for(index = 0; index < length_str  ; index++) {
		chrVal1 = value.charAt(index);
		x = 2;
		x = characterSetString.indexOf(chrVal1, x);
		if (x > 0) { /* Found */ 
		
			x = x + pinCodeIndex;
			if (x > 49) {
				/* Last & First character '>' '<<' has to ignore */
				x = 2 + ((x - 49) - 1);
			}
			
			chrVal2 = characterSetString.charAt(x);
		
		} else {
			chrVal2 = chrVal1;
		}
		encryptedString = encryptedString + chrVal2;
	}
return encryptedString; 
}


function windowWH2() {
  //parent.window.moveTo(0,0);
  var bV=parseInt(navigator.appVersion);
  var bName = navigator.appName;
  var bType;

  if(bV == 4)
   {
   if(bName.indexOf("Netscape") != -1){ bType = "NS4"}
  }
if(bV > 4)
   {
   //if(bName.indexOf("Netscape") != -1){ bType = "NS4"}
  }	

  if (bType == "NS4") {
   //parent.window.resizeTo(self.screen.availWidth - (parent.window.outerWidth - parent.window. innerWidth), self.screen.availHeight - (parent.window.outerHeight - parent.window.innerHeight));
	screenW=(self.screen.availWidth - (parent.window.outerWidth - parent.window. innerWidth));
	//screenH=(self.screen.availHeight - (parent.window.outerHeight - parent.window.innerHeight))
	
	screenH = self.screen.availHeight-90;
	
	
  }
  else
  {
	
	//screenW=self.screen.availWidth;
	screenW=(self.screen.availWidth-10);
	screenH=self.screen.availHeight-50;
	
  }

}

function openWindow2() {
  windowWH2();
	screenW= screenW * 0.82
	screenH= screenH * 0.65
  	dispPaymentWindow=window.open('','ibpsWinPayment','width='+screenW +',height='+screenH +',left=100,top=150,resizable=1,scrollbars=0,toolbar=0, directories=0,status=1,menubar=0');
}


function windowWH() {
  //parent.window.moveTo(0,0);
	
  var bV=parseInt(navigator.appVersion);
  var bName = navigator.appName;
  var bType;

  if(bV == 4)
   {
   if(bName.indexOf("Netscape") != -1){ bType = "NS4"}
  }
if(bV > 4)
   {
   //if(bName.indexOf("Netscape") != -1){ bType = "NS4"}
  }	

  if (bType == "NS4") {
   //parent.window.resizeTo(self.screen.availWidth - (parent.window.outerWidth - parent.window. innerWidth), self.screen.availHeight - (parent.window.outerHeight - parent.window.innerHeight));
	screenW=(self.screen.availWidth - (parent.window.outerWidth - parent.window. innerWidth));
	//screenH=(self.screen.availHeight - (parent.window.outerHeight - parent.window.innerHeight))
	
	screenH = self.screen.availHeight-90;
	
	
  }
  else
  {
	
	//screenW=self.screen.availWidth;
	screenW=(self.screen.availWidth-10);
	screenH=self.screen.availHeight-50;
	
  }

}

function openWindow() {
  windowWH();
//  alert(screenW +', '+screenH);
  disp1600Window=window.open('','ibpsWin1600D','width='+screenW +',height='+screenH +',left=0,top=0,resizable=1,scrollbars=1,toolbar=0, directories=0,status=1,menubar=0');
}

                                
                               
