// JavaScript Document

// Various navigation related functions
function show_submenu( id, subid ){
	
	document.getElementById('solutions_menu').style.display='none';	
	document.getElementById('benefits_menu').style.display='none';
	document.getElementById('testimonials_menu').style.display='none';
	document.getElementById('clientlist_menu').style.display='none';
	document.getElementById('casestudies_menu').style.display='none';
	document.getElementById('results_sub').style.display='none';
	document.getElementById( 'services_menu').style.display='none';
	document.getElementById( 'planning_menu').style.display='none';
	document.getElementById( 'collaboration_menu' ).style.display='none';
	document.getElementById( 'execution_menu' ).style.display='none';
	document.getElementById( 'evaluation_menu' ).style.display='none';
	document.getElementById('pricing_menu').style.display='none';
	document.getElementById( 'webinar_menu' ).style.display='none';
	document.getElementById( 'faq_menu' ).style.display='none';
	document.getElementById( 'glossary_menu' ).style.display='none';
	document.getElementById( 'architecture_menu' ).style.display='none';
	document.getElementById('support_menu').style.display='none';
	document.getElementById('video_menu').style.display='none';
	document.getElementById('history_menu').style.display='none';
	document.getElementById('career_menu').style.display='none';
	document.getElementById( id ).style.display='block';
	//document.getElementById( id+'_p' ).style.display='block';
	document.getElementById( subid ).style.textDecoration='underline';

}
function hide_submenu( id ){
	document.getElementById( id ).style.display='none';
	//document.getElementById( id+'_p' ).style.display='none'
}
function set_submenu_background(id){
	document.getElementById(id).style.backgroundColor="#586365";
}
function set_subnav_background(id){
	document.getElementById( id ).style.backgroundImage="url('http://www.qtask.com/public/images/main/navigation-background.gif')";
	document.getElementById( id ).style.backgroundRepeat='no-repeat';
}

//Login form functions

function check_login_form(){
	setTimeout('verify_login_form_fields()',1000);
}

//Display Qtask login form
function display_login(){
	document.getElementById( 'Qtask-login-back' ).style.display='block';
	document.getElementById( 'Qtask-login-form' ).style.display='block';
}
//Hide Qtask login form
function hide_login(){
	document.getElementById( 'Qtask-login-back' ).style.display='none';
	document.getElementById( 'Qtask-login-form' ).style.display='none';
}
//Used to clear out form field onclick
function clickclear(thisfield, defaulttext,changeid) {
	if (thisfield.value == defaulttext) {
	thisfield.style.fontStyle="normal";
	thisfield.value = "";
	thisfield.style.color="#000000";
	}
}
function swapbox( hide_field , display_field ){
		document.getElementById( hide_field ).style.display="none";
		document.getElementById( display_field ).style.display="inline";
		document.getElementById( display_field ).focus();
		document.getElementById( display_field ).style.color="#000000";
}
function verify_login_form_fields(){
	var	passwd = document.getElementById('title_password').value;
	var login = document.getElementById('title_email').value;
	if (login.length > 0){
		swapbox( 'title_email_text' , 'title_email' )
		if (passwd.length > 0){	swapbox('title_text','title_password');}
		
	}
}

// End login form functions


function VideoOver(TableCell, subn){
	//set subn = 1 to turn on color to background cell
	var main = document.getElementById(TableCell);

	if (subn == 1){
		var tmp = TableCell+'a';
		var submain = document.getElementById(tmp);
		submain.bgColor='#FFFFcc';
	}
	main.bgColor='#FFFFcc';
}
function VideoOut(TableCell, subn){
	//set subn = 1 to turn on color to background cell
	var main = document.getElementById(TableCell);
	
	if (subn == 1){
		var tmp = TableCell+'a';
		var submain = document.getElementById(tmp);
		submain.bgColor='#FFFFFF';
	}
	main.bgColor='#ffffff';
}
function CTAVideoOver(TableCell, s3){
	//set subn = 1 to turn on color to background cell
	var main = document.getElementById(TableCell);
	var text = document.getElementById('text'+TableCell);
	var icon = document.getElementById('icon'+TableCell);
	iconImage = s3 + '/images/services/Video-icon-over.jpg';
	main.style.backgroundColor='#8CC63F';
	text.style.color='#ffffff';
	icon.src=iconImage;

}
function CTAVideoOut(TableCell, s3){
	//set subn = 1 to turn on color to background cell
	var main = document.getElementById(TableCell);
	var text = document.getElementById('text'+TableCell);
	var icon = document.getElementById('icon'+TableCell);
	iconImage = s3 + '/images/services/Video-icon.jpg';
	main.style.backgroundColor='#D9EBC1';
	text.style.color='#666666';
	icon.src=iconImage;
}
function DownloadOver(TableCell, s3){
	//set subn = 1 to turn on color to background cell
	var main = document.getElementById(TableCell);
	var text = document.getElementById('text'+TableCell);
	var icon = document.getElementById('icon'+TableCell);
	iconImage = s3 + '/images/about/Download_icon_over.jpg';
	
	text.style.color='#ffffff';
	icon.src=iconImage;

}
function DownloadOut(TableCell, s3){
	//set subn = 1 to turn on color to background cell
	var main = document.getElementById(TableCell);
	var text = document.getElementById('text'+TableCell);
	var icon = document.getElementById('icon'+TableCell);
	iconImage = s3 + '/images/about/Download_icon.jpg';
	
	text.style.color='#3399cc';
	icon.src=iconImage;
}
function hide_login_error(){
	document.getElementById('loginerr').style.display='none';
	document.getElementById('loginpasswd').style.display='block';
};