// JavaScript Document

function createCSS(selector, declaration) {
        // test for IE
        var ua = navigator.userAgent.toLowerCase();
        var isIE = (/msie/.test(ua)) && !(/opera/.test(ua)) && (/win/.test(ua));

        // create the style node for all browsers
        var style_node = document.createElement("style");
        style_node.setAttribute("type", "text/css");
        style_node.setAttribute("media", "screen");

        // append a rule for good browsers
        if (!isIE) style_node.appendChild(document.createTextNode(selector + " {" + declaration + "}"));

        // append the style node
        document.getElementsByTagName("head")[0].appendChild(style_node);

        // use alternative methods for IE
        if (isIE && document.styleSheets && document.styleSheets.length > 0) {
                var last_style_node = document.styleSheets[document.styleSheets.length - 1];
                if (typeof(last_style_node.addRule) == "object") last_style_node.addRule(selector, declaration);
        }
};
 createCSS ("h1","overflow:hidden; text-indent:-10000px;")

var idName = 0;
function writeBanner (homePage ){
var fl;
if (homePage == 1){
	fl="<object type='application/x-shockwave-flash' width='630' height='195' id='headerH1"+idName+"' align='right' data='/flash/homeBanner.swf?isHomePage="+homePage+"'><param name='movie' value='/flash/homeBanner.swf?isHomePage="+homePage+"' /><param name='wmode' value='transparent' /><param name='scale' value='noscale' /></object>";}
else {
	fl="<object type='application/x-shockwave-flash' width='630' height='195' id='headerH1"+idName+"' align='right' data='/flash/homeBanner.swf'><param name='movie' value='/flash/homeBanner.swf' /><param name='wmode' value='transparent' /><param name='scale' value='noscale' /></object>";
}
//alert(fl);
 document.write(fl);
 idName=idName+1;
}
function writeHeader (h,t ){
var fl;
var w="470";
var ht="100";
var hd="1";
if (h=="H1") {w="350"; ht="100"; hd="1";}
if (h=="h1") {w="470"; ht="100"; hd="1";}
if (h=="h2") {w="230"; ht="70"; hd="3";}
if (h=="h3") {w="230"; ht="70"; hd="3";}
if (h=="H1") h="h1";

	fl="<h"+hd+" class='flashHeader'><object type='application/x-shockwave-flash' width='"+w+"' height='"+ht+"' id='header_"+idName+"' align='left' data='/flash/headers.swf?h="+h+"&t="+t+"'><param name='movie' value='/flash/headers.swf?h="+h+"&t="+t+"' /><param name='wmode' value='transparent' /><param name='scale' value='noscale' /><param name='salign' value='lt' /></object><span>"+t+"</span></h"+hd+">";

 document.write(fl);
 idName=idName+1;
}
function writeHeader1 (){
	hi=document.getElementsByTagName("H1");
	//alert(h[0].innerHTML);
if  (document.getElementsByTagName("body")[0].className=="homePage")h="H1";
else h="h1";

t=hi[0].innerHTML;
var fl;
var w="470";
var ht="100";
var hd="1";
if (h=="H1") {w="350"; ht="100"; hd="1";}
if (h=="h1") {w="470"; ht="100"; hd="1";}
if (h=="H1") h="h1";
	fl="<object type='application/x-shockwave-flash' width='"+w+"' height='"+ht+"' id='header_"+idName+"' align='left' data='/flash/headers.swf?h="+h+"&t="+t+"'><param name='movie' value='/flash/headers.swf?h="+h+"&t="+t+"' /><param name='wmode' value='transparent' /><param name='scale' value='noscale' /><param name='salign' value='lt' /></object><span>"+t+"</span>";

hi[0].className= 'flashHeader';
hi[0].innerHTML=fl;
 idName=idName+1;

}
function writeMap ( ){
var fl;
var w="265";
var ht="180";

	fl="<object type='application/x-shockwave-flash' width='"+w+"' height='"+ht+"' id='map_"+idName+"' align='middle' data='/flash/map.swf'><param name='movie' value='/flash/map.swf' /><param name='wmode' value='transparent' /><param name='scale' value='noscale' /></object>";

 document.write(fl);
 idName=idName+1;
}

function submit (bol){
	
	bol?window.location.assign("/?id=0&lg=1"):window.location.assign("/?id=0&lg=0");
	return true
}

