var currentSub = -1;
var displayType = 'none'
subArray = new Array('subb1');

function toggleSub(target) {
	obj2 = subArray[target];
	if(currentSub == target){
			currentSub = -1;
		if (document.layers) {
		}
		else if (document.all) {
	   		eval(obj2+'.style.display = "none"');
		}
		else {
	  	 	document.getElementById(obj2).style.display = 'none';
		}
	}
	else{
		for(i=0;i<subArray.length;i++) {
			obj2 = subArray[i];
			if(i == target) {
			    displayType = 'block'
			}
			else {
				displayType = 'none'
			}
			if (document.layers) {
		
			}
			else if (document.all) {
					eval(obj2+'.style.display = "'+ displayType +'"');
			}
			else {
	  			 	document.getElementById(obj2).style.display = displayType;
			}
		}
		currentSub = target;	
	}
}

function setCookie(name, value) {
	var argv = setCookie.arguments;  
	var argc = setCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  
	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
}

function getCookie(Name) {   
	var search = Name + "=" ;
	if (document.cookie.length > 0) { 
	      offset = document.cookie.indexOf(search);
		        if (offset != -1) { 
				          offset += search.length
						  end = document.cookie.indexOf(";", offset)

						  if (end == -1) {
						             end = document.cookie.length;
						  } 
				return unescape(document.cookie.substring(offset, end))				
			}
		}
}

function fireMenu() {
	openSub = getCookie('menuState');
	if (openSub != -1) {
	toggleSub(openSub)
	}
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

jc_timer = 300

jc_menu=new Array("sub1","sub2","sub3","sub4","sub5","sub6","sub7")

jc_retain = -1

function show(object) {
	jc_retain=object;
	hideAll();
	obj2 = jc_menu[object];
	if (document.layers) {
	   eval('document.'+obj2+'.display = "block"');
	}
	else if (document.all) {
	   eval(obj2+'.style.display = "block"');
	}
	else {
	   document.getElementById(obj2).style.display = 'block';
	}
}

function hideAll() {
	for(i=0;i<jc_menu.length;i++) {
		obj2 = jc_menu[i];
		if (document.layers && jc_retain!=i) {
		    eval('document.'+obj2+'.display = "none"');
		}
		else if (document.all && jc_retain!=i) {
		    eval(obj2+'.style.display = "none"');
		}
		else if (document.getElementById && jc_retain!=i){
		    document.getElementById(obj2).style.display = 'none';
		}
	}
}

function hide(object) {
	jc_retain=-1; setTimeout('hideAll()',jc_timer)
}


function goalslivepopup(){
var tmp;
if (aPopupWin){
tmp = aPopupWin;
aPopupWin = null;
}
aPopupWin = window.open("http://www.GoalsLive.com/EN/popup/goalslive_pu.asp?id=-10", "GoalsLive", "height=400, location=0, menubar=0, personalbar=0, scrollbars=1, status=0, toolbar=0, width=520, resizable=1, screenx=0, screeny=0, left=0, top=0");
}
var aPopupWin;

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}