/*************************/
/*    Open New Window    */
/*************************/

function NewWindow(mypage, myname, w, h, scroll)
{
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=0,toolbar=0,status=0,menubar=0';
    win = window.open(mypage, myname, winprops);
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); };
}


/**********************************/
/*    Search Engine Box Effect    */
/**********************************/

function checkInput(){
}

function checkInputFocus(input){
	input.style.background='none';
}

function checkInputBlur(input){
	if(!input.value){
		input.style.background='url(../images/search_label.gif) center left no-repeat';
	}
}

function checkInputBlurIndex(input){
	if(!input.value){
		input.style.background='url(images/search_label.gif) center left no-repeat';
	}
}


/**************************/
/*    Font Size Change    */
/**************************/

function decrease(){
	if(sizeoffset>-4){
		sizeoffset--;
		$('div,span,h1,h2,h3,h4,h5,p,a,ul,li,td').each(function(){$(this).css('font-size',(parseInt($(this).css('font-size'))-1)+'px');});
	}
		
}
function increase(){
	if(sizeoffset<4){
		sizeoffset++;
		$('div,span,h1,h2,h3,h4,h5,p,a,ul,li,td').each(function(){$(this).css('font-size',(parseInt($(this).css('font-size'))+1)+'px');});
	}

}
function regular(){
	if(sizeoffset!=0){
		$('div,span,h1,h2,h3,h4,h5,p,a,ul,li,td').each(function(){$(this).css('font-size',(parseInt($(this).css('font-size'))-sizeoffset)+'px');});
		sizeoffset=0;
	}
}
$(document).ready(function() {
	sizeoffset=0;
	
	$("#read").change(function(){
		if($(this).attr("checked")){
			$("#submit").removeAttr("disabled");
		}else{
			$("#submit").attr("disabled",true);
		}
	});
});

	
/************************************/
/*    New Window Warning Message    */
/************************************/

function warning(){
	if(confirm("This link will open a new window, do you want to proceed?")){
		return true;
	}else{
		return false;
	}
}


/************************************************/
/*    Change State Abbreviation to Full Name    */
/************************************************/

var state = {
	'AA' : 'Armed Forces - Americas (Except Canada)',
	'AE' : 'Armed Forces - Europe, Canada, Middle East, Africa',
	'AK' : 'Alaska',
	'AL' : 'Alabama',
	'AP' : 'Armed Forces - Pacific',
	'AR' : 'Arkansas',
	'AS' : 'American Samoa',
	'AZ' : 'Arizona',
	'CA' : 'California',
	'CO' : 'Colorado',
	'CT' : 'Connecticut',
	'DC' : 'District of Columbia',
	'DE' : 'Delaware',
	'FL' : 'Florida',
	'FM' : 'Federated States of Micronesia',
	'GA' : 'Georgia',
	'GU' : 'Guam',
	'HI' : 'Hawaii',
	'IA' : 'Iowa',
	'ID' : 'Idaho',
	'IL' : 'Illinois',
	'IN' : 'Indiana',
	'KS' : 'Kansas',
	'KY' : 'Kentucky',
	'LA' : 'Louisiana',
	'MA' : 'Massachusetts',
	'MD' : 'Maryland',
	'ME' : 'Maine',
	'MH' : 'Marshall Islands',
	'MI' : 'Michigan',
	'MN' : 'Minnesota',
	'MO' : 'Missouri',
	'MP' : 'Northern Mariana Islands',
	'MS' : 'Mississippi',
	'MT' : 'Montana',
	'NC' : 'North Carolina',
	'ND' : 'North Dakota',
	'NE' : 'Nebraska',
	'NH' : 'New Hampshire',
	'NJ' : 'New Jersey',
	'NM' : 'New Mexico',
	'NV' : 'Nevada',
	'NY' : 'New York',
	'OH' : 'Ohio',
	'OK' : 'Oklahoma',
	'OR' : 'Oregon',
	'PA' : 'Pennsylvania',
	'PR' : 'Puerto Rico',
	'PW' : 'Palau',
	'RI' : 'Rhode Island',
	'SC' : 'South Carolina',
	'SD' : 'South Dakota',
	'TN' : 'Tennessee',
	'TX' : 'Texas',
	'UT' : 'Utah',
	'VA' : 'Virginia',
	'VI' : 'Virgin Islands',
	'VT' : 'Vermont',
	'WA' : 'Washington',
	'WI' : 'Wisconsin',
	'WV' : 'West Virginia',
	'WY' : 'Wyoming'
};

function stateAbbrToFull(abbr){
	if(state[abbr]){
		document.write(state[abbr]);
	}else{
		document.write(abbr);	
	}
}
