﻿// JavaScript Document
//var rootpath="http://fs4/hcltech/"
var rootpath="http://www.hcltech.com/"

var pic1= new Image(25,25); 
var pic2= new Image(25,25); 
var pic3= new Image(25,25); 
var pic4= new Image(25,25);
var pic5= new Image(25,25);

pic1.src=rootpath+"images/home/service-plus.jpg";
pic2.src=rootpath+"images/home/events+webinars.jpg";
pic3.src=rootpath+"images/home/latest-buzz.jpg";
pic4.src=rootpath+"images/home/unstructure.jpg";
pic5.src=rootpath+"images/home/geo.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/service-plus.jpg)";
			objTabContent.innerHTML+="<div class='serviceplus'><ul><li><a href='"+rootpath+"services+/'>'Thinking IT' Framework</a></li><li><a href='"+rootpath+"application-development/'>Application Development</a></li><li><a href='"+rootpath+"application-management-operations/'>Application Management and Operations</a></li><li><a href='"+rootpath+"application-portfolio-optimization/'>Application Portfolio Optimization</a></li><li><a href='"+rootpath+"cloud-computing/'>Cloud Computing Services</a></li><li><a href='"+rootpath+"ECM/'>Enterprise Content Management (ECM)</a></li><li><a href='"+rootpath+"ERP/'>Enterprise Resource Planning</a></li><li><a href='"+rootpath+"FSCS/'>Full Services Co-Sourcing</a></li><li><a href='"+rootpath+"independent-verification-validation/'>Independent Verification and Validation</a></li><li><a href='"+rootpath+"mainframe-services/'>Mainframe Services</a></li><li><a href='"+rootpath+"mechanical-engineering/'>Mechanical Lifecycle Engineering</a></li><li><a href='"+rootpath+"RIM/'>Remote Infrastructure Management</a></li><li><a href='"+rootpath+"SaaS/'>Software as a Service (SaaS)</a></li><li><a href='"+rootpath+"systems-engineering/'>Systems Engineering</a></li><li><a href='"+rootpath+"software-product-engineering/'>Software Engineering</a></li><li><a href='"+rootpath+"SOA/'>SOA Reference Architecture</a></li><li><a href='"+rootpath+"web-technology/'>Web Technology</a></li></ul></div>";
			break;
		case 3:
			objTabContent.style.backgroundImage="url("+rootpath+"images/home/events+webinars.jpg)";
			objTabContent.innerHTML+="<div class='evt_web' ><ul><li><a href='"+rootpath+"events/upcoming/#ces' target='_blank'>2012 International CES<br /><em>January 10<sup>th</sup> – 13<sup>th</sup>, 2012</em></a></li><li><a href='"+rootpath+"events/upcoming/#msw' target='_blank'>Microstrategy world 2012<br /><em>January 23<sup>rd</sup> – 26<sup>th</sup>, 2012</em></a></li><li><a href='"+rootpath+"events/upcoming/#him' target='_blank'>HIMSS12 Annual Conference &amp; Exhibition - ICD 10 Knowledge Center<br /><em>February 21<sup>st</sup> – March 1<sup>st</sup>, 2012</em></a></li><li><a href='"+rootpath+"events/upcoming/#wmc' target='_blank'>Mobile World Congress 2012<br /><em>February 27<sup>th</sup> – March 1<sup>st</sup>, 2012</em></a></li><li><a href='"+rootpath+"events/upcoming/#acc' target='_blank'>ACORD LOMA Insurance Systems forum 2012<br /><em>May 15<sup>th</sup> - 17<sup>th</sup>, 2012</em></a></li></ul></div>";
			break;
		case 4:
			objTabContent.style.backgroundImage="url("+rootpath+"images/home/latest-buzz.jpg)";			
			objTabContent.innerHTML+="<div class='latestbuzz'><ul><li><a href='http://www.industryweek.com/articles/your_it_planning_checklist_23239.aspx?SectionID=2' target='_blank'><b>Your IT Planning Checklist</b><br />Information Technology can play a significant role, both in achieving cost optimization and business agility.</a></li><li><a href='http://timesofindia.indiatimes.com/biz/india-business/Staff-first-customers-second-for-HCL-boss/articleshow/6039039.cms' target='_blank'>Staff first, customers second for HCL boss.</a></li><!--li><a href='"+rootpath+"media/press-releases/2010/04/13/' target='_blank'>HCL Technologies Named to the 2010 WorldBlu List of Most Democratic Workplaces</a></li><li><a href='"+rootpath+"media/press-releases/2010/03/25/' target='_blank'>HCL Technologies Recognised as one of Britain’s Top Employers for the Fourth Consecutive Year</a></li--></ul><br /><br /><a href='http://www.thinkers50.com/biographies/118'><img src='http://www.hcltech.com/images/home/award.gif' border='0' style='margin-left:10px'></a></div>";
			break;
		case 5:
			objTabContent.style.backgroundImage="url("+rootpath+"images/home/geo.jpg)";
				
			objTabContent.innerHTML+="<div class='evt_weba'><ul><li><a href='"+rootpath+"geo-spread/anz/' target='_blank'>Australia &amp; New Zealand</a></li><li><a href='"+rootpath+"geo-spread/canada/' target='_blank'>Canada</a></li><li><a href='"+rootpath+"china/' target='_blank'>China</a></li><li><a href='"+rootpath+"geo-spread/europe/' target='_blank'>Europe</a></li><li><a href='"+rootpath+"geo-spread/hong-kong/' target='_blank'>Hong Kong</a></li><li><a href='"+rootpath+"geo-spread/india/' target='_blank'>India</a></li><li><a href='"+rootpath+"geo-spread/japan/' target='_blank'>Japan</a></li><li><a href='"+rootpath+"geo-spread/latin-america/' target='_blank'>Latin America</a></li><li><a href='"+rootpath+"geo-spread/malaysia/' target='_blank'>Malaysia</a></li><li><a href='"+rootpath+"geo-spread/middle-east/' target='_blank'>Middle East</a></li><li><a href='"+rootpath+"geo-spread/singapore/' target='_blank'>Singapore</a></li><li><a href='"+rootpath+"geo-spread/us/' target='_blank'>US</a></li></ul></div>";
			
			//objTabContent.innerHTML+="<div class='eandt'><br /><span style='color: #fff; font-size: 90%;'>The thought leadership platform of HCL is<br />there to bring about an open debate on<br />the relevance of Transformation. Many of<br />the opinion leaders and industry<br />practitioners have participated and<br />expressed their views here.</span><br /><br /><br /><a href='http://www.hcltech.com/etevent2007/' target='_blank' style='color: #FEF200; text-decoration: none; font-weight: 700; font-size: 15px;'>Join the debate</a></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 ($("txtorg").value.replace(/^\s*|\s*$/g,"")==""){
			alert ("Enter your Organization");
			$("txtorg").focus();
			return;
		} else if ($("txtdesi").value.replace(/^\s*|\s*$/g,"")==""){
			alert ("Enter your Job Title");
			$("txtdesi").focus();
			return;
		} else if ($("txtaddress").value.replace(/^\s*|\s*$/g,"")==""){
			alert ("Enter your Address");
			$("txtaddress").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;
		} 
		$("cmbsubmit").disabled=true;
		document.frmttm.submit();
		
	}
	
	//<li><a href='"+rootpath+"events/upcoming' target='_blank'>Defence Expo 2010<br /><em>February 15<sup>th</sup> - 17<sup>th</sup>, 2010</em></a></li>
