function alertUser(){
	alert("Your session will expire in 5 minutes. Please click 'OK' to stay logged on.");
	window.location.reload()
}

//
SBool1=1;SBool2=0;SBool3=0;SBool4=1;SBool5=1;SBool6=1;SBool7=1;SBool7=1;SBool8=1;SBool9=1;SBool10=1;SBool11=1;SBool12=1;SBool13=1;SBool14=1;SBool15=1;SBool16=1;SBool17=1;SBool18=1;SBool19=1;SBool20=1;SBool1Co=0;SBool1Co1=1;
SBool21=1;SBool22=1;SBool23=1;SBool24=1;SBool25=1;
image1="/rx/rxifa/images/arr.right.gif"
image2="/rx/rxifa/images/arr.left.gif"
image3="rx-arrow_new_up"
image4="rx-arrow_new_down"

norupeemgr1="/rx/rxifa/images/norupeemgrbig.gif"

noeq1="/rx/rxifa/images/noeqbig.gif"
noeq0="/rx/rxifa/images/noeq.gif" 

noalert1="/rx/rxifa/images/noalertbig.gif"
noalert0="/rx/rxifa/images/noalert.gif"

nomf1="/rx/rxifa/images/nomfbig.gif" 
nomf0="/rx/rxifa/images/nomf.gif"

norem1="/rx/rxifa/images/noremainderbig.gif"	
norem0="/rx/rxifa/images/noremainder.gif"

nofi1="/rx/rxifa/images/nofibig.gif" 
nofi0="/rx/rxifa/images/nofi.gif"

nonews1="/rx/rxifa/images/nonewsbig.gif" 
nonews0="/rx/rxifa/images/nonews.gif" 

nomis1="/rx/rxifa/images/nomisbig.gif"
nomis0="/rx/rxifa/images/nomis.gif"

nowatch0="/rx/rxifa/images/nowatch.gif"
nowatch1="/rx/rxifa/images/nowatchbig.gif"

