
/*
 * function to preload some over images of Global Navigation
 * Used in  :  bx_header.jspf, Business Express Permit Wizard.htm
 			   search.jsp
*/

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

/*
 * function used to change the image on mouseout action
 * Used in  :  sbs_be_header_sign_in_only.jsp, sbs_be_header.jsp, sbs_be_horizontal_nav.jsp
  			   bx_header.jspf, Business Express Permit Wizard.htm
  			   bx_wizard_header.jspf, renderQuestions.jspf
  			   main.jsp, search.jsp
*/

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

/*
 * function used to find diffrent objects
 * Used in  : function named MM_swapImage() in this file
*/

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

/*
 * function used to change the image on mouseover action
 * Used in  :  sbs_be_header_sign_in_only.jsp, sbs_be_header.jsp, sbs_be_horizontal_nav.jsp
 	 		   bx_header.jspf, Business Express Permit Wizard.htm
  			   bx_wizard_header.jspf, renderQuestions.jspf
  			   main.jsp, search.jsp
*/

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*
 * function to hide the more information contents
 * Used in  :  easystart.jsp, bx_wizard_moreinfo.jspf
*/

function hideMoreInfo(paneId) {
	var thePane = document.getElementById(paneId);
     if (thePane!=null) {
            thePane.style.display = "none";
	}
}

/*
 * function to view the more information contents
 * Used in  :  renderQuestions.jspf
*/

function viewMoreInfo(paneId) {
	var thePane = document.getElementById(paneId);
      if (thePane!=null) {
	      thePane.style.display = "";
	  }
}

/*
 * function to open a new window for printpreview
 * Used in  :  permit_info.jspf, ViewReadOnly.jsp
 			   bx_wizard_moreinfo.jspf, bx_wizard_results_agency.jspf, results_agency.jsp, results_category.jsp	
*/

function openPrintWindow(url) {
	var theWindow = window.open(url,'printMoreInfo','menubar=1,resizable=1,width=750,height=550,scrollbars=1');
	theWindow.focus();
}

/*
 * function to open a external links in new browsers
 * Used in  :  OutcomeHelper.java
*/

function openInNewBrowser(url) {
		window.open(url);
	}

/*
 * function to slide the images on pageload action
 * Used in  :  homePageImages.jsp, quickstart_index.jsp
*/

function slideInit() {
	switchSlide(0);
	setCurTime();
	setTimer();
}

/*
 * next 2 functions used to change the links color on mouseover and out actions
 * Used in  :  agency_list.jspf, Business Express Permit Wizard.htm
*/

function agencyOver(trObj) {
	trObj.bgColor="#C8E2E5";
}

function agencyOut(trObj) {
	trObj.bgColor="#FFFFFF";
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*
 * function to hide and show the content on click of hide and view buttons
 * Used in  :  easystart.jsp, agencyOutcomes.jspf, categoryOutcomes.jspf
 			   email_results_agency.jsp
*/

function wizHideView(divName) {
	if (document.getElementById(divName).style.visibility == "hidden") {
		document.getElementById(divName).style.visibility = "visible";
		document.getElementById(divName).style.display = "block";
		document.getElementById(divName + "Btn").src = (document.getElementById(divName + "Btn").src).replace(/view/i,"hide");
		document.getElementById(divName + "Btn").alt = "View";
	} else {
		document.getElementById(divName).style.visibility = "hidden";
		document.getElementById(divName).style.display = "none";
		document.getElementById(divName + "Btn").src = (document.getElementById(divName + "Btn").src).replace(/hide/i,"view");
		document.getElementById(divName + "Btn").alt = "Hide";
	}
}

/*
 * function to swipe the images from regular to over and vice versa
 * Used in  :  easystart.jsp, agencyOutcomes.jspf, categoryOutcomes.jspf  
*/

function hvOver(divName) {
	if ((document.getElementById(divName + "Btn").src).indexOf("_over") == -1) {
		document.getElementById(divName + "Btn").src = (document.getElementById(divName + "Btn").src).replace(/.gif/i,"_over.gif");	
	} else {
		document.getElementById(divName + "Btn").src = (document.getElementById(divName + "Btn").src).replace(/_over.gif/i,".gif");	
	}
}

function wizHide(divName) {
	document.getElementById(divName).style.visibility = "hidden";
	document.getElementById(divName).style.position = "absolute";
}

function wizView(divName) {
	document.getElementById(divName).style.visibility = "visible";
	document.getElementById(divName).style.position = "static";
  	
}

/*text size variables begin*/

var checker=1;
var standardStyle = '1'; 
var nameOfCookie = 'be_font_size'; 
var cssPath = '/portal/apps/businessexpress/';

var css1 = 'styles.css';
var css2 = 'styles2.css';
var css3 = 'styles3.css';

/*text size variables end*/


/*text size code begin*/

function setIcon(){
	
	if(GetCookie(nameOfCookie) == "1"){
	document.Image34.src='/portal/apps/businessexpress/images/a_small_over.gif';	
	}else if(GetCookie(nameOfCookie) == "2"){
	document.Image35.src='/portal/apps/businessexpress/images/a_medium_over.gif';	
	}else if(GetCookie(nameOfCookie) == "3"){
	document.Image36.src='/portal/apps/businessexpress/images/a_large_over.gif';	
	}else{
	document.Image34.src='/portal/apps/businessexpress/images/a_small_over.gif';	
	}
}

function switchStyle(){
/*alert('I am in switch style');*/
	var fontSize = GetCookie(nameOfCookie);
	if (fontSize == null) {
		fontSize = standardStyle;
	}
	if (fontSize == "1") { 
	
	document.write('<link rel="stylesheet" type"text/css" href="' + cssPath + css1 + '">'); 
	checker=1;
	}
	
	if (fontSize == "2") {

	document.write('<link rel="stylesheet" type"text/css" href="' + cssPath + css2 + '">');
	checker=2;
	}
	
	if (fontSize == "3") { 
	document.write('<link rel="stylesheet" type"text/css" href="' + cssPath + css3 + '">'); 
	checker=3;
	}
	
	var fontSize = "";
	return fontSize;
}

function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}

