﻿//var rootpath="http://localhost:81/HCL-AXON/";
var rootpath="http://www.hcl-axon.com/Test_Site/";

var pic1= new Image(25,25); 
var pic2= new Image(25,25); 
var pic3= new Image(25,25); 
var pic4= new Image(25,25);

pic1.src=rootpath+"images/home/know-HCL-AXON.jpg";
pic2.src=rootpath+"images/home/industry-secotrs.jpg";
pic3.src=rootpath+"images/home/sap-application.jpg";
pic4.src=rootpath+"images/home/global-delivery-capabilities.jpg";

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
function $() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
	}
	return elements;
}

var objTabContent, objTab, objCurTab;
var curtab=1; mytab=0; deftab=1;
var closetab=0, tmpclosetab=0, transtimer=0;
function changeTab(tabid) {	
	mytab=tabid;
	closetab=0;
	stop_timer();	
	if (curtab==tabid) return;
	objTabContent=document.getElementById("tabcontent");
	if (curtab<=1) {
		objTabContent.style.display="";
		objTabContent.style.visibility="visible";
	}
	objTab=document.getElementById("mnuTab"+tabid);
	objCurTab=document.getElementById("mnuTab"+curtab);
	objTabContent.innerHTML="";
	//objTabContent.style.height="289px";
	switch(tabid) {
		case 1:
			objTabContent.style.display="none";
			objTabContent.style.visibility="hidden";
			break;
		case 2:
			objTabContent.style.backgroundImage="url("+rootpath+"images/home/know-HCL-AXON.jpg)";
			objTabContent.innerHTML+="<div><a href='"+rootpath+"about-us/HCL-Technologies.asp'><img src='http://www.hcltech.com/images/blank_1x1.gif' style='width: 675px; height: 300px; border: none;'></a></div>";
			break;
		case 3:
			objTabContent.style.backgroundImage="url("+rootpath+"images/home/industry-secotrs.jpg)";
			objTabContent.innerHTML+="<div class='industry-secotrs'><ul><li><a href='"+rootpath+"Industries/aerospace-defense/'>Aerospace and Defense</a></li><li><a href='"+rootpath+"Industries/automotive/'>Automotive</a></li><li><a href='"+rootpath+"Industries/chemicals/'>Chemicals</a></li><li><a href='"+rootpath+"Industries/construction-mining/'>Construction and Mining</a></li><li><a href='"+rootpath+"Industries/consumer/'>Consumer</a></li><li><a href='"+rootpath+"Industries/financial_services/'>Financial Services</a></li><li><a href='"+rootpath+"Industries/hitech-manufacturing/'>Hi-Tech &amp; Manufacturing</a></li><li><a href='"+rootpath+"Industries/lifescience-healthcare/'>Life Sciences &amp; Healthcare</a></li><li><a href='"+rootpath+"Industries/media-entertainment/'>Media &amp; Entertainment</a></li><li><a href='"+rootpath+"Industries/government/'>Government</a></li><li><a href='"+rootpath+"Industries/retail/'>Retail</a></li><li><a href='"+rootpath+"Industries/telecommunications/'>Telecommunications</a></li><li><a href='"+rootpath+"Industries/travel-logistics/'>Travel, Transportation &amp; Logistics</a></li><li><a href='"+rootpath+"Industries/professional_services/'>Professional Services</a></li><li><a href='"+rootpath+"Industries/utilities/'>Utilities</a></li><li><a href='"+rootpath+"Industries/oil-gas/'>Oil & Gas</a></li></ul></div>";
			break;
		case 4:
			objTabContent.style.backgroundImage="url("+rootpath+"images/home/sap-application.jpg)";			
			objTabContent.innerHTML+="<div class='sap-application'><ul><li><a href='"+rootpath+"SAP-application-competencies/customer-relationship-management/'>Customer Relationship Management</a></li><li><a href='"+rootpath+"SAP-application-competencies/enterprise-performance-management/'>Enterprise Performance Management</a></li><li><a href='"+rootpath+"SAP-application-competencies/supply-chain-management/'>Supply Chain Management</a></li><li><a href='"+rootpath+"SAP-application-competencies/enterprise-resource-planning/'>Enterprise Resource Planning</a></li><li><a href='"+rootpath+"SAP-application-competencies/human-capital-management/'>Human Capital Management</a></li><li><a href='"+rootpath+"SAP-application-competencies/world-class-finance/'>World Class Finance</a></li><li><a href='"+rootpath+"SAP-application-competencies/supplier-relationship-management/'>Supplier Relationship Management</a></li><li><a href='"+rootpath+"SAP-application-competencies/product-lifecycle-management/'>Product Lifecycle Management</a></li><li><a href='"+rootpath+"SAP-application-competencies/asset-management/'>Service &amp; Asset Management</a></li><li><a href='"+rootpath+"SAP-application-competencies/master-data-management/'>Master Data Management</a></li><li><a href='"+rootpath+"SAP-application-competencies/governance-risk-compliance/'>Governance, Risk and Compliance</a></li><li><a href='"+rootpath+"SAP-application-competencies/integrated-application-operations/'>Integrated Application Operations</a></li><li><a href='"+rootpath+"SAP-application-competencies/manufacturing/'>Manufacturing</a></li></ul></div>";
			break;
		case 5:
			objTabContent.style.backgroundImage="url("+rootpath+"images/home/global-delivery-capabilities.jpg)";
			objTabContent.innerHTML+="<div class='geo-spread'><ul><li><a href='"+rootpath+"global-delivery-capabilities/Europe.asp'>Europe</a></li><li><a href='"+rootpath+"global-delivery-capabilities/US.asp'>US</a></li><li><a href='"+rootpath+"global-delivery-capabilities/africa.asp'>Africa</a></li><li><a href='"+rootpath+"global-delivery-capabilities/APJ.asp'>Asia Pacific and Japan</a></li><li><a href='"+rootpath+"global-delivery-capabilities/ANZ.asp'>Australia & New Zealand</a></li><li><a href='"+rootpath+"global-delivery-capabilities/India.asp'>India</a></li></ul></div>";
			break;
		default:
			//objTabContent.innerHTML="a";
	}
	if (objTab.className.indexOf(" over") < 0) {
		objTab.className+=" over";
	}
	if (curtab>0) {
		objCurTab.className=objCurTab.className.replace(" over", "");
	}
	curtab=tabid;
}

