// JavaScript Document

function menu_over(itm){
	document.getElementById('mnu_' + itm).className = "hovermenu";
	if(itm > 1 && itm <= 5){
		document.getElementById('mul_' + itm).style.display = 'block';
	}
}
		
function menu_out(itm){
	var curitem = document.getElementById('curmenu').value;
	if(curitem != itm){
		document.getElementById('mnu_' + itm).className = "normalmenu";
	}
	if(itm > 1 && itm <= 5){
		document.getElementById('mul_' + itm).style.display = 'none';
	}
}

function menu_over_li(itm){
	//alert(itm);
	//document.getElementById('mnu_' + itm).className = "hovermenu";
	document.getElementById('mul_' + itm).style.display = "block";
}
		
function menu_over_out(itm){
	//alert(itm);
		//document.getElementById('mnu_' + itm).className = "normalmenu";
	document.getElementById('mul_' + itm).style.display = "none";
}
function curclick(){
	document.getElementById('mul_9').style.display = "none";
	document.getElementById('mul_10').style.display = "none";
}

function curmenu(itm){
	document.getElementById('mul_9').style.display = 'none';
	document.getElementById('mul_10').style.display = 'none';
	if(itm > 1 && itm <= 5){
		document.getElementById('mul_' + itm).style.display = 'none';
	}
	document.getElementById('curmenu').value = itm;
	var curitem = document.getElementById('curmenu').value;
	
	for(i=1;i<=8;i++){
		
		if(curitem == i){
			document.getElementById('mnu_' + i).className = "hovermenu";
		}else{
			document.getElementById('mnu_' + i).className = "normalmenu";	
		}
	} 
}
function leftmenuover(item){
	document.getElementById('menu' + item).style.width = "8px";
}

function leftmenuout(item){
	document.getElementById('menu' + item).style.width = "3px";
}

function sleep(milliseconds)
{
var now = new Date();
var exitTime = now.getTime() + milliseconds;
while (true)
{
now = new Date();
if (now.getTime() > exitTime)
return;
}
}
 
 function clear_feed_back(){
 	document.getElementById("fb_name").value = '';
	document.getElementById("fb_company").value = '';
	document.getElementById("fb_email").value = '';
	document.getElementById("fb_phone").value = '';
	document.getElementById("fb_content").value = '';
	if(document.getElementById('result_hid').style.display == 'block'){
	document.getElementById('result_hid').style.display = 'none';
	}
 }
 
 function validation(){
	 if(document.getElementById("fb_name").value == ''){
	 alert("Enter your name!");
	 document.getElementById("fb_name").focus();
	return false;
	} else if(document.getElementById("fb_company").value == ''){
	 alert("Enter your Company Name!");
	 document.getElementById("fb_company").focus();
	 return false;
	}
	else if(document.getElementById("fb_email").value == ''){
	 alert("Enter your Email Address!");
	 document.getElementById("fb_email").focus();
	 return false;
	}
	else if(document.getElementById("fb_phone").value == ''){
	 alert("Enter your Phone No!");
	 document.getElementById("fb_phone").focus();
	 return false;
	}
	else if(document.getElementById("fb_content").value == ''){
	 alert("Enter your Comments!");
	 document.getElementById("fb_content").focus();
	 return false;
	} else {
	get_feedBack();	
	return true;
	}
 }
 
 
	var http_request = false;
   function makePOSTRequest(url, parameters) {
	   if(parameters == 'index_page'){
	   document.getElementById('loader').style.display = 'none';
	   parameters = 'Home';
	   }else{
	   document.getElementById('loader').style.display = 'block';
	   }//alert(parameters);
	   document.getElementById('pgTitle').innerHTML = parameters;
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }

	  http_request.onreadystatechange = alertContents;
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   }

   function alertContents() {
      if (http_request.readyState == 4) {
            result = http_request.responseText;
			document.getElementById('loader').style.display = 'none';
			document.getElementById('inner_result').innerHTML = result;
      }
   }

//home
function welcome_page(){  makePOSTRequest('index_ajax.php', 'Home'); }

function welcome_page_new(){  makePOSTRequest('index_ajax.php', 'index_page'); }

//company
function company_overview(){ makePOSTRequest('overview.php', 'Company > Overview'); }

function why_eprodix(){  makePOSTRequest('why_eprodix.php', '<a href="#" onclick="company_overview();" class="verdana_11">Company </a> > Why eProdix'); }

function partners(){ makePOSTRequest('partners.php', '<a href="#" onclick="company_overview();" class="verdana_11">Company </a> > Partners'); }

function profile(){  makePOSTRequest('profile.php', '<a href="#" onclick="company_overview();" class="verdana_11">Company </a> > Profile'); }

function careers(){  makePOSTRequest('careers.php', '<a href="#" onclick="company_overview();" class="verdana_11">Company </a> > Careers'); }

//services
function services_overview(){  makePOSTRequest('services_overview.php', 'Services > Customisation'); }

function cust_benfit(){  makePOSTRequest('benfit.php', '<a href="#" onclick="services_overview();" class="verdana_11">Services </a> > Customisation > Benefits'); }