function SetCookie (name, value) {
	//document.cookie = name + "=" + escape (value) + '; path=/';
	document.cookie = name + "=" + escape (value) + '; expires=Fri, 3 Aug 2050 20:47:11 UTC; path=/';
}

function DeleteCookie (name) {
	//var exp = new Date();
	//exp.setTime (exp.getTime() - 1);
	var cval = GetCookie (name);
	//createCookie(name,"",-1);
	document.cookie = name + "=" + escape ("noSession") + '; expires=Fri, 3 Aug 2050 20:47:11 UTC; path=/';
	//document.cookie = name +'="noSession"; expires=Thu, 01-Jan-70 00:00:01 GMT;';
	

}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}


function doRefresh(){
	location.reload();
}

function startall(){
/*alert('In start all');*/
 	isFormDefaultFieldPresent();
    hideFrame('theframe');
	setIcon();
	
}

function hideFrame(frmid){
	var frm = document.getElementById(frmid);
	frm.style.height = 0;
	frm.style.width = 0;
	frm.style.display = "none";	
}


switchStyle();

/*text size code end*/

/*
 * function to swipe the images from regular to over and vice versa
 * Used in  :  IndexBean.java 
*/

function genOver(divName) {
	swapImg = new Image();
	if ((document.getElementById(divName).src).indexOf("_over") == -1) {
		swapImg.src = (document.getElementById(divName).src).replace(/.gif/i,"_over.gif");
		document.getElementById(divName).src = (document.getElementById(divName).src).replace(/.gif/i,"_over.gif");	
	} else {
		swapImg.src = (document.getElementById(divName).src).replace(/_over.gif/i,".gif");
		document.getElementById(divName).src = (document.getElementById(divName).src).replace(/_over.gif/i,".gif");	
	}
}

/*
 * function used to switch to a different portlet
 * Used in  :  editProfile.jsp, viewProfile.jsp, scenarioList.jsp
*/

function switchPortlet(url) {

	window.location.href = url; 
}


/* Time out functions and variables start */

if(!sessionTimeOutlimit)
var sessionTimeOutlimit = 1500;

if(!warningTimeOutlimit)
var warningTimeOutlimit = 300;

if(!startCount)
var startCount=sessionTimeOutlimit;//2 minutes

if(!endCount1)
var endCount1 =warningTimeOutlimit;//1 min

if(!endCount2)
var endCount2= 0;
//timer state variables. Leave alone
if(!count)
var count = 0; //holds the current count

if(!timerStarted)
var timerStarted = false; //tracks timer state

if(!intervalID)
var intervalID = null; //keeps track of the id

if(!pathToSite)
var pathToSite = '/portal/site/businessexpress/';//path to site

if(!refreshPage)
var refreshPage = 'template.SBS_BE_SESSION_TIMEOUT/';//to refresh page

