  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-1456723-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

function globalInit() {
//	var theBrowser = new Browser();
	if (document.cookie.toUpperCase().indexOf("IWSESSIONID") < 0) {
		location.href = "/help-access.html";
	}

	
}

function isDef(variable) {
	variable += '';
	return (variable != '' && variable != "undefined" && variable != "null");
}

function isVal(variable) {
	variable += '';
	return (variable != '' && variable != "undefined" && variable != "null" && !isNaN(parseInt(variable,10)));
}


function addEvent(obj, evType, fn, useCapture) {
// General function for adding an event listener
if (obj.addEventListener) {
obj.addEventListener(evType, fn, useCapture);
return true;
} else if (obj.attachEvent) {
var r = obj.attachEvent("on" + evType, fn);
return r;
} else {
alert("handler could not be attached");
}

}

function clearDefaultText(e) {
    var target = window.event ? window.event.srcElement : e ? e.target : null;
    if (!target) return;
    
    if (target.value == target.defaultText) {
        target.value = '';
    }
}

function replaceDefaultText(e) {
    var target = window.event ? window.event.srcElement : e ? e.target : null;
    if (!target) return;
    
    if (target.value == '' && target.defaultText) {
        target.value = target.defaultText;
    }
}

function launch(filename,width,height,winName,isScroll) {


	var features = "width=" + width + ",height=" + height;
	features += ",menubar=0,toolbar=0,location=0,directories=0,status=0,resizable=0,hotkeys=0";
	if ('' + isScroll == "true")
	{
		features += ",scrollbars=1";
	} else {
		features += ",scrollbars=0";
	}

	void eval(winName + '= window.open("' + filename + '","' + winName + '","' + features + '")');

	
		// Try to focus it
		if (('' + window.focus) != "undefined" && ('' + window.focus) != '') 
		{
			eval(winName + '.focus()');
		}
	
}


function ShowOptionPage (sURL,sType,sKey)
{
sURL = sURL + "?opt=" + sType + "&key=" + sKey
ShowPopup(sURL,"True")
}
	
function ShowPopup(url,sWide) {
		if (sWide == "True")
		launch(url,600,600,'help',true)
		else
			launch(url,500,550,'help',true)
		

}
         function SwapTabs(nTabSelected)
        {
        var sTabName,sTabClass, sTabSelected;
        var nTabNo, sTabNo;
            for (nTabNo = 1; nTabNo <= 3; nTabNo++)
                {
                        {if (nTabSelected == nTabNo) 
                            {sTabSelected = 1}
                            else
                            {sTabSelected = 0}
                        }
                        sTabNo =nTabNo+'';
                        sTabName= "htabcontent" + sTabNo;
                        sTabClass= "htabcontent_" + sTabSelected;
                        ShowTab(sTabName,sTabClass);
                        sTabName ="htab" + sTabNo;
                        sTabClass= "htab" + "_" + sTabSelected;
                        ShowTab(sTabName,sTabClass);
                }
    }
	function ShowTab(idElement,sClass){
            document.getElementById(idElement).setAttribute("class", sClass);
           /**and for ie***/
            document.getElementById(idElement).className=sClass;
            }
            
    function HideLitUp(idElement)
                {
                    document.getElementById("divFlyScreen").style.display = "none";
                    document.getElementById(idElement).style.display = "none";
                    
                }            
           
        function ShowLitUp(idElement,idTextToClear)
                {
                    document.getElementById("divFlyScreen").style.display = "";
                    document.getElementById(idElement).style.display = "";
                    if (idTextToClear)
                        document.getElementById(idTextToClear).innerHTML = "";
                    
                }         
                
                
        