function OpenClose(PassValue,obj){
//for closing right side bar
	if (PassValue==1){
		if(SBool1==1){
			SBool1=0
			document.getElementById(obj).style.display="none";
			document.getElementById('CO').src=image2;
		}else{
			SBool1=1
			document.getElementById(obj).style.display="block";
			document.getElementById('CO').src=image1;
		}
	}
	if (PassValue=='CO'){//////for right slider bar closing and open
		if(SBool1Co==1){
			SBool1Co1=0
			document.getElementById(obj).style.display="none";
			document.getElementById('CO').src=image2;
		}else{
			SBool1Co=1
			document.getElementById(obj).style.display="block";
			document.getElementById('CO').src=image1;
		}
	}
		
	if (PassValue=='CO1'){//////for right slider bar closing and open
		if(SBool1Co1==1){
			SBool1Co1=0
			document.getElementById(obj).style.display="none";
			document.getElementById('CO1').src=image2;
		}else{
			SBool1Co1=1
			document.getElementById(obj).style.display="block";
			document.getElementById('CO1').src=image1;
		}
	}
		
	//Right side tools colse and open
	if (PassValue=="R1"){
		if(SBool2==0){
			SBool2=1			
			document.getElementById(obj).style.display="none";		
			document.getElementById('imgR1').className=image4;
		}else{
			SBool2=0
			document.getElementById(obj).style.display="block";
			document.getElementById('imgR1').className=image3;
		}
	}
		
	if (PassValue=="R2"){
		if(SBool3==1){
			SBool3=0
			document.getElementById(obj).style.display="none";
			document.getElementById('imgR2').className=image4;
		}else{
			SBool3=1
			document.getElementById(obj).style.display="block";
			document.getElementById('imgR2').className=image3;
		}
	}
	if (PassValue=="R3"){
		if(SBool4==1){
			SBool4=0
			document.getElementById(obj).style.display="none";
			document.getElementById('imgR3').className=image4;
		}else{
			SBool4=1
			document.getElementById(obj).style.display="block";
			document.getElementById('imgR3').className=image3;
		}
	}
	if (PassValue=="R4"){
		if(SBool5==0){
			SBool5=1
			document.getElementById(obj).style.display="block";
			document.getElementById('imgR4').className=image3;
		}else{
			SBool5=0
			document.getElementById(obj).style.display="none";
			document.getElementById('imgR4').className=image4;
		}
	}
	//for others in main content		
	if (PassValue==1){
		if(SBool6==1){
			SBool6=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img1').className=image4;
		}else{
			SBool6=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img1').className=image3;
		}
	}
	if (PassValue==2){
		if(SBool7==1){
			SBool7=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img2').className=image4;
		}else{
			SBool7=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img2').className=image3;
		}
	}
	if (PassValue==3){
		if(SBool8==1){
			SBool8=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img3').className=image4;
		}else{
			SBool8=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img3').className=image3;
		}
	}
	if (PassValue==4){
		if(SBool9==1){
			SBool9=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img4').className=image4;
		}else{
			SBool9=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img4').className=image3;
		}
	}
	if (PassValue==5){
		if(SBool10==1){
			SBool10=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img5').className=image4;
		}else{
			SBool10=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img5').className=image3;
		}
	}
	if (PassValue==6){
		if(SBool11==1){
			SBool11=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img6').className=image4;
		}else{
			SBool11=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img6').className=image3;
		}
	}
	if (PassValue==7){
		if(SBool12==1){
			SBool12=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img7').className=image4;
		}else{
			SBool12=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img7').className=image3;
		}
	}
	if (PassValue==8){
		if(SBool13==1){
			SBool13=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img8').className=image4;
		}else{
			SBool13=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img8').className=image3;
		}
	}
	if (PassValue==9){
		if(SBool14==1){
			SBool14=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img9').className=image4;
		}else{
			SBool14=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img9').className=image3;
		}
	}
	if (PassValue==10){
		if(SBool15==1){
			SBool15=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img10').className=image4;
		}else{
			SBool15=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img10').className=image3;
		}
	}
	if (PassValue==11){
		if(SBool16==1){
			SBool16=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img11').className=image4;
		}else{
			SBool16=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img11').className=image3;
		}
	}
	if (PassValue==12){
		if(SBool17==1){
			SBool17=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img12').className=image4;
		}else{
			SBool17=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img12').className=image3;
		}
	}
	if (PassValue==13){
		if(SBool18==1){
			SBool18=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img13').className=image4;
		}else{
			SBool18=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img13').className=image3;
		}
	}
	if (PassValue==14){
		if(SBool6==1){
			SBool6=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img1').className=image4;
		}else{
			SBool6=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img1').className=image3;
		}
	}
	if (PassValue==15){
		if(SBool21==1){
	 		SBool21=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img15').className=image4;
		}else{
			SBool21=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img15').className=image3;
		}		
	}
	if (PassValue==101){
		if(SBool22==1){
	 		SBool22=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img101').className=image4;
		}else{
			SBool22=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img101').className=image3;
		}
	}	
	if (PassValue==102){
		if(SBool23==1){
	 		SBool23=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img102').className=image4;
		}else{
			SBool23=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img102').className=image3;
		}
	}	
	if (PassValue==105){
		if(SBool24==1){
	 		SBool24=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img105').className=image4;
		}else{
			SBool24=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img105').className=image3;
		}
	}	
	if (PassValue==106){
		if(SBool25==1){
	 		SBool25=0
			document.getElementById(obj).style.display="none";
			document.getElementById('img106').className=image4;
		}else{
			SBool25=1
			document.getElementById(obj).style.display="block";
			document.getElementById('img106').className=image3;
		}	
	}
}

function popupprivacypolicy(myUrl){
	eval("window.open(myUrl,'privacypolicy','location=0,left=100,top=200,width=550,height=250,resizable=1,scrollbars=1');");
}

function verticalToggle(imgId, objId){
	obj = document.getElementById(objId);
	if(obj.style.display=="none"){
		obj.style.display = "block";
		document.getElementById(imgId).className=image3;
	}else{
		obj.style.display = "none";
		document.getElementById(imgId).className=image4;
	}
}