function cust_environment(){  makePOSTRequest('environment.php', '<a href="#" onclick="services_overview();" class="verdana_11">Services </a> > Customisation > Environments'); }

function services_features(){  makePOSTRequest('features.php', '<a href="#" onclick="services_overview();" class="verdana_11">Services </a> > Customisation > Features'); }

function cust_process(){  makePOSTRequest('cust_process.php', '<a href="#" onclick="services_overview();" class="verdana_11">Services </a> > Customisation > Customisation Process'); }

function cust_faq(){  makePOSTRequest('faq.php', '<a href="#" onclick="services_overview();" class="verdana_11">Services </a> > Customisation >  FAQ'); }

function alternative(){  makePOSTRequest('alternative.php', '<a href="#" onclick="services_overview();" class="verdana_11">Services </a> > Customisation > Alternative(Replay)'); }

function cust_download(){  makePOSTRequest('cust_download.php', '<a href="#" onclick="services_overview();" class="verdana_11">Services </a> > Customisation > Download Brochure'); }


function manual_test(){  makePOSTRequest('manual_testing.php', '<a href="#" onclick="services_overview();" class="verdana_11">Services </a> > Manual Testing'); }

function writting(){  makePOSTRequest('tech_writting.php', '<a href="#" onclick="services_overview();" class="verdana_11">Services </a> > Techincal Writting'); }

function test_management(){  makePOSTRequest('test_management.php', '<a href="#" onclick="services_overview();" class="verdana_11">Services </a> > Test Management'); }

function test_overview(){  makePOSTRequest('test_automation.php', '<a href="#" onclick="services_overview();" class="verdana_11">Services </a> > Test Automation'); }

function funct_test(){  makePOSTRequest('test_funct.php', '<a href="#" onclick="services_overview();" class="verdana_11">Services </a> > <a href="#" onclick="test_overview();" class="verdana_11">Test Automation </a> > Functional Testing'); }

function BPT(){  makePOSTRequest('bpt.php', '<a href="#" onclick="services_overview();" class="verdana_11">Services </a> > <a href="#" onclick="test_overview();" class="verdana_11">Test Automation </a> > Business Process Testing'); }

function reg_test(){  makePOSTRequest('reg_testing.php', '<a href="#" onclick="services_overview();" class="verdana_11">Services </a> > <a href="#" onclick="test_overview();" class="verdana_11">Test Automation </a> > Regression Testing'); }

//consultancy
function accelar(){  makePOSTRequest('accel.php', 'Consultancy > Accelerators(ESA)'); }

function quality_process(){  makePOSTRequest('quality_processes.php', '<a href="#" onclick="accelar();" class="verdana_11">Consultancy </a> > Quality Processes'); }

function skill(){  makePOSTRequest('skill_transfer.php', '<a href="#" onclick="accelar();" class="verdana_11">Consultancy </a> > Skill Transfer'); }

function tool_eva(){  makePOSTRequest('tool_eval.php', '<a href="#" onclick="accelar();" class="verdana_11">Consultancy </a> > Tool Evaluation'); }

//development
function custom_utilities(){  makePOSTRequest('custom_utilities.php', 'Development > Coustom Utilities'); }

function soft_dev(){  makePOSTRequest('software_dev.php', '<a href="#" onclick="custom_utilities();" class="verdana_11">Development </a> > Software Development'); }

//Training
function training(){  makePOSTRequest('training.php', 'Training'); }

function training_QT(){  makePOSTRequest('training_QT.php', '<a href="#" onclick="training();" class="verdana_11">Training</a> > QuickTest Pro'); }

function training_QCT(){  makePOSTRequest('training_QCT.php', '<a href="#" onclick="training();" class="verdana_11">Training</a> > Quality Center Trainings'); }

function training_WT(){  makePOSTRequest('training_WT.php', '<a href="#" onclick="training();" class="verdana_11">Training</a> > WinRunner Trainings'); }

function training_CT(){  makePOSTRequest('training_CT.php', '<a href="#" onclick="training();" class="verdana_11">Training</a> > Custom Trainings'); }

//news & events
function news_events(){  makePOSTRequest('news.php', 'News and Events'); }

//contact
function contact(){  makePOSTRequest('contact.php', 'Contact'); }

var http_request = false;
   function makePOSTRequest_FB(url, parameters) {
	   document.getElementById('loader').style.display = 'block';
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }

	  http_request.onreadystatechange = alertContents_FB;
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   }

   function alertContents_FB() {
      if (http_request.readyState == 4) {
            result = http_request.responseText;
			document.getElementById('loader').style.display = 'none';
			document.getElementById('result_hid').style.display = 'block';
			document.getElementById('result_feedback').innerHTML = result;
      }
   }
   
   function get_feedBack(){
	
   postr = "name="+escape(document.getElementById('fb_name').value)+"&company="+escape(document.getElementById('fb_company').value)+"&email="+escape(document.getElementById('fb_email').value)+"&phone="+escape(document.getElementById('fb_phone').value)+"&content="+escape(document.getElementById('fb_content').value);
		 makePOSTRequest_FB('feedBack.php', postr);
   }