var win;
var strWindows;
var strITCWin;
var strResWin;
var strPopupWindow;
var strOpinionPollWindow;
var srtStyle;
var strChildMenuNames = null; // Added by Sarit

/**Partha - Start ****************/
var TopMenuSubmitted = false;
var iCntTopMenuServiceFirst = 0;
var iCntTopMenuServiceLast = 9;

var offsetxpoint=-60
var offsetypoint=20
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false

function GoDefault()
{
	window.location.href = 'default.aspx';
}

function login(strLanguage)
{
	document.body.style.cursor="wait";
	document.frmDefaultWorkarea.btnSend.style.cursor="wait";
	if(Trim(document.forms[0].TxtUser.value).length <= 0)
	{
		alert("Please enter your User ID");
		document.forms[0].TxtUser.focus();
		document.body.style.cursor="auto";
		document.frmDefaultWorkarea.btnSend.style.cursor="auto";
		return false;
	}
	if(Trim(document.forms[0].TxtPwd.value).length <= 0)
	{
		alert("Please enter your Password");
		document.forms[0].TxtPwd.focus();
		document.body.style.cursor="auto";
		document.frmDefaultWorkarea.btnSend.style.cursor="auto";
		return false;
	}
	document.forms[0].target = "_top";
	document.forms[0].action = "frontcontroller.ech";
	document.forms[0].hidResource.value	= 'Login';
	document.forms[0].hidActivity.value	= 'Render';
	document.forms[0].hidLanguage.value	= strLanguage;	
	document.forms[0].method = "post";
	document.forms[0].submit();
}

function logOff()
{
	parent.window.frames[2].document.body.style.cursor="wait";
	document.forms[0].hidResource.value	= 'Logoff';
	document.forms[0].hidActivity.value	= 'Render';
	document.forms[0].action = "froncontroller.ech";
	document.forms[0].method = "post";
	document.forms[0].target = "_top";
	document.forms[0].submit();
}

function TransferAfterLogin()
{
	document.forms[0].target = "_top";
	document.forms[0].action = "frontcontroller.ech";
	document.forms[0].hidLanguage.value	= "";
	document.forms[0].hidResource.value	= 'DefaultWorkArea';
	document.forms[0].hidActivity.value	= 'Render';
	document.forms[0].method = "post";
	document.forms[0].submit();
}

