function IsClientValidationEnabled()
{
	if (typeof(Page_ClientValidate) == 'function')
	{
		return true;
	}
	else
	{
		return false;
	}
}

function EnableValidator(validator, enable)
{
	if (IsClientValidationEnabled())
	{
		ValidatorEnable(validator, enable);
	}
}
function showhello(college)
{
   //alert(college);
   document.getElementById("txtCollege1").value = collegeName;
   
}

function ValidateValidator(validator)
{
	if (IsClientValidationEnabled())
	{
		ValidatorValidate(validator);
	}
}

function UpdateValidatorDisplay(validator)
{
	if (IsClientValidationEnabled())
	{
		ValidatorUpdateDisplay(validator);
	}
}

function GetControlById(controlId)
{
	var ctr = document.getElementById(controlId);
	
	if ((ctr == null) || (ctr == 'undefined'))
	{
		for(var i = 0; i < document.forms.length; i++)
		{
			ctr = document.forms[i].elements[controlId];
			
			if (ctr != null)
			{
				break;
			}
		}
	}
	
	return ctr;
}

function ChangeToUpperCase(control)
{
	control.value = Trim(control.value.toUpperCase());
}

function ChangeToLowerCase(control)
{
	control.value = Trim(control.value.toLowerCase());
}

function LTrim(text)
{
	while (text.substring(0, 1) == ' ')
	{
		text = text.substring(1, text.length);
	}
	
	return text;
}

function RTrim(text)
{
	while (text.substring(text.length-1, text.length) == ' ')
	{
		text = text.substring(0, text.length-1);
	}
	
	return text;
}

function Trim(text)
{
	return LTrim(RTrim(text));
}

function ReplaceCharacters(text, findChar, replaceChar)
{
	var replacedText = text.split(findChar);
	replacedText = replacedText.join(replaceChar);
	
	return replacedText;
}

function FormatDecimal(control)
{
	if (isNaN(control.value))
	{
		return;
	}
	else
	{
		var result = (Math.round((parseFloat(control.value) * 100))/100).toString();
		
		if (!isNaN(result))
		{
			var digitPosition = result.indexOf('.');
			
			if (digitPosition < 0)
			{
				result += '.00';
			}
			else
			{					
				if ((result.length - digitPosition) < 3)
				{
					result += '0';
				}
			}
			
			control.value = result;			
		}
	}
}

function FormatDecimal(value)
{
	if (isNaN(value))
	{
		value = 0;
	}
		
	var result = (Math.round((parseFloat(value) * 100))/100).toString();
	
	var digitPosition = result.indexOf('.');
	
	if (digitPosition < 0)
	{
		result += '.00';
	}
	else
	{					
		if ((result.length - digitPosition) < 3)
		{
			result += '0';
		}
	}
	
	return result;
}

function OpenWin(url)
{
	window.open(url, "", "width = " + 300 + ", height = " + 300 + ", top = " + 150 + ", left = " + 300 + ", toolbar = no, location = no, directories= no , status= no , menubar = no, scrollbars = yes, resizable=yes");            
}

function ShowHelp(folder, page, section, height, width)
{
    if(isNaN(height) || height <= 0 || height == "")
    {
		var Height = 300;
    }
    else
    {
		var Height = height + 20;
    }
    
    if(isNaN(width) || width <= 0 || width == "")
    {
		var Width = 300;
    }
    else
    {
		var Width = width + 20;
    }

    if (folder == 'M') {
//        alert('in M');
        HelpWindow = window.open("../HelpPopup.aspx?folder=" + folder + "&page=" + page + "&section=" + section, "", "width = " + Width + ", height = " + Height + ", top=150, left=250, toolbar = no, location = no, directories= no , status= no , menubar = no, scrollbars = yes, resizable = yes");
    }
    else {
        if (folder != '') {

            HelpWindow = window.open("../HelpPopup.aspx?folder=" + folder + "&page=" + page + "&section=" + section, "", "width = " + Width + ", height = " + Height + ", top=150, left=250, toolbar = no, location = no, directories= no , status= no , menubar = no, scrollbars = yes, resizable = yes");
            //HelpWindow.moveTo(200, 100);
        }
        else {

            HelpWindow = window.open("../HelpPopup.aspx?folder=" + folder + "&page=" + page + "&section=" + section, "", "width = " + Width + ", height = " + Height + ", top=150, left=250, toolbar = no, location = no, directories= no , status= no , menubar = no, scrollbars = yes, resizable = yes");
            //HelpWindow.moveTo(200, 100);
        }
    }
}


