/// <summary>
/// Return if we're in IE or not
/// </summary>
function isIE()
{
	if(document.all)
    {
    	return true;
    }
}

/// <summary>
///  Shows or hides an element in the document
/// </summary>
/// <summary>

///  Shows or hides an element in the document

/// </summary>

function ShowHide(elementname,truefalse)
{
	try
    	{	
        	var theElement = document.getElementById(elementname);
            var theTagName = document.getElementById(elementname).tagName;

            if (theElement == null)
            	return;     

                        if (!truefalse)
                                    document.getElementById(elementname).style.display='none';
                        else
                        {          
                                    if(!isIE())
                                    {
                                                switch(theTagName)
                                                {          
                                                            case "DIV":
                                                            document.getElementById(elementname).style.display='block';
                                                            break;

                                                            case "SPAN":
                                                            document.getElementById(elementname).style.display='inline';
                                                            break;

                                                            case "TABLE":
                                                            document.getElementById(elementname).style.display='table';
                                                            break;

                                                            case "TR":
                                                            document.getElementById(elementname).style.display='table-row';
                                                            break;
                                                }
                                    }
                                    else
                                    {                                               
                                                            document.getElementById(elementname).style.display='block';
                                    }
                        }
            }
            catch(e)
            {
            alert("Error show/hiding - "+ elementname);
            }
}
/// <summary>
///  Shows or hides an element in the document
/// </summary>
function displayThawteDate()
{
	// Calculate Date Function
	var today = new Date(); 
	var myMonth = new String(today.getMonth()+1);
	var myDate = new String(today.getDate());
	
	// Prefix with a zero
	if (myDate.length == 1)
		myDate = "0" + myDate;
		
	if (myMonth.length==1)
		myMonth = "0" + myMonth;
		
	if (isIE())
	{
		position = "top : 23px; left : -445px;";
	}
	else
	{
		position = "top : 20px; left : -500px;";
	}
	// Write Date Above the Thawte Logo
	document.write("<div style='position : absolute; " + position + "color : black; font-size : 7pt; font-weight : bold;'>" + myDate + "-" + myMonth  + "-" + today. getFullYear() + "</div>");
}


function ResetFont()
{
document.body.style.fontSize = "70%";
document.cookie = "textsize=" + document.body.style.fontSize;
}

/// <summary>
/// Increase the font on the page
/// </summary>
function IncreaseFont()
{
	var amount = new String(document.body.style.fontSize);
	if (amount == "")
		amount="70%";

	var intAmount = new Number(amount.substring(0, amount.length-1));

	intAmount = intAmount + 10;
	document.body.style.fontSize = intAmount.toString() + "%";
	
	document.cookie = "textsize=" + document.body.style.fontSize;
}

/// <summary>
/// Decrease the font on the page
/// </summary>
function DecreaseFont()
{
	var amount = new String(document.body.style.fontSize);
	if (amount == "")
		amount="70%";

	var intAmount = new Number(amount.substring(0, amount.length-1));
	intAmount = intAmount - 10;
	document.body.style.fontSize = intAmount.toString() + "%";

	document.cookie = "textsize=" + document.body.style.fontSize;
}

/// <summary>
/// Check and set font size for the page
/// </summary>
function CheckFontSize()
{
	// Get Cookie from the browser and set the font size
	var Cookies = new String(document.cookie);
	var CookieCollection = Cookies.split(';');
	
	for (var count=0; count <CookieCollection.length; count++)
	{
		var Cookie = new String(CookieCollection[count]);
		var CookieInfo = Cookie.split('=');
		if (CookieInfo[0].substring(1, CookieInfo[0].length) == "textsize")
		{
			document.body.style.fontSize = CookieInfo[1];
		}
	}	
}

