
function Browser() {
	var b=navigator.appName;
	if (b=="Netscape") this.b="ns";
	else if (navigator.userAgent.indexOf("Opera")>0) this.b = "opera";
	else if (b=="Microsoft Internet Explorer") this.b="ie";
	if (!b) alert('Unidentified browser./nThis browser is not supported,');
	this.version=navigator.appVersion;
	this.v=parseInt(this.version);
	this.ns=(this.b=="ns" && this.v>=4);
	this.ns4=(this.b=="ns" && this.v==4);
	this.ns5=(this.b=="ns" && this.v==5);
	this.ie=(this.b=="ie" && this.v>=4);
	this.ie4=(this.version.indexOf('MSIE 4')>0);
	this.ie5=(this.version.indexOf('MSIE 5')>0);
	this.ie55=(this.version.indexOf('MSIE 5.5')>0);
	this.ie6=(this.version.indexOf('MSIE 6')>0);
	this.ie7=(this.version.indexOf('MSIE 7')>0);
	this.ie8 = (this.version.indexOf('MSIE 8') > 0);
	this.ie9 = (this.version.indexOf('MSIE 9') > 0);
	this.opera = (this.b == "opera");
	this.dom=((document.createRange&&(document.createRange().createContextualFragment)||this.ie5||this.ie55||this.ie6||this.ie7||this.ie8||this.ie9)?true:false);
	this.flash=false;
	if(this.ie){
		this.flash=((navigator.appName == "Microsoft Internet Explorer") && (navigator.appVersion.indexOf("Mac") == -1) && (navigator.appVersion.indexOf("3.1") == -1));
	}
	if(this.ns){
		this.flash=(navigator.plugins && navigator.plugins["Shockwave Flash"] || navigator.plugins["Shockwave Flash 2.0"]);
	}
	var ua=navigator.userAgent.toLowerCase();
	if (ua.indexOf("win")>-1) this.platform="win32";
	else if (ua.indexOf("mac")>-1) this.platform="mac";
	else this.platform="other";
}

var is=new Browser();
var savedRightText='';

function getObj(id){
	var obj;
	if(is.ie4)obj=document.all[id];
	if (is.ns4) obj = document[id];
	if(is.dom||is.ie5){
		obj=document.getElementById(id);
}
	return obj;
}

function getStyleObj(id){
	var obj = getObj(id);
	if( obj )
	{
		if(is.ie4) return obj.style;
		if(is.ns4) return obj;
		if(is.dom) return obj.style;
	}
	return null;
}

function moveObj(div,x,y){
	var obj=getStyleObj(div);
	obj.left=x;
	obj.top=y;
}

function showObj(div){
    var obj = getStyleObj(div);
	obj.visibility='visible';
}

function showObjDelayed(div)
{
	setTimeout('document.getElementById("ProgressBarOuter").style.display="block"',200);
}

function hideObj(div){
	var obj=getStyleObj(div);
	if( obj )
	{
		obj.visibility='hidden';
	}
}

function writeObj(div, text){
	var obj=getObj(div);
	if(is.ie4||is.ie5||is.dom)obj.innerHTML=text;
	if(is.ns4){
		obj.document.write(text)
		obj.document.close();
	}
}

function getObjX(div){
	return parseInt(getStyleObj(div).left);
}

function getObjY(div){
	return parseInt(getStyleObj(div).top);
}

function changeImg(id, newImage){
	var imgObj=getObj(id);
	if(typeof(imgObj)=='object'){
		imgObj.src=newImage;
	}
}

function changeBgColor(id, color)
{
	var obj=getStyleObj(id);
	if(typeof(obj)=='object'){
		obj.backgroundColor=color;
	}	
}

function writeRightInfo(headline, text, image, width){
	var obj;
	obj=getObj('ContentInCol2');

	if(savedRightText==''){
		savedRightText=obj.innerHTML;
	}
	obj.innerHTML='<h2 class="Headline1Right">' + headline + '</h2><p class="Normal">' + text + '</p><div style="text.align:center;"><img src="' + image + '" border="0" width="' + width + '"></div>';
}

function restoreRightInfo()
{
	var obj;
	obj=getObj('ContentInCol2');
	obj.innerHTML=savedRightText

}

function startTest(lLanguage){
	window.open("TestFS.asp?language=" + lLanguage,"testWin","width=732,height=580");
}


function writeMoreInfo(sHtml){
	var obj;
	obj=getObj('MoreInfo');

	if( obj )
	{
		showObj('MoreInfo');
		obj.innerHTML=sHtml;
	}
}

function restoreMoreInfo()
{
	hideObj('MoreInfo');
}

function clickOnEnterKey( e, buttonId )
{
	var keyCode;
	
	if( window.event )
	{
		keyCode = e.keyCode;
	}
	else
	{
		keyCode = e.which;
	}
	
	if( keyCode == 13 )
	{
		var button = document.getElementById( buttonId );
		if( button )
		{
			button.click();
			return false;
		}
	}
	return true;
}


function winPopUp(URL)
{
    WinOpen=window.open(URL,'ImageWin','resizable=1,scrollbars=1,width=835,height=369');
    if(typeof(WinOpen)=='object')
    {
        WinOpen.document.body.style.margin='10px';
        WinOpen.focus();
    };
    return false;
}

var winOpen;

function ImagePopUp( id, width, height)
{
	try
	{
		if( winOpen != null && !winOpen.isClosed )
		{
			winOpen.close();
		}
	}
	catch( e )
	{
		
	}
	winOpen = window.open( "/Templates/ShowImage.aspx?ImageId=" + id, 'ImageWin','resizable=1,scrollbars=1,width=' + width + ',height=' + height);
    if(typeof(winOpen)=='object')
    {
		winOpen.focus();
    }
    return false;
}

function PdfPopUp(url)
{
	try
	{
		if( winOpen != null && !winOpen.isClosed )
		{
			winOpen.close();
		}
	}
	catch (e)
	{
	}
	winOpen = window.open(url,'ImageWin','resizable=1,scrollbars=1' );
    if(typeof(winOpen)=='object')
    {
		winOpen.focus();
    }
    return false;
}

