function findSubmitFunction(submitFunctionType){



}
function setAction(action){

	document.forms["SpecificDataForm"]["action"].value = action;
}


function confirmation(msg) {
    var answer = confirm(msg);
     if (answer){
  return true;
 }return false;
}

function tooltip() {}
tooltip.id="tooltip";
tooltip.offsetx=10;
tooltip.offsety=10;
tooltip.x=0;
tooltip.y=0;
tooltip.tooltipElement = null;
tooltip.iframeElement = null;
tooltip.titleSaved = "";
tooltip.show=function(obj)  {
				var titlestr = obj.getAttribute("title");
								if ((titlestr!=null) && (titlestr!=''))
								{
								    if (document.getElementById(this.id) == null)
									{
										document.body.insertAdjacentHTML("afterBegin", "<div id='" + this.id + "' class='Hint'></div>");
										this.tooltipElement = document.getElementById(this.id);
										this.iframeElement = document.createElement("IFRAME");
										this.iframeElement.setAttribute("src", "/blank.html");
										this.tooltipElement.parentNode.insertBefore(this.iframeElement, this.tooltipElement);
//										document.body.insertAdjacentHTML("beforeEnd", "<iframe id='ifr_" + this.id + "' class='IfrHint'></iframe>");
//										this.iframeElement = document.getElementById("ifr_" + this.id);
//			                            this.iframeElement = this.tooltipElement.parentNode.insertBefore(document.createElement("IFRAME"), this.tooltipElement);
//			                            this.iframeElement.src="https://portal.cib.hu"; // to test avoiding http & https issues
                		                this.iframeElement.style.position="absolute";
								    }
								    this.titleSaved = titlestr;
								    obj.setAttribute("title", "");
									this.tooltipElement = document.getElementById(this.id);
									this.tooltipElement.onmouseover = tooltip.mouseMove;
								    this.saveonmouseover = document.onmousemove;
//									document.onmousemove = this.mouseMove;
									document.getElementById(this.id).innerHTML = titlestr;
//									this.moveTo(this.x+this.offsetx, this.y+this.offsety);
									this.mouseMove(event);
									this.tooltipElement.style.visibility="visible";
									this.iframeElement.style.visibility="visible";
									return false;
								}
							};
tooltip.hide=function(obj)	{
							    if (document.getElementById(this.id) != null)
							    {
					  				obj.setAttribute("title", this.titleSaved);
							  		this.titleSaved="";
		 					  		this.tooltipElement.style.visibility="hidden";
									this.iframeElement.style.visibility = "hidden";
									document.onmousemove = this.saveonmouseover;
								}
							};
tooltip.mouseMove=function(e) {
								tooltip.x = event.x + document.body.scrollLeft;
								tooltip.y = event.y + document.body.scrollTop;
								tooltip.moveTo( tooltip.x +tooltip.offsetx , tooltip.y + tooltip.offsety);
								};
tooltip.moveTo=function(x, y)	{
								this.tooltipElement.style.left=x+"px";
								this.tooltipElement.style.top=y+"px";
						        var horDistance = x-document.body.scrollLeft+this.tooltipElement.offsetWidth-document.body.clientWidth;
						        var verDistance = y-document.body.scrollTop+this.tooltipElement.offsetHeight-document.body.clientHeight;
						        if (horDistance>0)
								  this.tooltipElement.style.left=x-horDistance+"px";
						        if (verDistance>0)
								  this.tooltipElement.style.top=y-verDistance+"px";
						        this.iframeElement.style.left = this.tooltipElement.style.left;
						        this.iframeElement.style.top = this.tooltipElement.style.top;
						        this.iframeElement.style.width = this.tooltipElement.offsetWidth + 'px';
						        this.iframeElement.style.height = this.tooltipElement.offsetHeight + 'px';
							};


function doLinkAction(obj) 
{
	obj.disabled=true;
	window.location=obj.href;
}