function horizontalToggle(imgId, objId){
	obj = document.getElementById(objId);
	if(obj.style.display=="none"){
		obj.style.display = "block";
		document.getElementById(imgId).src=image1;
		if(eval(document.snapshotForm)){
			if(eval(document.snapshotForm.noeq))document.getElementById('noeq').src=noeq0;
			if(eval(document.snapshotForm.noalert))document.getElementById('noalert').src=noalert0;
			if(eval(document.snapshotForm.nomf))document.getElementById('nomf').src=nomf0;
			if(eval(document.snapshotForm.noreminder))document.getElementById('noreminder').src=norem0;
			if(eval(document.snapshotForm.nofi))document.getElementById('nofi').src=nofi0;
			if(eval(document.snapshotForm.nonews))document.getElementById('nonews').src=nonews0;
			if(eval(document.snapshotForm.nomis))document.getElementById('nomis').src=nomis0;
			if(eval(document.snapshotForm.nowatch))document.getElementById('nowatch').src=nowatch0;
		}
	}else{
		obj.style.display = "none";
		document.getElementById(imgId).src=image2;
		if(eval(document.snapshotForm)){
			if(eval(document.snapshotForm.norupeemgr))document.getElementById('norupeemgr').src=norupeemgr1;
			if(eval(document.snapshotForm.noeq))document.getElementById('noeq').src=noeq1;
			if(eval(document.snapshotForm.noalert))document.getElementById('noalert').src=noalert1;
			if(eval(document.snapshotForm.nomf))document.getElementById('nomf').src=nomf0;
			if(eval(document.snapshotForm.noreminder))document.getElementById('noreminder').src=norem1;
			if(eval(document.snapshotForm.nofi))document.getElementById('nofi').src=nofi1;
			if(eval(document.snapshotForm.nonews))document.getElementById('nonews').src=nonews1;
			if(eval(document.snapshotForm.nomis))document.getElementById('nomis').src=nomis1;
			if(eval(document.snapshotForm.nowatch))document.getElementById('nowatch').src=nowatch1;
		}	
	}
}


//script for snapshot list view Collapsable and Expand

//Function to display and block taxation page
function submitForm(form){          
    form.submit();          
}
function addTxn(event, form){
	document.getElementById("event").value = event;
	form.submit();
}
/*login page start*/
var windowHandle;
function myConfirm(mode) {
    windowHandle = window.open('/jsp/common/confirmwindow.jsp?mode='+mode,'windowName','width=270,height=70,left=200,top=200,screenX=200,screenY=220','resizable=no','toolbar=no','copyhistory=no','status=no');
    if (!windowHandle.opener){
    	windowHandle.opener = self;
    }
	return false;
}



function closepopup(){
	if (newConfirm("RupeeX Confirmation ","Do you want to LogOut?",1,1,0)){
		location.href = "/logout.do?event=initSummary";
	 }
}
function newConfirm(title,mess,icon,defbut,mods) {
	icon = (icon==0) ? 0 : 2;
	defbut = (defbut==0) ? 0 : 1;
	retVal = makeMsgBox(title,mess,icon,4,defbut,mods);
	retVal = (retVal==6);
	return retVal;
}
/*start title content for snapshot */
Xoffset=-60;Yoffset= 20;   
var old,skn,iex=(document.all),yyy=-1000;
var ns4=document.layers;
var ns6=document.getElementById&&!document.all;
var ie4=document.all;

/* unconfirmed calculations */
function validateConfirm(form){
	if(checkForm(form)){
		var pureAmount=0,numerator=0,denominator=0,amtHidden=0; 
		for(i=0;i<document.unconfirmedForm.elements.length;i++){
			el=document.unconfirmedForm.elements[i];
			var tmp=el.id.split("_");
			if(tmp[0]=="contractQty"){
				var Asset_id =eval("document.unconfirmedForm.unConfAssetId_"+tmp[1]+".value");
				if(Asset_id ==""){
					alert("Select the company Name"); 
					return false;
				}
				var txnType=eval("document.unconfirmedForm.contractTxnType_"+tmp[1]+".value");
				if(txnType ==""){
					alert("Select the txnType");
					return false;
				}
				var qty=el.value;
				if((qty=="")||(qty == 0)){
					alert("Quantity cannot be Empty or Zero");
					return false;
				}
				var rate=eval("document.unconfirmedForm.contractPrice_"+tmp[1]+".value");	
				if((rate=="")||(rate == 0)){
					alert("Price cannot be Empty or Zero");
					return false;
				}
			}			
		}
	           
		var chargesObj=document.unconfirmedForm.charges.value;	
		var nteAmtObj=document.unconfirmedForm.noteAmount.value;
		var	validNo=parseFloat(Math.abs(nteAmtObj))*0.02;
		if(validNo<parseFloat(chargesObj)){
			ans=confirm("Charges is more than 2% of transaction amount. Due you still want to submit ?");
		}else{
			ans=true;
		}
		if(ans){	   
			
	    	document.unconfirmedForm.event.value='contractConfirmTxn';
			document.unconfirmedForm.submit();
		}
	}
	return false;
}
	
