﻿<!--
function generateMenu()
{
    if (TransMenu.isSupported())
    {
		ms = new TransMenuSet(TransMenu.direction.down, 1, 0, TransMenu.reference.bottomLeft);
		menu1 = ms.addMenu(document.getElementById("mtm_home"));
		menu1.addItem("About Us", _basePath + "about-us/");
		menu1.addItem("Philosophy", _basePath + "philosophy/");
		menu1.addItem("Team", _basePath + "team/");
		menu1.addItem("Vision", _basePath + "vision/");
		menu1.addItem("Technical Expertise", _basePath + "technical-expertise/");
		
		menu2 = ms.addMenu(document.getElementById("mtm_company"));
		menu2.addItem("Our Expertise And Domain Knowledge", _basePath + "our-expertise-domain-knowledge/");
		menu2.addItem("Why Companies Resort to Us", _basePath + "why-companies-resort-us/");
		menu2.addItem("The Best Web Outsourcing Process", _basePath + "best-outsourcing-work-process/");
		menu2.addItem("Human Resource Availability", _basePath + "human-resource-availability/");
		menu2.addItem("Client Satisfaction", _basePath + "client-satisfaction/");
		menu2.addItem("Why You Should Go With Best Web Outsourcing?", _basePath + "why-best-web-outsourcing/");	
		
		menu3 = ms.addMenu(document.getElementById("mtm_services"));
		menu3.addItem("Fixed Price Project", _basePath + "fixed-price-project/");
		menu3.addItem("Extended Office", _basePath + "extended-office/");
		//menu3.addItem("Hire a Resource Now!", _basePath + "resource-pricing-chart/");
		TransMenu.renderAll();
	}
}

function initMenu()
{
	if (TransMenu.isSupported())
	{
		TransMenu.initialize();
		//document.getElementById("mtm_home1").onmouseover = function() { ms.hideCurrent(); this.className = "hover"; }
		//document.getElementById("mtm_home1").onmouseout = function() { this.className = ""; }
		menu1.onactivate = function() { this.className = "hover"; };
		menu1.ondeactivate = function() { this.className = ""; };
		menu2.onactivate = function() { this.className = "hover"; };
		menu2.ondeactivate = function() { this.className = ""; };
		menu3.onactivate = function() { this.className = "hover"; };
		menu3.ondeactivate = function() { this.className = ""; };
	}
}

function MM_openBrWindow(theURL,winName,features) 
{
    window.open(theURL,winName,features);
}

function dokey(first,next,len)
{
    if(first.value.length == len)
    {
	    next.focus();
    }
}

// This function will count character for text area.
function CharacterCount(obj, total)
{
	if(total == null) total = 500;
	var len = obj.value.length;
	var newdiv;
	
	if(document.getElementById("note" + obj.id) == null){
		newdiv = document.createElement('div');
		newdiv.id = "note" + obj.id;
	    obj.parentNode.appendChild(newdiv);
	}
	else{
		newdiv = document.getElementById("note" + obj.id);
	}
	
	if(len == 0){
	    obj.parentNode.removeChild(newdiv);
    }
		
	if(len >= total){
		var temp = obj.value.substring(0, total)
		obj.value = temp;
		newdiv.innerHTML = "You have reached maximum characters limit of <b>" + total + "</b>."
	}
	else{
		newdiv.innerHTML = "Your maximum characters limit is: <b>" + total + "</b>. Current character count: <b>" + len + "</b>.";
	}
}

function stateChange(source,spanid){
    if(source.value == "0")
        document.getElementById(spanid).style.display = "inline";
    else
        document.getElementById(spanid).style.display = "none";
}
function toggleCal()
{
    var div = document.getElementById("divCalender");
    if(div.style.visibility == "hidden")
        div.style.visibility = "visible";
    else
        div.style.visibility = "hidden";
}
        
function formatPhone(source, style)
{
	var realNumber = '';
	var pFormat = '';
	for(var i = 0; i < source.value.length; i++){
		if(isNaN(source.value.charAt(i)) == false && source.value.charAt(i) != ' '){realNumber += source.value.charAt(i);}
	}
	if(style == null) style = 'US';
	if(style == 'US'){
		//document.getElementById("divTest").innerHTML = realNumber.length + "<br />" + realNumber;
		for(var i = 0; i < realNumber.length; i++){
			switch (i){
				case 0:
					pFormat += "(" + realNumber.charAt(i); break;
				case 3:
					pFormat += ") " + realNumber.charAt(i); break;
				case 6:
					pFormat += "-" + realNumber.charAt(i); break;
				case 10:
					pFormat += "-" + realNumber.charAt(i); break;
				case 15:
					pFormat = pFormat; break;
				default:
					if(i < 15)
						pFormat += realNumber.charAt(i); 
					break;
			}
		}
	}
	else{
		for(var i = 0; i < realNumber.length; i++){
			switch (i){
				case 0:
					pFormat += "+" + realNumber.charAt(i); break;
				case 3:
					pFormat += "-" + realNumber.charAt(i); break;
				case 6:
					pFormat += "-" + realNumber.charAt(i); break;
				case 9:
					pFormat += "-" + realNumber.charAt(i); break;
				case 13:
					pFormat += "-(" + realNumber.charAt(i); 
					pFormat = pFormat.substring(0, pFormat.length) + ")";
					break;
				case 14:
					pFormat = pFormat.substring(0, pFormat.length -1);
					pFormat += realNumber.charAt(i) + ")";
					break;
				case 15:
					pFormat = pFormat.substring(0, pFormat.length-1);
					pFormat += realNumber.charAt(i) + ")";
					break;
				case 16:
				    pFormat = pFormat.substring(0, pFormat.length-1);
					pFormat += realNumber.charAt(i) + ")"; break;
				default:
					if(i < 17)
						pFormat += realNumber.charAt(i); 
					break;
			}
		}
	}
	source.value = pFormat;
}

function validatePhone(source, style)
{
	if(style == null) style = 'US';
	if(style == 'US'){
		if(!(/^(\([1-9]\d{2}\)\s?\d{3}\-\d{4})+(-\d{1,5})?$/).test(source.value))
		{
			alert("Invalid US Phone Number.");
			source.focus();
			return false;
		}
	}
	else
	{
		if(!(/^(\+\d{1,3}-\d{3}-\d{3}-\d{4})+(-\(\d{1,5}\))?$/).test(source.value))
		{
			alert("Invalid Phone Number.");
			source.focus();
			return false;
		}
	}
}
//-->