if(!logoutPage)
var logoutPage = 'template.LOGOUT/action.process/';

function timer() {

	if (!timerStarted) {
	     count=startCount;
	     timerStarted = true;
	}
	if (count==endCount1) {
	    showMessage("timeout15");
	    positionIFrame('timeout15', 'theframe');
	}
	if (count==endCount2) {
		window.clearInterval(intervalID);
		forceLogout();
	}
	//tick();
	count--;
}

//page-specific implementation methods

/**
* Tick is used show the count down.. BE does not need this at the moment...
*/
/*function tick() {
	var minutesDisplay = document.getElementById('minutes');
	var secondsDisplay = document.getElementById('seconds');
	var minutes = Math.floor(count/60);
	var seconds = count % 60;
	if (minutes<10) minutes = '0'+ minutes;
	if (seconds<10) seconds = '0'+ seconds;
	minutesDisplay.innerHTML = minutes;
	secondsDisplay.innerHTML = seconds;
}
*/

/*
 * function used to show a message
 * Used in  : function named timer(), SessionRefreshFailed() in this file
*/

function showMessage(messagePane ) {
    var posx=0;
    var posy=0;
    var myHeight=0;
    var myWidth=0;
    var scrOfY=0;
    var scrOfX=0;
    if(window.innerWidth){
    	myHeight=window.innerWidth/2;
    }else if( document.documentElement && document.documentElement.clientHeight) {
        //IE 6+ in 'standards compliant mode'
        myHeight = document.documentElement.clientHeight;
    } else if( document.body && document.body.clientHeight) {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
    }
    if( document.documentElement && document.documentElement.clientWidth) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
    } else if( document.body && document.body.clientWidth) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
    }
    if( document.body && document.body.scrollTop) {
        //DOM compliant
        scrOfY = document.body.scrollTop;
    } else if( document.documentElement && document.documentElement.scrollTop) {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
    }
    if( document.body && document.body.scrollLeft) {
        //DOM compliant
        scrOfX = document.body.scrollLeft;
    } else if( document.documentElement && document.documentElement.scrollLeft) {
        //IE6 standards compliant mode
        scrOfX = document.documentElement.scrollLeft;
    }
    posx=(myWidth-436)/2+scrOfX;
    posy=(myHeight-206)/2+scrOfY;
    var thisPane = document.getElementById(messagePane);
    thisPane.style.top = posy;
    thisPane.style.left = posx;
   	thisPane.style.display = "";
}

/*
 * function used to force the logout process
 * Used in  : function named timer() in this file
*/

function forceLogout() {
	logOut();
}

/*
 * function used to skeep logging out and continue working on
 * Used in  : sbs_be_grid_account_profile.jsp, sbs_be_grid.jsp
*/

function skipAndContinue() {
	HandleRefresh();
	//resetTimer();
}

/*
 * function used to set the position of frame
 * Used in  : function named timer() in this file
*/

function positionIFrame(divid, frmid)
{ 
        //alert('in position iframe');
	var div = document.getElementById(divid);
	var frm = document.getElementById(frmid);
	frm.style.left = div.style.left;
	frm.style.top = div.style.top;
	frm.style.height = div.offsetHeight;
	frm.style.width = div.offsetWidth;
	frm.style.display = "";	
}

/*
 * function used refresh the frame
 * Used in  : function named skipAndContinue() in this file
*/

function HandleRefresh()
{

	var myFrame = document.createElement("IFRAME");
	myFrame.src = pathToSite+refreshPage;
	myFrame.height = "0px";
	myFrame.width = "0px";
	document.body.appendChild(myFrame);
    var frm = document.getElementById("theframe");
	frm.style.display = "none";
	return false;
}

/*
 * function used to reset the timer
 * Used in  : function named SessionRefreshComplete() in this file
*/

function resetTimer(){
	count=startCount;
}

function logOut() {
    window.location=pathToSite+logoutPage;
    return false;
}

/*
 * function used to hide the timeout popup
 * Used in  : function named SessionRefreshComplete() and SessionRefreshFailed() in this file
*/

function hideTimeoutPopup(){
    document.getElementById("timeout15").style.display = "none";
}

/*
 * function used to hidesession when refresh fails
 * Used in  : sbs_be_grid_account_profile.jsp, sbs_be_grid.jsp 
*/

function hideSessionRefreshFailed(){
    document.getElementById("timeout_failed").style.display = "none";
}

/*
 * function used when refresh completes
 * Used in  : sbs_be_timeout.jsp 
*/

