
showTab = function(thisID) {
	
	clickMenu('tabs');
}

 

addLoadEvent(showTab);
// addLoadEvent() gets passed a function that you want to fire off on page load
function addLoadEvent(objFunc) {
	
	var objOldOnload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = objFunc;
	} else {
		window.onload = function() {
			if (objOldOnload) {
				objOldOnload();
			}
			objFunc();
		}
	}
	
}





function changeImages() {

   if (document.images) {
      for (var i=0; i<changeImages.arguments.length; i+=2) {
         document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
         
         //mySrc = eval(changeImages.arguments[i+1] + ".src");
		 //alert("changeImages.arguments[i]="+mySrc)
      }
   }
}

//Funtionality for mini-tabs
clickMenu = function(menu) {
	var getEls = document.getElementById(menu);
	if(getEls != null){
	    getEls = getEls.getElementsByTagName("LI");
	}else{
	    return;
	}
	
	
	var getAgn = getEls;
	
	for (var i=0; i<getEls.length; i++) {
			getEls[i].onclick=function() {
				
				for (var x=0; x<getAgn.length; x++) {
				getAgn[x].className=getAgn[x].className.replace("click", "");
				}
				this.className+=" click";
				}
			}
		}
		
		
function popUpWindow(strURL, intWidth, intHeight) {



	window.open( strURL, "_blank", "status=1, height=" + intHeight + ", width=" + intWidth + ", resizable=1, scrollbars=1, toolbar=1, location=1" )



}



function popUpWindowNoScroll(strURL, intWidth, intHeight) {



	window.open( strURL, "_blank", "status=1, height=" + intHeight + ", width=" + intWidth + ", resizable=0, scrollbars=0, toolbar=0, location=0" )



}
function clickButton(e, buttonid)
{
    var bt = document.getElementById(buttonid);    
    if (typeof bt == 'object')
    {
        if(navigator.appName.indexOf("Netscape")>(-1))
        {
            if (e.keyCode == 13)
            {
                bt.click();
                return false;
            }
        }
        if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
        {
            if (event.keyCode == 13)
            {
                bt.click();
                return false;
            }
        }
    } 
}



function GetActionTag(URL)
{ 

  document.action_tag.src = 'http://switch.atdmt.com/action/' + URL;
}

function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else expires = "";
	document.cookie = name + "=" + value + expires + "; path=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

//The following code is to deactivate the Search button click evnent on press of enter key.The event gets fired only if the focus is in the Search TextBox: Web Team.
var bFocus = false;
if(navigator.appName=="Microsoft Internet Explorer")
{
    document.attachEvent("onkeypress",detectKey);
}
else if (navigator.appName=="Netscape")
{
    document.addEventListener("keypress",detectKey,false);
}
         
function detectKey(e)
{
    if(navigator.appName=="Microsoft Internet Explorer")
    {
        if(event.keyCode==13)
        {
            event.returnValue=false;
            event.cancelBubble = true;
            enterKeyPressed();
        }
    }
    else if (navigator.appName=="Netscape")
    {
        if(e.which==13)
            {
                e.preventDefault();
                enterKeyPressed();
            }
    }
}
        
        //The following code is to deactivate the Search button click event on press of enter key.The event gets fired only if the focus is in the Search TextBox: Web Team.
        
function enterKeyPressed()
{    

    if(bFocus)
    {
        document.getElementById(id).click();
        return false;
    }
    else
    {
        var btn;
        var input = document.getElementsByTagName('input');
		//Check no of Submit buttons in the page (To check if we are in registration pages).
		for (var i in input) {
			var typ = input[i].type;
			if (typ == 'submit' || typ == 'button' || typ == 'image') 
			{
			     if (input[i].id!= id)
			     {
			        btn = input[i]
			     }
            }
        }
        if(btn!= null)
        {
            btn.click();
        }
        
    }
}