//function init(){
	xWidth=screen.width;
	yHeight=screen.height;
	xCenter = (xWidth/2)-(700/2);
	yCenter = (yHeight/2)-(500/2);
	xPop = (xWidth/2)-(400/2);
	yPop = (yHeight/2)-(550/2);
	
	//alert(screen.width + ":" + screen.height);
	//alert(xCenter + ":" + yCenter);
//}

function imageBrowser(indexImg,imgList,projName){

	var url = 'index.cfm?fuseaction=portfolio.imageBrowser&currImage=' + indexImg + '&imgList=' + imgList + '&projName=' + projName;
	var winName = "imageBrowser";
	myWin = window.open( url, winName,'width=700,height=500,left=' + xCenter + ',top=' + yCenter + ',directories=no,location=yes,menubar=no,scrollbars=yes,status=yes,toolbar=no,resizable=yes');
}

function popUp(url){
	var winName = "helpWindow";
	myWin = window.open( url, winName,'width=400,height=550,left=' + xPop + ',top=' + yPop + ',directories=no,location=yes,menubar=no,scrollbars=yes,status=yes,toolbar=no,resizable=yes');
	if(! myWin){
		alert("It appears as though you have a popup blocker enabled. To view our help content, you will need to disable your popup blocking software while using our web site.");
	}else{
		myWin.focus();
	}
}

function _CF_onError(form_object, input_object, object_value, error_message)
    {
	alert(error_message);
       	return false;	
    }


function _CF_hasValue(obj, obj_type)
    {
    if (obj_type == "TEXT" || obj_type == "PASSWORD")
	{
    	if (obj.value.length == 0) 
      		return false;
    	else 
      		return true;
    	}
    else if (obj_type == "SELECT")
	{
        for (i=0; i < obj.length; i++)
	    	{
		if (obj.options[i].selected)
			return true;
		}

       	return false;	
	}
    else if (obj_type == "SINGLE_VALUE_RADIO" || obj_type == "SINGLE_VALUE_CHECKBOX")
	{

		if (obj.checked)
			return true;
		else
       		return false;	
	}
    else if (obj_type == "RADIO" || obj_type == "CHECKBOX")
	{

        for (i=0; i < obj.length; i++)
	    	{
		if (obj[i].checked)
			return true;
		}

       	return false;	
	}
	}


function _CF_checknumber(object_value)
    {
    //Returns true if value is a number or is NULL
    //otherwise returns false	

    if (object_value.length == 0)
        return true;

    //Returns true if value is a number defined as
    //   having an optional leading + or -.
    //   having at most 1 decimal point.
    //   otherwise containing only the characters 0-9.
	var start_format = " .+-0123456789";
	var number_format = " .0123456789";
	var check_char;
	var decimal = false;
	var trailing_blank = false;
	var digits = false;

    //The first character can be + - .  blank or a digit.
	check_char = start_format.indexOf(object_value.charAt(0))
    //Was it a decimal?
	if (check_char == 1)
	    decimal = true;
	else if (check_char < 1)
		return false;
        
	//Remaining characters can be only . or a digit, but only one decimal.
	for (var i = 1; i < object_value.length; i++)
	{
		check_char = number_format.indexOf(object_value.charAt(i))
		if (check_char < 0)
			return false;
		else if (check_char == 1)
		{
			if (decimal)		// Second decimal.
				return false;
			else
				decimal = true;
		}
		else if (check_char == 0)
		{
			if (decimal || digits)	
				trailing_blank = true;
        // ignore leading blanks

		}
	        else if (trailing_blank)
			return false;
		else
			digits = true;
	}	
    //All tests passed, so...
    return true
    }


function  _CF_checkEditCandidateProfileForm(_CF_this)

    {

    if  (!_CF_hasValue(_CF_this.firstName, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.firstName, _CF_this.firstName.value, "The Candidate Name field is required."))

            {

            return false; 

            }

        }


    if  (!_CF_hasValue(_CF_this.lastName, "TEXT" )) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.lastName, _CF_this.lastName.value, "The Candidate Name field is required."))

            {

            return false; 

            }

        }


    if  (!_CF_checknumber(_CF_this.salary.value))

        {

        if  (!_CF_onError(_CF_this, _CF_this.salary, _CF_this.salary.value, "The Salary field is required. Please be sure to enter a decimal number, without commas, in the following format: 3200230.29"))

            {

            return false; 

            }

        }


    return true;

    }
	
	function copyTo(content,to){
		thisField = document.EditCandidateProfileForm[to];
		thisField.value = content;
	}