function validateForMFUnconfirmTxn(form){
	document.unconfirmedForm.event.value='contractConfirmTxn';
	document.unconfirmedForm.submit();
}

function checkForm(form) {
	form.txnDate.required = true;
	form.txnDate.requiredError = 'The txn date field must be filled in.';
	form.txnDate.pattern = 'date';
	form.txnDate.patternError = 'Put valid date.';
	var errors = getFormErrors(form);
	if (errors.length > 0) {
		var errorMessage = 'The form was not submitted due to the following problem' + ((errors.length > 1) ? 's' : '') + ':\n\n';
		for (var errorIndex = 0; errorIndex < errors.length; errorIndex++) {
		   errorMessage += '* ' + errors[errorIndex] + '\n';
		}
		errorMessage += '\nPlease fix ' + ((errors.length > 1) ? 'these' : 'this') + ' problem' + ((errors.length > 1) ? 's' : '') + ' and resubmit the form.';
		alert(errorMessage);
		return false;
	}
	return true;
}	

function calculateChargeAmount(){
	var pureAmount=0,numerator=0,denominator=0,amtHidden=0; 
	for(i=0;i<document.unconfirmedForm.elements.length;i++){
		el=document.unconfirmedForm.elements[i];
		var tmp=el.id.split("_");
		if(tmp[0]=="contractQty"){
			var qty=el.value;
			var txnType=eval("document.unconfirmedForm.contractTxnType_"+tmp[1]+".value");
			var rate=eval("document.unconfirmedForm.contractPrice_"+tmp[1]+".value");	
			var pureAmt=eval("document.unconfirmedForm.contractAmount_"+tmp[1]);
			if(txnType==3 || txnType==13) {
				pureAmt.value=-(qty*rate);
				denominator-=(qty*rate);	
			}else{
				pureAmt.value=(qty*rate);
				denominator+=(qty*rate);			  
			}
		}
	}		
	var chargesObj=document.unconfirmedForm.charges.value;		    
	var pNTotObj=document.unconfirmedForm.pureNoteAmount.value;
	var nteAmtObj=document.unconfirmedForm.noteAmount.value;	
	var msgObj=document.unconfirmedForm.msg.value;
	if(parseFloat(nteAmtObj)>0){
		msgObj="Due to You *" ;
	}else {
		msgObj="Due to Broker *" ;
	}
    pNTotObj=denominator;
    var chargeValue=(denominator-parseFloat(nteAmtObj));		    
	document.unconfirmedForm.charges.value=chargeValue.toFixed(3);
}
function GoUnconfirmedSearch(val,evt,searchboxid,txnId){
	if(document.getElementById(searchboxid).value ==""){
		alert("Please Enter first 3 letters of Company");
	}else{
		document.getElementById(val).style.display ="block";
		pressEnterUnconfirmedSearch(evt,document.getElementById(searchboxid).value,searchboxid,txnId);
	}
}


function pressEnterUnconfirmedSearch(evt,objval,searchboxid,txnId){
	//document.unconfirmedForm.searchText.value = objval;
	document.unconfirmedForm.searchboxid.value = objval;
	document.unconfirmedForm.txnId.value = txnId;
	var oldEvent=document.unconfirmedForm.event.value;
	//document.unconfirmedForm.txnId.value = txnId;
	searchUnConfTxnAjax(objval,document.unconfirmedForm,'searchUnconfirmedEqtAjax');
	document.unconfirmedForm.event.value=oldEvent;

} 
function showCompannyContractNote(dropSec,textSec){
	document.getElementById(dropSec).style.display="block";
	document.getElementById(textSec).style.display="none";
	globalAssetIdObj.options[0].selected=true;
}