function ietruebody()
{
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function ddrivetip(thetext, thecolor, thewidth)
{
	if (ns6||ie)
	{
		if (ie||ns6)
			var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : "";
		if (typeof thewidth!="undefined") tipobj.style.width= (thetext.length * 8 + 10) +"px";
		tipobj.innerHTML=thetext;
		enabletip=true;
		return false;
	}
}

function positiontip(e)
{
	if (enabletip)
	{
		if (ie||ns6)
			var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : "";
	
		var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
		var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
		var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20;
		var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20;
		var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000;

		if (rightedge<tipobj.offsetWidth)
			tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px";
		else if (curX<leftedge)
			tipobj.style.left="5px";
		else
			tipobj.style.left=curX+offsetxpoint+"px";

		if (bottomedge<tipobj.offsetHeight)
		{
			tipobj.style.top=ie? ((ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint)+15)+"px" : ((window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint) +15)+"px";
		}
		else
		{
			tipobj.style.top=curY+offsetypoint+"px";
		}
		tipobj.style.visibility="visible";
	}
}

function hideddrivetip()
{
	if (ns6||ie)
	{
		if (ie||ns6)
			var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : "";
	
		enabletip=false
		tipobj.style.visibility="hidden"
		tipobj.style.left="-1000px";
		tipobj.style.backgroundColor='';
		tipobj.style.width='';
	}
}
document.onmousemove=positiontip;

function ServiceMenuMoveNext(iTotalMenuCount)
{
	var strEval = "";
	var strDivID = "";
	
//	alert(iCntTopMenuServiceFirst + ' - ServiceMenuMoveNext');
	
	if(iCntTopMenuServiceFirst < 7)
	{
		strDivID = "TopService" + iCntTopMenuServiceFirst.toString();
		strEval = strDivID + ".style.display='none';";
		eval(strEval);
		
		strDivID = "TDService" + iCntTopMenuServiceFirst.toString();
		strEval = strDivID + ".style.display='none';";
		eval(strEval);
		
		strDivID = "TDService" + iCntTopMenuServiceFirst.toString();
		strEval = strDivID + ".style.visibility='hidden';";
		eval(strEval);
		
		strDivID = "TDService" + iCntTopMenuServiceFirst.toString();
		strEval = strDivID + ".style.width='0px';";
		eval(strEval);
			
		iCntTopMenuServiceFirst++;
		iCntTopMenuServiceLast++;
	}
//	alert(iCntTopMenuServiceLast + ' - ServiceMenuMoveNext');

	if(iCntTopMenuServiceLast <= iTotalMenuCount)
	{
		strDivID = "TDService" + iCntTopMenuServiceLast.toString();
		strEval = strDivID + ".style.display='';";
		eval(strEval);

		strDivID = "TDService" + iCntTopMenuServiceLast.toString();
		strEval = strDivID + ".style.visibility='visible';";
		eval(strEval);
		
		strDivID = "TopService" + iCntTopMenuServiceLast.toString();
		strEval = strDivID + ".style.display='';";
		eval(strEval);
	}

//	alert(iCntTopMenuServiceLast + ' - ServiceMenuMoveNext');
	
	if(iCntTopMenuServiceFirst == 7){iCntTopMenuServiceFirst = 7;}
	if(iCntTopMenuServiceLast >= iTotalMenuCount){iCntTopMenuServiceLast = iTotalMenuCount;}
}

function ServiceMenuMovePrev(iTotalMenuCount)
{
	var strEval = "";
	var strDivID = "";
	
//	alert(iCntTopMenuServiceFirst + ' - ServiceMenuMovePrev');
	
	if(iCntTopMenuServiceFirst >= 0)
	{
		iCntTopMenuServiceFirst--;
		if(iCntTopMenuServiceFirst >= 0)
		{		
//			alert(iCntTopMenuServiceFirst + ' - ServiceMenuMovePrev');
			
			strDivID = "TDService" + iCntTopMenuServiceFirst.toString();
			strEval = strDivID + ".style.display='';";
			eval(strEval);

			strDivID = "TDService" + iCntTopMenuServiceFirst.toString();
			strEval = strDivID + ".style.visibility='visible';";
			eval(strEval);
				
			strDivID = "TopService" + iCntTopMenuServiceFirst.toString();
			strEval = strDivID + ".style.display='';";
			eval(strEval);
		}
		else {iCntTopMenuServiceFirst = 0;}
	}
//	alert(iCntTopMenuServiceFirst + ' - ServiceMenuMovePrev');
	
	if(iCntTopMenuServiceLast > 9)
	{
		if(iCntTopMenuServiceFirst < 0){iCntTopMenuServiceFirst = 0;}
		
//		alert(iCntTopMenuServiceFirst + ' - ServiceMenuMovePrev');
//		alert(iCntTopMenuServiceLast + ' - ServiceMenuMovePrev');
		
		if(iCntTopMenuServiceLast >= 0)
		{
			strDivID = "TopService" + iCntTopMenuServiceLast.toString();
			strEval = strDivID + ".style.display='none';";
			eval(strEval);
			
			strDivID = "TDService" + iCntTopMenuServiceLast.toString();
			strEval = strDivID + ".style.display='none';";
			eval(strEval);
			
			strDivID = "TDService" + iCntTopMenuServiceLast.toString();
			strEval = strDivID + ".style.visibility='hidden';";
			eval(strEval);
			
			strDivID = "TDService" + iCntTopMenuServiceLast.toString();
			strEval = strDivID + ".style.width='0px';";
			eval(strEval);
			
			iCntTopMenuServiceLast--;
		}
	}
//	alert(iCntTopMenuServiceLast + ' - ServiceMenuMovePrev');
	if(iCntTopMenuServiceFirst < 0){iCntTopMenuServiceFirst = 0;}
	if(iCntTopMenuServiceLast <= 9){iCntTopMenuServiceLast = 9;}
}

function ShowBranch(branch, blnTopMenu)
{
	var objBranch = null;
	var iLevel = 0;
	if(!blnTopMenu)
	{
		if(document.getElementById(branch) != null)
		{
			var objNode = document.getElementById(branch).childNodes.length;
			if(objNode != null && objNode > 1)
			{
				if(document.getElementById(branch).childNodes[1].childNodes.length != 0)
				{
					objBranch = document.getElementById(branch).style;
					if(objBranch.display == 'block'){objBranch.display = 'none';}
					else {objBranch.display = 'block';}
				}
			}
			else 
			{
				if(document.getElementById(branch).childNodes[0].childNodes.length != 0)
				{
					objBranch = document.getElementById(branch).style;
					if(objBranch.display == 'block'){objBranch.display = 'none';}
					else {objBranch.display = 'block';}
				}
			}
			objNode = null;
		}
    }
    else
    {
		if(parent.window.document.childNodes[0].parentNode.frames[1].frames.frames[0].document.getElementById(branch) != null)
		{
			objBranch = parent.window.document.childNodes[0].parentNode.frames[1].frames.frames[0].document.getElementById(branch).style;
			if(objBranch.display == 'block'){objBranch.display = 'none';}
			else {objBranch.display = 'block';}
		}
    }
    objBranch = null;
}

function FnOnSelect()
{
	var objList = null;
	var strSelectNode = document.frames.document.all;
	
	if((strSelectNode != null) && (strSelectNode.length>0))
	{
		for(var intCnt=0;intCnt<strSelectNode.length;intCnt++)
		{
			objList = strSelectNode[0].document.all[intCnt];
			if(objList.tagName == 'TD')
			{
				if(objList.style.backgroundColor != '#cccccc')
				{
					objList.style.backgroundColor = '#fffbb2';
				}
				else
				{
					objList.style.backgroundColor = '#a69543';
				}
			}
		}
	}
	objList = null;
	strSelectNode = null;
}

function FnMouseOver(NodeTD)
{
	if(NodeTD.style.backgroundColor != '#a69543')
	{
		NodeTD.style.backgroundColor = "#cccccc";
		NodeTD.style.borderColor='black';
		NodeTD.style.borderWidth = '1px';
	}
}

function FnMouseOut(NodeTD)
{
	if(NodeTD.style.backgroundColor == '#cccccc')
	{
		NodeTD.style.backgroundColor = "#fffbb2";
		NodeTD.style.borderWidth = '0px';
	}
	else
	{
		NodeTD.style.backgroundColor = '#a69543';
		NodeTD.style.borderWidth = '0px';
	}
}

function fn_ShowSearch()
{
	document.body.style.cursor="wait";

	var strDivName = '';
	var strImgLeft = '';
	var strImgRight = '';
	
	document.forms[0].target	= "toppanel";
	document.forms[0].action	= "topmenu.aspx?Mock=0&Div=" + strDivName + "&ImgLeft=" + strImgLeft + "&ImgRight=" + strImgRight;
	document.forms[0].submit();
	TopMenuSubmitted = false;
	
	parent.window.frames[1].document.forms[0].target = "left";
	parent.window.frames[1].document.forms[0].action = "leftmenu.aspx";	
	parent.window.frames[1].document.forms[0].submit();
		
	parent.window.frames[0].document.forms[0].hidResource.value = "ECHOUPALSEARCH";
	parent.window.frames[0].document.forms[0].hidActivity.value = "render";
	parent.window.frames[0].document.forms[0].target = "work";
	parent.window.frames[0].document.forms[0].action = "frontcontroller.ech";
	parent.window.frames[0].document.forms[0].submit();
	document.body.style.cursor="auto";
}

function GetChangePswd()
{
	document.body.style.cursor= "wait";
	TopMenuSubmitted = false;
	var strDivName = '';
	var strImgLeft = '';
	var strImgRight = '';
	document.forms[0].target = "toppanel";
	document.forms[0].action = "topmenu.aspx?Mock=0&Div=" + strDivName + "&ImgLeft=" + strImgLeft + "&ImgRight=" + strImgRight;
	document.forms[0].submit();
	
	parent.window.frames[1].document.forms[0].target = "left";
	parent.window.frames[1].document.forms[0].action = "leftmenu.aspx";	
	parent.window.frames[1].document.forms[0].submit();
	
	parent.window.frames[0].document.forms[0].hidActivity.value = "render";
	parent.window.frames[0].document.forms[0].hidResource.value = "CHANGEPASSWORD";
	parent.window.frames[0].document.forms[0].action = "frontcontroller.ech";			
	parent.window.frames[0].document.forms[0].target = "work";
	parent.window.frames[0].document.forms[0].submit();
	document.body.style.cursor="auto";
}

function GetService(strLanguage, strResource, strCategory, strCategoryChain, 
						strServiceCaption, strRMSUrl, iHasContent, strDivName, 
						strImgTabLeft, strImgTabRight, strAppPath)
{
	var iFlag = 0;
	
	if(strResource == 'LEVEL1')
	{	
		if(iHasContent > 0)
		{
			
			fnServiceSubmit(strServiceCaption, strCategory, strCategoryChain,
							strDivName,strImgTabLeft, strImgTabRight, TopMenuSubmitted, 1, strLanguage);
			if(iFlag == 0) {FnOnSelectTopMenu('LEFT', strDivName, strImgTabLeft, strImgTabRight, ('/' + strAppPath))};
			if(iHasContent > 0) {FnOnSelect();}
			TopMenuSubmitted = true;
				
		
		}
		ShowBranch(strCategoryChain, false);
	}
	//Start Modification by BIPLAB on 04-04-2005 for dynamic left menus e.g. RMS,ENTERTAINMENT etc. against CRF/0002
	//else if(strResource != 'BOTTOM' && strCategory != 'LEFTMENU')
	else if(strResource != 'BOTTOM' && (strCategory != 'RMS'|| strCategory != 'ENTERTAINMENT'|| strCategory != 'SERVICEUSEFULLINKS'||strCategory != 'WEATHERSERVICE'))
	{
		if((strResource == 'LEVEL2') || (strResource == 'LEVEL3'))
		{
			var strChain = strCategoryChain;
			strChain = strChain.replace("$","\\");
			strChain = strChain.replace("$","\\");
			strChain = strChain.replace("$","\\");
			if(iHasContent > 0)
			{
				fnServiceSubmit(strServiceCaption, strCategory, strChain,
							strDivName,strImgTabLeft, strImgTabRight, TopMenuSubmitted, 1, strLanguage);
				if(iHasContent > 0) {FnOnSelect();}
				if(iFlag == 0) {FnOnSelectTopMenu('LEFT', strDivName, strImgTabLeft, strImgTabRight, ('/' + strAppPath))};
				TopMenuSubmitted = true;
				
			}
			ShowBranch(strCategoryChain, false);
		}
		else if(strResource == 'LEVEL4')
		{
			strCategoryChain = strCategoryChain.replace("$","\\");
			strCategoryChain = strCategoryChain.replace("$","\\");
			strCategoryChain = strCategoryChain.replace("$","\\");
			if(iHasContent > 0)
			{
				fnServiceSubmit(strServiceCaption, strCategory,strCategoryChain,
							strDivName,strImgTabLeft, strImgTabRight, TopMenuSubmitted, 1, strLanguage);

				if(iHasContent > 0) {FnOnSelect();}
				if(iFlag == 0) {FnOnSelectTopMenu('LEFT', strDivName, strImgTabLeft, strImgTabRight, ('/' + strAppPath))};
				TopMenuSubmitted = true;
			}
		}
	}
	
	if(strResource == 'BOTTOM' && (strCategory == 'RMS' || strCategory == 'ENTERTAINMENT'|| strCategory == 'SERVICEUSEFULLINKS'||strCategory == 'WEATHERSERVICE'))
	//if(strCategory == 'RMS' )
	{
		if(strCategoryChain == 'SERVICEUSEFULLINKS')
		{
			renderService(strLanguage,'SERVICEUSEFULLINKS','SERVICEUSEFULLINKS','SERVICEUSEFULLINKS', 1);
			fnServiceSubmit('', 'SERVICEUSEFULLINKS','',strDivName, strImgTabLeft, strImgTabRight,true, 0, strLanguage);
		}
		else if(strCategoryChain == 'ENTERTAINMENT')
		{
			renderService(strLanguage,'ENTERTAINMENT','ENTERTAINMENT','ENTERTAINMENT', 1);
			fnServiceSubmit('', 'ENTERTAINMENT','',strDivName, strImgTabLeft, strImgTabRight,true, 0, strLanguage);
		}		
		else if(strCategoryChain == 'WEATHERSERVICE')
		{
			GetWeather();
			fnServiceSubmit('', 'WEATHERMAP','',strDivName, strImgTabLeft, strImgTabRight,true, 0, strLanguage);
		}
		else if(strCategoryChain == 'RMS')
		{
			if(strRMSUrl != 'NONE')
			{
				iFlag = 1;
				openemailwindow('RMS',strRMSUrl);
			}
		}
		TopMenuSubmitted = false;
		FnOnSelect();
	}
}
//End of Modification by BIPLAB on 04-04-2005 for dynamic left menus e.g. RMS,ENTERTAINMENT etc. against CRF/0002

function GetWeather()
{
	document.body.style.cursor= "wait";
	parent.window.document.forms[0].hidActivity.value = "render";
	parent.window.document.forms[0].hidResource.value = "WEATHERMAP";
	parent.window.document.forms[0].action = "frontcontroller.ech";
	parent.window.document.forms[0].target = "work";
	parent.window.document.forms[0].submit();
	document.body.style.cursor= "auto";
}

function GetServiceTopMenu(argLangID, strServiceID, strServiceTDID, strDivName, strImgLeft, strImgRight, strAppPath)
{	
	renderServiceTopMenu(argLangID,'SERVICE',strServiceID,strServiceID);
	FnOnSelectTopMenu(strServiceTDID, strDivName, strImgLeft, strImgRight, strAppPath);
}

function FnOnSelectTopMenu(argServiceTDID, strDivName, strImgLeft, strImgRight, strAppPath)
{
	var strServiceTDID = argServiceTDID;
	var objList = null;
	if(strServiceTDID != 'LEFT')
	{
		var strSelectNode = parent.window.document.childNodes[0].parentNode.frames[1].frames.frames[0].document.all;
		if((strSelectNode != null) && (strSelectNode.length>0))
		{
			for(var intCnt=0;intCnt<strSelectNode.length;intCnt++)
			{
				objList = strSelectNode[0].document.all[intCnt];
				if(objList.tagName == 'TD')
				{
					if(objList.style.backgroundColor == '#a69543')
					{
						objList.style.backgroundColor = '#fffbb2';
					}
				}
			}
		}
		objList = null;
		strSelectNode = null;
	
		var objNode = null;
		objNode = parent.window.document.childNodes[0].parentNode.frames[1].frames.frames[0].document.getElementById(strServiceTDID);
		if(objNode != null)
		{
			if(objNode.style.backgroundColor == '#fffbb2')
			{
				objNode.style.backgroundColor = '#a69543';
			}
		}
		objNode = null;
	}
	
	var objImgLeft  = null;
	var objImgRight = null;
	var objDiv		= null;
	var strImgName  = null;
	var objItem		= null;
	
	if(strServiceTDID != 'LEFT')
	{
		objItem = document.all;
	}
	else
	{
		objItem = parent.window.parent[0].document.all;
	}
	if(objItem != null)
	{
		for(var intCnt=0;intCnt<objItem.length;intCnt++)
		{
			if(objItem[intCnt].tagName == 'DIV')
			{
				if(strAppPath == '/')
				{
					objItem[intCnt].style.backgroundImage = 'url(/images/tab_body.jpg)';
				}
				else
				{
					objItem[intCnt].style.backgroundImage = 'url(' + strAppPath + '/images/tab_body.jpg)';
				}
			}

			strImgName  = objItem[intCnt].id;
			strImgName	= strImgName.substring(0, strImgName.length -1);
			
			if(objItem[intCnt].tagName == 'IMG' && strImgName == 'ImgTabLeft')
			{
				if(strAppPath == '/')
				{
					objItem[intCnt].src = '/images/tab_left.jpg';
				}
				else
				{
					objItem[intCnt].src = strAppPath + '/images/tab_left.jpg';
				}
				
			}
			if(objItem[intCnt].tagName == 'IMG' && strImgName == 'ImgTabRight')
			{
				if(strAppPath == '/')
				{
					objItem[intCnt].src = '/images/tab_right.jpg';
				}
				else
				{
					objItem[intCnt].src = strAppPath + '/images/tab_right.jpg';
				}
			}
		}
	}
	
	objItem		= null;
	strImgName	= null;
	
	if(strServiceTDID != 'LEFT')
	{
		objDiv = document.getElementById(strDivName);
	}
	else
	{
		objDiv = parent.window.parent[0].document.getElementById(strDivName);
	}
	
	if(objDiv != null)
	{
		if(objDiv.tagName == 'DIV' && objDiv.id == strDivName)
		{
			if(strAppPath == '/')
			{
				objDiv.style.backgroundImage = 'url(/images/roll_over_tab_body.jpg)';
			}
			else
			{
				objDiv.style.backgroundImage = 'url(' + strAppPath + '/images/roll_over_tab_body.jpg)';
			}
		}
	}

	if(strServiceTDID != 'LEFT')
	{
		objImgLeft = document.getElementById(strImgLeft);
	}
	else
	{
		objImgLeft = parent.window.parent[0].document.getElementById(strImgLeft);
	}
	if(objImgLeft != null)
	{
		if(objImgLeft.tagName == 'IMG' && objImgLeft.id == strImgLeft)
		{
			if(strAppPath == '/')
			{
				objImgLeft.src = '/images/roll_over_tab_left.jpg';
			}
			else
			{
				objImgLeft.src = strAppPath + '/images/roll_over_tab_left.jpg';
			}
		}
	}

	if(strServiceTDID != 'LEFT')
	{
		objImgRight = document.getElementById(strImgRight);
	}
	else
	{
		objImgRight = parent.window.parent[0].document.getElementById(strImgRight);
	}
	if(objImgRight != null)
	{
		if(objImgRight.tagName == 'IMG' && objImgRight.id == strImgRight)
		{
			if(strAppPath == '/')
			{			
				objImgRight.src = '/images/roll_over_tab_right.jpg';
			}
			else
			{
				objImgRight.src = strAppPath + '/images/roll_over_tab_right.jpg';
			}
		}
	}
	objDiv			= null;
	objImgLeft		= null;
	objImgRight     = null;
	strServiceTDID	= null;
}

function renderService(strLanguage, strResource, strCategory, strCategoryChain, argFromServiceMenu)
{	
	document.body.style.cursor="wait";
	var newarray = strCategoryChain.split('\\');
	for(var intCols=0;intCols <(newarray.length);intCols++)
	{	
		if (intCols == 1)
		{
			strResource='PRODUCTINFORMATION';
			if (newarray[intCols]=='MARKETINFORMATION')
			{
				strResource='MARKETINFORMATION';
			}									
			if (newarray[intCols]=='QUERIESDISCUSSION')
			{
				strResource = "QUERYDISCUSSION";
			}
			if (newarray[intCols]=='SUGGESTION')
			{
				strResource = "SUGGESTION";
			}
		}
		strCategory = newarray[intCols];
	}
	if(argFromServiceMenu == 1)
	{
		parent.window.document.forms[0].target = "";
		parent.window.document.forms[0].hidResource.value		= strResource;
		parent.window.document.forms[0].hidActivity.value		= "render";
		parent.window.document.forms[0].hidLanguage.value		= strLanguage;	
		parent.window.document.forms[0].hidCateGory.value		= strCategory;
		parent.window.document.forms[0].hidCateGoryChain.value	= strCategoryChain;
		parent.window.document.forms[0].action = "frontcontroller.ech";
		parent.window.document.forms[0].target= "work";		
		parent.window.document.forms[0].submit();
		document.body.style.cursor= "auto";
	}
	else
	{
		document.forms[0].target = "";
		document.forms[0].hidResource.value		= strResource;
		document.forms[0].hidActivity.value		= "render";
		document.forms[0].hidLanguage.value		= strLanguage;	
		document.forms[0].hidCateGory.value		= strCategory;	
		document.forms[0].hidCateGoryChain.value	= strCategoryChain;
		document.forms[0].action = "frontcontroller.ech";
		document.forms[0].target= "work";	
		document.forms[0].submit();
		document.body.style.cursor= "auto";
	}
}

function renderServiceTopMenu(strLanguage, strResource, strCategory, strCategoryChain)
{
	document.body.style.cursor="wait";
	var newarray = strCategoryChain.split('$');
	for(var intCols=0;intCols <(newarray.length);intCols++)
	{	
		if (intCols == 1)
		{
			strResource='PRODUCTINFORMATION';
			if (newarray[intCols]=='MARKETINFORMATION')
			{
				strResource='MARKETINFORMATION';
			}									
			if (newarray[intCols]=='QUERIESDISCUSSION')
			{
				strResource = "QUERYDISCUSSION";
			}
			if (newarray[intCols]=='SUGGESTION')
			{
				strResource = "SUGGESTION";
			}
		}
		strCategory = newarray[intCols];
	}
	document.forms[0].target					= "";
	document.forms[0].hidResource.value			= strResource;
	document.forms[0].hidActivity.value			= "render";
	document.forms[0].hidLanguage.value			= strLanguage;	
	document.forms[0].hidCateGory.value			= strCategory;	
	document.forms[0].hidCateGoryChain.value	= strCategoryChain;		
	document.forms[0].action					= "frontcontroller.ech";
	document.forms[0].target					= "work";
	document.forms[0].submit();
	document.body.style.cursor= "auto";
}

function fnServiceSubmit(argServiceCaption,argServiceName, argCatgChain,
						argDivName, argImgLeft, argImgRight, argTopMenuSubmitted, argFlag, argLang)
{
	document.body.style.cursor="wait";
	if(argTopMenuSubmitted == false && argFlag == 1)
	{
		parent.window.document.forms[0].hidResource.value = argServiceName;
		parent.window.document.forms[0].hidActivity.value = "SERVICE";
		parent.window.document.forms[0].hidTabID.value = argServiceCaption;
	
		parent.window.document.forms[0].target	= "toppanel";
		parent.window.document.forms[0].action	= "topmenu.aspx?Mock=1&Div=" + argDivName + "&ImgLeft=" + argImgLeft + "&ImgRight=" + argImgRight;
		parent.window.document.forms[0].submit();
		renderService(argLang,'SERVICE', argServiceName, argCatgChain, 1);
	}
	else if(argFlag == 1)
	{
		renderService(argLang,'SERVICE', argServiceName, argCatgChain, 1);
	}
	else if(argTopMenuSubmitted == true && argFlag == 0)
	{
		parent.window.document.forms[0].hidResource.value = argServiceName;
		parent.window.document.forms[0].hidActivity.value = "SERVICE";
		parent.window.document.forms[0].hidTabID.value = argServiceCaption;

		parent.window.document.forms[0].target	= "toppanel";
		parent.window.document.forms[0].action	= "topmenu.aspx?Mock=0&Div=" + argDivName + "&ImgLeft=" + argImgLeft + "&ImgRight=" + argImgRight;
		parent.window.document.forms[0].submit();
	}
	document.body.style.cursor="auto";	
}

function openemailwindow(strNewWindow, strUrl)
{
	if(Trim(strUrl).length <= 0)
	{
		return false;
	}
	var strWinUrl	=	strUrl.substring(strUrl.indexOf(".") + 1,(strUrl.length + 1));
	strWinUrl		=	strWinUrl.substring(0,strWinUrl.indexOf("."));
	var strWinName	=   "OneChoupalWindow";
	
	if (strNewWindow == "EMAIL")
	{
		document.forms[0].hidResource.value = 'ECHOUPALEMAIL';
		document.forms[0].hidUrl.value = strUrl;
		document.forms[0].target = "_blank";
		document.forms[0].hidActivity.value = 'ECHOUPALEMAIL';
		document.forms[0].action = "frontcontroller.ech";
		document.forms[0].submit();
	}
	else if (strNewWindow == "RMS")
	{
		var objHidResource = null;
		objHidResource = parent.window.document.getElementById("hidResource")
		if(objHidResource != null)
		{
			objHidResource.value = 'RMS';
		}
		objHidResource = null;
		
		var objhidUrl = null;
		objhidUrl = parent.window.document.getElementById("hidUrl")
		if(objhidUrl != null)
		{
			objhidUrl.value = strUrl;
		}
		objhidUrl = null;

		var objhidActivity = null;
		objhidActivity = parent.window.document.getElementById("hidActivity")
		if(objhidActivity != null)
		{
			objhidActivity.value = 'RMS';
		}
		objhidActivity = null;
	
		parent.window.document.forms[0].target = "_blank";
		parent.window.document.forms[0].action = "frontcontroller.ech";
		parent.window.document.forms[0].submit();
	}
}

function fn_ShowSearchImg(argFlag, argTooltip , argAppPath)
{
	if(argFlag == 0) 
	{
		StopTicker();
		if(argAppPath == '/')
		{
			document.forms[0].ImgSearch.src = '/images/search_up.jpg';
		}
		else
		{
			document.forms[0].ImgSearch.src = argAppPath + '/images/search_up.jpg';
		}
		ddrivetip(argTooltip,'yellow',50);
	}
	if(argFlag == 1) 
	{
		IncreaseSpeed();
		if(argAppPath == '/')
		{
			document.forms[0].ImgSearch.src = '/images/search.jpg';
		}
		else
		{
			document.forms[0].ImgSearch.src = argAppPath + '/images/search.jpg';
		}
		hideddrivetip();
	}
}

function fn_ShowEmailImg(argFlag, argTooltip , argAppPath)
{
	if(argFlag == 0) 
	{
		StopTicker();
		if(argAppPath == '/')
		{
			document.forms[0].ImgEmail.src = '/images/email_up.jpg';
		}
		else
		{
			document.forms[0].ImgEmail.src = argAppPath + '/images/email_up.jpg';
		}		
		ddrivetip(argTooltip,'yellow',50);
	}
	if(argFlag == 1) 
	{
		IncreaseSpeed();
		if(argAppPath == '/')
		{
			document.forms[0].ImgEmail.src = '/images/email.jpg';
		}
		else
		{
			document.forms[0].ImgEmail.src = argAppPath + '/images/email.jpg';
		}
		hideddrivetip();
	}
}

function fn_ShowPSWDImg(argFlag, argTooltip , argAppPath)
{
	if(argFlag == 0) 
	{
		StopTicker();
		if(argAppPath == '/')
		{
			document.forms[0].ImgPswd.src = '/images/change_password_up.jpg';
		}
		else
		{
			document.forms[0].ImgPswd.src = argAppPath + '/images/change_password_up.jpg';
		}
		ddrivetip(argTooltip,'yellow',50);
	}
	if(argFlag == 1) 
	{
		IncreaseSpeed();
		if(argAppPath == '/')
		{
			document.forms[0].ImgPswd.src = '/images/change_password.jpg';
		}
		else
		{
			document.forms[0].ImgPswd.src = argAppPath + '/images/change_password.jpg';
		}
		hideddrivetip();
	}
}

function fn_ShowLogOff(argFlag, argTooltip)
{
	if(argFlag == 0) 
	{
		StopTicker();
		ddrivetip(argTooltip,'yellow',50);
	}
	if(argFlag == 1) 
	{
		IncreaseSpeed();
		hideddrivetip();
	}
}
/**Partha - End ****************/


/** Aniruddha****************/
function SaveQuestion()
{	
	//document.frmAsqQuestion.BtnSendInfo.disable=true;	
	if (document.frmAsqQuestion.cmbCategory != null)
	{
		var strCatgList = document.frmAsqQuestion.cmbCategory.options(document.frmAsqQuestion.cmbCategory.selectedIndex).value;	
		if(strCatgList == 'None')
		{
			alert('Please select content category');
			document.frmAsqQuestion.cmbCategory.focus();
			document.body.style.cursor="auto";
			//document.frmAsqQuestion.BtnSendInfo.disable=false;
			document.frmAsqQuestion.BtnSendInfo.style.cursor="auto";
			return false;
		}						
	}	
	
	if(Trim(document.frmAsqQuestion.TxtQuestion.value).length <= 0)
	{
		alert("Please enter Question");
		document.frmAsqQuestion.TxtQuestion.focus();
		document.body.style.cursor="auto";
		//document.frmAsqQuestion.BtnSendInfo.disable=false;
		document.frmAsqQuestion.BtnSendInfo.style.cursor="auto";
		return false;
	}	
	
	if(Trim(document.frmAsqQuestion.TxtQuestion.value).length > 1000)
	{
		alert("Question text cannot exceed 1000 charecter");
		document.frmAsqQuestion.TxtQuestion.focus();
		document.body.style.cursor="auto";
		document.frmAsqQuestion.BtnSendInfo.disable=false;
		//document.frmAsqQuestion.BtnSendInfo.style.cursor="auto";
		return false;
	}
	document.frmAsqQuestion.hidResource.value		= "askquestion";
	document.frmAsqQuestion.hidActivity.value		= "saveadmincontent";
	document.frmAsqQuestion.BtnSendInfo.style.cursor="wait";
	document.frmAsqQuestion.submit();
	return true;
}

function SaveAdminAnswer()
{
	document.body.style.cursor="wait";
	if(Trim(document.frmAsqQuestion.TxtAnswer.value).length <= 0)
	{
		alert("Please enter answer");
		document.frmAsqQuestion.TxtAnswer.focus();
		document.body.style.cursor="auto";
		return false;
	}
		
	if(Trim(document.frmAsqQuestion.TxtAnswer.value).length > 1000)
	{
		alert("Question text cannot exceed 1000 charecter");
		document.frmAsqQuestion.TxtAnswer.focus();
		document.body.style.cursor="auto";
		return false;
	}
	document.frmAsqQuestion.hidResource.value		= "ADMINQUERYANSWER";// "QUESTIONANSWER";
	document.frmAsqQuestion.hidActivity.value		= "saveadmincontent";
	//document.frmAsqQuestion.action="PageRender/PageRender.aspx";
	document.frmAsqQuestion.submit();
	return true;
}
function CancelAnswer()
{
	document.frmAsqQuestion.hidResource.value		= "ADMINANSWER";// "QUESTIONANSWER";
	document.frmAsqQuestion.hidActivity.value		= "render";
	document.body.style.cursor="wait";
	document.frmAsqQuestion.submit();
}
/******************/

function ViewAllAnswer(strcontent,strtype)
{
//	window.open("RenderMaster/frmOldAnswer.aspx?Cid=" + strcontent + ",'OneChoupalWindow','toolbar=no,status=no,maximize=true,height=500,width=500,left=300,top=400');
	var argFileName ="";
	if(strtype == "FAQ")
	{
		argFileName = "frmOldAnswer.aspx?Cid=" + strcontent;
		window.open(argFileName,"eChoupal","status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,width=800,left=100,height=400");
	}
	else
	{
		argFileName = "frmAllAnswer.aspx?Cid=" + strcontent;
		window.open(argFileName,"eChoupal","status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,LEFT=50,TOP=190,width=850,height=400");
	}
}

function getQuestion(strLang)
{
	if(strLang=="")
	{
		alert("Please select a language");
	}
	else
	{
		document.body.style.cursor="wait";
		document.forms[0].hidLanguage.value=strLang;
		document.forms[0].hidResource.value="ADMINANSWER";
		document.forms[0].submit();
	}
}

/////**************Function for rendering CensusQuestion starts*****************
function renderCensusQuestion(strLanguage, strNewWindow, strResource,strTrgtGrup)
{
	document.forms[0].target = "";
	document.forms[0].hidResource.value		= strResource;
	document.forms[0].hidActivity.value		= "render";
	document.forms[0].hidLanguage.value		= strLanguage;	
	document.forms[0].hidTrgtGrup.value		= strTrgtGrup;	
	
	if (strNewWindow.toUpperCase() == "YES")
	{
		strResWin = window.open("../OnchWindow.aspx?hidResource=" + strResource + "&hidActivity=render&hidLanguage=" + strLanguage+ "&hidTrgtGrup=" + strTrgtGrup,"OneChoupalWindow","toolbar=no,status=no,maximize=null,height=700,width=800,left=200,top=10,scrollbars=yes");
		//self.close();
	}
	else
	{
		document.body.style.cursor="auto";
		document.forms[0].action = "frontcontroller.ech";
		document.forms[0].target= "work";
		document.body.style.cursor="wait";
		document.forms[0].submit();
	}
}

///*************CensusQuestion ends*********************

/////**************Function for rendering UserQuestion starts*****************
function renderNonRegUser(strLanguage, strNewWindow, strResource,strTrgtGrup)
{
	document.forms[0].target = "";
	document.forms[0].hidResource.value		= strResource;
	document.forms[0].hidActivity.value		= "render";
	document.forms[0].hidLanguage.value		= strLanguage;	
	document.forms[0].hidTrgtGrup.value		= strTrgtGrup;		
	if (strNewWindow.toUpperCase() == "YES")
	{
		strResWin = window.open("../OnchWindow.aspx?hidResource=" + strResource + "&hidActivity=render&hidLanguage=" + strLanguage+ "&hidTrgtGrup=" + strTrgtGrup,"OneChoupalWindow","toolbar=no,status=no,maximize=null,height=700,width=800,left=200,top=10,scrollbars=yes");
		//self.close();
	}
	else
	{
		document.body.style.cursor="wait";
		document.forms[0].action = "frontcontroller.ech";
		document.forms[0].target= "work";
		document.body.style.cursor="Wait";
		document.forms[0].submit();
	}
}

///*************UserQuestion ends*********************


////**************Function for rendering OpinionPoll starts*****************
function renderOpinionPoll(strLanguage,strNewWindow,strResource,strQuesId,strUserId)
{
	document.forms[0].target = "";
	document.forms[0].hidResource.value		= strResource;
	document.forms[0].hidActivity.value		= "render";
	document.forms[0].hidLanguage.value		= strLanguage;	
	document.forms[0].hidQuesId.value			= strQuesId;	
	document.forms[0].hidUserId.value			= strUserId;	
	if (strNewWindow.toUpperCase() == "YES")
	{
		//strResWin = window.open("OnchWindow.aspx?hidResource=" + strResource + "&hidActivity=render&hidLanguage=" + strLanguage+ "&hidQuesId=" + strQuesId,"OneChoupalWindow","toolbar=no,status=no,maximize=null,height=700,width=800,left=200,top=10,scrollbars=yes");
		strResWin = window.open("../OnchWindow.aspx?hidResource=" + strResource + "&hidActivity=render&hidLanguage=" + strLanguage+ "&hidQuesId=" + strQuesId+ "&hidUserId=" + strUserId,"OneChoupalWindow","toolbar=no,status=no,maximize=null,height=700,width=800,left=200,top=10,scrollbars=yes");
	}
	else
	{
		document.forms[0].action = "frontcontroller.ech";
		document.forms[0].target= "work";
		document.forms[0].submit();
	}
}

///*************OpinionPoll ends*********************

function Trim(value_to_be_trimmed)
{
	while(true)
	{
		i=value_to_be_trimmed.length;
		j=value_to_be_trimmed.lastIndexOf(' ');
		if(j==-1)
		{
			break;
		}
		else
		{
			j=j+1;
			if(j!=i)
			{
				break;
			}
			else
			{
				value_to_be_trimmed=value_to_be_trimmed.substring(0,j-1);
			}
		}
	}

	while(true)
	{
		j=value_to_be_trimmed.indexOf(' ');
		if(j==0)
		{
			value_to_be_trimmed=value_to_be_trimmed.substring(1,value_to_be_trimmed.length);
		}
		else
		{
			break;
		}
	}
	return value_to_be_trimmed;

}
function eChoupalWindow(strNewWindow, strUrl)
{
	var strWinUrl	=	strUrl.substring(strUrl.indexOf(".") + 1,(strUrl.length + 1));
	strWinUrl		=	strWinUrl.substring(0,strWinUrl.indexOf("."));
	var strWinName	= "OneChoupalWindow";
	document.body.style.cursor="auto";
	if (strNewWindow == "Yes")
	{
		// goes through frontcontroller
		if(document.getElementById("hidUrl") != null)
		{
			document.forms[0].hidResource.value = 'USELINK';
			document.forms[0].hidUrl.value = strUrl;
			document.forms[0].target = "_blank";
			document.forms[0].hidActivity.value = 'USELINK';
			document.forms[0].action = "frontcontroller.ech";
			document.forms[0].submit();
		}
		// directly opening a page with openwindow
		// if siteusage required then this
		// else block must be commented and 
		// if block with "goes through frontcontroller"
		// should be used but in those page 
		// there should be one hidden variable hidUrl used.
		else
		{
			var newwin = window.open(strUrl,"eChoupal","status=yes,toolbar=yes,menubar=yes,location=yes,scrollbars=yes,width=800,left=100,height=400");
		}
	}
	else
	{
		document.forms[0].target = "work";
		document.forms[0].action = strUrl;
		document.forms[0].method = "Get";		
		document.forms[0].submit();
	}
}
//added by Biplab on 08/12/2006 for advertisement capture in site usage
function eChoupalAdvtsWindow(strNewWindow, strUrl,advertCnt)
{
	var strWinUrl	=	strUrl.substring(strUrl.indexOf(".") + 1,(strUrl.length + 1));
	strWinUrl		=	strWinUrl.substring(0,strWinUrl.indexOf("."));
	var strWinName	= "OneChoupalWindow";
	document.body.style.cursor="auto";
	if (strNewWindow == "Yes")
	{
		// goes through frontcontroller
		if(document.getElementById("hidUrl") != null)
		{
			document.forms[0].hidResource.value = 'ADVERTISELINK  '+advertCnt;
			document.forms[0].hidUrl.value = strUrl;
			document.forms[0].target = "_blank";
			document.forms[0].hidActivity.value = 'USELINK';
			document.forms[0].action = "frontcontroller.ech";
			document.forms[0].submit();
		}
		else
		{
			var newwin = window.open(strUrl,"eChoupal","status=yes,toolbar=yes,menubar=yes,location=yes,scrollbars=yes,width=800,left=100,height=400");
		}
	}
	else
	{
		document.forms[0].target = "work";
		document.forms[0].action = strUrl;
		document.forms[0].method = "Get";		
		document.forms[0].submit();
	}
}
//end of advertisement capture
function validateEmail(strval)
{  
	
	if (strval.charAt(0)=="" && strval.charAt(1)=="" && strval.charAt(2)=="" && strval.charAt(3)=="")
	{
	    return(false);
	}
	
	var pos=strval.indexOf('@',0);
	var pos1=strval.lastIndexOf('@',strval.length);

	if (pos!=pos1||strval.charAt(pos+1)=="."||strval.charAt(pos1+1)==".")
	{
		return (false);
	}
	
	if (strval.indexOf('@', 0) == -1 || strval.indexOf('.', 0) == -1)
	{
	    return (false);
	}

	if (strval.charAt(0)=="."||strval.charAt(0)=="@"||strval.charAt(strval.length-1)=="."||strval.charAt(strval.length-1)=="@")
	{
	    return(false);
	}
	
	for(var i=0;i<strval.length;i++)
	{
		if(isNaN(strval.charAt(i)))
		{
		   if ((!(strval.charCodeAt(i)>=97&&strval.charCodeAt(i)<=122))&&(!(strval.charCodeAt(i)>=65&&strval.charCodeAt(i)<=90))&&(strval.charCodeAt(i)!=45)&&(strval.charCodeAt(i)!=64)&&(strval.charCodeAt(i)!=46)&&(strval.charAt(i)!="_"))
		   {
			return(false);
		    }
		}
	}
}

function sendInfo(strMsg)
{
	document.forms[0].hidResource.value		= "contactUs";
	document.forms[0].hidActivity.value		= "mail";
	document.forms[0].action = "frontcontroller.ech";
	document.body.style.cursor="wait";	
	if(Trim(document.forms[0].TxtFirstName.value).length <= 0)
	{
		//alert("Please enter your first name");
		alert(getMsgDesc(strMsg, "MSG003"));
		document.forms[0].TxtFirstName.focus();
		document.body.style.cursor="auto";
		return false;
	}
	if(Trim(document.forms[0].TxtLastName.value).length <= 0)
	{
		//alert("Please enter your last name");				
		alert(getMsgDesc(strMsg, "MSG004"));
		document.forms[0].TxtLastName.focus();
		document.body.style.cursor="auto";
		return false;
	}
	if(Trim(document.forms[0].TxtEmail.value).length <= 0)
	{
		//alert("Please enter your email");
		alert(getMsgDesc(strMsg, "MSG005"));
		document.forms[0].TxtEmail.focus();
		document.body.style.cursor="auto";
		return false;
	}
	
	// check date of birth
		sysdate_check = true;
		var sysdate = document.forms[0].hidSysdate.value;
		var arr_app;
		var arr_sys;
		arr_app = new Array();
		arr_sys = new Array();
		arr_sys = sysdate.split("/");//Currrent date
if ((document.forms[0].TxtDob.value != null) &&
	(document.forms[0].TxtDob.value != ""))
	{
		arr_app = document.forms[0].TxtDob.value.split("/");		
		if(parseInt(arr_app[2].toString(),10) > parseInt(arr_sys[2].toString(),10))
		{
			alert("Date of birth cannot be greater than current date");
			document.body.style.cursor="auto";
			return false;
		}

		if(parseInt(arr_app[2].toString(),10) == parseInt(arr_sys[2].toString(),10))
		{
			if(parseInt(arr_app[1].toString(),10) > parseInt(arr_sys[1].toString(),10))
			{
				alert("Date of birth cannot be greater than current date");
				document.body.style.cursor="auto";
				return false;
			}
			else
			{
				if(parseInt(arr_app[1].toString(),10) == parseInt(arr_sys[1].toString(),10))
				{
					if(parseInt(arr_app[0].toString(),10) > parseInt(arr_sys[0].toString(),10))								
					{
						alert("Date of birth cannot be greater than current date ");
						document.body.style.cursor="auto";
						return false;
					}
				}
			}
		}
}
	// end
	//if(Trim(document.forms[0].TxtDob.value).length <= 0)
	//{
	//	alert("Please enter your date of birth");
	//	document.forms[0].TxtDob.focus();
	//	return false;
	//}	
	
	
	
	if(Trim(document.forms[0].TxtComment.value).length <= 0)
	{
		//alert("Please enter your Comment");
		alert(getMsgDesc(strMsg, "MSG006"));
		document.forms[0].TxtComment.focus();
		document.body.style.cursor="auto";
		return false;
	}
	if(validateEmail(Trim(document.forms[0].TxtEmail.value)) == false)	
	{
		//alert("Please enter a valid email address");
		alert(getMsgDesc(strMsg, "MSG007"));
		document.forms[0].TxtEmail.focus();
		document.body.style.cursor="auto";
		return false;
	}
	document.forms[0].submit();
	
}
/*** kousik *****/
function renderResourceMaster(strLanguage, strNewWindow, strResource)
{
	document.forms[0].target = "";
	document.forms[0].hidResource.value		= strResource;
	document.forms[0].hidActivity.value		= "render";
	document.forms[0].hidLanguage.value		= strLanguage;	
	document.body.style.cursor="wait";
	if (strNewWindow.toUpperCase() == "YES")
	{
		strResWin = window.open("../OnchWindow.aspx?hidResource=" + strResource + "&hidActivity=render&hidLanguage=" + strLanguage,"OneChoupalWindow","toolbar=no,status=no,maximize=null,height=700,width=800,left=200,top=10,scrollbars=yes");
		
	}
	else
	{
		document.forms[0].action = "frontcontroller.ech";
		document.forms[0].target= "work";
		document.forms[0].submit();
	}
	
	/*document.forms[0].action = "frontcontroller.ech";
	if (strNewWindow == "Yes")
	{
		document.forms[0].target = "_blank";	
	}
	document.forms[0].submit();
	*/
	
}
/*** kousik *****/

function renderResource(strLanguage, strNewWindow, strResource)
{
	document.forms[0].target = "";
	document.forms[0].hidResource.value		= strResource;
	document.forms[0].hidActivity.value		= "render";
	document.forms[0].hidLanguage.value		= strLanguage;	
	
	if (strNewWindow.toUpperCase() == "YES")
	{
		strResWin = window.open("OnchWindow.aspx?hidResource=" + strResource + "&hidActivity=render&hidLanguage=" + strLanguage,"OneChoupalWindow","toolbar=no,status=no,maximize=null,height=700,width=800,left=200,top=10,scrollbars=yes");		
	}
	else
	{
	/*SANNONUSG is added by kushal on 8/2/2006*/
		if(strResource == 'APPROVALCHAINAUDT' ||strResource == 'CONTCATGMASTERAUDT' 
							|| strResource == 'CONTCATGACCESSAUDT' || strResource == 'LINKPRODSERVAUDT' 
							|| strResource == 'TRGTGRUPAUDT' || strResource == 'USERAUDT'
							|| strResource.toUpperCase() == 'CATGACSSREPORT'
							|| strResource.toUpperCase() == 'SITEUSAGEREPORT'
							|| strResource.toUpperCase() == 'SITELOGREPORT'
							|| strResource.toUpperCase() == 'SANNONUSG')
		{
			GetHtmlHiddenObject('hidSession');
		}	
		parent.window.frames[2].document.body.style.cursor="wait";
		document.forms[0].action = "frontcontroller.ech";
		document.forms[0].target= "work";
		document.forms[0].submit();
	}
}

function GetHtmlHiddenObject(argObjName)
{
	var ObjHidEle = document.getElementById(argObjName);
	if(ObjHidEle != null)
	{
		ObjHidEle.value = '0';
	}
	ObjHidEle = null;
}

function renderServiceResource(strLanguage, strNewWindow, strResource, strService, strRecID)
{
	document.forms[0].target = "";
	document.forms[0].hidResource.value		= strResource;
	document.forms[0].hidActivity.value		= "render";
	document.forms[0].hidLanguage.value		= strLanguage;	
	document.forms[0].hidService.value		= strService;	
	document.forms[0].hidRecID.value		= strRecID;		
	if (strNewWindow.toUpperCase() == "YES")
	{
		strResWin = window.open("OnchWindow.aspx?hidResource=" + strResource + "&hidActivity=render&hidLanguage=" + strLanguage,"OneChoupalWindow","toolbar=no,status=no,maximize=null,height=700,width=800,left=200,top=10,scrollbars=yes");
		
	}
	else
	{
		parent.window.frames[2].document.body.style.cursor="wait";
		document.forms[0].action = "frontcontroller.ech";
		document.forms[0].target= "work";
		document.forms[0].submit();
	}
}

function OpenFileLink(strNewWindow,strFileName,strSubject)
{	
	document.forms[0].target = "";
	document.forms[0].hidResource.value		= strFileName + "~" + strSubject;
	document.forms[0].hidActivity.value		= "Attachment";
	document.forms[0].action				= "frontcontroller.ech";
	document.body.style.cursor="wait";
	if (strNewWindow == "Yes")
	{
		document.forms[0].target = "_blank";	
	}
	document.forms[0].submit();
}

function OpenAttachment(strNewWindow,strFileName, strContID)
{	
	document.forms[0].target = "";
	document.forms[0].hidResource.value		= strFileName;
	document.forms[0].hidActivity.value		= "ViewAttachment";
	document.forms[0].hidRecID.value		= strContID;
	document.forms[0].action				= "frontcontroller.ech";
	document.body.style.cursor="wait";
	if (strNewWindow == "Yes")
	{
		document.forms[0].target = "_blank";	
	}
	document.forms[0].submit();
}

function OpenFileLinkByChannelID(strNewWindow,strFileName,strContID)
{	
	document.forms[0].target = "";
	document.forms[0].hidResource.value		= strFileName + "~" + strContID;
	document.forms[0].hidActivity.value		= "Attachment";
	document.forms[0].action				= "frontcontroller.ech";
	document.body.style.cursor="wait";
	if (strNewWindow == "Yes")
	{
		document.forms[0].target = "_blank";	
	}
	document.forms[0].submit();
}

function onMouseOut(strTDid, tdCol)
{
	var str1;
	str1 = strTDid;
	str1 += ".style.backgroundColor = '"+tdCol;
	str1 += "'";
	eval(str1);
}
function onMouseOver(strTbl)
{
	var strtblid;
	strtblid = strTbl;
	strtblid += ".style.display = '';"; 	
	eval(strtblid);	
	
}
function colChange(strTDid, tdCol)
{
	var str2;
	str2 = strTDid;
	str2 += ".style.backgroundColor= '"+tdCol;
	str2 += "'";
	eval(str2);
}

function TabVisout(strTbl)
{
	var str3;
	str3 = strTbl;
	str3 += ".style.display = 'none';"; 	
	//alert(str3);
	eval(str3);	
}	

function ModalWin(strTextBoxName)
{
	var str1 = '';
	str1 = window.showModalDialog("calender.htm",str1,"dialogWidth:210px; dialogHeight: 210px;");
	
	if (str1 == null)
		{
			alert("Please enter a valid date");
		}
	else
		{
			strForm =  "document.forms[0]." + strTextBoxName;
			eval(strForm).value = str1;		
		}
}

function ModalWinTwo(strTextBoxName)
{
	
	var str1 = '';
	str1 = window.showModalDialog("calender.htm",str1,"dialogWidth:210px; dialogHeight: 210px;");
	var str2= eval("document.forms[0]." + strTextBoxName).value;
	//alert( str2);
	var Datearr = str1.toString().split("/");
		
		var selDate=new Date(Datearr[2],Datearr[1]-1,Datearr[0]);
		var entDate=Datearr[2]+Datearr[1]+Datearr[0];
		
	    var sysDate=new Date();
		var  strdt	= "";
		
	strdt += sysDate.getDate() + "/";                   //Get day
    strdt += (sysDate.getMonth() + 1) + "/";            //Get month
    strdt += sysDate.getYear();                         //Get year.
	var  strdte				= new Array();
	var strdte =strdt.split("/");
	//alert(sdte[1]);
	if (strdte[1].length==1)
	{strdte[1]= "0"+strdte[1];
	}
	var strdate= strdte[2] +strdte[1] + strdte[0] ;
		
		if(parseInt(entDate,10) < parseInt(strdate,10)) 
		{
			alert("Date selected should be greater than OR equal to today");
			//document.opinionpollentry.StartDate.value='';
			//document.opinionpollentry.StartDate.focus();
			return;
		}	
		/*else
		{
			valistartdate_flag=true;
		}*/
		
	
	if (str1 == null)
		{
			alert("Please enter a valid date");
		}
	else
		{
			strForm =  "document.forms[0]." + strTextBoxName;
			eval(strForm).value = str1;		
		}
}

function calChar()
{
	//document.form[0].name = "contact";
	maxChar = 1200;
	charleft=0;
	document.forms[0].TxtMaxChar.value = maxChar;
	
	if (document.forms[0].TxtComment.value.length > maxChar) { 
	        document.forms[0].TxtComment.value = document.forms[0].TxtComment.value.substring(0,maxChar)
		charleft = 0
		clipped = true
        } 
        else 
        {
			charleft = maxChar - document.forms[0].TxtComment.value.length
		}
        document.forms[0].TxtMaxChar.value = charleft;
}
function sendPressClippingsFeedBack(strNewWindow)
{
	document.body.style.cursor="wait";
	if(Trim(document.forms[0].TxtFirstName.value).length <= 0)
	{
		alert("Please enter your first name");
		document.forms[0].TxtFirstName.focus();
		document.body.style.cursor="auto";
		return false;
	}
	if(Trim(document.forms[0].TxtLastName.value).length <= 0)
	{
		alert("Please enter your last name");
		document.forms[0].TxtLastName.focus();
		document.body.style.cursor="auto";
		return false;
	}
	if(Trim(document.forms[0].TxtEmail.value).length <= 0)
	{
		alert("Please enter your email");
		document.forms[0].TxtEmail.focus();
		document.body.style.cursor="auto";
		return false;
	}
	else
	{
		if(validateEmail(Trim(document.forms[0].TxtEmail.value)) == false)	
		{
			alert("Please enter a valid email address");
			document.forms[0].TxtEmail.focus();
			document.body.style.cursor="auto";
			return false;
		}
	}
	if(Trim(document.forms[0].TxtComment.value).length <= 0)
	{
		alert("Please enter your Comment");
		document.forms[0].TxtComment.focus();
		document.body.style.cursor="auto";
		return false;
	}	
	
	document.forms[0].hidResource.value		= "Feedback";
	document.forms[0].hidActivity.value		= "mail";
	document.forms[0].hidNewWindow.value	= strNewWindow;
	
	document.forms[0].action = "frontcontroller.ech";	
	document.forms[0].submit();	
}

function sendFeedBack(strMsg)
{
	document.forms[0].hidResource.value		= "RegFeedback";
	document.forms[0].hidActivity.value		= "mail";
	document.forms[0].action = "frontcontroller.ech";
	document.body.style.cursor="wait";
		
	if(Trim(document.forms[0].TxtComment.value).length <= 0)
	{
		//alert("Please enter your Comment");
		alert(getMsgDesc(strMsg, "MSG013"));
		document.body.style.cursor="auto";		
		return false;
	}	
	document.forms[0].submit();
}

function CloseWindow()
{
	window.close();
}

function GoPreviousWindow()
{
	window.close();
}

function RenderMainPage(strLanguage)
{
	document.forms[0].hidResource.value		= "";
	document.forms[0].hidActivity.value		= "";
	document.forms[0].hidLanguage.value		= strLanguage;
	
	document.forms[0].target				= "DefaultTop";
	document.forms[0].action				= "DefaultTop.aspx";
	document.body.style.cursor="wait";	
	document.forms[0].submit();	
		
	document.forms[0].target				= "DefaultWork";
	document.forms[0].action				= "DefaultWorkarea.aspx";	
	document.body.style.cursor="wait";
	document.forms[0].submit();	
	
	document.forms[0].target				= "DefaultBottom";
	document.forms[0].action				= "DefaultBottom.aspx";	
	document.body.style.cursor="wait";
	document.forms[0].submit();		
}

function closeChilds()
{
	if(strITCWin != null)
	{
		if(strITCWin.open || !strITCWin.closed)
		{
			strITCWin.close();
		}
	}
	if(strResWin != null)
	{
		if(strResWin.open || !strResWin.closed)
		{
			strResWin.close();
		}
	}
	if(strPopupWindow != null)
	{
		if(strPopupWindow.open || !strPopupWindow.closed)
		{
			strPopupWindow.close();			
		}
	}
	if(strOpinionPollWindow != null)
	{
		if(strOpinionPollWindow.open || !strOpinionPollWindow.closed)
		{
			strOpinionPollWindow.close();			
		}
	}	
}


function fnCheckDate(Datearr)
{
	Datearr = Datearr.split("/");
	var selDate=new Date(); // added
	var curDate	= new Date();
	var iDate = 0;
	var iMonth = 0;
	var iYear = 0;
	var lCurDateinMIllis = 0
	var lTodayDateinMIllis = 0
	iDate = parseInt(Datearr[0],10);
	iMonth = parseInt(Datearr[1],10);
	iYear = parseInt(Datearr[2],10);
	if (iDate > 0 && iMonth >= 0 && iYear > 0)
	{
		selDate.setYear(iYear);
		selDate.setMonth(iMonth -1 );
		selDate.setUTCDate(iDate);	
				
		lCurDateinMIllis = selDate.getTime();
		lTodayDateinMIllis = curDate.getTime();
		if ( lCurDateinMIllis < lTodayDateinMIllis )
		{
			alert("Date selected should be greater than or equal to today");
			return false;
		}
	}
	else
	{
		alert("Invalid date");
		return false;
	}	
} //end function


/*function fnCheckDate(Datearr)
{
	Datearr = Datearr.split("/");
	var selDate=new Date(Datearr[2],Datearr[1]-1,Datearr[0]);
	var entDate=Datearr[2]+Datearr[1]+Datearr[0];
	var sysDate=new Date();
	var  strdt	= "";
		
	strdt += sysDate.getDate() + "/";                   //Get day
    strdt += (sysDate.getMonth() + 1) + "/";            //Get month
    strdt += sysDate.getYear();                         //Get year.
	var  strdte				= new Array();
	var strdte =strdt.split("/");
	//alert(sdte[1]);
	if (strdte[1].length==1)
	{strdte[1]= "0"+strdte[1];
	}
	var strdate= strdte[2] +strdte[1] + strdte[0] ;
		
	if(parseInt(entDate) < parseInt(strdate)) 
	{
		alert("Date selected should be greater than OR equal to today");
		return false;
	}				
} //end function*/

function checkUniqueFields(strColFirst,objVal)
{
	var  strColFirstArry = new Array();
	var strColFirstArry =strColFirst.split("~");
	var strColFirstArryLen=strColFirstArry.length-1;		
	for(var i=0;i<=strColFirstArryLen-1;i++)
	{
		var iIndex=strColFirstArry[i].toUpperCase().indexOf(objVal.toUpperCase());					
		if (iIndex >-1)
		{
			alert("Static content location already exists");
			return false;				
		}
	}
	return true;
}

function SaveUseFullLinkAdminContent()
{
	var intIndex = 0;
	document.body.style.cursor="wait";
	if (document.frmadmindlg.cmbLanguage != null)
	{
		intIndex = document.frmadmindlg.cmbLanguage.selectedIndex;
		if (intIndex == -1)
		{
			alert("Please Select Language");
			document.frmadmindlg.cmbLanguage.focus();
			document.body.style.cursor="auto";
			return false;
		}
	}	
	if(Trim(document.frmadmindlg.S_CONT_CAPTION.value).length <= 0)
	{
		alert("Please enter content description");
		document.frmadmindlg.S_CONT_CAPTION.focus();
		document.body.style.cursor="auto";
		return false;
	}	
	if ((document.frmadmindlg.S_CONT_CAPTION.value.indexOf("<") > -1 ) ||
		(document.frmadmindlg.S_CONT_CAPTION.value.indexOf(">") > -1 ) ||
		(document.frmadmindlg.S_CONT_CAPTION.value.indexOf("\\") > -1 ))
	{
		alert(unescape('Content you have entered contains which are suspect. Please copy the contents in a text editor and remove the characters \< or \> or \\'));				
		document.frmadmindlg.S_CONT_CAPTION.focus();
		document.body.style.cursor="auto";
		return false;
	}
	
	var strCatgList = document.frmadmindlg.S_DISP_CATG_ID.options(document.frmadmindlg.S_DISP_CATG_ID.selectedIndex).value;	
	if(strCatgList == 'None')
	{
		alert('Please select location');
		document.frmadmindlg.S_DISP_CATG_ID.focus();
		document.body.style.cursor="auto";
		return false;
	}	
	if(Trim(document.frmadmindlg.S_CONT_TEXT.value).length <= 0)
	{
		alert("Please enter content text");
		document.frmadmindlg.S_CONT_TEXT.focus();
		document.body.style.cursor="auto";
		return false;
	}
	if ((document.frmadmindlg.S_CONT_TEXT.value.indexOf("<")>-1) ||
		(document.frmadmindlg.S_CONT_TEXT.value.indexOf(">") > -1) || 
		(document.frmadmindlg.S_CONT_TEXT.value.indexOf("\\") > -1))	
	{
		alert(unescape('Content you have entered contains which are suspect. Please copy the contents in a text editor and remove the characters \< or \> or \\'));				
		document.frmadmindlg.S_CONT_TEXT.focus();
		document.body.style.cursor="auto";
		return false;
	}	
	
	if ((document.frmadmindlg.B_ON_CLIC_URL==null) &&		
	   (Trim(document.frmadmindlg.S_ON_CLIC_VALU.value).length > 0))
	{	
		if (checkUniqueFields(document.frmadmindlg.hidTempDtl.value,document.frmadmindlg.S_ON_CLIC_VALU.value+"`"+document.frmadmindlg.hidLanguage.value) == false) 
		{
			document.frmadmindlg.S_ON_CLIC_VALU.focus();
			document.body.style.cursor="auto";
			return false;
		}
	}
	
	if ((document.frmadmindlg.B_ON_CLIC_URL.checked==false) &&
	   (Trim(document.frmadmindlg.S_ON_CLIC_VALU.value).length > 0))
	{	
		if (checkUniqueFields(document.frmadmindlg.hidTempDtl.value,document.frmadmindlg.S_ON_CLIC_VALU.value+"`"+document.frmadmindlg.hidLanguage.value) == false) 
		{
			document.frmadmindlg.S_ON_CLIC_VALU.focus();
			document.body.style.cursor="auto";
			return false;
		}
	}
	
	var Tableid= "ControlChildTable";
	var strTable	= document.getElementById(Tableid);
	var intLastRow	= strTable.rows.length;	
	
	if (intLastRow == 0)
	{
		if(Trim(document.frmadmindlg.S_ON_CLIC_VALU.value).length <= 0)
		{
			if (document.frmadmindlg.B_ON_CLIC_URL.checked==false) 
			{
				alert("Please enter static content location");
			}
			else
			{
				alert("Please enter URL");
			}
			document.frmadmindlg.S_ON_CLIC_VALU.focus();
			document.body.style.cursor="auto";
			return false;
		}
		if ((document.frmadmindlg.S_ON_CLIC_VALU.value.indexOf("<") > -1 ) ||
		(document.frmadmindlg.S_ON_CLIC_VALU.value.indexOf(">") > -1 ) ||
		(document.frmadmindlg.S_ON_CLIC_VALU.value.indexOf("\\") > -1 ))
		{
			alert(unescape('Content you have entered contains which are suspect. Please copy the contents in a text editor and remove the characters \< or \> or \\'));				
			document.frmadmindlg.S_ON_CLIC_VALU.focus();
			document.body.style.cursor="auto";
			return false;
		}
	}
	
	if(Trim(document.frmadmindlg.D_EFCT_FROM.value).length <= 0)
	{
		alert("Please enter effective from ");
		document.frmadmindlg.D_EFCT_FROM.focus();
		document.body.style.cursor="auto";
		return false;
	}
	if (fnCheckDate(Trim(document.frmadmindlg.D_EFCT_FROM.value))== false)
	{
		document.frmadmindlg.D_EFCT_FROM.value='';
		document.frmadmindlg.D_EFCT_FROM.focus();
		document.body.style.cursor="auto";
		return false;	
	}
	
	if(Trim(document.frmadmindlg.I_CONT_ORDR.value).length <= 0)
	{
		alert("Please enter order");
		document.frmadmindlg.I_CONT_ORDR.focus();
		document.body.style.cursor="auto";
		return false;
	}
	
	intIndex = Trim(document.frmadmindlg.I_CONT_ORDR.value);
	if (isNaN(intIndex))
	{
		alert("Please enter valid order");
		document.frmadmindlg.I_CONT_ORDR.focus();
		document.body.style.cursor="auto";
		return false;
	}
		
	if (intIndex<=0)
	{
		alert("Please enter positive integer value");
		document.frmadmindlg.I_CONT_ORDR.focus();
		document.body.style.cursor="auto";
		return false;
	}

	for(var i=0;i<intLastRow;i++)
	{
		var TxtBoxMenu = "document.frmadmindlg.txtMenuName"+i+".value";
		TxtBoxMenu = eval(TxtBoxMenu);		
		TxtBoxURL = "document.frmadmindlg.txtURL"+i+".value";
		TxtBoxURL = eval(TxtBoxURL);		
			
		if ((Trim(TxtBoxMenu).length <= 0) && (Trim(TxtBoxURL).length > 0))
		{
			alert("Please enter menu name");
			TxtBoxMenu = "document.frmadmindlg.txtMenuName"+i+".focus()";
			eval(TxtBoxMenu);		
			document.body.style.cursor="auto";			
			return false;			
		}
		if ((TxtBoxMenu.indexOf("<") > -1 ) ||
			(TxtBoxMenu.indexOf(">") > -1 ) ||
			(TxtBoxMenu.indexOf("\\") > -1 ))
		{
			alert(unescape('Content you have entered contains which are suspect. Please copy the contents in a text editor and remove the characters \< or \> or \\'));				
			TxtBoxMenu = "document.frmadmindlg.txtMenuName"+i+".focus()";
			eval(TxtBoxMenu);	
			document.body.style.cursor="auto";
			return false;
		}
		var chkValidURL = "document.frmadmindlg.chkURL"+i+".checked";
		chkValidURL = eval(chkValidURL);
		if ((Trim(TxtBoxMenu).length > 0) && (Trim(TxtBoxURL).length <= 0))
		{				
			if (chkValidURL==false)
			{
				alert("Please enter static content location");
			}
			else
			{
				alert("Please enter URL");
			}
			TxtBoxURL = "document.frmadmindlg.txtURL"+i+".focus()";
			eval(TxtBoxURL);	
			document.body.style.cursor="auto";				
			return false;
		}	
		if ((TxtBoxURL.indexOf("<") > -1 ) ||
			(TxtBoxURL.indexOf(">") > -1 ) ||
			(TxtBoxURL.indexOf("\\") > -1 ))
		{
			alert(unescape('Content you have entered contains which are suspect. Please copy the contents in a text editor and remove the characters \< or \> or \\'));				
			TxtBoxURL = "document.frmadmindlg.txtURL"+i+".focus()";
			eval(TxtBoxURL);		
			document.body.style.cursor="auto";			
			return false;
		}
		if (chkValidURL==false)
		{
			if (Trim(TxtBoxURL).length > 0)
			{	
				if (checkUniqueFields(document.frmadmindlg.hidTempDtl.value,TxtBoxURL+"`"+document.frmadmindlg.hidLanguage.value) == false) 
				{
					TxtBoxURL = "document.frmadmindlg.txtURL"+i+".focus()";
					eval(TxtBoxURL);
					document.body.style.cursor="auto";
					return false;
				}
			}
		}	
	}
	
	document.frmadmindlg.style.cursor="Wait";		
	
	if (document.frmadmindlg.btn9 != null)
	{
		document.frmadmindlg.btn9.disabled=true 
	}
	if (document.frmadmindlg.btn10 != null)
	{
		document.frmadmindlg.btn10.disabled=true 
	}
	if (document.frmadmindlg.btn11 != null)
	{
		document.frmadmindlg.btn11.disabled=true 
	}
	if (document.frmadmindlg.btn12 != null)
	{
		document.frmadmindlg.btn12.disabled=true 
	}
	
	
	document.frmadmindlg.hidResource.value		= "usefullinks";
	document.frmadmindlg.hidActivity.value		= "saveadmincontent";
	document.frmadmindlg.submit();
	return true;
}

function SaveStaticTextAdminContent()
{
	var intIndex = 0;
	document.body.style.cursor="wait";
	if (document.frmadmindlg.cmbLanguage != null)
	{
		intIndex = document.frmadmindlg.cmbLanguage.selectedIndex;
		if (intIndex == -1)
		{
			alert("Please select language");
			document.frmadmindlg.cmbLanguage.focus();
			document.body.style.cursor="auto";
			return false;
		}
	}
	
	intIndex = document.frmadmindlg.S_DISP_CATG_ID.selectedIndex;
	if (intIndex == -1)
	{
		alert("Please select location");
		document.frmadmindlg.S_DISP_CATG_ID.focus();
		document.body.style.cursor="auto";
		return false
	}	
	
	if(Trim(document.frmadmindlg.S_CONT_CAPTION.value).length <= 0)
	{
		alert("Please enter content description");
		document.frmadmindlg.S_CONT_CAPTION.focus();
		document.body.style.cursor="auto";
		return false;
	}
	if ((document.frmadmindlg.S_CONT_CAPTION.value.indexOf("<") > -1 ) ||
		(document.frmadmindlg.S_CONT_CAPTION.value.indexOf(">") > -1 ) ||
		(document.frmadmindlg.S_CONT_CAPTION.value.indexOf("\\") > -1 ))
	{
		alert(unescape('Content you have entered contains which are suspect. Please copy the contents in a text editor and remove the characters \< or \> or \\'));				
		document.frmadmindlg.S_CONT_CAPTION.focus();
		document.body.style.cursor="auto";
		return false;
	}
	var strCatgList = document.frmadmindlg.S_DISP_CATG_ID.options(document.frmadmindlg.S_DISP_CATG_ID.selectedIndex).value;	
	if(strCatgList == 'None')
	{
		alert('Please select content location');
		document.frmadmindlg.S_DISP_CATG_ID.focus();
		document.body.style.cursor="auto";
		return false;
	}	
	if(Trim(document.frmadmindlg.S_CONT_TEXT.value).length <= 0)
	{
		alert("Please enter content text");
		document.frmadmindlg.S_CONT_TEXT.focus();
		document.body.style.cursor="auto";
		return false;
	}
	if ((document.frmadmindlg.S_CONT_TEXT.value.indexOf("<") > -1) ||
		(document.frmadmindlg.S_CONT_TEXT.value.indexOf(">") > -1) || 
		(document.frmadmindlg.S_CONT_TEXT.value.indexOf("\\") > -1))	
	{
		alert(unescape('Content you have entered contains which are suspect. Please copy the contents in a text editor and remove the characters \< or \> or \\'));				
		document.frmadmindlg.S_CONT_TEXT.focus();
		document.body.style.cursor="auto";
		return false;
	}	
	if(document.frmadmindlg.B_ATCH_FILE != null)
	{
		if ((document.frmadmindlg.B_ATCH_FILE.checked==true) &&
			(Trim(document.frmadmindlg.S_ATCH_FILE.value).length <= 0))				
		{
			alert("Please enter file name");
			document.body.style.cursor="auto";			
			return false;			
		}				
	}
	
	if(Trim(document.frmadmindlg.D_EFCT_FROM.value).length <= 0)
	{
		alert("Please enter effective from ");
		document.frmadmindlg.D_EFCT_FROM.focus();
		document.body.style.cursor="auto";
		return false;
	}		
	
	if (fnCheckDate(Trim(document.frmadmindlg.D_EFCT_FROM.value))== false)
	{
		document.frmadmindlg.D_EFCT_FROM.value='';
		document.frmadmindlg.D_EFCT_FROM.focus();
		document.body.style.cursor="auto";
		return false;	
	}
	
	document.frmadmindlg.style.cursor="Wait";
	
	if (document.frmadmindlg.btn11 != null)
	{
		document.frmadmindlg.btn11.disabled=true 
	}
	if (document.frmadmindlg.btn12 != null)
	{
		document.frmadmindlg.btn12.disabled=true 
	}
	if (document.frmadmindlg.btn13 != null)
	{
		document.frmadmindlg.btn13.disabled=true 
	}	
			
	document.frmadmindlg.hidResource.value		= "statictext";
	document.frmadmindlg.hidActivity.value		= "saveadmincontent";
	document.frmadmindlg.submit();
	return true;
}

function SaveImageAdminContent()
{
	var intIndex = 0;
	document.body.style.cursor="wait";
	intIndex = document.frmadmindlg.S_DISP_CATG_ID.selectedIndex;
	if (intIndex == -1)
	{
		alert("Please select location");
		document.frmadmindlg.S_DISP_CATG_ID.focus();
		document.body.style.cursor="auto";
		return false
	}	
	
	if(Trim(document.frmadmindlg.S_CONT_CAPTION.value).length <= 0)
	{
		alert("Please enter image description");
		document.frmadmindlg.S_CONT_CAPTION.focus();
		document.body.style.cursor="auto";
		return false;
	}
	if ((document.frmadmindlg.S_CONT_CAPTION.value.indexOf("<") > -1 ) ||
		(document.frmadmindlg.S_CONT_CAPTION.value.indexOf(">") > -1 ) ||
		(document.frmadmindlg.S_CONT_CAPTION.value.indexOf("\\") > -1 ))
	{
		alert(unescape('Content you have entered contains which are suspect. Please copy the contents in a text editor and remove the characters \< or \> or \\'));				
		document.frmadmindlg.S_CONT_CAPTION.focus();
		document.body.style.cursor="auto";
		return false;
	}
	var strCatgList = document.frmadmindlg.S_DISP_CATG_ID.options(document.frmadmindlg.S_DISP_CATG_ID.selectedIndex).value;	
	if(strCatgList == 'None')
	{
		alert('Please select location');
		document.frmadmindlg.S_DISP_CATG_ID.focus();
		document.body.style.cursor="auto";
		return false;
	}	
	if (Trim(document.frmadmindlg.S_ATCH_FILE.value).length <= 0)				
	{
		alert("Please enter file name");
		document.body.style.cursor="auto";			
		return false;			
	}				
	
	if(Trim(document.frmadmindlg.D_EFCT_FROM.value).length <= 0)
	{
		alert("Please enter effective from ");
		document.frmadmindlg.D_EFCT_FROM.focus();
		document.body.style.cursor="auto";
		return false;
	}		
	
	if (fnCheckDate(Trim(document.frmadmindlg.D_EFCT_FROM.value))== false)
	{
		document.frmadmindlg.D_EFCT_FROM.value='';
		document.frmadmindlg.D_EFCT_FROM.focus();
		document.body.style.cursor="auto";
		return false;	
	}
	
	document.frmadmindlg.style.cursor="Wait";
	
	if (document.frmadmindlg.btn5 != null)
	{
		document.frmadmindlg.btn5.disabled=true 
	}
	if (document.frmadmindlg.btn6 != null)
	{
		document.frmadmindlg.btn6.disabled=true 
	}
	if (document.frmadmindlg.btn7 != null)
	{
		document.frmadmindlg.btn7.disabled=true 
	}			
		
	document.frmadmindlg.hidResource.value		= "imageupload";
	document.frmadmindlg.hidActivity.value		= "saveadmincontent";
	document.frmadmindlg.submit();
	return true;
}

function SetFileTextBoxProperty()
{
	if(document.frmadmindlg.B_ATCH_FILE != null)
	{	
		document.frmadmindlg.S_ATCH_FILE.value = '';
		if (document.frmadmindlg.B_ATCH_FILE.checked == true)
		{		
			document.frmadmindlg.S_ATCH_FILE.style.display='';
			lnkSelectFile.style.display='';
		}
		else 
		{
			document.frmadmindlg.S_ATCH_FILE.style.display='none';
			lnkSelectFile.style.display='none';
		}		
	}
}

function GetSelectedLanguage(thisform,ItemSelect)
{
		var Language = thisform + "." + ItemSelect + ".options(" + thisform + "." + ItemSelect + ".selectedIndex).value";
		Language = eval(Language);	
		Language = Trim(Language);		
		var Resource  = thisform + ".hidResource.value";
		Resource = eval(Resource);
		var RecID  = thisform + ".hidRecID.value";
		RecID = eval(RecID);		
		renderAdminResource(Language,'No',Resource,RecID);			
}

function renderAdminResource(strLanguage, strNewWindow, strResource, strRecID)
{
	document.body.style.cursor="wait";
	if (document.forms[0].hidCatgAcss != null)
	{
		if(Trim(document.forms[0].hidCatgAcss.value) == "No")
		{
			alert("You do not have access to this screen. Please contact administrator.");
			document.body.style.cursor="auto";			
			return false;			
		}	
	}
	if (document.forms[0].hidApprExists != null)
	{
		if(Trim(document.forms[0].hidApprExists.value).length <= 0)
		{
			alert("No approvers defined for this category. Please contact administrator for approval chain creation.");			
			document.body.style.cursor="auto";
			return false;			
		}	
	}
	document.forms[0].target = "";
	document.forms[0].hidResource.value		= strResource;
	document.forms[0].hidActivity.value		= "render";
	document.forms[0].hidLanguage.value		= strLanguage;	
	document.forms[0].hidRecID.value		= strRecID;
	document.forms[0].action = "frontcontroller.ech";
	if (strNewWindow == "Yes")
	{
		document.forms[0].target = "_blank";	
	}	
	document.forms[0].submit();
}

function GenerateControl(strMenuFont,strMenuFontSize)
{
			var id= "ControlChildTable";
			var strTable				= document.getElementById(id);;
			var intLastRow				= strTable.rows.length;			
			var strRow					= strTable.insertRow(intLastRow);				
			var LangGlobalStyle = "style='  FONT-SIZE: "+strMenuFontSize+"; COLOR: #000000; FONT-FAMILY: "+strMenuFont+"'";												
			
			var pcell = strRow.insertCell(0);
			pcell.width='10%'; 
			pcell.align='right';
			pcell.innerHTML="Menu Name";
			pcell=strRow.insertCell(1);						
			pcell.innerHTML="&nbsp;&nbsp;&nbsp;";
			pcell=strRow.insertCell(2);						
			pcell.width='20%'; 			
			pcell.innerHTML="<input type=textbox "+LangGlobalStyle+" name=txtMenuName"+ intLastRow + "  size=15 maxlength=25 >";				
			pcell=strRow.insertCell(3);			
			pcell.width='25%'; 
			pcell.align='right';
			pcell.innerHTML="Static Content Location/URL";						
			pcell=strRow.insertCell(4);						
			pcell.innerHTML="&nbsp;&nbsp;&nbsp;";						
			pcell=strRow.insertCell(5);			
			pcell.width='5%'; 
			pcell.innerHTML="<input type=checkbox ID=chkURL"+ intLastRow + " name=chkURL"+ intLastRow + " onclick=ChangeTableLabelCaption('TDURLID"+intLastRow+"','chkURL"+ intLastRow+"','txtURL" + intLastRow + "')>";										
			pcell=strRow.insertCell(6);					
			pcell.width='20%'; 
			pcell.align='right';
			pcell.id='TDURLID'+intLastRow;			
			pcell.innerHTML="Static Content Location";									
			pcell=strRow.insertCell(7);						
			pcell.innerHTML="&nbsp;&nbsp;&nbsp;";									
			pcell=strRow.insertCell(8);
			pcell.width='20%'; 
			pcell.innerHTML="<input type=textbox name=txtURL" + intLastRow + " size=15 maxlength=50>";		
		
			//Clear S_ON_CLIC_VALU Text Box
			id = "S_ON_CLIC_VALU"
			strTxtBox = document.getElementById(id)
			strTxtBox.value = "";
}

function ChangeTableLabelCaption(argTDID,chkURL,txtURL)
{
	argTDID = eval(argTDID);
	chkURL = "document.frmadmindlg."+chkURL;
	chkURL = eval(chkURL);	
	txtURL = "document.frmadmindlg."+txtURL;
	txtURL = eval(txtURL);	
	
	if (argTDID != null)	
	{
		if (chkURL.checked==false)
		{			
			argTDID.innerText = 'Static Content Location '; 			
		}	
		else
		{
			argTDID.innerText = 'URL '; 			
		}
	}
	txtURL.value = "";
}

function ChangeLabelCaption()
{
	if (TDURLID != null)
	{
		if (document.frmadmindlg.B_ON_CLIC_URL.checked==false)
		{			
			TDURLID.innerText = 'Static Content Location '; 			
		}	
		else
		{
			TDURLID.innerText = 'URL '; 			
		}
	}
	var id = "S_ON_CLIC_VALU"
	strTxtBox = document.getElementById(id)
	strTxtBox.value = "";
}

function fn_movr()
{
	//---------added for test on 260305
	var strpstp = "";
	//---------added for test on 260305 End
	if (parent.window.frames[2].document.getElementById("tblAdminMenu") != null)
	{
		eval(parent.window.frames[2].document.getElementById("iframM1")).style.display='';
		eval(parent.window.frames[2].document.getElementById("tblAdminMenu")).style.display='';
		//----------Added for test on 2603.05 ----------------
		strpstp = eval(parent.window.frames[2].document.body).scrollTop;
		eval(parent.window.frames[2].document.getElementById("iframM1")).style.posTop = strpstp;
		eval(parent.window.frames[2].document.getElementById("tblAdminMenu")).style.posTop = strpstp;				
		//----------Added for test on 2603.05 End----------------
	}
	fn_ChildMenuHide();
}
function fn_movrOtherServ()
{	
	if (parent.window.frames[2] != null)
	{
		if (parent.window.frames[2].document.getElementById("tblAdminMenu") != null)
		{	
			eval(parent.window.frames[2].document.getElementById("iframM1")).style.display='none';
			eval(parent.window.frames[2].document.getElementById("tblAdminMenu")).style.display='none';
		}
		fn_ChildMenuHide();	
	}
}

//---------------Temporary Addition ------------
//function fn_movrTempSubMenu1()
//{
//	tblQryDis.style.display='';
//	tblQryDisSM1.style.display='';
//}
//function fn_movrTempSubMenu2()
//{
//	tblQryDis.style.display='';
//	tblQryDisSM2.style.display='';
//}
//function fn_moutTempSubMenu1()
//{
//	tblQryDis.style.display='none';
//	tblQryDisSM1.style.display='none';
//}
//function fn_moutTempSubMenu2()
///{
//	tblQryDis.style.display='none';
//	tblQryDisSM2.style.display='none';
//}
//-----------------------------------
function fn_movrSubMenu1()
{
	var strpstp = 15;
	tblAdminMenu.style.display='';
	eval(parent.window.frames[2].document.getElementById("iframM1")).style.display='';
	eval(parent.window.frames[2].document.getElementById("iframSM1")).style.display='';
	tblAdminSubMenu1.style.display='';
	Mast.bgColor="#862B2B";
	strpstp += eval(parent.window.frames[2].document.body).scrollTop;	
	eval(parent.window.frames[2].document.getElementById("iframSM1")).style.posTop = strpstp;
	eval(parent.window.frames[2].document.getElementById("tblAdminSubMenu1")).style.posTop = strpstp;
}
function fn_movrSubMenu2()
{
	var strpstp = 15;
	tblAdminMenu.style.display='';
	eval(parent.window.frames[2].document.getElementById("iframM1")).style.display='';
	eval(parent.window.frames[2].document.getElementById("iframSM2")).style.display='';
	tblAdminSubMenu2.style.display='';
	Price.bgColor="#862B2B";
	strpstp += eval(parent.window.frames[2].document.body).scrollTop;
	eval(parent.window.frames[2].document.getElementById("iframSM2")).style.posTop = strpstp;	
	eval(parent.window.frames[2].document.getElementById("tblAdminSubMenu2")).style.posTop = strpstp;
}
function fn_movrSubMenu3()
{
	var strpstp = 15;
	tblAdminMenu.style.display='';
	eval(parent.window.frames[2].document.getElementById("iframM1")).style.display='';
	eval(parent.window.frames[2].document.getElementById("iframSM3")).style.display='';
	tblAdminSubMenu3.style.display='';	
	Man.bgColor="#862B2B";
	strpstp += eval(parent.window.frames[2].document.body).scrollTop;	
	eval(parent.window.frames[2].document.getElementById("iframSM3")).style.posTop = strpstp;
	eval(parent.window.frames[2].document.getElementById("tblAdminSubMenu3")).style.posTop = strpstp;
}
function fn_movrSubMenu4()
{
	var strpstp = 15;
	tblAdminMenu.style.display='';	
	eval(parent.window.frames[2].document.getElementById("iframM1")).style.display='';
	eval(parent.window.frames[2].document.getElementById("iframSM4")).style.display='';
	tblAdminSubMenu4.style.display='';	
	Adm.bgColor="#862B2B";	
	strpstp += eval(parent.window.frames[2].document.body).scrollTop;	
	eval(parent.window.frames[2].document.getElementById("iframSM4")).style.posTop = strpstp;
	eval(parent.window.frames[2].document.getElementById("tblAdminSubMenu4")).style.posTop = strpstp;
}
function fn_movrSubMenu5()
{
	var strpstp = 15;
	tblAdminMenu.style.display='';	
	eval(parent.window.frames[2].document.getElementById("iframM1")).style.display='';
	eval(parent.window.frames[2].document.getElementById("iframSM5")).style.display='';
	tblAdminSubMenu5.style.display='';	
	Rep.bgColor="#862B2B";	
	strpstp += eval(parent.window.frames[2].document.body).scrollTop;	
	eval(parent.window.frames[2].document.getElementById("iframSM5")).style.posTop = strpstp;
	eval(parent.window.frames[2].document.getElementById("tblAdminSubMenu5")).style.posTop = strpstp;
}
function fn_moutSubMenu1()
{
	eval(parent.window.frames[2].document.getElementById("iframM1")).style.display='none';
	eval(parent.window.frames[2].document.getElementById("iframSM1")).style.display='none';
	tblAdminMenu.style.display='none';
	tblAdminSubMenu1.style.display='none';
	Mast.bgColor="#738927";
}
function fn_moutSubMenu2()
{
	eval(parent.window.frames[2].document.getElementById("iframM1")).style.display='none';
	eval(parent.window.frames[2].document.getElementById("iframSM2")).style.display='none';
	tblAdminMenu.style.display='none';
	tblAdminSubMenu2.style.display='none';
	Price.bgColor="#738927";
}
function fn_moutSubMenu3()
{
	eval(parent.window.frames[2].document.getElementById("iframM1")).style.display='none';
	eval(parent.window.frames[2].document.getElementById("iframSM3")).style.display='none';
	tblAdminMenu.style.display='none';
	tblAdminSubMenu3.style.display='none';
	Man.bgColor="#738927";
}
function fn_moutSubMenu4()
{
	eval(parent.window.frames[2].document.getElementById("iframM1")).style.display='none';
	eval(parent.window.frames[2].document.getElementById("iframSM4")).style.display='none';
	tblAdminMenu.style.display='none';
	tblAdminSubMenu4.style.display='none';
	Adm.bgColor="#738927";
}
function fn_moutSubMenu5()
{
	eval(parent.window.frames[2].document.getElementById("iframM1")).style.display='none';
	eval(parent.window.frames[2].document.getElementById("iframSM5")).style.display='none';
	tblAdminMenu.style.display='none';
	tblAdminSubMenu5.style.display='none';
	Rep.bgColor="#738927";
}
function fn_AdmSubMenuOvr(tdid)
{
	if (tdid != null)
	{
		eval(tdid.id).bgColor="#d2f120"; 
	}
}
function fn_AdmSubMenuOut(tdid)
{
	if (tdid != null)
	{
		eval(tdid.id).bgColor="#FAEB84"; 
	}
}
function fn_MainMenuMouseOut()
{
	tblAdminMainMenu.style.display='none';
}
function fn_MainMenuMouseOvr()
{
	tblAdminMainMenu.style.display='';
}

//function UploadFile(strURL)
//{
//	window.open("Uploader.aspx?&hidSaveValue=''","OneChoupalWindow","toolbar=no,status=no,maximize=null, height=100,width=400,left=400,top=300");	
//}

//function UploadImageFile(strURL)
//{
//	window.open("Uploader.aspx?&hidSaveValue=IMAGEFOLDER","OneChoupalWindow","toolbar=no,status=no,maximize=null, height=100,width=400,left=400,top=300");			
//}

function UploadFile(strRandNo, strContID, strOldFileName)
{
	window.open("UploadContent/UploaderContent.aspx?&hidFormName=frmadmindlg&hidSaveValue=false&Rand=" + strRandNo + "&ContID=" + strContID + "&OldFileName=" + strOldFileName,"OneChoupalWindow","toolbar=no,status=no,maximize=null, height=100,width=400,left=350,top=530");
}

function UploadImageFile(strRandNo, strContID, strOldFileName)
{
	window.open("UploadContent/UploaderContent.aspx?&hidFormName=frmadmindlg&hidSaveValue=false&Rand=" + strRandNo + "&ContID=" + strContID + "&OldFileName=" + strOldFileName,"OneChoupalWindow","toolbar=no,status=no,maximize=null, height=100,width=400,left=350,top=530");
}

function SubmitForm()
{
	document.body.style.cursor="wait";
	if (Trim(document.frmUpload.filFileName.value).length <= 0)				
	{
		alert("Please enter file name");	
		document.body.style.cursor="auto";		
		return false;			
	}	
	window.opener.document.forms[0].hidFileName.value = document.frmUpload.filFileName.value;	
	if (window.opener.document.forms[0].S_ATCH_FILE != null)
	{
		var fileName = document.frmUpload.filFileName.value;
		fileName = fileName.substring(fileName.lastIndexOf('\\')+1)		
		window.opener.document.forms[0].S_ATCH_FILE.value = fileName;	
	}	
	frmUpload.submit();					
}

//Added by kushal on 22/11/2006 OneCh/ECRF/3

function SubmitFormPolicy()
{

	Form1.submit();					
}
//end of OneCh/ECRF/3

function fn_EnterKeyPress(strlang)
{
	if (window.event.keyCode == 13)
	{
		login(strlang);
	}
}
/*** Commented by Partha on 19.08.2005 ***************************
//shibaji
function renderService(strLanguage, strResource, strCategory, strCategoryChain)
{
	parent.window.frames[2].document.body.style.cursor="wait";
	
	var newarray = strCategoryChain.split('\\');
	
	for(var intCols=0;intCols <(newarray.length);intCols++)
	{	
		if (intCols == 1)
		{
			strResource='PRODUCTINFORMATION';
			if (newarray[intCols]=='MARKETINFORMATION')
			{
				strResource='MARKETINFORMATION';
			}									
			if (newarray[intCols]=='QUERIESDISCUSSION')
			{
				strResource = "QUERYDISCUSSION";
				//strResource='ASKQUESTION';
			}
			if (newarray[intCols]=='SUGGESTION')
			{
				strResource = "SUGGESTION";
			}
		}
		strCategory = newarray[intCols];
	}
	
	document.forms[0].target = "";
	document.forms[0].hidResource.value		= strResource;
	document.forms[0].hidActivity.value		= "render";
	document.forms[0].hidLanguage.value		= strLanguage;	
	document.forms[0].hidCateGory.value		= strCategory;	
	document.forms[0].hidCateGoryChain.value	= strCategoryChain;		
	document.forms[0].action = "frontcontroller.ech";
	document.forms[0].target= "work";
	document.forms[0].submit();	
}
************************************/


//shibaji
function openURL(argURL)
{
	if (strResWin != null)
	{
		strResWin.close();
	}
	strResWin = window.open(argURL,"OneChoupalWindow","");	
	strResWin.focus();
	if (document.forms[0].txtDummy != null)
	{
		document.forms[0].txtDummy.focus();
	}
}

//shibaji
function OpenServiceLink(strContID)
{	
	parent.window.frames[2].document.body.style.cursor="wait";
	document.forms[0].hidActivity.value		= "renderservice";
	document.forms[0].hidRecID.value		= strContID;		
	document.forms[0].action = "frontcontroller.ech";
	document.forms[0].target= "work";
	document.forms[0].submit();	
}

function GoHome()
{
	//document.body.style.cursor="auto";
	parent.window.frames[0].document.body.style.cursor				= "wait";
	parent.window.frames[1].document.body.style.cursor				= "wait";
	parent.window.frames[2].document.body.style.cursor				= "wait";
	parent.window.frames[0].document.forms[0].target				= "work";
	parent.window.frames[0].document.forms[0].action				= "workarea.aspx";	
	
	parent.window.frames[0].document.forms[0].submit();
	
	parent.window.frames[0].document.forms[0].target				= "toppanel";
	parent.window.frames[0].document.forms[0].action				= "topmenu.aspx";	
	//parent.window.frames[0].document.body.style.cursor				= "wait";
	parent.window.frames[0].document.forms[0].submit();	
		
	parent.window.frames[0].document.forms[0].target				= "left";
	parent.window.frames[0].document.forms[0].action				= "leftmenu.aspx";	
	//parent.window.frames[0].document.body.style.cursor				= "wait";
	parent.window.frames[0].document.forms[0].submit();				
	
	parent.window.frames[0].document.forms[0].target				= "bottom";
	parent.window.frames[0].document.forms[0].action				= "bottommenu.aspx";
	//parent.window.frames[0].document.body.style.cursor				= "wait";	
	parent.window.frames[0].document.forms[0].submit();	
}

function calQuestionChar()
{
	//document.form[0].name = "contact";
	maxChar = 1000;
	charleft=0;	
	document.forms[0].TxtMaxChar.value = maxChar;
			
	if (document.forms[0].TxtQuestion.value.length > maxChar) { 
	        document.forms[0].TxtQuestion.value = document.forms[0].TxtQuestion.value.substring(0,maxChar)
		charleft = 0
		clipped = true
        } 
        else 
        {
			charleft = maxChar - document.forms[0].TxtQuestion.value.length
		}
        document.forms[0].TxtMaxChar.value = charleft;
}

		function calAnswerChar()
		{
			//document.form[0].name = "contact";
			maxChar = 1000;
			charleft=0;	
			document.forms[0].TxtMaxChar.value = maxChar;
			
			if (document.forms[0].TxtAnswer.value.length > maxChar) { 
		        document.forms[0].TxtAnswer.value = document.forms[0].TxtAnswer.value.substring(0,maxChar)
			charleft = 0
			clipped = true
			} 
			else 
			{
				charleft = maxChar - document.forms[0].TxtAnswer.value.length
			}
			document.forms[0].TxtMaxChar.value = charleft;
		}
		
		//Menu Function By Annirudha
		function Getfaqresponse()
		{
			
			document.forms[0].hidResource.value = "FAQRESPONSE";
			document.forms[0].action = "frontcontroller.ech";
			document.forms[0].hidActivity.value		= "render";
			document.forms[0].target = "work";
			document.forms[0].submit();
		}
		function GetSanFAQ()
		{
			
			document.forms[0].hidResource.value = "FAQSANRESPONSE";
			document.forms[0].action = "frontcontroller.ech";
			document.forms[0].hidActivity.value		= "render";			
			document.forms[0].target = "work";
			document.forms[0].submit();
		}
		function GetResponses(resource)
		{
			
			document.forms[0].hidResource.value = resource;
			document.forms[0].action = "frontcontroller.ech";
			document.forms[0].hidActivity.value		= "render";
			document.forms[0].target = "work";
			
			// Added by Partha - 210305
			if (parent.window.frames[2].document.getElementById("hidJob") != null)
			{
				document.forms[0].hidJob.value		= '';
			}
			document.body.style.cursor="Wait";
			document.forms[0].submit();
		}
		function SetActivateflag(resource)
		{
			
			document.forms[0].hidResource.value = resource;
			document.forms[0].hidActivity.value = "render";
			document.forms[0].action = "frontcontroller.ech";
			document.forms[0].target = "work";
			document.body.style.cursor="Wait";
			document.forms[0].submit();
		}
/*****************Commented by Partha on 19.08.2005 ******************************
		function GetWeather()
		{
			parent.window.frames[2].document.body.style.cursor= "wait";
			document.forms[0].hidActivity.value = "render";
			document.forms[0].hidResource.value = "WEATHERMAP";
			document.forms[0].action = "frontcontroller.ech";			
			document.forms[0].target = "work";
			document.forms[0].submit();
		}
*********************************************************************************/
		function maintainWeather()
		{
			
			document.forms[0].hidActivity.value = "render";
			document.forms[0].hidResource.value = "WEATHERSELECT";
			document.forms[0].action = "frontcontroller.ech";			
			document.forms[0].target = "work";
			document.body.style.cursor="wait";
			document.forms[0].submit();
		}
		function GetApprover()
		{
			
			document.forms[0].hidActivity.value = "render";
			document.forms[0].hidResource.value = "APPROVERINFO";
			document.forms[0].action = "frontcontroller.ech";	
			document.forms[0].target = "work";
			document.body.style.cursor="wait";
			document.forms[0].submit();
		}
		
		//Added by kushal on 22/11/2006 OneCh/ECRF/3

		function PolSub(resource)
		{
			
			
			document.forms[0].hidActivity.value = "render";
			
			
			document.forms[0].hidResource.value = resource;
			document.forms[0].action = "frontcontroller.ech";	
			document.forms[0].target = "work";
			document.body.style.cursor="Wait";
			
			document.forms[0].submit();
			
		}
		
		
		function ViewUsers(resource)
		{
			parent.window.frames[2].document.body.style.cursor="wait";
			if(document.forms[0].hidJob != null)
			{
				document.forms[0].hidJob.value="";
			}
			if(resource == 'VIEWALLUSERS')
			{
				GetHtmlHiddenObject('hidSession');
			}
			
			
			document.forms[0].hidActivity.value = "render";
			document.forms[0].hidResource.value = resource;
			document.forms[0].action = "frontcontroller.ech";	
			document.forms[0].target = "work";
			document.body.style.cursor="Wait";
			//Added by kushal on 22/11/2006 OneCh/ECRF/3

			if (resource="INSCMAILCONFIG")
			{
			if (document.forms[0].hidcatgmail!=null)
			{
			document.forms[0].hidcatgmail.value="";
			}
			if (document.forms[0].hidpartner!=null)
			{
			document.forms[0].hidpartner.value="";
			}
			if (document.forms[0].hidITC!=null)
			{
			document.forms[0].hidITC.value="";
			}
				if (document.forms[0].hidinscsave!=null)
			{
			document.forms[0].hidinscsave.value="";
			}
			
			}
			document.forms[0].submit();
			
		}
		//end of OneCh/ECRF/3
		
		function GetSanchalakView()
		{
			//location.href = "../sanchalak/frmsanchalak.aspx";
		}
		
		//---------------------------------------Menu Start -----------------------

var strRwId = null;
var strHRwId = null;
var strCropTab = null;
/*
function ChangeTdColor(strRowId,strID)
{		
	var objstrID = null;
	var objstrRwId = null;
	var objstrHRwId = null;
	var objstrRowId = null;

	fn_ChildMenuHide();
	if (strRwId != null)
	{		
		objstrRwId = eval(strRwId);
		if (objstrRwId != null)
		{
			objstrRowId = eval(strRowId);
			if (objstrRowId != null)
			{
				objstrRwId.bgColor = objstrRowId.bgColor;
				objstrRowId.bgColor = "#862B2B";

			}
			if (strID != null)
			{
				objstrID = eval(parent.window.frames[2].document.getElementById(strID));
				if (objstrID != null)
				{
					objstrID.style.display='';
					objstrID.style.posTop=event.clientY-5;		
				}
			}
		}
		
	}
	strRwId = strRowId;
	strHRwId = strID;		
}
*/
/*
function ChangeTdColor(strNRowId,strID)
{		
	var objstrID = null;
	var objstrRwId = null;
	var objstrHRwId = null;
	var objstrRowId = null;
	fn_movrOtherServ();
	//fn_ChildMenuHide();
	if (strNRowId != null)
	{		
		objstrRwId = eval(strNRowId);
		if (objstrRwId != null)
		{
			objstrRowId = eval(strNRowId);
			if (objstrRowId != null)
			{
				objstrRwId.bgColor = objstrRowId.bgColor;
				objstrRowId.bgColor = "#862B2B";

			}
			if (strID != null)
			{
				objstrID = eval(parent.window.frames[2].document.getElementById(strID));
				if (objstrID != null)
				{
					var strpsy = "";
					var strpsx = "";
					strpsy = eval(parent.window.frames[2].document.body).scrollTop;
					strpsx = eval(parent.window.frames[2].document.body).scrollLeft;
					objstrID.style.display='';
					//Added by sumit on 010405 for test ----------------------
					//IfrmHor.style.posTop=strpsy+event.clientY-5;					
					objstrID.style.posTop=strpsy+event.clientY-5;
				}
			}
		}
		
	}
	strRwId = strNRowId;
	strHRwId = strID;		
}
*/
var objUserType = null;
function ChangeTdColor(strNRowId,strID,objDtl,strUserType)
{		
	parent.window.frames[1].document.objUserType = strUserType;
	parent.window.frames[1].document.objFather=objDtl;
	//objFather = objDtl;
	var objstrID = null;
	var objstrRwId = null;
	var objstrHRwId = null;
	var objstrRowId = null;
	fn_movrOtherServ();
	//fn_ChildMenuHide();
	if (strNRowId != null)
	{		
		objstrRwId = eval(strNRowId);
		if (objstrRwId != null)
		{
			objstrRowId = eval(strNRowId);
			if (objstrRowId != null)
			{
				objstrRwId.bgColor = objstrRowId.bgColor;
				objstrRowId.bgColor = "#862A2B";

			}
			if (strID != null)
			{
				objstrID = eval(parent.window.frames[2].document.getElementById(strID));
				if (objstrID != null)
				{
					var strpsy = "";
					var strpsx = "";
					strpsy = eval(parent.window.frames[2].document.body).scrollTop;
					strpsx = eval(parent.window.frames[2].document.body).scrollLeft;
					objstrID.style.display='';
					//Added by sumit on 010405 for test ----------------------
					//IfrmHor.style.posTop=strpsy+event.clientY-5;	
					if(objDtl !=null)
					{				
					//---------Commented for test ----- objstrID.style.posTop=strpsy+event.clientY-5;
						//alert(objDtl.offsetTop);
						if((strUserType == "VIEWER") || (strUserType == "SNCH"))
						{
							objstrID.style.posTop=strpsy+objDtl.offsetTop;
							if (eval(parent.window.frames[2].document.getElementById("FileFrame"))!= null)
							{
								eval(parent.window.frames[2].document.getElementById("FileFrame")).style.top=strpsy+objDtl.offsetTop+100;
							}
						}
						else
						{
							objstrID.style.posTop=strpsy+objDtl.offsetTop+objDtl.offsetHeight;
							if (eval(parent.window.frames[2].document.getElementById("FileFrame"))!= null)
							{
								eval(parent.window.frames[2].document.getElementById("FileFrame")).style.top=strpsy+objDtl.offsetTop+objDtl.offsetHeight+100;
							}
						}
					}
				}
			}
		}
		
	}
	strRwId = strNRowId;
	strHRwId = strID;	
		
}
/*
function tabDisp(strID)
{
	if (strCropTab != null)
	{
		eval(parent.window.frames[2].document.getElementById(strCropTab)).style.display='none';
	}
	var tblId = null;
	//tblId = eval(strID.replace("\","\\"));
	//tblId = eval(strID);
	if (strID != null)
	{
		var strpsy = "";
		var strpsx = "";
		strpsy = eval(parent.window.frames[2].document.body).scrollTop;
		strpsx = eval(parent.window.frames[2].document.body).scrollLeft;
		eval(parent.window.frames[2].document.getElementById(strID)).style.display='';
		eval(parent.window.frames[2].document.getElementById(strID)).style.posTop=strpsy + event.clientY+10;
		eval(parent.window.frames[2].document.getElementById(strID)).style.posLeft=strpsx + event.clientX;
		
		/*tblId.style.display='';
		tblId.style.posTop=event.clientY+10;
		tblId.style.posLeft=event.clientX;
	}
	strCropTab = strID;
}*/
function tabDisp(strID,objDtl)
{
	if (strCropTab != null)
	{
		
		eval(parent.window.frames[2].document.getElementById(strCropTab)).style.display='none';
	}
	var tblId = null;
	//tblId = eval(strID.replace("\","\\"));
	//tblId = eval(strID);
	if (strID != null)
	{
		var strpsy = "";
		var strpsx = "";
		strpsy = eval(parent.window.frames[2].document.body).scrollTop;
		strpsx = eval(parent.window.frames[2].document.body).scrollLeft;
		eval(parent.window.frames[2].document.getElementById(strID)).style.display='';
		//-------------Commented fot Test/ Subu 21/04/05---eval(parent.window.frames[2].document.getElementById(strID)).style.posTop=strpsy + event.clientY+10;
		eval(parent.window.frames[2].document.getElementById(strID)).style.posTop=strpsy + objDtl.offsetTop;
		//-------------Commented fot Test/ Subu 21/04/05---eval(parent.window.frames[2].document.getElementById(strID)).style.posLeft=strpsx + event.clientX;
		eval(parent.window.frames[2].document.getElementById(strID)).style.posLeft=strpsx + objDtl.offsetLeft;
		
		/*tblId.style.display='';
		tblId.style.posTop=event.clientY+10;
		tblId.style.posLeft=event.clientX;*/
	}
	strCropTab = strID;
}

//--------Added on 08.03.2005
var strParID = null;
var objChildMenu = null;
function tabDispOut(strID, strPID)
{
	var objstrID = null;
	var objstrPID = null;
	objstrID = eval(parent.window.frames[2].document.getElementById(strID));
	objstrPID = eval(parent.window.frames[2].document.getElementById(strPID));
	if (objstrID != null)
	{
		if (objChildMenu != null)
			objChildMenu.style.display = 'none';
		objstrID.style.display='none';
		if (objstrPID != null)
		{
			objstrPID.style.display='none';
		}
	}
	strParID = strPID;
}
function tabDataCellOut(strID)
{
	var objstrID = null;
	var objstrParID = null;
	
	if (strParID != null)
		objstrParID = eval(strParID);
	if (strID != null)		
		objstrID = eval(parent.window.frames[2].document.getElementById(strID));
	if (objstrID != null)
	{
		objstrID.style.display='';
		objChildMenu = objstrID;
		
		if (objstrParID != null)
		{
			//objstrParID.style.display='';
			
			if (oldTbl != null && objstrParID.id != oldTbl.id)
				oldTbl.style.display='none';
		}
	}
	
	return;
}
//-----------Added on 10.03.05 ------------
//-------------- Added as per Saritda's advice
var objL4Menu = null;
//-------------- Added as per Saritda's advice
function tabL4Disp(L4InID, L3InID)
{
	if (L4InID != null)
	{
		if (L3InID != null)
		{
			//-------------- Added as per Saritda's advice
			if (objL4Menu != null)
			{
				eval(parent.window.frames[2].document.getElementById(objL4Menu)).style.display = 'none'
				//objL4Menu = 'none';
			}
			//-------------- Added as per Saritda's advice
			eval(parent.window.frames[2].document.getElementById(L4InID)).style.display = '';
			eval(parent.window.frames[2].document.getElementById(L3InID)).style.display = '';
			//--------------- Added by Sumit on 010405---------
			//eval(parent.window.frames[2].document.getElementById(IfrmHor)).style.display = '';
			//--------------- Added by Sumit on 010405 End---------
			// -------------- Added as per Saritda's advice
			//objL4Menu = eval(parent.window.frames[2].document.getElementById(L4InID)).style.display;
			objL4Menu = L4InID;
			// -------------- Added as per Saritda's advice
		}
	}
}
function tabL4DispOut(L4OutID, L3OutID)
{
	if (L4OutID != null)
	{
		if (L3OutID != null)
		{
			eval(parent.window.frames[2].document.getElementById(L4OutID)).style.display = 'none';
			for (var i=0; i<50; i++)
			{				
				;
			}			
			eval(parent.window.frames[2].document.getElementById(L3OutID)).style.display = 'none';						
		}
	}
}
/*
function tabL4_L3Disp(L4InID, L3InID)
{
	if (L4InID != null)
	{
		if (L3InID != null)
		{			
			//-------------- Added as per Saritda's advice
			if (objL4Menu != null)
			{
				if (eval(parent.window.frames[2].document.getElementById(objL4Menu)) != null)
				{
					eval(parent.window.frames[2].document.getElementById(objL4Menu)).style.display = 'none'
				}
			}
			//-------------- Added as per Saritda's advice
			var strpsy = "";
			var strpsx = ""; 
			strpsy = eval(parent.window.frames[2].document.body).scrollTop;
			strpsx = eval(parent.window.frames[2].document.body).scrollLeft;
			if (eval(parent.window.frames[2].document.getElementById(L4InID)) != null)
			{
				eval(parent.window.frames[2].document.getElementById(L4InID)).style.display = '';						
				eval(parent.window.frames[2].document.getElementById(L4InID)).style.posTop=strpsy + event.clientY+4;
				eval(parent.window.frames[2].document.getElementById(L4InID)).style.posLeft=strpsx + event.clientX;
			}
			eval(parent.window.frames[2].document.getElementById(L3InID)).style.display = '';
			// -------------- Added as per Saritda's advice
			//objL4Menu = eval(parent.window.frames[2].document.getElementById(L4InID)).style.display;
			objL4Menu = L4InID;
			// -------------- Added as per Saritda's advice					
		}
	}
}
*/

function tabL4_L3Disp(L4InID, L3InID, objId, intCntrSS)
{
	if (L4InID != null)
	{
		if (L3InID != null)
		{
			if (objL4Menu != null)
			{
				if (eval(parent.window.frames[2].document.getElementById(objL4Menu)) != null)
				{
					
					eval(parent.window.frames[2].document.getElementById(objL4Menu)).style.display = 'none'
				}
			}
			var strpsy = "";
			var strpsx = ""; 
			var tdWdth = 0;
			strpsy = eval(parent.window.frames[2].document.body).scrollTop;
			strpsx = eval(parent.window.frames[2].document.body).scrollLeft;
			if (eval(parent.window.frames[2].document.getElementById(L4InID)) != null)
			{
				eval(parent.window.frames[2].document.getElementById(L4InID)).style.display = '';									
				var strUserTp = "";
				if(parent.window.frames[1].document.objUserType != null)
				{
					strUserTp = parent.window.frames[1].document.objUserType;
				}
				if ((strUserTp == "SNCH") || (strUserTp == "VIEWER"))
				{
					eval(parent.window.frames[2].document.getElementById(L4InID)).style.posTop=strpsy+parent.window.frames[1].document.objFather.offsetTop+objId.offsetHeight+4;				
				}
				else
				{
					eval(parent.window.frames[2].document.getElementById(L4InID)).style.posTop=strpsy+parent.window.frames[1].document.objFather.offsetTop+(objId.offsetHeight*2)+7;
				}				
				if (parent.window.frames[1].document.objGlobal != null)
				{
					tdWdth = parent.window.frames[1].document.objGlobal.offsetWidth;
				}
				var intCtrS = intCntrSS;				
				var exctPos = tdWdth*intCtrS;			
				eval(parent.window.frames[2].document.getElementById(L4InID)).style.posLeft=strpsx+exctPos+(intCtrS*2)+4;
			}
			eval(parent.window.frames[2].document.getElementById(L3InID)).style.display = '';			
			objL4Menu = L4InID;		
			parent.window.frames[2].document.obMenu4 = L4InID;
		}
	}
}
function SetGlobal(objTdID)
{		
	parent.window.frames[1].document.objGlobal=objTdID;	
}
function tabL3Disp(L3InID)
{
	if (L3InID != null)
	{
		eval(parent.window.frames[2].document.getElementById(L3InID)).style.display = '';
	}
}
function tabL4Out(L4InID, L3InID)
{
	
	//-------------- Added as per Saritda's advice
			if (objL4Menu != null)
			{
				if (eval(parent.window.frames[2].document.getElementById(objL4Menu)) != null)
				{
					eval(parent.window.frames[2].document.getElementById(objL4Menu)).style.display = 'none'
				}
				//objL4Menu = 'none';
			}
	//-------------- Added as per Saritda's advice
	if (L3InID != null)
	{
		if (eval(parent.window.frames[2].document.getElementById(L3InID)) != null)
		{
			eval(parent.window.frames[2].document.getElementById(L3InID)).style.display = '';
		}
	}
	if (L4InID != null)
	{
		for (var i=0; i<50; i++)
		{				
			;
		}			
		if (eval(parent.window.frames[2].document.getElementById(L4InID)) != null)
		{
			eval(parent.window.frames[2].document.getElementById(L4InID)).style.display = 'none';
		}	
	}
	objL4Menu = L4InID;
}
function tabL3Out(L3InID)
{
	if (L3InID != null)
	{
		for (var i=0; i<50; i++)
		{				
			;
		}	
		eval(parent.window.frames[2].document.getElementById(L3InID)).style.display = 'none';
	}
}
//----------------Added on 10.03.05 ------------
function ItemTabDispOut(ItmTblID,ItmVarTblId)
{
	var objItmTblID = null;
	var objItmVarTblId = null;
	objItmTblID = eval(parent.window.frames[2].document.getElementById(ItmTblID));
	objItmVarTblId = eval(parent.window.frames[2].document.getElementById(ItmVarTblId));
	if (objItmTblID != null)
	{
		objItmTblID.style.display='none';
		if (objItmVarTblId != null)
		{
			objItmVarTblId.style.display='none';
		}
	}
	
}

/******************** Commented by Partha on 19.08.2005 ***********************
//-----------Added on 08.03.2005
var objSrvsNm	= null;
var objLang		= null;
function fnServiceSubmit(SrvsCap,SrvsName)
{
	objSrvsNm = SrvsName;
	parent.window.frames[0].document.body.style.cursor="wait";
	parent.window.frames[1].document.body.style.cursor="wait";
	parent.window.frames[2].document.body.style.cursor="wait";
	document.forms[0].hidResource.value = SrvsName;
	document.forms[0].hidActivity.value = "SERVICE";
	document.forms[0].hidTabID.value = SrvsCap;
	//alert(document.forms[0].hidResource.value);
	//document.forms[0].action = "frontcontroller.ech";	
	//document.forms[0].method = "post";
	//document.forms[0].target = "_top";
	//document.forms[0].submit();	
	
	
	document.forms[0].target				= "toppanel";
	document.forms[0].action				= "topmenuMock.aspx";	
	document.forms[0].submit();	
	
	
	
	document.forms[0].target				= "left";
	document.forms[0].action				= "leftmenuMock.aspx";	
	document.forms[0].submit();		
	
	//document.forms[0].target				= "work";
	//document.forms[0].action				= "workareaMock.aspx";	
	//document.forms[0].submit();	
	
	objLang = document.forms[0].hidLanguage.value;
	
	renderService(document.forms[0].hidLanguage.value,'SERVICE',SrvsName,SrvsName);
	
}
**********************************************************************************/

function fnServiceSubmitBred(SrvsCap,SrvsName)
{
	var srvnm = "TD_";
	srvnm += SrvsName;
	objSrvsNm = SrvsName;
	parent.window.frames[2].document.body.style.cursor="wait";
	document.forms[0].hidResource.value = SrvsName;
	document.forms[0].hidActivity.value = "SERVICE";
	document.forms[0].hidTabID.value = SrvsCap;	
	objLang = document.forms[0].hidLanguage.value;
	FnOnSelectTopMenu(srvnm);
	renderService(document.forms[0].hidLanguage.value,'SERVICE',SrvsName,SrvsName, 0);
}
function fnServiceSubmitBred1(SrvsCap,SrvsName,srvnam)
{
	var srvnm = "TD_";
	srvnm += srvnam;
	objSrvsNm = SrvsName;
	parent.window.frames[2].document.body.style.cursor="wait";
	document.forms[0].hidResource.value = SrvsName;
	document.forms[0].hidActivity.value = "SERVICE";
	document.forms[0].hidTabID.value = SrvsCap;	
	objLang = document.forms[0].hidLanguage.value;
	FnOnSelectTopMenu(srvnm);
	renderService(document.forms[0].hidLanguage.value,'SERVICE',SrvsName,SrvsName, 0);
}
/*
function fnSrvSubmit()
{
	if (objSrvsNm != null)
	{
		if (objLang != null)
		{
			renderService(eval(objLang),'SERVICE',eval(objSrvsNm),eval(objSrvsNm));
		}
	}	
}*/

/* Commented for test
function ChangeTDCol(argTdId, SrvsCap)
{	
	document.forms[0].hidTabID.value = SrvsCap;
	tdids.bgColor = argTdId.bgColor;
	eval(parent.window.frames[1].document.getElementById(tdids.id)).style.display='none';
	argTdId.bgColor = "#a69543";
	tdids = argTdId;
	eval(parent.window.frames[1].document.getElementById(argTdId.id)).style.display='';
	
	renderService(document.forms[0].hidLanguage.value,'SERVICE',argTdId.id,argTdId.id);
	//Added on 12.03.2005
	//fnSrvSubmit();
}
*/
var tdids = null;
function ChangeTDCol(argTdId, SrvsCap)
{	
	tdids.bgColor = argTdId.bgColor;
	document.forms[0].hidTabID.value = SrvsCap;	
	var strOldId = null;
	if (tdids != null)
	{		
		//eval(parent.window.frames[1].document.getElementById(tdids.id)).style.display='none';
		strOldId = eval(parent.window.frames[1].document.getElementById(tdids.id));
		if (strOldId != null)
		{
			strOldId.style.display = 'none';
		}
	}
	argTdId.bgColor = "#a69543";
	tdids = argTdId;
	eval(parent.window.frames[1].document.getElementById(argTdId.id)).style.display='';	
	renderService(document.forms[0].hidLanguage.value,'SERVICE',argTdId.id,argTdId.id);
}
/*
commented as not tested sumit
function SubML4Out(M4ID)
{
	if (M4ID != null)
	{
		eval(parent.window.frames[2].document.getElementById(M4ID)).style.display='none';
	}
}
*/
function ChangeTDColSrv(argSrvId)
{
	tdids=null;
	var objSrvId = null;
	if (argSrvId != null)
	{
		objSrvId = eval(parent.window.frames[1].document.getElementById(argSrvId));
		if (objSrvId != null)
		{
			objSrvId.bgColor='#a69543';
			//eval(document.getElementById(argSrvId)).style.display='';
			objSrvId.style.display='';
		}
	}
}
function assignMenuId(argMenuPrev,argAllTblNm)
{
	tdids = eval(parent.window.frames[0].document.getElementById(argMenuPrev));
	strChildMenuNames = argAllTblNm;
}

function ChangeTdColorBack(strRowId,argTDCol)
{
	//alert(argTDCol);
	eval(strRowId).bgColor = argTDCol;
}
//added on 08.03.05--------
/*function ItmTblDispOut()
{
	alert(tdids);
}*/
//added on 08.03.05--------

var oldTbl = null
/*
function setOldTblId(agrOldTblId)
{
	var objMenuItem = null;
	if (agrOldTblId != null)
	{	
		objMenuItem = eval(parent.window.frames[2].document.getElementById(agrOldTblId));
		if (objMenuItem != null && objChildMenu != null && objMenuItem.id != objChildMenu.id )
			objChildMenu.style.display = 'none';
		objChildMenu = objMenuItem;
	}
		
}*/
/*
function setOldTableDispOff(agrOldTblId)
{
	if (objChildMenu != null)
		objChildMenu.style.display = 'none';
			
	if (oldTbl != null && oldTbl.id != agrOldTblId.id )
		oldTbl.style.display = 'none';
	
	agrOldTblId.style.display = '';
	oldTbl = agrOldTblId;
}
*/
function fn_ChildMenuHide()
{
	//alert(strChldMenuId);
	var objMenuItem = null;
	if (strChildMenuNames != null)
	{
		var newarray= strChildMenuNames.split("~"); 
		var temp;
		for(var i= 0;  i <  newarray.length; i++)
		{
			if (newarray[i] != "")
			{
				//alert(newarray[i]);
				objMenuItem = eval(parent.window.frames[2].document.getElementById(newarray[i]));
				if (objMenuItem != null)
				{
					//alert(objMenuItem.id);
					objMenuItem.style.display = 'none';
					if (objL4Menu != null)
					//if (parent.window.frames[2].document.objL4Menu != null)
					{
						if(eval(parent.window.frames[2].document.getElementById(objL4Menu))!= null)
						{
							eval(parent.window.frames[2].document.getElementById(objL4Menu)).style.display = 'none';
						}	
					}
					if (parent.window.frames[2].document.obMenu4 != null)
					{
						if(eval(parent.window.frames[2].document.getElementById(parent.window.frames[2].document.obMenu4)) != null)
						{
							eval(parent.window.frames[2].document.getElementById(parent.window.frames[2].document.obMenu4)).style.display = 'none';
						}	
					}
				}
			}
		}
	}	
}
function fn_tblIDAssn(objtblid)
{
	strChildMenuNames = objtblid;
}
function fn_ChildMenuNames(strChldMenuId)
{
	strChildMenuNames = strChldMenuId ;
}
function sendSuggession(strMsg)
{
	document.forms[0].hidResource.value		= "Suggession";
	document.forms[0].hidActivity.value		= "mail";
	document.forms[0].action = "frontcontroller.ech";
		
	if(Trim(document.forms[0].TxtComment.value).length <= 0)
	{
		//alert("Please enter your Suggession");
		alert(getMsgDesc(strMsg, "MSG017"));
		document.body.style.cursor= "auto";
		return false;
	}
	parent.window.frames[2].document.body.style.cursor="wait";	
	document.forms[0].submit();
}
//---------------------------------------Menu End-----------------------

function OpenWebForm(strFormName)
{
	
	document.forms[0].action = strFormName;
	document.forms[0].target= "work";
	document.forms[0].submit();
}

//-----------Added on 08.03.2005
function showHubPrice(strCategoryChain)
{
	//alert(strCategoryChain);
	
	document.forms[0].hidResource.value = "VIEWHUBPRICELIST";
	document.forms[0].hidActivity.value = "render";
	document.forms[0].target = "work";
	document.forms[0].action = "frontcontroller.ech";
	document.forms[0].hidCateGoryChain.value=strCategoryChain;
	document.forms[0].submit();
}
function showMandiPrice(strCategoryChain)
{
	
	document.forms[0].hidResource.value = "VIEWMANDIPROCELIST";
	document.forms[0].hidActivity.value = "render";
	document.forms[0].target = "work";
	document.forms[0].action = "frontcontroller.ech";
	document.forms[0].hidCateGoryChain.value=strCategoryChain;
	document.forms[0].submit();
}
/*** change ******/

function DownloadFile(strFileID,strFileName,strHubID,strMessage)
{
	parent.window.frames[2].document.body.style.cursor="wait";
	if (Trim(strFileID).length <= 0) 
	{
		alert(strMessage);
		document.body.style.cursor= "auto";
		return false;
	}	
	document.forms[0].hidActivity.value = "renderpriceinformation";
	document.forms[0].hidRecID.value	= strFileID;		
	document.forms[0].hidFileName.value = strFileName;
	document.forms[0].hidHubID.value = strHubID;	
	document.forms[0].action = "frontcontroller.ech";
	document.forms[0].target= "work";
	document.forms[0].submit();		
}

function openAspx(strRes)
{
	
	document.forms[0].hidResource.value = strRes;
	document.forms[0].hidActivity.value = "renderaspx";
	document.forms[0].target			= "work";
	document.forms[0].action			= "frontcontroller.ech";
	//document.forms[0].action			= strRes + ".aspx";
	document.body.style.cursor="Wait";
	document.forms[0].submit();	
}
/****************/

//--------------------Added on 24.03.05 Sumit -------

var nScrollDelay = 25
function IncreaseSpeed()
{
	if(nScrollDelay > 10 && nScrollDelay<10000)
	{
		nScrollDelay -= 15 ;
		Mar1.scrollDelay = nScrollDelay;
		Mar1.trueSpeed = 1;	
		Mar1.scrollAmount = 1;
		SaveScrollDelay();
	}
	else if(nScrollDelay > 10000)
	{
		nScrollDelay = 25 ;
		Mar1.scrollDelay = nScrollDelay;
		Mar1.trueSpeed = 1;	
		Mar1.scrollAmount = 1;
		SaveScrollDelay();
	}
}
function StopTicker()
{
	if(nScrollDelay==100000 )
	{
		Mar1.scrollDelay = 20;
		nScrollDelay=Mar1.scrollDelay;
	}
	else
	{
		Mar1.scrollDelay = 100000;
		nScrollDelay=Mar1.scrollDelay;
		SaveScrollDelay();
	}				
}
function DecreaseSpeed()
{				
	if(nScrollDelay < 40)
	{
		nScrollDelay += 15;
		Mar1.scrollDelay = nScrollDelay ;
		Mar1.trueSpeed = 1;
		Mar1.scrollAmount = 1;
		SaveScrollDelay();
	}
	else if(nScrollDelay > 10000)
	{
		nScrollDelay = 25 ;
		Mar1.scrollDelay = nScrollDelay;
		Mar1.trueSpeed = 1;	
		Mar1.scrollAmount = 1;
		SaveScrollDelay();
	}

}
function SaveScrollDelay()
{
	var exp = new Date();
	var tenYearsFromNow = exp.getTime() + (10 * 365 * 24 * 60 * 60 * 1000);				
	exp.setTime(tenYearsFromNow);
	document.cookie = "scrolldelay=" + nScrollDelay + "; expires=" + exp.toGMTString();				
}
//-----------------------End-------------------
//------------------------Added By Sumit on 290305 ------------------
function sendInfoRegContact(strMsg)
{
	document.forms[0].hidResource.value		= "SERVICECONTACTUS";
	document.forms[0].hidActivity.value		= "mail";
	document.forms[0].action = "frontcontroller.ech";
		
	if(Trim(document.forms[0].TxtComment.value).length <= 0)
	{
//		alert(strMsg);
		alert(getMsgDesc(strMsg, "MSG014"));
		document.forms[0].TxtComment.focus();
		document.body.style.cursor= "auto";
		return false;
	}	
	document.forms[0].submit();	
}

//------------------------Added By Sumit on 290305 End------------------
//------------------------Added by Sumit on 070305 ---------------------

function getMsgDesc(strMsg, strMsgCode)
{
	var strMsgTemp	= null;
	var	iIndex	= 0;
	
	if(strMsg != null)
	{
		iIndex	 = strMsg.indexOf(strMsgCode);
		if (iIndex >= 0)
		{
			strMsgTemp = strMsg.substr(iIndex + strMsgCode.length + 1);
			iIndex	 = strMsgTemp.indexOf("~");
			if (iIndex	 >= 0 )
			{
				strMsgTemp = strMsgTemp.substr(0, iIndex);
			}
		}
		
	}	
	return strMsgTemp;
}

function SaveNewPswd(strMsg)
{	
	document.body.style.cursor="wait";	
	document.FrmChangePswd.BtnSendInfo.style.cursor="wait";
	if(Trim(document.FrmChangePswd.TxtOldPsd.value).length <= 0)
	{
//		alert("Please enter your old password");
//		alert(newarray[0]);
		alert(getMsgDesc(strMsg, "MSG018"));
		document.FrmChangePswd.TxtOldPsd.focus();
		document.body.style.cursor="auto";
		document.FrmChangePswd.BtnSendInfo.style.cursor="auto";
		return false;
	}
	/*	
	if(Trim(document.FrmChangePswd.TxtOldPsd.value).length < 8)
	{
//		alert("Your old password can not be less than 8 characters");
//		alert(newarray[1]);
		alert(getMsgDesc(strMsg, "MSG019"));
		document.FrmChangePswd.TxtOldPsd.focus();
		return false;
	}	
	if(Trim(document.FrmChangePswd.TxtOldPsd.value).length > 20)
	{
//		alert("Your old password can not be greater than 20 characters");
//		alert(newarray[2]);
		alert(getMsgDesc(strMsg, "MSG020"));
		document.FrmChangePswd.TxtOldPsd.focus();
		return false;
	}
	*/
	if(Trim(document.FrmChangePswd.TxtNewPsd.value).length <= 0)
	{
//		alert("Please enter new password");		
//		alert(newarray[3]);
		alert(getMsgDesc(strMsg, "MSG021"));
		document.FrmChangePswd.TxtNewPsd.focus();
		document.body.style.cursor="auto";
		document.FrmChangePswd.BtnSendInfo.style.cursor="auto";
		return false;
	}
	if(Trim(document.FrmChangePswd.TxtNewPsd.value).length < 8)
	{
//		alert("Password should be minimum 8 characters long");
//		alert(newarray[4]);
		alert(getMsgDesc(strMsg, "MSG022"));
		document.FrmChangePswd.TxtNewPsd.focus();
		document.body.style.cursor="auto";
		document.FrmChangePswd.BtnSendInfo.style.cursor="auto";
		return false;
	}
	if(Trim(document.FrmChangePswd.TxtNewPsd.value).length > 20)
	{
//		alert("Password should be maximum 20 characters long");
//		alert(newarray[5]);
		alert(getMsgDesc(strMsg, "MSG023"));
		document.FrmChangePswd.TxtNewPsd.focus();
		document.body.style.cursor="auto";
		document.FrmChangePswd.BtnSendInfo.style.cursor="auto";
		return false;
	}
	if(Trim(document.FrmChangePswd.TxtCnfrmPsd.value).length <= 0)
	{
//		alert("Please confirm your new password");
//		alert(newarray[6]);
		alert(getMsgDesc(strMsg, "MSG024"));
		document.FrmChangePswd.TxtCnfrmPsd.focus();
		document.body.style.cursor="auto";
		document.FrmChangePswd.BtnSendInfo.style.cursor="auto";
		return false;
	}
	if(Trim(document.FrmChangePswd.TxtCnfrmPsd.value).length < 8)
	{
//		alert("Confirm Password should be minimum 8 characters long");
//		alert(newarray[7]);
		alert(getMsgDesc(strMsg, "MSG025"));
		document.FrmChangePswd.TxtCnfrmPsd.focus();
		document.body.style.cursor="auto";
		document.FrmChangePswd.BtnSendInfo.style.cursor="auto";
		return false;
	}	
	if(Trim(document.FrmChangePswd.TxtCnfrmPsd.value).length > 20)
	{
//		alert("Confirm Password should be maximum 20 characters long");
//		alert(newarray[8]);
		alert(getMsgDesc(strMsg, "MSG026"));
		document.FrmChangePswd.TxtCnfrmPsd.focus();
		document.body.style.cursor="auto";
		document.FrmChangePswd.BtnSendInfo.style.cursor="auto";
		return false;
	}
	if(document.FrmChangePswd.TxtCnfrmPsd.value.length != document.FrmChangePswd.TxtNewPsd.value.length)
	{
//		alert("Confirm Password should be same with the new password");
//		alert(newarray[9]);
		alert(getMsgDesc(strMsg, "MSG027"));
		document.FrmChangePswd.TxtCnfrmPsd.focus();
		document.body.style.cursor="auto";
		document.FrmChangePswd.BtnSendInfo.style.cursor="auto";
		return false;
	}
	if(document.FrmChangePswd.TxtCnfrmPsd.value != document.FrmChangePswd.TxtNewPsd.value)
	{
//		alert("Confirm Password should be same with the new password");
//		alert(newarray[10]);
		alert(getMsgDesc(strMsg, "MSG027"));
		document.FrmChangePswd.TxtCnfrmPsd.focus();
		document.body.style.cursor="auto";
		document.FrmChangePswd.BtnSendInfo.style.cursor="auto";
		return false;
	}
	
	document.FrmChangePswd.hidResource.value		= "CHANGEPASSWORD";
	document.FrmChangePswd.hidActivity.value		= "UPDATECHNGPSWD";
	document.FrmChangePswd.submit();	
	//document.body.style.cursor="auto";
}
function fn_ChngPswd(strMsg)
{
	if (window.event.keyCode == 13)
	{
		SaveNewPswd(strMsg);
	}
}
//------------------------Added by Sumit on 070305 ---------------------

function CheckRecordPerPage(PageCnt)
{
	var intIndex = 0;	
	intIndex = Trim(document.forms[0].intRecCnt.value);
	intIndex = Math.ceil(intIndex);	
	document.forms[0].intRecCnt.value=intIndex;
	
	if(Trim(document.forms[0].intRecCnt.value).length <= 0)	
	{
		alert("Please enter Records / Page");
		document.forms[0].intRecCnt.focus();		
		return false;
	}
	else if((isNaN(intIndex)) || (intIndex>5000))	//(isNaN(intIndex))
	{
		document.forms[0].intRecCnt.value="";
		alert("Please enter numeric value between 1 to 5000");		
		document.body.style.cursor="auto";		
		return false;
	}
	else if (intIndex<=0)
	{		
		alert("Please enter positive integer value");
		document.forms[0].intRecCnt.focus();		
		return false;
	}	
	
}

function submitlogreport()
{
	if (document.forms[0].cmbStateList != null)
	{
		var strSelState = document.forms[0].cmbStateList.options(document.forms[0].cmbStateList.selectedIndex).value;	
		if(strSelState == 'None')
		{
			alert('Please select state');
			document.forms[0].cmbStateList.focus();
			return false;				
		}		
	}	
	if(Trim(document.forms[0].txtdtLogStartDate.value).length <= 0)
	{
		alert("Please enter start date");		
		return false;				
	}
	if (fnCheckPrevDate(Trim(document.forms[0].txtdtLogStartDate.value))== false)
	{
		document.forms[0].txtdtLogStartDate.value='';		
		return false;	
	}	
	if(Trim(document.forms[0].txtdtLogEndDate.value).length <= 0)
	{
		alert("Please enter end date");		
		return false;		
	}
	if (fnCheckPrevDate(Trim(document.forms[0].txtdtLogEndDate.value))== false)
	{
		document.forms[0].txtdtLogEndDate.value='';		
		return false;	
	}		
	
	if (fnCheckStartEndDate(Trim(document.forms[0].txtdtLogStartDate.value),Trim(document.forms[0].txtdtLogEndDate.value))==false)
	{
		document.forms[0].txtdtLogStartDate.value='';		
		document.forms[0].txtdtLogEndDate.value='';		
		return false;			
	}
	if (CheckRecordPerPage(document.forms[0].intRecCnt.value)==false)
	{
		return false;			
	}
	
	document.forms[0].style.cursor="Wait";
	document.forms[0].hidResource.value = "sitelogreport";
	document.forms[0].hidActivity.value = "render";
	document.forms[0].hidPageCnt.value = 1;			
	document.forms[0].hidFetchClick.value = true;
	document.forms[0].hidSession.value = '1';	
	document.forms[0].submit();			
}

function DisablePrevNextBtn()
{
	document.forms[0].btnPrev.disabled	=true;
	document.forms[0].btnNext.disabled	=true;
}

function SubmitReportData()
{
	if (CheckRecordPerPage(document.forms[0].intRecCnt.value)==false)
	{
		return false;			
	}
	document.forms[0].style.cursor="Wait";
	document.forms[0].hidResource.value = "sitelogreport";
	document.forms[0].hidActivity.value = "render";	
	document.forms[0].hidPageCnt.value = 1;		
	document.forms[0].hidFetchClick.value = true;		
	document.forms[0].hidSession.value = '1';	
	document.forms[0].submit();			
}

function ShowNextPrevReportData(PageCnt)
{
	if (CheckRecordPerPage(document.forms[0].intRecCnt.value)==false)
	{
		return false;			
	}
	document.forms[0].style.cursor="Wait";
	document.forms[0].hidResource.value = "sitelogreport";
	document.forms[0].hidActivity.value = "render";	
	document.forms[0].hidPageCnt.value = PageCnt;		
	document.forms[0].hidFetchClick.value = false;		
	document.forms[0].hidSession.value = '1';	
	document.forms[0].submit();			
}

function LogReportGetAllUser()
{
	if (CheckRecordPerPage(document.forms[0].intRecCnt.value)==false)
	{
		return false;			
	}
	document.forms[0].style.cursor="Wait";
	document.forms[0].hidResource.value = "sitelogreport";
	document.forms[0].hidActivity.value = "render";	
	document.forms[0].hidUser.value="user";
	document.forms[0].hidPageCnt.value = 1;		
	document.forms[0].hidFetchClick.value = true;
	document.forms[0].hidSession.value = '1';	
	document.forms[0].submit();			
}

function submitusagereport()
{
	if (document.forms[0].cmbStateList != null)
	{
		var strSelState = document.forms[0].cmbStateList.options(document.forms[0].cmbStateList.selectedIndex).value;	
		if(strSelState == 'None')
		{
			alert('Please select state');
			document.forms[0].cmbStateList.focus();
			return false;				
		}		
	}	
	if(Trim(document.forms[0].txtdtStartDate.value).length <= 0)
	{
		alert("Please enter start date");		
		return false;				
	}
	if (fnCheckPrevDate(Trim(document.forms[0].txtdtStartDate.value))== false)
	{
		document.forms[0].txtdtStartDate.value='';		
		return false;	
	}	
	if(Trim(document.forms[0].txtdtEndDate.value).length <= 0)
	{
		alert("Please enter end date");		
		return false;		
	}
	if (fnCheckPrevDate(Trim(document.forms[0].txtdtEndDate.value))== false)
	{
		document.forms[0].txtdtEndDate.value='';		
		return false;	
	}		
	
	if (fnCheckStartEndDate(Trim(document.forms[0].txtdtStartDate.value),Trim(document.forms[0].txtdtEndDate.value))==false)
	{
		document.forms[0].txtdtStartDate.value='';		
		document.forms[0].txtdtEndDate.value='';		
		return false;			
	}
	if (CheckRecordPerPage(document.forms[0].intRecCnt.value)==false)
	{
		return false;			
	}
	
	document.forms[0].style.cursor="Wait";	
	document.forms[0].hidResource.value = "siteusagereport";
	document.forms[0].hidActivity.value = "render";	
	document.forms[0].hidPageCnt.value = 1;		
	document.forms[0].hidFetchClick.value = true;
	document.forms[0].hidSession.value = '1';	
	document.forms[0].submit();			
}

function SubmitUsageReportData()
{
	
	if (CheckRecordPerPage(document.forms[0].intRecCnt.value)==false)
	{
		return false;			
	}
	document.forms[0].style.cursor="Wait";
	document.forms[0].hidResource.value = "siteusagereport";
	document.forms[0].hidActivity.value = "render";	
	document.forms[0].hidPageCnt.value = 1;		
	document.forms[0].hidFetchClick.value = true;
	document.forms[0].hidSession.value = '1';	
	document.forms[0].submit();			
}

function ShowNextPrevUsageReportData(PageCnt)
{
	if (CheckRecordPerPage(document.forms[0].intRecCnt.value)==false)
	{
		return false;			
	}
	document.forms[0].style.cursor="Wait";
	document.forms[0].hidResource.value = "siteusagereport";
	document.forms[0].hidActivity.value = "render";	
	document.forms[0].hidPageCnt.value = PageCnt;		
	document.forms[0].hidFetchClick.value = false;		
	document.forms[0].hidSession.value = '1';	
	document.forms[0].submit();				
}

function UsageReportGetAllUser()
{
	if (CheckRecordPerPage(document.forms[0].intRecCnt.value)==false)
	{
		return false;			
	}
	document.forms[0].style.cursor="Wait";
	document.forms[0].hidResource.value = "siteusagereport";
	document.forms[0].hidActivity.value = "render";	
	document.forms[0].hidUser.value="user";
	document.forms[0].hidPageCnt.value = 1;		
	document.forms[0].hidFetchClick.value = true;
	document.forms[0].hidSession.value = '1';		
	document.forms[0].submit();			
}

function fnCheckPrevDate(Datearr)
{
	Datearr = Datearr.split("/");
	var selDate=new Date(); // added
	var curDate	= new Date();
	var iDate = 0;
	var iMonth = 0;
	var iYear = 0;
	var lCurDateinMIllis = 0
	var lTodayDateinMIllis = 0
	iDate = parseInt(Datearr[0],10);
	iMonth = parseInt(Datearr[1],10);
	iYear = parseInt(Datearr[2],10);
	if (iDate > 0 && iMonth >= 0 && iYear > 0)
	{
		selDate.setYear(iYear);
		selDate.setMonth(iMonth -1 );
		selDate.setUTCDate(iDate);	
		lCurDateinMIllis = selDate.getTime();
		lTodayDateinMIllis = curDate.getTime();
		if ( lCurDateinMIllis > lTodayDateinMIllis )
		{
			alert("Date should be less than or equal to today");			
			return false;
		}
	}
	else
	{
		alert("Invalid date");
		return false;
	}	
} //end function

function fnCheckStartEndDate(Startdatearr,EnddateArr)
{
	Startdatearr = Startdatearr.split("/");
	var iStartDate = 0;
	var iStartMonth = 0;
	var iStartYear = 0;
	iStartDate = parseInt(Startdatearr[0],10);
	iStartMonth = parseInt(Startdatearr[1],10);
	iStartYear = parseInt(Startdatearr[2],10);
	
	EnddateArr = EnddateArr.split("/");
	var iEndDate = 0;
	var iEndMonth = 0;
	var iEndYear = 0;
	iEndDate = parseInt(EnddateArr[0],10);
	iEndMonth = parseInt(EnddateArr[1],10);
	iEndYear = parseInt(EnddateArr[2],10);
	
	var lStartDateinMIllis = 0
	var lEndDateinMIllis = 0
	
	var selStartDate = new Date(); 
	var selEndDate	 = new Date();
	
	if (iStartDate > 0 && iStartMonth >= 0 && iStartYear > 0 && iEndDate > 0 && iEndMonth >= 0 && iEndYear > 0)
	{
		selStartDate.setYear(iStartYear);
		selStartDate.setMonth(iStartMonth -1);
		selStartDate.setUTCDate(iStartDate);		
		
		selEndDate.setYear(iEndYear);		
		selEndDate.setMonth(iEndMonth -1);
		selEndDate.setUTCDate(iEndDate);	
		
		lStartDateinMIllis = selStartDate.getTime();
		lEndDateinMIllis   = selEndDate.getTime();
		if (lStartDateinMIllis > lEndDateinMIllis)
		{
			alert("End date cannot be less than start date");			
			return false;
		}
	}
	else
	{
		alert("Invalid date");
		return false;
	}	
}

function DisableSaveButton()
{
	if (document.forms[0].SaveOp != null)
	{
		document.forms[0].SaveOp.disabled=true;	
	}	
}

function OpenOpinionPollWindow(AttachFile,ForceUser)
{
	if (ForceUser=="TRUE") 
	{
		var	strModalWindow='';
		var WindowModes ='';
		if (AttachFile=="TRUE") 
		{
			WindowModes = 'dialogWidth:460px;dialogHeight:525px;status:0;help:0';
			strModalWindow = window.showModalDialog('OpinionPollPage.aspx',strModalWindow,WindowModes);		
		}
		else 
		{
			WindowModes = 'dialogWidth:460px;dialogHeight:300px;status:0;help:0';
			strModalWindow = window.showModalDialog('OpinionPollPage.aspx',strModalWindow,WindowModes);		
		}
		if (strModalWindow!="DATASAVED")
		{
			OpenOpinionPollWindow(AttachFile,ForceUser);
		}		
	}	
	else
	{
		if (AttachFile=="TRUE") 
		{
			strOpinionPollWindow = window.open('OpinionPollPage.aspx','OpinionWindow','height=525,width=460,scrollbars=1,resizable=1,maximize=1');
		}
		else 
		{
			strOpinionPollWindow = window.open('OpinionPollPage.aspx','OpinionWindow','height=300,width=460,scrollbars=1,resizable=1,maximize=1');
		}
		strOpinionPollWindow.focus();	
	}		
}

function OpenPopupWindow(OpenPopup,OpenOpinionPoll,AttachFile,ForceUser)
{
	if (OpenPopup=="TRUE") 
	{
		strPopupWindow = window.open('PopUpPage.aspx','PopupWindow','height=536,width=624,scrollbars=1,resizable=1,maximize=1');
		strPopupWindow.focus();							
	}
	if (OpenOpinionPoll=="TRUE") 
	{
		OpenOpinionPollWindow(AttachFile,ForceUser);
	}
}
//added by biplab for Onech/20069/16
function OpenPopupWindowPromo(OpenPopup,OpenOpinionPoll,AttachFile,ForceUser)
{
	if (OpenPopup=="TRUE") 
	{
		strPopupWindowPromo = window.open('PopUpPagePromo.aspx','PopupWindowPromo','height=536,width=624,scrollbars=1,resizable=1,maximize=1,screenX=50,screenY=50');
		strPopupWindowPromo.focus();							
	}	
}
//end of addition
//added by Biplab from Insc Policy Report-- OneCh/ECRF/3
function SubmitInscReportData()
{
	
	if (CheckRecordPerPage(document.forms[0].intRecCnt.value)==false)
	{
		return false;			
	}
	document.forms[0].style.cursor="Wait";
	document.forms[0].hidResource.value = "INSCPOLCREPT";
	document.forms[0].hidActivity.value = "render";	
	document.forms[0].hidPageCnt.value = 1;		
	document.forms[0].hidFetchClick.value = true;
	document.forms[0].hidSession.value = '1';	
	document.forms[0].submit();			
}

function submitinscreport()
{
	if (document.forms[0].cmbStateList != null)
	{
		var strSelState = document.forms[0].cmbStateList.options(document.forms[0].cmbStateList.selectedIndex).value;	
		if(strSelState == 'None')
		{
			alert('Please select state');
			document.forms[0].cmbStateList.focus();
			return false;				
		}		
	}	
	if(Trim(document.forms[0].txtdtStartDate.value).length <= 0)
	{
		alert("Please enter start date");		
		return false;				
	}
	if (fnCheckPrevDate(Trim(document.forms[0].txtdtStartDate.value))== false)
	{
		document.forms[0].txtdtStartDate.value='';		
		return false;	
	}	
	if(Trim(document.forms[0].txtdtEndDate.value).length <= 0)
	{
		alert("Please enter end date");		
		return false;		
	}
	if (fnCheckPrevDate(Trim(document.forms[0].txtdtEndDate.value))== false)
	{
		document.forms[0].txtdtEndDate.value='';		
		return false;	
	}		
	
	if (fnCheckStartEndDate(Trim(document.forms[0].txtdtStartDate.value),Trim(document.forms[0].txtdtEndDate.value))==false)
	{
		document.forms[0].txtdtStartDate.value='';		
		document.forms[0].txtdtEndDate.value='';		
		return false;			
	}
	if (CheckRecordPerPage(document.forms[0].intRecCnt.value)==false)
	{
		return false;			
	}
	
	document.forms[0].style.cursor="Wait";	
	document.forms[0].hidResource.value = "INSCPOLCREPT";
	document.forms[0].hidActivity.value = "render";	
	document.forms[0].hidPageCnt.value = 1;		
	document.forms[0].hidFetchClick.value = true;
	document.forms[0].hidSession.value = '1';	
	document.forms[0].submit();			
}

function ShowNextPrevInscReportData(PageCnt)
{
	if (CheckRecordPerPage(document.forms[0].intRecCnt.value)==false)
	{
		return false;			
	}
	document.forms[0].style.cursor="Wait";
	document.forms[0].hidResource.value = "INSCPOLCREPT";
	document.forms[0].hidActivity.value = "render";	
	document.forms[0].hidPageCnt.value = PageCnt;		
	document.forms[0].hidFetchClick.value = false;		
	document.forms[0].hidSession.value = '1';	
	document.forms[0].submit();				
}
//added by Biplab on 13/10/2005
function TmplModalWin(strTextBoxName)
{
   
	var str1 = '';
	
	str1 = window.showModalDialog("../calender.htm",str1,"dialogWidth:210px; dialogHeight: 210px;");
	
	if (str1 == null)
		{
			alert("Please enter a valid date");
		}
	else
		{
			strForm =  "document.forms[0]." + strTextBoxName;			
			eval(strForm).value = str1;		
			
		}
}
//end of insc rept-- OneCh/ECRF/3
