function verify() {
	var blank_array = ['first','last','fullname','phone','email1','oldpassword','password1','ccnum','message','code','title','description']
	var match_array = ['email','password']
	var other_array = ['ccexp_error','terms_error','code_error','code_invalid_error']
	for ( i = 0; i < blank_array.length; i++ ) {
		var el = document.getElementById(blank_array[i] + '_blank_error')
		if ( el ) {
			el.style.display = 'none'
		}
	}
	for ( i = 0; i < match_array.length; i++ ) {
		var el = document.getElementById(match_array[i] + '_match_error')
		if ( el ) {
			el.style.display = 'none'
		}
	}
	for ( i = 0; i < other_array.length; i++ ) {
		var el = document.getElementById(other_array[i])
		if ( el ) {
			el.style.display = 'none'
		}
	}
	if ( document.getElementById('signup') ) {
		if ( ! document.getElementById('signup').elements['Plan'][0].checked && ! document.getElementById('signup').elements['Plan'][1].checked ) {
			document.getElementById('plan_error').style.display = ''
			location.href = 'signup.php#a1'
			return false
		}
	}
	for ( i = 0; i < blank_array.length; i++ ) {
		var el1 = document.getElementById(blank_array[i])
		var el2 = document.getElementById(blank_array[i] + '_blank_error')
		if ( el1 && el2 && el1.value == '' ) {
			el2.style.display = ''
			return false
		}
	}
	for ( i = 0; i < match_array.length; i++ ) {
		var el1 = document.getElementById(match_array[i] + '1')
		var el2 = document.getElementById(match_array[i] + '2')
		if ( el1 && el2 && el1.value != el2.value ) {
			document.getElementById(match_array[i] + '_match_error').style.display = ''
			return false
		}
	}
	var m = document.getElementById('month')
	var y = document.getElementById('year')
	var d = new Date()
	if ( m && y && y.options[y.selectedIndex].value == d.getFullYear() && m.options[m.selectedIndex].value <= d.getMonth() ) {
		document.getElementById('ccexp_error').style.display = ''
		return false
	}
	if ( document.getElementById('terms') && ! document.getElementById('terms').checked ) {
		document.getElementById('terms_error').style.display = ''
	}
	if ( document.getElementById('process') ) {
		document.getElementById('process').innerHTML = '<img src="images2/processingapplication.jpg" alt="" />'
	}
	if ( document.getElementById('uploadsubmit') ) {
		document.getElementById('uploadsubmit').innerHTML = 'Uploading... Please wait...'
	}
}
try {
	document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}
var c_name = 'GFA_LANGUAGE'
$(document).ready(function(){
	if (document.cookie.length>0) {
		c_start=document.cookie.indexOf(c_name + "=")
		if ( c_start != -1 ) {
			c_start = c_start + c_name.length + 1
			c_end = document.cookie.indexOf(";",c_start)
			if ( c_end == -1 ) c_end = document.cookie.length
			var destLang = document.cookie.substring(c_start,c_end)
			var el = document.getElementById('languageSelect')
			if ( el ) {
				for ( var i = 0; i < el.options.length; i++ ) {
					if ( el.options[i].value == destLang ) {
						el.selectedIndex = i
					} 
				}
			}
			translate_page(destLang)
		}
	}
	$('.popup').click(function(){
		if ( ! window.open(this.href + '&popup=1','popup','width=600,scrollbars') ) {
			location.href = this.href
		}
		return false
	})
	if ( window.opener ) {
		$('a').click(function(){
			window.opener.location.href = this.href
			window.close()
		})
	}
});
function change_language(t) {
	translate_page(t.options[t.selectedIndex].value)
}
function translate_page(destLang) {
	$('body').translate('en',destLang,{not:'input,embed,#languageSelect',fromOriginal: true});
	document.cookie = c_name + '=' + destLang + ';path=/' 
}