var increm = 0;
function deleteArrTxn(chkid, txnId)  {	
	if(document.getElementById(chkid).checked==false) {
		for(i=0; i<txnDeleteArray.length; i++)	{
			if(txnDeleteArray[i]==txnId){
				txnDeleteArray[i]=0;
			}
		}
	}else {
		txnDeleteArray[increm] = txnId;
		increm++;	
	}
}
function pressEnterUnconfirmEq(ev,txtObj){
	var getCurrentRowNo=txtObj.id.split("_");
	for(i=0;i<document.unconfirmedForm.elements.length;i++){
		el=document.unconfirmedForm.elements[i];
		if(el.type=="select-one"){
			var str=el.id.split("_");
			if(str[0]=="unConfAssetId" && str[1]==getCurrentRowNo[1]){
				performEqMultiSearch(el, txtObj.value)
			}
		}
	}
}
function toggleSubTable(assetId,imgId){
	var cur = document.getElementById(assetId).style.display;
	if(cur=='none'){
		document.getElementById(assetId).style.display = "block";
		document.getElementById(imgId).className ="rx-ico_treegreenSnap";
	}else{
		document.getElementById(assetId).style.display = "none";	
		document.getElementById(imgId).className ="rx-ico_treegreenSnap1";
	}	
}
function toggleSubTable1(assetId,imgId){
	var cur = document.getElementById(assetId).style.display;
	if(cur=='none'){
		document.getElementById(assetId).style.display = "block";
		document.getElementById(imgId).src="/et/rxifa/images/collapsebtn2.gif";
	}else{
		document.getElementById(assetId).style.display = "none";	
		document.getElementById(imgId).src="/et/rxifa/images/expandbtn2.gif"
	}	
}
function showSnapShot(snapshotId){
	document.getElementById("event").value = "snapshotView";
	document.getElementById("snapShotId").value = snapshotId;
	performEqTxnViewAction(document.snapshotForm,"snapshotView");
}
function showMfSnapShot(snapshotMfId){
	document.snapshotForm.event.value = "snapshotMfView";
	document.snapshotForm.snapShotId.value = snapshotMfId;
	performMfTxnViewAction(document.snapshotForm,"snapshotMfView");
}
function familyChange(id){
	if(id == "add") {
		location.href = "family.do?event=add";
	} else {
		location.href = "menu.do?"+id;
	}
}
function popupSearch(sId){
	eval("window.open(sId,'alertId','location=0,width=955,height=500,resizable=yes,top=50,left=30,scrollable=yes');");
}
function searchUnConfTxnAjax(inputText, form,ev){	
	inputText = Trim(inputText);
	if(inputText!=""){
		if(inputText.length <3){
			alert("Minimum three letters required for search.");
		}else{
			document.getElementById("event").value=ev;
			var url = "/secure/unconfirmedLedger.do"+"?event=" + ev +"&searchboxid="+inputText+"&txnId="+document.unconfirmedForm.txnId.value; 
			genericAjaxRetriever(url,document.unconfirmedForm.txnId.value);
		}
	}
}
function searchEquityTextAjax(inputText, form,ev){	
	inputText = Trim(inputText);
	if(inputText!=""){
		if(inputText.length <3){
			alert("Minimum three letters required for search.");
		}else{
			document.getElementById("event").value=ev;
			performSearchAjax(form,ev);
		}
	}
}
function deleteTxn(eventName,txnId,ledgerId,form){
	var ans = confirm('Are you sure you want to delete this transaction?');
	if(ans){
		if(eventName=="deleteTxnFromAudit"){
			form.eqEvent.value = eventName;
		}else{
    		form.event.value = eventName;
    	}
		form.txnId.value = txnId;
		form.ledgerId.value = ledgerId;
		form.submit();
	}
}
function activateWatchTab(x,val){
	for(i=0; i<=x.parentNode.childNodes.length-1; i++){
		if(x.parentNode.childNodes[i].tagName=="A"){
			x.parentNode.childNodes[i].className= "marketTab";
		}
		x.className= "marketTabActive";	
	}
	if(val=='yesday') {
		document.getElementById("yesday").style.display = "block";
		document.getElementById("entry").style.display = "none";
	} else {
		document.getElementById("yesday").style.display = "none";
		document.getElementById("entry").style.display = "block";	
	}
}
function activateWatchTabET(x,val){
	if(val=='yesday') {
		document.getElementById("yesday").style.display = "block";
		document.getElementById("swyId").className="snapShotTabActive";
		document.getElementById("sweId").className="snapShotTab";
		document.getElementById("entry").style.display = "none";
	} else {
	    document.getElementById("sweId").className="snapShotTabActive";
		document.getElementById("swyId").className="snapShotTab";
		document.getElementById("yesday").style.display = "none";
		document.getElementById("entry").style.display = "block";	
	}
}
function saveDuplicateEditEqTxn(event,form){
	var formValidBool=false,dateValidBool=false;
	if(editEqTxnCheckForm(form)){
	formValidBool=true;
	if(chkValidCurrentPastDate(form.txnDate.value)){dateValidBool=true;}else dateValidBool=false;}
	if(formValidBool==true && dateValidBool==false){
		var errorMessage = "The form was not submitted due to the following problem \n\n   ";
		errorMessage += "* Transaction date cannot be greater than today's date \n\n ";
		errorMessage += "Please fix this and resubmit the form.";
		alert(errorMessage);return;
	}
	if(formValidBool && dateValidBool){
		form.event.value="saveDuplicateEditEqTxn";
		form.submit();
	}
}
function editEqTxnCheckForm(form) { 
   form.quantity.required = true;
   form.quantity.requiredError = 'The quantity field must be filled in.';
   form.quantity.pattern = 'decimal';
   form.quantity.patternError = 'The quantity field accepts only numbers.';
  
   form.rate.required = true;
   form.rate.requiredError = 'The Price field must be filled in.';
   form.rate.pattern = 'decimal';
   form.rate.patternError = 'The Price field accepts only numbers.';
            
   form.exchangeType.required=true;
   form.exchangeType.requiredError = 'The exchangeType field must be filled in.';
  
   form.txnDate.required = true;
   form.txnDate.requiredError = 'The Transaction Date field must be filled in.';
   form.txnDate.pattern = 'date';
   form.txnDate.patternError = 'The Transaction Date field accepts only dd/mm/yyyy.'; 

   var editTxnErrors = getFormErrors(form);               
   if (editTxnErrors.length > 0) {
    
      var errorMessage = 'The form was not submitted due to the following problem' + ((editTxnErrors.length > 1) ? 's' : '') + ':\n\n';
      for (var errorIndex = 0; errorIndex < editTxnErrors.length; errorIndex++) {
         errorMessage += '* ' + editTxnErrors[errorIndex] + '\n';
      }
      errorMessage += '\nPlease fix ' + ((editTxnErrors.length > 1) ? 'these' : 'this') + ' problem' + ((editTxnErrors.length > 1) ? 's' : '') + ' and resubmit the form.';
      alert(errorMessage);
      return false;
   }
   return true;
}
function demoUserMsg() {
	alert("This feature is disabled for demo users");
}
var newsreq;
var newsSecs;
var newsTimerID = null;
var newsTimerRunning = false;
var newsDelay = 1000;
function InitializeTimer(){
 newsSecs = 5
 StopTheClock()
 StartTheTimer()
}
function StopTheClock(){
 if(newsTimerRunning)
     clearTimeout(newsTimerID)
 newsTimerRunning = false
}
function StartTheTimer(){
 if (newsSecs==0){
     StopTheClock()
     performTimerAction()
  InitializeTimer()
 }else{
     self.status = newsSecs
     newsSecs = newsSecs - 1
     newsTimerRunning = true
     newsTimerID = self.setTimeout("StartTheTimer()", newsDelay)
 }
}  
//home page
function performTimerAction(){ 
 var url =  "default.do?event=fetchNextNews&currNews=" + document.getElementById('newsId').value
 genericAjaxRetriever(url, "newsContent"); 
}
//endfunction

// method for the easiupload
function openGWTWindow(aboutUsUrl){
 eval("window.open(aboutUsUrl,'EasiUpload','left=50,top=50,scrollbars=1,resizable=1,width='+(screen.width-200)+',height='+(screen.height-150)+',');");
}
// end of easu upload method