function resizeUp() {
	if (document.getElementById ('reduceFont').style.display=='none'){
		document.getElementById ('noReduce').style.display='none';
		document.getElementById ('reduceFont').style.display='inline';
		
	}
	document.getElementById ('noDefault').style.display='none';
	document.getElementById ('defaultFont').style.display='inline';	
	var bds =document.getElementsByTagName('BODY');
	var bodyObj = bds[0];
	if(!bodyObj.style.fontSize){
		bodyObj.style.fontSize = '80%';
	} else {
		var str_fontsize = bodyObj.style.fontSize;
		var num_fontsize = str_fontsize.substring(0,str_fontsize.length-1);
		
		var num_newsize = num_fontsize * 1 + 5;
		if (num_newsize>95) num_newsize=95;
		bodyObj.style.fontSize = num_newsize + '%';
	}
	
	if (bodyObj.style.fontSize > '94%'){
		document.getElementById ('increaseFont').style.display='none';
		document.getElementById ('noIncrease').style.display='inline';	
	}
	if (bodyObj.style.fontSize == '70%'){
		document.getElementById ('noDefault').style.display='inline';
		document.getElementById ('defaultFont').style.display='none';
	}
}

function resizeZero() {
	var bds =document.getElementsByTagName('BODY');
	var bodyObj = bds[0];
	bodyObj.style.fontSize = '70%';
	document.getElementById ('increaseFont').style.display='inline';
	document.getElementById ('noIncrease').style.display='none';
	document.getElementById ('reduceFont').style.display='inline';
	document.getElementById ('noReduce').style.display='none';
	document.getElementById ('noDefault').style.display='inline';
	document.getElementById ('defaultFont').style.display='none';	
	
}

function resizeDown() {
	if (document.getElementById ('increaseFont').style.display=='none'){
		document.getElementById ('noIncrease').style.display='none';
		document.getElementById ('increaseFont').style.display='inline';

		
	}
	document.getElementById ('noDefault').style.display='none';
	document.getElementById ('defaultFont').style.display='inline';	
	
	var bds =document.getElementsByTagName('BODY');
	var bodyObj = bds[0];
	if(!bodyObj.style.fontSize){
		bodyObj.style.fontSize = '66%';
	} else {
		var str_fontsize = bodyObj.style.fontSize;
		var num_fontsize = str_fontsize.substring(0,str_fontsize.length-1);

		var num_newsize = num_fontsize * 1 - 5;
		if (num_newsize<60) num_newsize=60;
		bodyObj.style.fontSize = num_newsize + '%';

	}
	
	if (bodyObj.style.fontSize <'66%'){
		document.getElementById ('reduceFont').style.display='none';
		document.getElementById ('noReduce').style.display='inline';

	}
	if (bodyObj.style.fontSize == '75%'){
		document.getElementById ('noDefault').style.display='inline';
		document.getElementById ('defaultFont').style.display='none';

	}
}

function showHint(obj){
	p=obj.parentNode.getElementsByTagName("div");
	p[0].style.display="block";
	if (document.all){
	if (obj.parentNode.getElementsByTagName("iframe").length>0){
		ifr=obj.parentNode.getElementsByTagName("iframe")
		ifr[0].style.display="block";
		ifr[0].style.height=p[0].offsetHeight;
		ifr[0].style.zIndex=100;
		p[0].style.zIndex=101;
		}
	}
}
function closeHint(o){
	p=o.parentNode.getElementsByTagName("div");
	obj=p[0];
	obj.tagName=="IMG"?obj.parentNode.style.display="none":obj.style.display="none";
	if (document.all && obj.parentNode.getElementsByTagName("iframe").length>0)obj.parentNode.getElementsByTagName("iframe")[0].style.display="none";
}

function getAllChildren(e) {
// Returns all children of element. Workaround required for IE5/Windows. Ugh. 
return e.all ? e.all : e.getElementsByTagName('*'); 
}




function showIcons() {
	var functionIcons = document.getElementById('functionIcons');
	//var functionIcons2 = document.getElementById('functionIcons2');
	//var functionIcons = getElementsByClassName('functionIcons');
	var icons = getAllChildren(functionIcons) 
	//var icons2 = getAllChildren(functionIcons2)
	for(i=0; i<icons.length; i++) {
		if(icons[i].className=='noscript'){
			icons[i].className = 'scriptAvailable';
		}
	}

}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

if (window.attachEvent) window.attachEvent("onload", showIcons);
if (window.addEventListener) window.addEventListener( "load", showIcons, false );