function showWarning(obj)
{
    var el = document.createElement('DIV');
    if (document.getElementById('cibfe_pleasewait')!=null) {
	    el.innerHTML=document.getElementById('cibfe_pleasewait').innerHTML;
	}
	else {
	    el.innerHTML='Please wait...';
	}
    el.className='PopupWarning';
    el.style.position='absolute';
//    el.style.left =	obj.style.left;
//    el.style.top = obj.style.top;
	el.style.paddingTop='10px';
//	el.style.marginTop='10px';
	el.style.left=document.body.clientWidth/2-150;
	el.style.top=document.body.clientHeight/2-50;
if(obj==null) document.forms["SpecificDataForm"].appendChild(el);
    else obj.appendChild(el);
    
//   obj.parentElement.appendChild(el);
	var iframeElement = document.createElement('IFRAME');
	//iframeElement.setAttribute("src", "/blank.html");	
	//el.parentNode.insertBefore(iframeElement, el);
	iframeElement.style.position="absolute";
    iframeElement.style.left = el.style.left;
    iframeElement.style.top = el.style.top;
    iframeElement.style.width = el.offsetWidth + 'px';
    iframeElement.style.height = el.offsetHeight + 'px';

}


function submitForm(obj,id,operation,forwardurl,ifTest,whatTest,msg,localOperationId,localOperationValue,warning,submitFunctionType,lastItem)
{ 

  if(operation=='no') return;
  

  
   if(document.forms["SpecificDataForm"][ifTest]!=null){
  	var message=ifTest+"MSG";
  	if(document.forms["SpecificDataForm"][ifTest].value==''||document.forms["SpecificDataForm"][ifTest].value==-1){
  	if(document.forms["SpecificDataForm"][message]==null) {alert('Please select a row !');return;
  	}else{ alert(document.forms["SpecificDataForm"][message].value);return;
  	}
  }
  }
	if(whatTest!=null && whatTest!='' ){
		if (whatTest == 'remove'){
			var removeQuestionValue=document.forms["SpecificDataForm"]['removeQuestion'].value;
 			if(removeQuestionValue != null && removeQuestionValue != ''){
  				var resultAtremove = removeFunction(removeQuestionValue); 	
				if(resultAtremove==1)
					return; 	
  			}
  		}
  		if (whatTest == 'close'){
  			var closeQuestionValue=document.forms["SpecificDataForm"]['closeQuestion'].value;
	 		if(closeQuestionValue != null && closeQuestionValue != ''){
  				var resultAtClose = closeFunction(closeQuestionValue); 	
				if(resultAtClose==1)
					return; 	
	  		}
  		}
	}
  
  if(localOperationId!=null && localOperationId!=''){
  document.forms["SpecificDataForm"][localOperationId].value=localOperationValue;
  }
  document.forms["SpecificDataForm"]['hd_operation'].value = operation;
	
  	var submitOrNot=
  	findSubmitFunction(submitFunctionType);
  	if(submitOrNot!=null &&!submitOrNot){
  	return;
  	
  	}
  	
	if (obj.tagName!='SELECT')
	obj.disabled=true;
		
   showWarning(document.forms["SpecificDataForm"]);
   document.forms["SpecificDataForm"].submit();
   
 
}
function ifTest(what,msg){
 if(document.forms["SpecificDataForm"][what]!=null){
  	if(document.forms["SpecificDataForm"][what].value==''){
  	if(msg=='') {alert('Please select a row !');return;
  	}else{ alert(msg);return;}
  }
  }
}



