/*********************************************************************
'***    Program: PopupViewWindow( strURL, strWindow, nWidth, nHeight )
'***    Type: Function
'***
'***    Function: Pops up a new window with displaying the URL passed
'***
'***    Parameters: 
'***		strURL  - the URL to display within the new window
'***
'***	Note: TO GET CONTROL ON TURNNING ON POPUP OR NOT, NEED TO SET CONST SE_SUPPORTS_POPUPS TO true
'***
'***	SE_LINK_SUPPORT_POPUP_WINDOW = true;
'***
'***    Returns: String
'***    Remarks: none
'***
'***    Created by: Jeffl
'***    Changed by: Jeffl
'***    Last change: 08/10/01
'*********************************************************************/
function PopupViewWindow( strURL, strWindow, nWidth, nHeight, strToolbar, strStatus, strLocation, strDirectories, strMenubar) {

   var SE_SUPPORTS_POPUPS = true;
   //Default Page
   var strWindowVal = "New";
   //Default Width
   var nWidthVal = new Number(520);
   //Default Height
   var nHeightVal = new Number(600);
   //Default Toolbar
   var strToolbarVal = "no";
   //Default Statusbar
   var strStatusVal = "no";
   //Default Location
   var strLocationVal = "no";
   //Default Directories
   var strDirectoriesVal = "no";
   //Default Menubar
   var strMenubarVal = "no";

   if (strWindow){
     strWindowVal = strWindow
   }
   if (nWidth){
     nWidthVal = nWidth
   }
   if (nHeight){
     nHeightVal = nHeight
   }
   if (strToolbar){
     strToolbarVal = "yes"
   }
   if (strStatus){
     strStatusVal = "yes"
   }
   if (strLocation){
     strLocationVal = "yes"
   }
   if (strDirectories){
     strDirectoriesVal = "yes"
   }
   if (strMenubar){
     strMenubarVal = "yes"
   }

   if (SE_SUPPORTS_POPUPS == (true || null || "")){
		aPopupViewWindowTest = window.open( strURL,strWindowVal,"toolbar=" + strToolbarVal + ",location=" + strLocationVal + ",directories=" + strDirectoriesVal + ",status=" + strStatusVal + ",scrollbars=yes,resizable=yes,width="+nWidthVal.toString()+",height="+nHeightVal.toString()+ ",menubar=" + strMenubarVal);
		aPopupViewWindowTest.focus();	 
   }
   else {
	    window.location.href = strURL;
   }

}


/*********************************************************************
'***    Program: SelectAllCheckBox()
'***    Type: Function
'***
'***    Function: select all checkbox
'***
'***    Parameters: 
'***		none
'***
'***
'***
'***    Created by: jzhou
'***    Changed by: jzhou
'***    Last change: 03/05/2007
'*********************************************************************/
function SelectAllCheckBoxes(){
	var blnFirstCheckValue = GetFirstCheckBox();
	var aDivs = document.getElementsByTagName('input');
	if (blnFirstCheckValue){
		for(var i = 0; i < aDivs.length; i++)
			aDivs[i].checked = false;
	}
	else{
		for(var i = 0; i < aDivs.length; i++)
			aDivs[i].checked = true;		
	}
}

function GetFirstCheckBox(){
	var aDivs = document.getElementsByTagName('input');
	
	for(var i = 0; i < aDivs.length; i++)
	{
		if(aDivs[i].type == "checkbox");
			return aDivs[i].checked;
	}	
}

/*********************************************************************
'***    Function: fillParentChildGroupObjects(  )
'***		
'***
'***    Parameters: strParentChildData, - Cached Data to be parsed
'***	       	    strParentChildDelimiterChar, char sep. par. chld data
'***                strChildDataDelimiterChar - char sep. child value pair data
'***    Returns: arrDroups array
'***    Remarks: none
'***    created by:  niloa
'***    Changed by:  niloa
'***    Last change: 12/16/2008
'*********************************************************************/
function fillParentChildGroupObjects( strParentChildData, strParentChildDelimiterChar, strChildDataDelimiterChar ){
    
    // Fill Droup objects with Data from Application("UserDefType_ParentChildData")
    var strUserDefType_ParentChildData = new String("");
    var strChildData = new String("");
    var arrUserDefType_ParentChildData = new Array();
    var arrChildData = new Array();
    var arrDroups = new Array();
	
	if( strParentChildDelimiterChar == null || strParentChildDelimiterChar == "" )
	    strParentChildDelimiterChar = ";";
    
    //Child data delimiter charactr
	if( strChildDataDelimiterChar == null || strChildDataDelimiterChar == "" )
	    strChildDataDelimiterChar = ",";
	    
    // Get Application("UserDefType_ParentChildData") Data from Server
    strUserDefType_ParentChildData = strParentChildData;

    arrUserDefType_ParentChildData = strUserDefType_ParentChildData.split(strParentChildDelimiterChar);
	
    for (var intIndex = 0; intIndex < arrUserDefType_ParentChildData.length; intIndex++) {
        // Get array from Items
        strChildData = arrUserDefType_ParentChildData[intIndex];
        arrChildData = strChildData.split(strChildDataDelimiterChar);
        arrDroups[intIndex] = new Group(arrChildData[0], arrChildData[1],arrChildData[2]);
    }
return arrDroups;
}