//---------------------------------------------------------
//
// File Name        : GeneralJSFunctions.js
// Copyright        : (c) Micro Focus Limited. 2004
// Description      : JavaScript General Function
// Modification History 
// 22Sep2004      Created
// 22Sep2004      Added General_onunload function
//
//---------------------------------------------------------

//--------------------
// Gobal Variables
//--------------------

var childWin; 

//--------------------
/* Clear text in an input field when focus is set to it */
 function doClear(theText) 
{
     if (theText.value == theText.defaultValue)
 {
         theText.value = ""
     }
 }

/*Generic pop up code - please use this only unless you really need something different*/
function popUpPage(url, parameters, name)
{
	var day = new Date();
	var pageName = name ? name : day.getTime()

	eval("bbc"+pageName+" = window.open('"+url+"','"+pageName+"','"+parameters+"')");

	if (eval("bbc"+pageName) && window.focus) eval("bbc"+pageName).focus();
}

/* Radio Player tag for PodCasting */
window.name="main";
function aodpopup(URL){
window.open(URL,'aod','width=693,height=525,toolbar=no,personalbar=no,location=no,directories=no,statusbar=no,menubar=no,status=no,resizable=yes,left=60,screenX=60,top=100,screenY=100');
}
if(location.search.substring(1)=="focuswin"){
	window.focus();
}

     function general_onunload(filePathPageName,childWindow){


          switch(filePathPageName.toLowerCase( )){
          
               // For index.asp White Papers
               case '\microfocus.com\root\whitepapers\index':
               if (typeof(childWindow)!='undefined'){
	               childWindow.close();
                          }
               // For index.asp Analyst Research Papers
               case '\microfocus.com\pressroom\analystresearch\index':
               if (typeof(childWindow)!='undefined'){
	               childWindow.close();
	          }
	          //---------------------------
          }
           

     }