function ShowLoginHelp(folder, page, section, height, width )
{
    if(isNaN(height) || height <= 0 || height == "")
    {
		var Height = 300;
    }
    else
    {
		var Height = height + 20;
    }
    
    if(isNaN(width) || width <= 0 || width == "")
    {
		var Width = 300;
    }
    else
    {
		var Width = width + 20;
    }

   
    if(folder != '')
    {
        
		HelpWindow = window.open("../HelpMenu.aspx?folder=" + folder + "&page=" + page + "&section=" + section, "", "width = " + Width + ", height = " + Height + ", top=150, left=250, toolbar = no, location = no, directories= no , status= no , menubar = no, scrollbars = yes, resizable = yes");            
		//HelpWindow.moveTo(200, 100);
	}
	else
	{
	  
		HelpWindow = window.open("../HelpMenu.aspx?folder=" + folder + "&page=" + page + "&section=" + section, "", "width = " + Width + ", height = " + Height + ", top=150, left=250, toolbar = no, location = no, directories= no , status= no , menubar = no, scrollbars = yes, resizable = yes");
		//HelpWindow.moveTo(200, 100);
	}
}
function ShowHSLoginHelp(folder, page, section, height, width )
{
    if(isNaN(height) || height <= 0 || height == "")
    {
		var Height = 300;
    }
    else
    {
		var Height = height + 20;
    }
    
    if(isNaN(width) || width <= 0 || width == "")
    {
		var Width = 300;
    }
    else
    {
		var Width = width + 20;
    }
    
    if(folder != '')
    {
        
		HelpWindow = window.open("../HelpMenuHS.aspx?folder=" + folder + "&page=" + page + "&section=" + section, "", "width = " + Width + ", height = " + Height + ", top=150, left=250, toolbar = no, location = no, directories= no , status= no , menubar = no, scrollbars = yes, resizable = yes");            
		//HelpWindow.moveTo(200, 100);
	}
	else
	{
	  
		HelpWindow = window.open("../HelpMenuHS.aspx?folder=" + folder + "&page=" + page + "&section=" + section, "", "width = " + Width + ", height = " + Height + ", top=150, left=250, toolbar = no, location = no, directories= no , status= no , menubar = no, scrollbars = yes, resizable = yes");
		//HelpWindow.moveTo(200, 100);
	}
}
var popUpWin = 0;

function ShowPopUpWindow(URLStr, width, height, scrollbar)
{	
	if(!isNaN(width))
    {
		var width = width + 20;
    }
    else
    {
		var width = 300;
    }
	
	if(!isNaN(height))
    {
		var height = height + 20;
    }
    else
    {
		var height = 300;
    }    
    
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(URLStr, 'popUpWin', 'toolbar=no, location=no, directories=no, status=no,menubar=no, scrollbars=' + scrollbar + ', resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 300 + ', top = ' + 150 + ', screenX = ' + 300 + ', screenY = ' + 150 + '');  		
  	popUpWin.focus();
}

function ShowSchoolCodeSearchWindow(url)
{	
	var width = 700;
	var height = 600;
	
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');  		
  	popUpWin.focus();
}


function ShowApplicantSearchWindow(url)
{	
	var width = 730;
	var height = 600;
	
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');  		
  	popUpWin.focus();
}

function OpenFAFSACollegeCodeSearchWindow(url)
{	
	var width = 600;
	var height = 600;
	
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');  		
  	popUpWin.focus();
}

function OpenHighSchoolSearchWindow(target)
{	
	var width = 700;
	var height = 600;
	var url = "HighSchoolSearch.aspx?target=" + target + "&r=" + Math.random();
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');  		
  	popUpWin.focus();

}







function OpenCollegeSearchWindow()
{	
	var width = 680;
	var height = 300;
	var url = "CollegeSearchForTranscript.aspx?r=" + Math.random();
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');  		
  	popUpWin.focus();
}

function OpenCollegeSearchWindowforfound() {
  
    var width = 680;
    var height = 300;
    var url = "CollegeSearchforFoundation.aspx?r=" + Math.random();
    if (popUpWin) {
        if (!popUpWin.closed) popUpWin.close();
    }

    popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');
    popUpWin.focus();
}

function OpenCollegeSearchWindowForCz()
{	
	var width = 680;
	var height = 300;
	var url = "CollegeSearchForCz.aspx?r=" + Math.random();
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');  		
  	popUpWin.focus();

}

function OpenCollegeSearchWindowForFoundation() {
    var width = 680;
    var height = 300;
    var url = "../CollegiateZone/CollegeSearchForCz.aspx?r=" + Math.random();
    if (popUpWin) {
        if (!popUpWin.closed) popUpWin.close();
    }

    popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');
    popUpWin.focus();
}
function OpenFoundationSearchWindowForCz()
{	
	var width = 680;
	var height = 300;
	var url = "FoundationSearchForCz.aspx?r=" + Math.random();
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');  		
  	popUpWin.focus();
}

function OpenCollegeSearchWindowForCzRegistration()
{	
	var width = 680;
	var height = 300;
	var url = "../CollegiateZone/CollegeSearchForCz.aspx?r=" + Math.random();
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');  		
  	popUpWin.focus();
}

function OpenCollegeSearchWindowForScholarship()
{	
	var width = 680;
	var height = 300;
	var url = "CollegeSearchForScholarShip.aspx?r=" + Math.random();
	
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');  		
  	popUpWin.focus();
}

function OpenCollegeSearchWindowForApplicant()
{	
	var width = 680;
	var height = 300;
	var url = "../GCUControlPanel/CollegeSearchForScholarShip.aspx?r=" + Math.random();
	
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');  		
  	popUpWin.focus();
}
function OpenCollegeSearchWindowForApp()
{	
	var width = 680;
	var height = 300;
	var url = "../GCUControlPanel/Collegesearchforapplicant.aspx?r=" + Math.random();
	
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');  		
  	popUpWin.focus();
}
function OpenCollegeSearchWindowForAdmin()
{	
	var width = 680;
	var height = 300;
	var url = "../Admin/CollegeSpecificSearch.aspx?r=" + Math.random();
	
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');  		
  	popUpWin.focus();
} 

function OpenCollegeSearchWindowForAdminList() {
    var width = 680;
    var height = 300;
    var url = "../Admin/CollegeSearchList.aspx?r=" + Math.random();

    if (popUpWin) {
        if (!popUpWin.closed) popUpWin.close();
    }

    popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');
    popUpWin.focus();
}

function OpenCollegeSearchWindowForGcu()
{	
	var width = 680;
	var height = 300;
	var url = "CollegeSearchForGcu.aspx?r=" + Math.random();
	
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');  		
  	popUpWin.focus();
}

function OpenSchoolSearchWindowForScholarship()
{	
	var width = 680;
	var height = 300;
	var url = "SchoolSearch.aspx?r=" + Math.random();
	
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');  		
  	popUpWin.focus();
}

function OpenAutoFillHelpWindow()
{	
	var width = 450;
	var height = 305;
	var url = "AutoFillHelp.aspx?r=" + Math.random();
	
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}
	
	popUpWin = open(url, 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 300 + ', top = ' + 100 + ', screenX = ' + 300 + ', screenY = ' + 100 + '');  		
  	popUpWin.focus();
}