function SessionRefreshComplete()
{
	hideTimeoutPopup();
	resetTimer();
}

/*
 * function used when refresh fails
 * Used in  : sbs_be_timeout.jsp 
*/

function SessionRefreshFailed()
{
//	alert("session refresh failed");
	hideTimeoutPopup();
	showMessage("timeout_failed");

}

/* Time out functions and variables end */


/* Logout prompt functions start */

/* Function to check logout action
   Used in : sbs_be_header.jsp
*/

 function checkLogout(){
 	          
 	 //alert('you are in check logout');
 	 //alert('globalLogoutVaribale '+globalLogoutVaribale );
 	 if(typeof( globalLogoutVaribale ) == 'undefined'){
 	 	 //alert('globalLogoutVaribale is not set');
 	 	if (GetCookie ('logout') == null){
			//alert('setting logout cookie')			
			SetCookie('logout', 'true');
     	}
 	 	location.href='/portal/site/businessexpress/template.LOGOUT/action.process/';  
 	 }
 	 else{
 	  	 //alert('globalLogoutVaribale is  set');
 	  	 showLogoutMessage();
 	 }
 }
 
/* Function to logout
   Used in : function named forceLogout() in this file above
*/

 function logOut() {
     //alert("you are in logout");
     if (GetCookie ('logout') == null){
		//alert('setting logout cookie')			
		SetCookie('logout', 'true');
     }
     document.location.href='/portal/site/businessexpress/template.LOGOUT/action.process/';
      //alert(document.location);
     
}

/* Function to show logout message
   Used in : function named checkLogout() in this file above
*/

function showLogoutMessage() {
 //alert('you are in logout message');
    var posx=0;
    var posy=0;
    var myHeight=0;
    var myWidth=0;
    var scrOfY=0;
    var scrOfX=0;
    if(window.innerWidth){
    	myHeight=window.innerWidth/2;
    }else if( document.documentElement && document.documentElement.clientHeight) {
        //IE 6+ in 'standards compliant mode'
        myHeight = document.documentElement.clientHeight;
    } else if( document.body && document.body.clientHeight) {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
    }
    if( document.documentElement && document.documentElement.clientWidth) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
    } else if( document.body && document.body.clientWidth) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
    }
    if( document.body && document.body.scrollTop) {
        //DOM compliant
        scrOfY = document.body.scrollTop;
    } else if( document.documentElement && document.documentElement.scrollTop) {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
    }
    if( document.body && document.body.scrollLeft) {
        //DOM compliant
        scrOfX = document.body.scrollLeft;
    } else if( document.documentElement && document.documentElement.scrollLeft) {
        //IE6 standards compliant mode
        scrOfX = document.documentElement.scrollLeft;
    }
    posx=(myWidth-436)/2+scrOfX;
    posy=(myHeight-206)/2+scrOfY;
    document.getElementById("logoutMessage").style.top = posy;
    document.getElementById("logoutMessage").style.left = posx;
    document.getElementById("logoutMessage").style.display = "block";
}

/* Function to cancel logout and stay logged in
   Used in : sbs_be_grid_account_profile.jsp, sbs_be_grid.jsp
*/

function canelLogout()
{
	//alert('you are in cancel logout');
	hideLogoutMessagePopup();
	
}

/* Function to hide logout message popup 
   Used in : function named canelLogout() in this file above
*/

function hideLogoutMessagePopup(){
    document.getElementById("logoutMessage").style.display = "none";
}

/* Logout prompt functions end */

/* Change from Wizard to Incentives Confirmation to Clear Session */

function readCookie(name) {
	var nameEQ = name + "=";
	
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	
	return null;
}

function checkSession(whichSession,Continueurl){
     
	 
	var popUpCondn = getCookieVal('incentiveCookie');
	//alert('popUpCondn=' + popUpCondn);
	if(GetCookie('incentiveCookie')== 'noSession'){
		location.href=Continueurl;
	}
	if(GetCookie('incentiveCookie')== whichSession){
		showSessionMessage(whichSession);
		
		/*alert(readCookie(whichSession));
		//if(readCookie(whichSession)==null)
		 //showSessionMessage(whichSession);
		//else
		   //location.href=Continueurl;	
		   */
	}else {
		location.href=Continueurl;
	}
	 
}

function proceedClearSession(whichSession,continuUrl){
	DeleteCookie('incentiveCookie');
	//hideFrame('tempFrame');
	location.href=continuUrl;
}

/* Function to show logout message
  Used in : function named checkLogout() in this file above
*/

