var pic1= new Image(100,25); 
var pic2= new Image(100,25); 

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
var blockedEmailIds = new Array("accenture", "yahoo", "gmail", "hotmail","rediffmail", "infosys","wipro","patni","tcs","cognizant","satyam");

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=0;
var closetab=0, tmpclosetab=0, transtimer=0;

//var rootpath="http://fs4/hcltech/"
var rootpath="http://www.hcltech.com/"

function changeTab(tabid) {	
	closetab=0;
	stop_timer();

	if (curtab==tabid) return;
	objTabContent=document.getElementById("tabcontent");
	if (curtab==0) {
		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.innerHTML+="<div class='tnav_box'><div class='heading i_services'><span class='hd'>Business Lines</span><br />Value is created by integrating services for optimization at interface points and greater end-business impact.</div><div class='mnulist_2c'><ul><li class='l1'><a href='"+rootpath+"engineering-services/'>Engineering and R&amp;D Services</a></li><li class='l2'><a href='"+rootpath+"engineering-services/hardware-engineering/'>Hardware Engineering</a>, <a href='"+rootpath+"engineering-services/embedded-engineering/'>Embedded Engineering</a>, <a href='"+rootpath+"engineering-services/mechanical-engineering/'>Mechanical Engineering</a>, <a href='"+rootpath+"engineering-services/software-product-engineering/'>Software Product Engineering</a> </li><li class='l1'><a href='"+rootpath+"enterprise-transformation-services/'>Enterprise Transformation Services</a></li><li class='l2'><a href='"+rootpath+"enterprise-transformation-services/business-transformation-services/'>Business Transformation</a>, <a href='"+rootpath+"enterprise-transformation-services/technology-transformation-services/'>Technology Transformation,</a> ...</li><li class='l1'><a href='"+rootpath+"bpo/'>Business Process Outsourcing</a></li></ul></div><div class='mnulist_2c'><ul><li class='l1'><a href='"+rootpath+"custom-application/'>Custom Application Services</a></li><li class='l2'><a href='"+rootpath+"custom-application/application-development/'>Application Development</a>, <a href='"+rootpath+"custom-application/application+re-engineering/'>Application Re-engineering &amp; Integration</a>, <a href='"+rootpath+"custom-application/application-maintenance/'>Application Support &amp; Maintenance,</a> ...</li><li class='l1'><a href='"+rootpath+"enterprise-application-services/'>Enterprise Application Services</a></li><li class='l2'><a href='"+rootpath+"enterprise-application-services/SAP/'>SAP</a>, <a href='"+rootpath+"enterprise-application-services/oracle/'>Oracle</a>, <a href='"+rootpath+"enterprise-application-services/microsoft-dynamics/'>Microsoft Dynamics,</a> ...</li><li class='l1'><a href='"+rootpath+"IT-infrastructure-management/'>IT Infrastructure Management</a></li></ul></div>";
			break;
		case 2:
			objTabContent.innerHTML+="<div class='tnav_box'><div class='heading i_is'><span class='hd'>Industry Sectors</span></div><div class='mnulist_3c'><ul><li class='l1'><a href='"+rootpath+"#/'>Telecom</a></li><li class='l1'><a href='"+rootpath+"#/'>Financial </a></li><li class='l1'><a href='"+rootpath+"#/'>Healthcare</a></li><li class='l1'><a href='"+rootpath+"#/'>Transportation</a></li></ul></div><div class='mnulist_3c'><ul><li class='l1'><a href='"+rootpath+"#/'>Media & Entertainment</a></li><li class='l1'><a href='"+rootpath+"#/'>Manufacturing</a></li><li class='l1'><a href='"+rootpath+"#/'>Life Science</a></li><li class='l1'><a href='"+rootpath+"#/'>Travel</a></li></ul></div><div class='mnulist_3c'><ul><li class='l1'><a href='"+rootpath+"#/'>Retail</a></li><li class='l1'><a href='"+rootpath+"#/'>Other Services</a></li></ul></div>";
			break;
			
		case 3:
			objTabContent.innerHTML+="<div class='tnav_box bg_geo' ><div class='heading i_geo'><span class='hd'>Services</span></div><div class='mnulist_3c'><ul><li class='l1'><a href='"+rootpath+"#'>Inbound Call Center</a></li><li class='l1'><a href='"+rootpath+"#'>Outbound Call Center</a></li><li class='l1'><a href='"+rootpath+"#'>Telemarketing Services</a></li><li class='l1'><a href='"+rootpath+"#'>Technical Support Service </a></li><li class='l1'><a href='"+rootpath+"#'>Email Support Services</a></li></ul></div><div class='mnulist_3c'><ul><li class='l1'><a href='"+rootpath+"#'>Chat Support Services</a></li><li class='l1'><a href='"+rootpath+"#'>Answering Service</a></li><li class='l1'><a href='"+rootpath+"#'>Inquiry Handling</a></li><li class='l1'><a href='"+rootpath+"#'>Remote Reception</a></li><li class='l1'><a href='"+rootpath+"#'>Help Desk Support</a></li></ul></div><div class='clear'></div> " ;			
			break;
		

	}
	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", "");			
			objTabContent.style.display="none";
			objTabContent.style.visibility="hidden";
			curtab=0;
		}
	}
}

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();
	}
	
function show_content(){	
		navRoot = document.getElementById("more_content");
	if (navRoot.className=="hidden_content"){
		navRoot.className="show_content";
	}
	else if (navRoot.className=="show_content"){
		navRoot.className="hidden_content";
		}	
}

function collapse(hd,des){
	if ($(hd).className=="hd expand") {
		$(hd).className="hd collapse";
		$(des).className="bnlnk over";
	} else {
		$(hd).className="hd expand";
		$(des).className="bnlnk";
	}
}


//Functions for display or hide a object
function showmore(objid, objmore, objless) {
	$(objid).style.display="block";
	$(objmore).style.display="none";
	$(objless).style.display="";
}

function showless(objid, objmore, objless) {
	$(objid).style.display="none";
	$(objmore).style.display="";
	$(objless).style.display="none";
}
/* END */

//Code for Right Navigation
function resetRNTab() {
	var v = document.getElementById("txtpageinfo").value;
	splitvalues = v.split("|");
	if (document.getElementById("rnav"+splitvalues[0])) {
		changeRNTab(splitvalues[1],splitvalues[2]);
		document.getElementById("rnav"+splitvalues[0]).className+=" active";
	}
}

function changeRNTab(actTabId, hideTabId) {	
	if (actTabId==0 || hideTabId==0) return;
	var actTab=document.getElementById("rntab"+actTabId);
	var hideTab=document.getElementById("rntab"+hideTabId);
	if (actTab.className=="active") return;
	actTab.className="active";
	hideTab.className="";
	
	var actContent=document.getElementById("rncontent"+actTabId);
	var hideContent=document.getElementById("rncontent"+hideTabId);
	
	actContent.className="active";
	hideContent.className="";
}
window.onload=resetRNTab;