/**
Copyright © 2004. Polaris Software Lab Limited. All rights reserved.
These materials are confidential and proprietary to Polaris Software
Lab Limited and no part of these materials should be reproduced,
published, transmitted or distributed in any form or by any means,
electronic, mechanical, photocopying, recording or otherwise, or
stored in any information storage or retrieval system of any nature
nor should the materials be disclosed to third parties or used in any
other manner for which this is not authorized, without the prior express
written authorization of Polaris Software Lab Limited.
*/
//Screen Code and Corresponding Vertical Code
/*****************************************************************************************
CHANGE LOG
CHANGE CODE AUTHOR DESCRIPTION DATE
CHG001 GUNEET S. ANAND Code modified to remove setting of focus 7/19/2005
to the target field in Calendar. This is
done only if the target field is disabled.
If the field is not disabled the existing
flow remains.
CHG002 Udesh.p CHanging Date based on UserPersonlization 19/09/2005
CHG003 Udesh.p CHanging Date based on UserPersonlization 10/11/2005
bug reported by Nagarajan on Clear Date
CHG004 Udesh.p Code changed for disablin past date for TI
& enabling the same for Inquiry and reports 22/02/2006
CHg005 Udesh.p IUT Fix for Future date 23/03/2006
CHG001_26719 Sushil Enhancement for Service Transaction 5/6/2006
22953_CHG001 Nagarajan Calendar Style change 20-5-2006
CHG32196 kandasamy Email validation 6/12/2008
*****************************************************************************************/
var screenArray = new Array();
screenArray["GIRO_T1"]="cash";
screenArray["COIT_T1"]="cash";
screenArray["CBPT_T2"]="cash";
screenArray["DFTT_T1"]="cash";
screenArray["COTT_T2"]="cash";
screenArray["CCQT_T2"]="cash";
screenArray["MCQT_T2"]="cash";
screenArray["INBT_T2"]="cash";
screenArray["CTTT_T2"]="cash";
screenArray["CSYT_T1"]="cash";
screenArray["FCCY_T1"]="cash";
screenArray["LCCY_T1"]="cash";
screenArray["LCRN_D1"]="trade";
screenArray["AMLC_D1"]="trade";
screenArray["SHIP_D1"]="trade";
screenArray["DELV_D1"]="trade";
screenArray["BGIP_D1"]="trade";
screenArray["BGIP_D2"]="trade";
screenArray["SETL_D1"]="trade";
screenArray["SETL_D2"]="trade";
/*Added by CHG001_26719 for Service Transaction on 5/4/2006*/
screenArray["STOP_D2"]="infra";
screenArray["CNCL_D2"]="infra";
screenArray["PAZC_DY"]="infra";
screenArray["DELT_D1"]="infra";
screenArray["STOP_D1"]="infra";
screenArray["CNCL_D1"]="infra";
/*Added for Tide booking*/
screenArray["TIDP_BK"]="invst";
/*if(top.parent.frames[1] !=null)
top.parent.frames[1].focus();
if (window.Event)
document.captureEvents(Event.MOUSEUP);
document.oncontextmenu = norightclick;
document.onmousedown = norightclick;
*/
/********* Function to disable right click in IE ***/
/*
function nocontextmenu()
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
*/
function norightclick(e)
{
return true;
if (window.Event)
{
if (e.which !=1)
return false;
}
else{
if (event.button !=1)
{
event.cancelBubble = true;
event.returnValue = false;
return false;
}
}
}
/********* Function to disable right click Netscape ***/
/* function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
//else if (navigator.appName == 'Microsoft Internet Explorer' &&
//(event.button == 2 || event.button == 3)) {
//alert("Sorry, right click is disabled for this form");
//return false;
//}
return true;
}
document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;
if(document.all)
document.onkeydown = captureF11;
function captureF11(){
if(event.keyCode == 122 ){
top.parent.frames[1].focus();
event.keyCode = 0;
return false;
}
else if(event.keyCode == 116)
{
event.keyCode = 0;
return false;
}
}
// disable right click
if( document.all ){
document.oncontextmenu = onMouseDown;
}else{
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=onMouseDown_NE;
}
function onMouseDown(){
return false;
}
function onMouseDown_NE(evt){
if(evt.which == 3)
return false;
return true;
}
// end
*/
/*************************************************************/
/*
if(document.all)
document.onkeydown = captureF11;
function captureF11()
{
if(event.keyCode == 122 )
{
event.keyCode = 0;
return false;
}
}
*/
/**********************************************************************/
function global_width()
{
var nWidth
if(screen.availWidth==800){
if(document.all)
nWidth=screen.availWidth-180 //620
else
nWidth=screen.availWidth-180 //620
}else{
if(document.all)
nWidth=screen.availWidth-210 //804
else
nWidth=screen.availWidth-180 //844
}
// alert(nWidth)
return nWidth
}
/*******************************************************/
var style_sheet= "";//Vijeesh added for dynamic stylesheet
var weekend = [0];//22953_CHG001
var weekendColor = "#ADE684";//22953_CHG001
var nodateColor = "white"
var fontface = "Verdana";
var fontsize = 2;
var checkDates; //CHG004
var currYr; //CHG005
var enablingPastDates; //CHG004
var gNow = new Date();
var ggWinCal;
isNav = (navigator.appName.indexOf("Netscape") != -1) ? true : false;
isIE = (navigator.appName.indexOf("Microsoft") != -1) ? true : false;
Calendar.Months = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];
Calendar.Months1 = ["01", "02", "03", "04", "05", "06",
"07", "08", "09", "10", "11", "12"];
// Non-Leap year Month days..
Calendar.DOMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
// Leap year Month days..
Calendar.lDOMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function Calendar(p_item, p_WinCal, p_month, p_year, p_format) {
if ((p_month == null) && (p_year == null)) return;
if (p_WinCal == null)
this.gWinCal = ggWinCal;
else
this.gWinCal = p_WinCal;
if (p_month == null) {
this.gMonthName = null;
this.gMonth = null;
this.gYearly = true;
} else {
this.gMonthName = Calendar.get_month(p_month);
this.gMonth = new Number(p_month);
this.gYearly = false;
}
this.gYear = p_year;
this.gFormat = p_format;
this.gBGColor = "white";
this.gFGColor = "black";
this.gTextColor = "black";
this.gHeaderColor = "black";
this.gReturnItem = p_item;
this.gReturnItemH = p_item;
var befappend$ = this.gReturnItem.substring(0,this.gReturnItem.lastIndexOf("."));
var starappend$ = this.gReturnItem.substring(this.gReturnItem.lastIndexOf(".")+1,this.gReturnItem.length);
var befappendH$ = this.gReturnItem.substring(0,this.gReturnItem.lastIndexOf(".")+1);
var afterRemove$ = this.gReturnItem.substring(this.gReturnItem.indexOf("$")+1,this.gReturnItem.length);
this.gReturnItemH = befappendH$ + afterRemove$
if(this.gReturnItem.indexOf("$")==-1)
this.gReturnItem = befappend$ +".$"+starappend$;
}
Calendar.get_month = Calendar_get_month;
Calendar.get_month1 = Calendar_get_month1;
Calendar.get_daysofmonth = Calendar_get_daysofmonth;
Calendar.calc_month_year = Calendar_calc_month_year;
Calendar.print = Calendar_print;
function Calendar_get_month(monthNo) {
return Calendar.Months[monthNo];
}
function Calendar_get_month1(monthNo) {
return Calendar.Months1[monthNo];
}
function Calendar_get_daysofmonth(monthNo, p_year) {
/*
Check for leap year ..
1.Years evenly divisible by four are normally leap years, except for...
2.Years also evenly divisible by 100 are not leap years, except for...
3.Years also evenly divisible by 400 are leap years.
*/
if ((p_year % 4) == 0) {
if ((p_year % 100) == 0 && (p_year % 400) != 0)
return Calendar.DOMonth[monthNo];
return Calendar.lDOMonth[monthNo];
} else
return Calendar.DOMonth[monthNo];
}
function Calendar_calc_month_year(p_Month, p_Year, incr) {
/*
Will return an 1-D array with 1st element being the calculated month
and second being the calculated year
after applying the month increment/decrement as specified by 'incr' parameter.
'incr' will normally have 1/-1 to navigate thru the months.
*/
var ret_arr = new Array();
if (incr == -1) {
// B A C K W A R D
if (p_Month == 0) {
ret_arr[0] = 11;
ret_arr[1] = parseInt(p_Year) - 1;
}
else {
ret_arr[0] = parseInt(p_Month) - 1;
ret_arr[1] = parseInt(p_Year);
}
} else if (incr == 1) {
// F O R W A R D
if (p_Month == 11) {
ret_arr[0] = 0;
ret_arr[1] = parseInt(p_Year) + 1;
}
else {
ret_arr[0] = parseInt(p_Month) + 1;
ret_arr[1] = parseInt(p_Year);
}
}
return ret_arr;
}
function Calendar_print() {
ggWinCal.print();
}
function Calendar_calc_month_year(p_Month, p_Year, incr) {
/*
Will return an 1-D array with 1st element being the calculated month
and second being the calculated year
after applying the month increment/decrement as specified by 'incr' parameter.
'incr' will normally have 1/-1 to navigate thru the months.
*/
var ret_arr = new Array();
if (incr == -1) {
// B A C K W A R D
if (p_Month == 0) {
ret_arr[0] = 11;
ret_arr[1] = parseInt(p_Year) - 1;
}
else {
ret_arr[0] = parseInt(p_Month) - 1;
ret_arr[1] = parseInt(p_Year);
}
} else if (incr == 1) {
// F O R W A R D
if (p_Month == 11) {
ret_arr[0] = 0;
ret_arr[1] = parseInt(p_Year) + 1;
}
else {
ret_arr[0] = parseInt(p_Month) + 1;
ret_arr[1] = parseInt(p_Year);
}
}
return ret_arr;
}
// This is for compatibility with Navigator 3, we have to create and discard one object before the prototype object exists.
new Calendar();
Calendar.prototype.getMonthlyCalendarCode = function() {
var vCode = "";
var vHeader_Code = "";
var vData_Code = "";
// Begin Table Drawing code here..
vCode = vCode + "
";
vHeader_Code = this.cal_header();
vData_Code = this.cal_data();
vCode = vCode + vHeader_Code + vData_Code;
vCode = vCode + "
";
vCode = vCode + "";
//CHG001 start
// " onMouseDown=\"if(!self.opener."+this.gReturnItem+".disabled){self.opener." + this.gReturnItem + ".value='';self.opener."+this.gReturnItem+".focus();window.close();} else {self.opener." + this.gReturnItem + ".value='';window.close();}\">Clear Date"; //commented by Udesh
" onkeyDown=\"if(event.keyCode == 13){if(!self.opener."+this.gReturnItem+".disabled){self.opener." + this.gReturnItem + ".value='';self.opener."+this.gReturnItemH+".value='';self.opener."+this.gReturnItem+".focus();window.close();} else {self.opener." + this.gReturnItem + ".value='';self.opener."+this.gReturnItemH+".value='';window.close();}}\""+
" onMouseDown=\"if(!self.opener."+this.gReturnItem+".disabled){self.opener." + this.gReturnItem + ".value='';self.opener."+this.gReturnItemH+".value='';self.opener."+this.gReturnItem+".focus();window.close();} else {self.opener." + this.gReturnItem + ".value='';self.opener."+this.gReturnItemH+".value='';window.close();}\">Clear Date"; //CHG003
//CHG001 end
return vCode;
}
Calendar.prototype.show = function() {
var vCode = "";
this.gWinCal.document.open();
// Setup the page...
this.wwrite("");
this.wwrite("Calendar");
this.wwrite("");
this.wwrite("");
this.wwriteA("");
this.wwriteA( this.gMonthName + " " + this.gYear);
this.wwriteA("
");
// Show navigation buttons
var prevMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, -1);
var prevMM = prevMMYYYY[0];
var prevYYYY = prevMMYYYY[1];
var nextMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, 1);
var nextMM = nextMMYYYY[0];
var nextYYYY = nextMMYYYY[1];
//22953_CHG001
this.wwrite("
");
// Get the complete calendar code for the month..
vCode = this.getMonthlyCalendarCode();
this.wwrite(vCode);
this.wwrite("