

jQuery(document).ready(function(){
						   
	$("ul.main_nav li").hover(
				function(){
					$(this.parentNode).children('li').css('z-index','2').removeClass('slctNav').find("div").stop(true,true).hide();
					$(this).css('z-index','10').addClass('slctNav').children('div').slideDown('fast'); 
				},
				function(){
					$(this).css('z-index','2').removeClass('slctNav').children('div').hide();
				}
	);
	
	$("ul.main_nav li a").each(
		function(){
			if($(this).html().toLowerCase() =='our team'){
				$(this).attr('target','_blank');
			}
			
		}
	);
						   
	$("ul.tutorial_list li a.img_link").hover(
		function(){$(this).append('<em></em>')},
		function(){$(this).find('em').remove()}
	);
	
	$('.pg_faq h3').click(
			function(){
			
			if($(this).next().is(':hidden')){
				$('.faq_box').hide();
				$(this).next().show();
			}
			else{
				$('.faq_box').hide();	
			}
	});
	
	//pdf24PluginUrl

	
	
	
});


function ltrim(str) { 
	for(var k = 0; k < str.length && isWhitespace(str.charAt(k)); k++);
	return str.substring(k, str.length);
}
function rtrim(str) {
	for(var j=str.length-1; j>=0 && isWhitespace(str.charAt(j)) ; j--) ;
	return str.substring(0,j+1);
}
function trim(str) {
	return ltrim(rtrim(str));
}
function isWhitespace(charToCheck) {
	var whitespaceChars = " \t\n\r\f";
	return (whitespaceChars.indexOf(charToCheck) != -1);
}

function checkEmail(emial){
	var str=emial;
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	if (filter.test(str))
		return true;
	else
		return false;
}

function checkRequired(){
	
	document.getElementById('commess').style.display = 'none';
	
	var status = document.getElementById('loggedin').value;
	var comment = trim(document.getElementById('comment').value);
	
	if( status=='no' ){
		var name = trim(document.getElementById('author1').value);
		var email = trim(document.getElementById('email').value);
		
		if( name=='' || email=='' ){
			//alert('Please complete the required fields (Name, Email).');
			document.getElementById('commess').innerHTML = 'Please complete the required fields (Name, Email).';
			document.getElementById('commess').style.display = 'block';
			return false;
		}
		else if( comment=='' ){
			//alert('Please type a Comment.');
			document.getElementById('commess').innerHTML = 'Please type a Comment.';
			document.getElementById('commess').style.display = 'block';
			return false;
		}
		else if( !checkEmail(email) ){
			//alert('Please enter a valid email address.');
			document.getElementById('commess').innerHTML = 'Please enter a valid email address.';
			document.getElementById('commess').style.display = 'block';
			return false;
		}
	}
	else{
		if( comment=='' ){
			//alert('Please type a Comment.');
			document.getElementById('commess').innerHTML = 'Please type a Comment.';
			document.getElementById('commess').style.display = 'block';
			return false;
		}
	}
	
	
	return true;
	
}

function submitComment(){
	if(checkRequired())	
		document.commentform.submit();
}