function SetDropDownListValue(control, value)
{
	totalOptions = control.options.length;
	for(i = 0; i < totalOptions; i++)
	{
		if(control.options[i].value == value)
		{
			control.options.selectedIndex = i;
			return;
		}
	}
}

function OpenCommonApplicationForm()
{	
	var width = screen.width-12;
	var height = screen.height-91;	
	
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
}

	popUpWin = open("../Applicant/PrintCommonApplicationForm.aspx", 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');
	
  	popUpWin.focus();

}
function OpenCZlistForm() {
    var width = screen.width - 12;
    var height = screen.height - 91;

    if (popUpWin) {
        if (!popUpWin.closed) popUpWin.close();
    }

    popUpWin = open("../HighSchoolRegistration/PrintCZList.aspx", 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');
    popUpWin.focus();
}

function ValidateEditor()
{
	if (typeof(Page_ClientValidate) == 'function') 
	{
		if(Page_ClientValidate() == false)
		{
			document.getElementById('divMessage').style.display = 'block';
		}
		else					
		{
			document.getElementById('divMessage').style.display = 'none';
		}
	}
}





function OpenSalesOrganizationReport()
{	
	var width = screen.width-12;
	var height = screen.height-91;	
	
	if(popUpWin)
	{
		if(!popUpWin.closed) popUpWin.close();
	}

	popUpWin = open("../Admin/PrintSalesOrganizationReport.aspx", 'popUpWin', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width = ' + width + ', height = ' + height + ', left = ' + 0 + ', top = ' + 0 + ', screenX = ' + 0 + ', screenY = ' + 0 + '');  		
  	popUpWin.focus();
}

function ClearList(ctl)
{
	i = 0
	ln = ctl.options.length
	for(i = 0; i < ln; i++)
	{
		ctl.options[0] = null
	}
}

var sc_project=1734643; 
var sc_invisible=1; 
var sc_partition=16; 
var sc_security="075ea320";


var favicon = {
change: function(iconURL) {
  if (arguments.length==2) {
	document.title = optionalDocTitle;
  }
  this.addLink(iconURL, "icon");
  this.addLink(iconURL, "shortcut icon");
},
addLink: function(iconURL, relValue) {
  var link = document.createElement("link");
  link.type = "image/x-icon";
  link.rel = relValue;
  link.href = iconURL;
  this.removeLinkIfExists(relValue);
  this.docHead.appendChild(link);
},
removeLinkIfExists: function(relValue) {
  var links = this.docHead.getElementsByTagName("link");
  for (var i=0; i<links .length; i++) {
	var link = links[i];
	if (link.type=="image/x-icon" && link.rel==relValue) {
	  this.docHead.removeChild(link);
	  return; // Assuming only one match at most.
	}
  }
},
docHead:document.getElementsByTagName("head")[0]
}