function setCookie(name, value, expires, path, domain, secure)
{
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

/**
 * Deletes the specified cookie.
 *
 * name      name of the cookie
 * [path]    path of the cookie (must be same as path used to create cookie)
 * [domain]  domain of the cookie (must be same as domain used to create cookie)
 */
function deleteCookie(name, path, domain)
{
    if (getCookie(name))
    {
        document.cookie = name + "=" + 
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }

}   
    
    
function promptPrinterName(txt) 
{
    var printer_name = getCookie("printerName");
    var new_name = prompt(txt, printer_name);
    if (new_name==null)
    {
      event.cancelBubble=true;
      return false;
    }
    if (new_name!=printer_name)
    {
    	var futureDate = new Date();
    	futureDate.setYear(futureDate.getYear()+5);
    	setCookie("printerName", new_name, futureDate, null, "cib.hu", false);
    	return true;
    }
}

function popupErrors()
{
  var errormsg = document.getElementById("errorlist").innerText;
  if ((errormsg!=null) && (errormsg.length>0))
  {
	  if (getCookie('lastmsg')!=errormsg)
	  {
	  	alert(errormsg);
	  	setCookie('lastmsg', errormsg);
	  }
  }
  else
  {
	  	setCookie('lastmsg', '');
  }
}

function submitSpecificDataForm(nextItemId, cmPid, cmUrl)
{	
	showWarning(document.forms["SpecificDataForm"]);
	document.forms["SpecificDataForm"]["operation"].value =item;
	if(document.forms["SpecificDataForm"]["hd_operation"].value !='no'){
		if(forward !=''){
		document.forms["SpecificDataForm"].action=forward;
		}
	document.forms["SpecificDataForm"].submit();
	}else return;
}

function submitSpecificDataForm(item,forward)
{
	showWarning(document.forms["SpecificDataForm"]);
	document.forms["SpecificDataForm"]["operation"].value =item;
	if(document.forms["SpecificDataForm"]["hd_operation"].value !='no'){
		if(forward !=''){
		document.forms["SpecificDataForm"].action=forward;
		}
	document.forms["SpecificDataForm"].submit();
	}else return;
}

/*********************************************************
	CM Related block begin
**********************************************************/

	if(navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 4) this.browser = "ie4"
	else if(navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4 && parseInt(navigator.appVersion) < 5) this.browser = "nav4"
	else if(navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 5) this.browser = "nav6"



	var appletWin = null;
	var appletAlive = false;
	var windowPropertiesCM = "width=500,height=700,left=500,top=20,resizable=1,scrollbars=1"

	function openDoc(docid, docurl, inAppletViewer)
	{
		if ((docid!=null) && (docid!=''))
		{
		    if ( inAppletViewer == "true" )
		    {
		   		if (isAppletAlive())
		   		{  
	 	       		appletWin.focus();
	    			appletWin.document.applets[0].loadDocument(docid);
	   			}
	   			else
	   			{
	      			openAppletViewer(docurl);       
	   			}
	   		}
	   		else
	   		{
				window.open(docurl, "viewWin", windowPropertiesCM);	
	   		}
	   	}
	}

	function openAppletViewer( docurl )
	{
		appletWin = window.open(docurl, "appletWin", windowPropertiesCM);      	
		appletAlive = "true";
		setCookie("appletAlive", "true");
	}

	function isAppletAlive()
	{
		appletAlive = getCookie("appletAlive");
   
   		if (appletAlive == "true")
   		{
   			if (appletWin == null)
   			appletWin = window.open("", "appletWin", windowPropertiesCM);
   			return true;
   		}
   		else
   		{	
   			appletWin = null;
   			return false;
   		}   
	}

	function appletWindowClosed()
	{
		appletAlive = "false";
		setCookie("appletAlive", "false");	
   		appletWin = null;   
	}	

	function begin()
	{   
		appletAlive = getCookie("appletAlive");
   
   		if (appletAlive == "true")
   		{
   			appletWin = window.open("", "appletWin", windowPropertiesCM);
   		}
   		else
   		{	
   			appletWin = null;
   		}   
	}
	
	function showWarningLink(){
	showWarning(document.forms['SpecificDataForm']);
}
	
/*********************************************************
	AMON Related block begin
**********************************************************/


/*********************************************************
	AMON Related block begin
**********************************************************/
	