
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

function ValidateForm(){
	var emailID=document.frmSample.txtEmail
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }

function switchHomepageText(sSS) {
	document.all['sMs'].className="pasInnerPageTopMenu";
	document.all['sMp'].className="pasInnerPageTopMenu";
	document.all['sMa'].className="pasInnerPageTopMenu";
	//document.all['sMx'].className="pasInnerPageTopMenu";

	if (sSS=="services") {
		document.all['flexText'].innerHTML="<h2>TOBIUS/SERVICES</h2>Empower ICT business systems through Flexible and Managed Services";
		document.all['sMs'].className="actInnerPageTopMenu";
	}
	if (sSS=="perform") {
		document.all['flexText'].innerHTML="<h2>TOBIUS/PERFORM</h2>Empower business performance through end-to-end project and portfolio management";
		document.all['sMp'].className="actInnerPageTopMenu";
	}
	if (sSS=="align") {
		document.all['flexText'].innerHTML="<h2>TOBIUS/ALIGN</h2>Empower the ICT application landscape to enable future growth";
		document.all['sMa'].className="actInnerPageTopMenu";
	}
	if (sSS=="xconnect") {
		document.all['flexText'].innerHTML="<h2>TOBIUS/xCONNECT</h2>Empower any relationship with a single platform";
		document.all['sMx'].className="actInnerPageTopMenu";
	}
}


  function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

function setposX(divname, xpos) {
	//alert(divname);
	document.all(divname).style.pixelLeft = xpos-1;
	document.all(divname).style.pixelTop = 25;
}

function hideFloatMenus() {
	hideFloatMenu('menuSSmo');
	hideFloatMenu('menuCCmo');
	hideFloatMenu('menuNEmo');
	hideFloatMenu('menuATmo');
	hideFloatMenu('menuCTmo');
}

function showFloatMenu(oElement) {
	hideFloatMenus();
	var oOriginalElement=oElement;
	document.all[oElement.id+"mo"].className="activeDiv";
	if( typeof( oElement.offsetParent ) != 'undefined' ) {
		for( var posX = 0; oElement; oElement = oElement.offsetParent ) {
			posX += oElement.offsetLeft;
			//posY += oElement.offsetTop;
		}
		//alert (oOriginalElement.id+"mo");
		setposX(oOriginalElement.id+"mo",posX);
		//alert (posX);
		return (posX);
	} else {
		//alert (oElement.x);
		return (oElement.x);
	}
}

function hideFloatMenu(sDiv) {
	document.all[sDiv].className="passiveDiv";
	//oDiv.className="passiveDiv"
	
}

function PopupImageCustomSize(strURL,sWidth,sHeight) {
	window.open(strURL,"","top=100,left=100,height=" + sHeight + ",width=" + sWidth + ",toolbar=no,menubar=no,location=no");
}

function PopupImage(strURL) {
//	alert(strURL);
	window.open(strURL,"","height=220,width=320,toolbar=no,menubar=no,location=no");
}

function SubmitForm(oForm,sLanguage) {
//	alert(oForm);
	var pass=true;
	for (i=0;i<oForm.length;i++) {
		var tempobj=oForm.elements[i]
		if (tempobj.name.substring(0,8)=="required") {
			if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1)) {
//				alert(tempobj.name);
				pass=false;
				break;
			}
		}
	}
	if (!pass){
		switch (sLanguage) {
			case "en" :
				alert("One or more of the required form-elements are not completed.\nPlease verify them, then submit again!");
				break;
			case "fr" :
				alert("Un ou plusieurs des forme-éléments exigés n'est pas accompli. Veuillez les vérifier, soumettent alors encore.");
				break;
			case "de" :
				alert("Man oder mehr der angeforderten Form-Elemente werden nicht durchgeführt. Überprüfen Sie sie bitte, einreichen dann wieder!");
				break;
		}
		tempobj.focus();
		return false;
	} else {
		oForm.submit();
		return true;
	}
}

// Navigation menu functions
function restoreCurrentMenu() {
	activateMenu(oCurrentMenu);
}

function activateMenu(oTab) {
	deactivateMenus();
	document.getElementById("menu"+oTab).className ="activeDiv";
//	alert(document.getElementById("m_mainTabs").src);
	document.getElementById("img_mainTabs").src="/img/mnu/menu_"+oTab+"_en.jpg";
//	alert(document.getElementById("m_mainTabs").src);
}

function deactivateMenus() {
	document.getElementById('menuHome').className="passiveDiv";
	document.getElementById('menuCustomerSolutions').className="passiveDiv";
	document.getElementById('menuCareerCentre').className="passiveDiv";
	document.getElementById('menuNewsEvents').className="passiveDiv";
	document.getElementById('menuAboutTOBIUS').className="passiveDiv";
	document.getElementById('menuContact').className="passiveDiv";
}

function ShowIt(sClass,sObj) {
	var oObject = document.all['s'+sClass+sObj];
	oObject.className = "activeDiv";
}