function showSessionMessage(whichSession) {
//alert('you are in logout message');
   var posx=0;
   var posy=0;
   var myHeight=0;
   var myWidth=0;
   var scrOfY=0;
   var scrOfX=0;
   if(window.innerWidth){
   	myHeight=window.innerWidth/2;
   }else if( document.documentElement && document.documentElement.clientHeight) {
       //IE 6+ in 'standards compliant mode'
       myHeight = document.documentElement.clientHeight;
   } else if( document.body && document.body.clientHeight) {
       //IE 4 compatible
       myHeight = document.body.clientHeight;
   }
   if( document.documentElement && document.documentElement.clientWidth) {
       //IE 6+ in 'standards compliant mode'
       myWidth = document.documentElement.clientWidth;
   } else if( document.body && document.body.clientWidth) {
       //IE 4 compatible
       myWidth = document.body.clientWidth;
   }
   if( document.body && document.body.scrollTop) {
       //DOM compliant
       scrOfY = document.body.scrollTop;
   } else if( document.documentElement && document.documentElement.scrollTop) {
       //IE6 standards compliant mode
       scrOfY = document.documentElement.scrollTop;
   }
   if( document.body && document.body.scrollLeft) {
       //DOM compliant
       scrOfX = document.body.scrollLeft;
   } else if( document.documentElement && document.documentElement.scrollLeft) {
       //IE6 standards compliant mode
       scrOfX = document.documentElement.scrollLeft;
   }
   posx=(myWidth-436)/2+scrOfX;
   posy=(myHeight-206)/2+scrOfY;
   document.getElementById(whichSession).style.top = posy;
   document.getElementById(whichSession).style.left = posx;
   document.getElementById(whichSession).style.display = "block";
   //positionIFrame(whichSession, 'tempFrame');
}

/* Function to cancel logout and stay logged in
  Used in : sbs_be_grid_account_profile.jsp, sbs_be_grid.jsp
*/

function canelCheckSession(whichSession,returnUrl)
{
	//alert('you are in cancel logout');
	hideSessionMessagePopup(whichSession);
	//hideFrame('tempFrame');
	location.href=returnUrl;
	
}

function hideSessionMessagePopup(whichSession){
   document.getElementById(whichSession).style.display = "none";
}

/* End of Confirm Clear Session for Wizard/Incentive*/

/* Function used to check for form defaults 
   Used in : function named startall() in this file above
*/

function isFormDefaultFieldPresent(){
	if(typeof( localFormDefaultVaribale ) == 'undefined'){ 
	 	//alert('form focus is not set');
     	}else{
		//alert('form focus is set');
		setlLocalFormDefaultField();
	}
} 

/* Function used to show more information window
   Used in : easystart.jsp
*/

function showMoreInfo(paneId,theElement) {
	var thePane = document.getElementById(paneId);
    var tempEl = theElement.offsetParent;
	var posy = tempEl.offsetTop;
    while (tempEl != null) {
          posy += tempEl.offsetTop;
          tempEl = tempEl.offsetParent;
      }

	thePane.style.top=posy+45;
      if (thePane!=null) {
	      thePane.style.display = "";
	  }
}

function info(wich){
 control = document.getElementById(wich + '_img');
 if (control.src.indexOf('view')!= -1){
 control.src = '/portal/apps/businessexpress/images/hide_over.gif';
 control = document.getElementById(wich + '_text');
 control.style.visibility = 'hidden';
 control.style.display = 'none';
 control = document.getElementById(wich + '_data');
 control.style.visibility = 'visible';
 control.style.display = 'block';
 }
 if (control.src.indexOf('hide')!= -1){
 control.src = '/portal/apps/businessexpress/images/view_over.gif';
 control = document.getElementById(wich + '_text');
 control.style.visibility = 'visible';
 control.style.display = 'block';
 control = document.getElementById(wich + '_data');
 control.style.visibility = 'hidden';
 control.style.display = 'none';
 }
}

 function view_over(wich){
 	if (wich.src.indexOf('view')!= -1) wich.src = '/portal/apps/businessexpress/images/view_over.gif';
 	if (wich.src.indexOf('hide')!= -1) wich.src = '/portal/apps/businessexpress/images/hide_over.gif';
 }
 
 function view_out(wich){
  	if (wich.src.indexOf('view')!= -1) wich.src = '/portal/apps/businessexpress/images/view.gif';
 	if (wich.src.indexOf('hide')!= -1) wich.src = '/portal/apps/businessexpress/images/hide.gif';
}