function closeme() {
	closetab=1;
	tmpclosetab=0;
	closethistab();	
}

function closethistab() {
	transtimer=setTimeout("closethistab()",10);
	if (!closetab) {
		stop_timer();
	} else {
		if (tmpclosetab<100) {
			tmpclosetab++;
		} else {
			stop_timer();
			objTabContent=document.getElementById("tabcontent");
			objCurTab=document.getElementById("mnuTab"+curtab);
			objCurTab.className=objCurTab.className.replace(" over", "");
			
			if (document.getElementById("mnuTab"+deftab).className.indexOf(" over") < 0) {
				document.getElementById("mnuTab"+deftab).className+=" over";
			}
			
			if (deftab>1) {
				if (mytab==1) {
					objTabContent.style.display="none";
					objTabContent.style.visibility="hidden";
				}
				changeTab(deftab);
			} else {			
				objTabContent.style.display="none";
				objTabContent.style.visibility="hidden";
				curtab=1;			
			}
		}
	}
}

function stop_timer() {
	clearTimeout(transtimer); transtimer=0;
	tmpclosetab=0;
	closetab=0;
}

function talktome() {
		if ($("txtname").value.replace(/^\s*|\s*$/g,"")==""){
			alert ("Enter your Name");
			$("txtname").focus();
			return;
		} else if (emailfilter.test($("txtemailid").value)==false) {
			alert ("Enter valid E-Mail ID");
			$("txtemailid").focus();
			return;
		} else if ($("txtphone").value.replace(/^\s*|\s*$/g,"")==""){
			alert ("Enter your Contact No.");
			$("txtphone").focus();
			return;
		}  else if ($("txtcomments").value.replace(/^\s*|\s*$/g,"")==""){
			alert ("Enter your comments");
			$("txtcomments").focus();
			return;
		}
		document.frmttm.submit();
	}
