


function classTools(id)
	  {
  
	this.isDefined = function(variable)
		{
		return eval('(typeof('+variable+') != "undefined");');
		}
	
	var http = createRequestObject();							
	function createRequestObject()
		{
		var request;
		var browser = navigator.appName;
		if (browser == "Microsoft Internet Explorer")
			{ request = new ActiveXObject ("Microsoft.XMLHTTP");  }
		else { request = new XMLHttpRequest (); }
		return request;
		}	
		
	this.ReloadPage = function()	
			{	
			GCS.Window.location.replace(GCS.Window.location.href);
			}
    this.LoadPage = function(url)	
			{									
			GCS.Window.location.href=url;
			}
	
	this.GetURL = function(URL)	
			{									
			http.open("GET", URL, false);
			http.send(null);
			return http.responseText;
			}	
	this.GetWidth = function()
			{	
			
			if (parseInt(GCS.Navigator.appVersion)>3) {
				 if (GCS.Navigator.appName=="Netscape") {
				  winW = GCS.Window.innerWidth;
				 }
				 if (GCS.Navigator.appName.indexOf("Microsoft")!=-1) {
				  winW = GCS.Document.body.offsetWidth-4;
				 }
				}
				
			return winW;
			}	
	this.GetHeight = function()	
			{				
			
			if (parseInt(GCS.Navigator.appVersion)>3) {
				 if (GCS.Navigator.appName=="Netscape") {
					 
				  winH = GCS.Window.top.innerHeight;
				 }
				 if (GCS.Navigator.appName.indexOf("Microsoft")!=-1) {
					
				  winH = GCS.Document.body.offsetHeight-4;
				 }
				}
				
			return winH;
			}		
		<!--- Window --->
		this.DisplayCompanyMenu = function(compID,compName,URLToken){
			  var myWindow = GCS.Windows.getWindow('Window_CompanyMenu');
			  myWindow.Width(800);
			  myWindow.Title(compName);
			  myWindow.Url('/HelpDiv/companyMenu.cfm?customercode='+compID+'&'+URLToken);
			  myWindow.OnHide = function(winID){ 
			  	if(myWindow.ReloadFlag == true){
					myWindow.ReloadFlag = false;
			  		GCS.Tools.ReloadPage();
				}
			  }
			  myWindow.Show();
		}		
		this.DisplayCompanyMenuURL = function(myUrl,compName){
			  var myWindow = GCS.Windows.getWindow('Window_CompanyMenu');
			  myWindow.Width(800);
			  myWindow.Title(compName);
			  myWindow.Url(myUrl);
			  myWindow.OnHide = function(winID){ 
			  	if(myWindow.ReloadFlag == true){
					myWindow.ReloadFlag = false;
			  		GCS.Tools.ReloadPage();
				}
			  }
			  myWindow.Show();
		}	
		
		this.DisplayPortfolioManager = function(myUrl,repName,myWidth,myHeight){
			  var myWindow = GCS.Windows.getWindow('Window_PortfolioManager');
			  myWindow.Title(repName);
			  myWindow.Url(myUrl);
			  if(myWidth == 0){
				  myWindow.Width(GCS.Tools.GetWidth());
			  }
			  else{
				  myWindow.Width(GCS.Tools.GetWidth()-myWidth);
			  }
			   if(myHeight == 0){
				  myWindow.Height(GCS.Tools.GetHeight()+30);
			  }
			  else{
				  //myWindow.Height(GCS.Tools.GetHeight() - myHeight);
				  myWindow.Height(GCS.Tools.GetHeight()+30);
			  }
			  myWindow.OnHide = function(winID){ 
			  	var myWindow = GCS.Windows.getWindow('Window_PortfolioManager');				
			  	if(myWindow.ReloadFlag == true){
					myWindow.ReloadFlag = false;
			  		GCS.Tools.ReloadPage();
				}
			  }
			  myWindow.Show();
		}	
		
		this.DisplayCompanyReport = function(myUrl,repName,myWidth,myHeight){
			  var myWindow = GCS.Windows.getWindow('Window_PortfolioReport');
			  myWindow.Title(repName);
			  myWindow.Url(myUrl);
			  if(myWidth == -1){
			  }
			  else if(myWidth == 0){
				  myWindow.Width(GCS.Tools.GetWidth()+20);
			  }
			  else{
				  myWindow.Width(GCS.Tools.GetWidth()-myWidth);
			  }
			  if(myHeight == -1){
			  }
			  else if(myHeight == 0){
				  myWindow.Height(GCS.Tools.GetHeight()+60);
			  }
			  myWindow.OnHide = function(winID){ 
			  	var myWindow = GCS.Windows.getWindow('Window_PortfolioReport');
			  	if(myWindow.ReloadFlag == true){
					myWindow.ReloadFlag = false;
					var jqGridReport = document.getElementById("jqGridReport");
					if(jqGridReport != "undefined" && jqGridReport != null){
						var myCompanyMenuWindow = GCS.Windows.getWindow('Window_CompanyMenu');
						myCompanyMenuWindow.Navigate(myCompanyMenuWindow.Url());
						var mySection = jqGridReport.getAttribute("repSection");
						if(mySection == 'MPV'){
							gridRefreshMPV();
						}	
						else if(mySection == 'EDP'){
							gridRefreshEDP();
						}
					}
					else{
						var myCompanyMenuWindow = GCS.Windows.getWindow('Window_CompanyMenu');
						if(myCompanyMenuWindow.isVisible == true){
							myCompanyMenuWindow.ReloadFlag = true;
							myCompanyMenuWindow.Navigate(myCompanyMenuWindow.Url());
						}
						else{
							GCS.Tools.ReloadPage();
						}
					}
				}
			  }
			  myWindow.Show();
		}	
		
		this.DisplayInteractiveWindow = function(myUrl,repName,myWidth,myHeight,reloadWindow,reloadDefault){
			  var myWindow = GCS.Windows.getWindow('Window_Interactive');
			  myWindow.Title(repName);
			  myWindow.Url(myUrl);
			 if(myWidth == 0){
				  myWindow.Width(GCS.Tools.GetWidth());
			  }
			  else{
				  myWindow.Width(GCS.Tools.GetWidth()-myWidth);
			  }
			   if(myHeight == 0){
				  myWindow.Height(GCS.Tools.GetHeight()+30);
			  }
			  else{
				  //myWindow.Height(GCS.Tools.GetHeight() - myHeight);
				  myWindow.Height(GCS.Tools.GetHeight()+30);
			  }
			  myWindow.OnHide = function(winID){ 
			  	var myWindow = GCS.Windows.getWindow('Window_Interactive');
			  	if(reloadWindow != '' && (myWindow.ReloadFlag == true || reloadDefault == 'Reload')){
					myWindow.ReloadFlag = false;
					if(reloadWindow == 'Root'){
						GCS.Tools.ReloadPage();
					}
					else if(reloadWindow  == 'Window_PortfolioManager'){
						var myParentWindow = GCS.Windows.getWindow(reloadWindow);						
						myParentWindow.NavigateReload(myParentWindow.Url());
					}
					else{
						var myParentWindow = GCS.Windows.getWindow(reloadWindow);						
						myParentWindow.Navigate(myParentWindow.Url());
					}
				}
			  }
			  myWindow.Show();
		}	
		
		this.DisplayReportDetailsEDP = function(scoreFrom,scoreTo,parent,repType,risk,URLToken){
			  var myWindow = GCS.Windows.getWindow('Window_PortfolioReport');
			  myWindow.Title('Report Details');
			  myWindow.Url('/include_templates/ds/Method/EDPdetails.cfm?section=UTL&parent='+parent+'&risk='+risk+'&score='+scoreFrom+','+scoreTo+'&repType='+repType+'&'+URLToken);
			  myWindow.Width(GCS.Tools.GetWidth());
		 	  myWindow.Height(GCS.Tools.GetHeight());
			  myWindow.Show();
		}
		
		this.OnLoad = function(doc)	
		{	
		}
		this.LincClick = function(mylink,doc)	
			{				
			}
			
		/*  FORMATING    
			<cfset form.collAmt = trim(replace(form.collAmt,",","","ALL"))>   
			onkeyup="GCS.Tools.FormatNumber(document.getElementById('amt'),'false');"    */
		this.FormatNumber = function(ampVal,sighn){
			  var tempVal = ampVal.value;
			  tempVal = formatInt(tempVal,sighn);
			  ampVal.value = tempVal;	
		  }
		  function formatInt(intVal,sighn){
			  var tVal = '';
			  var totVal = '';
			  n = 1;
			  for(i=intVal.length-1; i >= 0 ;i--){	
				  if(intVal.charAt(i) >= 0 && intVal.charAt(i) <= 9){						
					  if(n == 4){							
						  tVal = tVal + ',';
						  //alert("n " + n);	
						  n = 1;
					  }						
					  tVal = tVal + intVal.charAt(i);
					  //alert(tVal);
					  n++;
				  }
				  else if(sighn == true && intVal.charAt(i) == '-' && i == 0){
					  tVal = tVal + intVal.charAt(i);
				  }
			  }
			  for(i=tVal.length; i >= 0 ;i--){
				  totVal = totVal + tVal.charAt(i);
			  }
			  return totVal;
		  }
		  
		  this.FormatDate = function(amt){
				ampVal = document.getElementById(amt);
				var tempVal = ampVal.value;	
				var tVal = '';
				n = 1;
				for(i=0; i < tempVal.length ;i++){	
					if(tempVal.charAt(i) >= 0 && tempVal.charAt(i) <= 9){						
						if(n == 3 || n == 5){							
							tVal = tVal + '/' + tempVal.charAt(i);
						}	
						else{
							tVal = tVal + tempVal.charAt(i);
						}
						n++;
					}
				}
				ampVal.value = 	tVal;	
			}
	  }
	  
	  
	  /*  ------------------------------------- HELP --------------------
	  	--- Window Submit ---
				myWindow.Windows.EnableWindow('Window_Interactive',document);
				
	  			Window.ReloadFlag = true;
				Window.Submit();
	  
	  	--- Scrole ---
			  <cfset scroll=false>
			  <cfif customers.recordcount GT 20 and (not isDefined("staticPage") or staticPage NEQ 'Y')>
				  <cfset scroll=true>
			  </cfif>
			  <cf_scrolltable Scroll="#scroll#" Height="#session.TableHight#" >
				  <thead>
				  		<cfif scroll and not session.browser.ISEXPLORER>
							<th width="16px">&nbsp;</th>
						</cfif>
				  </thead>
				  <tbody></tbody>
			  </cf_scrolltable>
			  
		--- replace ' ---
		<cfset tempVar = replace(Method.CreditScore_QA.Name,"'","\'","ALL")>
		--- Edit CL ---
		<a onclick="GCS.Tools.DisplayCompanyReport('/include_templates/ds/ul/ULEdit.cfm?section=UL&customercode=#AA2J5A#&type=E&market=100&#session.urltoken#','#customers.aa116aR#',0,0);" class="aLink">
		--- Edit Collateral --->
		<a onclick="GCS.Tools.DisplayCompanyReport('/include_templates/ds/UL/CTR/CTR4.cfm?section=CTC&customercode=#customers.AA2J5A#&reportType=4&delType=#NR2bgA#_#NP4rA#_#dateformat(NPkkA,'MM/dd/yyyy')#_#ISO_MARKET#_#NP4sA#_#nrgya#&#session.urltoken#','#customers.aa116aR#',0,0);" class="aLink">
		
		---- Reload ---
			<script language="JavaScript1.2">
				<!--
					var myCurrentWindow = GCS.Windows.getWindow('Window_PortfolioReport');
					myCurrentWindow.ReloadFlag = true;				
				-->
			</script>
	  */
	  
	  
	  

