function textBuffer() {
	$('.textBuffer, .secondaryContentBlock p, .secondaryContentBlock h1, .secondaryContentBlock h2, .secondaryContentBlock h3, .secondaryContentBlock span, .secondaryContentBlock ul, .teaserText p, .title h3, .item h6, .sub h3, .symbols p, .symbolsRight font').css({
		display: 'block'
	});
	
	$('.secondaryContentBlock a, span').css({
		display: 'inline'
	});
	
	$('.secondaryNavLeft .shareThis span').css({
		display: 'inline-block'
	});
	
	$('.subNavigationBlock .shareThis span').css({
		display: 'inline-block',
		background: 'none',
		height: '20px'
	});
}

function emailSubcribeInputOver(node) {
	if(node.value == 'email address') {
		node.value = '';
	}
}

function emailSubcribeInputOut(node) {
	if(node.value == '') {
		node.value = 'email address';
	}
}

function emailSubcribe() {
	var emailAddress = $('#email').val();
	$('.subscribe .submit').html('');
	$('.subscribe .submit').css({
		background: '#bbd9ed url(_img/ajax-loader.gif) no-repeat center center'
	});
	
	$.ajax({
		type: "POST",
		url: "_ajax/email-subscribe.php",
		cache: false,
		data: "email=" + emailAddress + '&lang=en',
		success: function(data){
			
			$('.subscribe .submit').css({
				background: '#bbd9ed url(_img/ajax-comp.jpg) no-repeat center center'
			});
		
			$('#email').attr("readonly", true);
			$('#email').css({
				background: '#ddd',
				color: '#999'
			});
			$('.subscribe .field').css({
				background: '#ddd',
				border: '1px solid #ddd',
				borderRight: '0'
			});
		}
	});
}

function qaEx(num) {

	var question = $('.question:eq('+num+')');
	var answer = $('.answer:eq('+num+')');
	var answerHeight = $('.answer:eq('+num+')').css('height');
	
	if($(answer).css('display') === 'none') {
		$(answer).css({
			display: 'block',
			height: 0
		});
		
		$(answer).stop(true, true).animate({
			height: answerHeight
		}, 250, 'swing');
		
		$(question).css({
			background: 'url(_img/q-a-collapse.jpg) no-repeat left center'
		});
	} else {
		$(answer).stop(true, true).animate({
			height: 0
		}, 250, 'swing', function() {
			$(answer).css({
				display: 'none',
				height: answerHeight
			});
		});
		
		
		$(question).css({
			background: 'url(_img/q-a-expand.jpg) no-repeat left center'
		});
	}
}

function highlightManditory(id) {
	
	var mandFieldArray = new Array();
	
	var fieldArray = new Array();
	fieldArray[0] = 'firstName';
	fieldArray[1] = 'lastName';
	fieldArray[3] = 'organization';
	fieldArray[4] = 'email';
	fieldArray[5] = 'address1';
	fieldArray[6] = 'address2';
	fieldArray[7] = 'city';
	fieldArray[8] = 'province';
	fieldArray[9] = 'postalCode';
	fieldArray[10] = 'country';
	fieldArray[11] = 'note';

	if($('#investorKit').attr('checked') == true) {
		mandFieldArray.push('firstName');
		mandFieldArray.push('lastName');
		mandFieldArray.push('email');
		mandFieldArray.push('address1');
		mandFieldArray.push('city');
		mandFieldArray.push('province');
		mandFieldArray.push('postalCode');
		mandFieldArray.push('country');
		mandFieldArray.push('captcha');
	}
	
	if($('#newsReleases').attr('checked') == true) {
		mandFieldArray.push('firstName');
		mandFieldArray.push('lastName');
		mandFieldArray.push('email');
		mandFieldArray.push('captcha');
	}
	
	for(var i = 0; i < fieldArray.length; i++) {
	
		$('#' + fieldArray[i]).css({
			background: '#fff',
			border: '2px solid #fff'
		});
		
	}
	
	for(var i = 0; i < mandFieldArray.length; i++) {
	
		if($('#' + mandFieldArray[i]).val() == '') {
		
			$('#' + mandFieldArray[i]).css({
				background: '#fddcdc',
				border: '2px solid #f7b3c1'
			});

			blankField = true;
			
		} else {
			
			$('#' + mandFieldArray[i]).css({
				background: '#fff',
				border: '2px solid #fff'
			});
			
		}
		
	}
	
}

function submitInvestorContact() {
	
	var mandFieldArray = new Array();
	
	if($('#investorKit').attr('checked') == true) {
		mandFieldArray.push('firstName');
		mandFieldArray.push('lastName');
		mandFieldArray.push('email');
		mandFieldArray.push('address1');
		mandFieldArray.push('city');
		mandFieldArray.push('province');
		mandFieldArray.push('postalCode');
		mandFieldArray.push('country');
		mandFieldArray.push('captcha');
	}
	
	if($('#newsReleases').attr('checked') == true) {
		mandFieldArray.push('firstName');
		mandFieldArray.push('lastName');
		mandFieldArray.push('email');
		mandFieldArray.push('captcha');
	}
	
	var fieldArray = new Array();
	fieldArray[0] = 'firstName';
	fieldArray[1] = 'lastName';
	fieldArray[3] = 'organization';
	fieldArray[4] = 'email';
	fieldArray[5] = 'address1';
	fieldArray[6] = 'address2';
	fieldArray[7] = 'city';
	fieldArray[8] = 'province';
	fieldArray[9] = 'postalCode';
	fieldArray[10] = 'country';
	fieldArray[11] = 'note';
	
	var blankField = false;
	var dataString = '';
	for(var i = 0; i < mandFieldArray.length; i++) {
		
		if($('#' + mandFieldArray[i]).val() == '') {
		
			$('#' + mandFieldArray[i]).css({
				background: '#fddcdc',
				border: '2px solid #f7b3c1'
			});

			blankField = true;
			
		} else {
			
			$('#' + mandFieldArray[i]).css({
				background: '#fff',
				border: '2px solid #fff'
			});
			
		}
		
	}
	
	if(blankField) {
		return false;
	}
	
	for(var i = 0; i < fieldArray.length; i++) {
		
		if(i > 0) {
			dataString += '&';
		}
		
		dataString += fieldArray[i] + '=' + $('#' + fieldArray[i]).val();
	
	}
	
	dataString += '&investorKit=' + $('#investorKit').attr('checked');
	dataString += '&newsReleases=' + $('#newsReleases').attr('checked');
	
	var password = $('#captcha').val();
	var random = $('#random').val();
	
	//check captcha
	$.ajax({
		type: "POST",
		url: "_ajax/captcha-check.php",
		cache: false,
		data: 'password=' + password + '&random=' + random,
		success: function(data){
			
			if(data != 'success') {
			
				$('#captcha').css({
					background: '#fddcdc',
					border: '2px solid #f7b3c1'
				});
	
				blankField = true;
				
			} else {
				
				$('#captcha').css({
					background: '#fff',
					border: '2px solid #fff'
				});
				
			}
		
			if(blankField) {
				return false;
			}
			
			$.ajax({
				type: "POST",
				url: "_ajax/contact-submit.php",
				cache: false,
				data: dataString,
				success: function(data){
					
					alert(data);
					window.location.href = "contact.php?submit=true";
					
				}
			});
		
		}
		
	});
	
}
