// break out of frames
if(top.location != location) {
    top.location.href = document.location.href;
}

//hide content when not needed
var ns6=document.getElementById&&!document.all?1:0
var head="display:''"
var folder=''

function enlarge(oject){
folder=ns6?oject.nextSibling.nextSibling.style:document.all[oject.sourceIndex+1].style
if (folder.display=="none")
folder.display=""
else
folder.display="none"
}


function popwin(url,name){
	if(url.match(/\.jpg$/i) || url.match(/\.gif$/i))
	{
		if(name==null)
		{
			name='boiro';
		}
		w=open("",name,'width=381,height=598,toolbar=no,scrollbars=no,resizable=yes'); 
		w.document.write("<HTML><HEAD><TITLE>"+name+"</TITLE></HEAD>"); 
		w.document.write("<SCRIPT language=javascript>function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+10,document.images[0].height+30); window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT>"); 
		w.document.write("<BODY onload='checksize()' onblur='window.close()' onclick='window.close()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
		w.document.write("<TABLE width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><TR>");
		w.document.write("<TD valign='top' align='center' height='588'><IMG src='"+url+"' border=0 alt='Mon image'>"); 
		w.document.write("</TD></TR></TABLE>");
		w.document.write("</BODY></HTML>"); 
		w.document.close(); 
	}
	else
	{
		window.open(url,'boiro','width=381,height=500,toolbar=no,scrollbars=no,resizable=yes');
	}
	return false;
}

var enabletabpersistence=1 
var tabcontentIDs=new Object()
var currbg = ''
var currselected = ''

function expandcontent(linkobj){
	var ulid=linkobj.parentNode.parentNode.id 
	var ullist=document.getElementById(ulid).getElementsByTagName("li")
	for (var i=0; i<ullist.length; i++){
		ullist[i].className="" 
		if (typeof tabcontentIDs[ulid][i]!="undefined") 
		document.getElementById(tabcontentIDs[ulid][i]).style.display="none" 
	}

	currselected.src = currbg;
	linkobj.parentNode.className="selected"

	currbg = linkobj.getElementsByTagName("img")[0].src;
	currselected = linkobj.getElementsByTagName("img")[0];
	
	linkobj.getElementsByTagName("img")[0].src = linkobj.style.backgroundImage.toString().replace("url(","").replace("(","");

	document.getElementById(linkobj.getAttribute("rel")).style.display="block"
	saveselectedtabcontentid(ulid, linkobj.getAttribute("rel"))
}

function expandtab(tabcontentid, tabnumber){
	var thetab=document.getElementById(tabcontentid).getElementsByTagName("a")[tabnumber]
	if (thetab.getAttribute("rel"))
	expandcontent(thetab)
}

function savetabcontentids(ulid, relattribute){
	if (typeof tabcontentIDs[ulid]=="undefined")
	tabcontentIDs[ulid]=new Array()
	tabcontentIDs[ulid][tabcontentIDs[ulid].length]=relattribute
}

function saveselectedtabcontentid(ulid, selectedtabid){
	if (enabletabpersistence==1) 
	setCookie(ulid, selectedtabid)
}

function getullistlinkbyId(ulid, tabcontentid){
	var ullist=document.getElementById(ulid).getElementsByTagName("li")
	for (var i=0; i<ullist.length; i++){
		if (ullist[i].getElementsByTagName("a")[0].getAttribute("rel")==tabcontentid){
			return ullist[i].getElementsByTagName("a")[0]
		break
		}
	}
}

function initializetabcontent(){
	for (var i=0; i<arguments.length; i++){
		if (enabletabpersistence==0 && getCookie(arguments[i])!="")
		setCookie(arguments[i], "")
		var clickedontab=getCookie(arguments[i]) 
		var ulobj=document.getElementById(arguments[i])
		var ulist=ulobj.getElementsByTagName("li") 
		for (var x=0; x<ulist.length; x++){ 
			var ulistlink=ulist[x].getElementsByTagName("a")[0]
			if (ulistlink.getAttribute("rel")){
				savetabcontentids(arguments[i], ulistlink.getAttribute("rel")) 
				ulistlink.onclick=function(){
					expandcontent(this)
					return false
				}
				if (ulist[x].className=="selected" && clickedontab=="") 
				expandcontent(ulistlink)
			}
		} 
		if (clickedontab!=""){
			var culistlink=getullistlinkbyId(arguments[i], clickedontab)
			if (typeof culistlink!="undefined")
			expandcontent(culistlink)
			else
			expandcontent(ulist[0].getElementsByTagName("a")[0])
		}
		else
		{
			expandcontent(ulist[1].getElementsByTagName("a")[0])
		}
	} 
}


function getCookie(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i");
	if (document.cookie.match(re))
	return document.cookie.match(re)[0].split("=")[1]
	return ""
}

function setCookie(name, value){
	document.cookie = name+"="+value 
}
