<!--
//if collapse if the bar is clicked 2nd time:
var isCollapse=1

// ititialize the items for expand / collapse:
function InitExpand(){
	for (i=1; i<=no; i++) {
		eval("expanded"+arrPrjID[i-1]+"=0")
		if (ns6){
			eval('objCont'+arrPrjID[i-1]+'=document.getElementById("divCont'+arrPrjID[i-1]+'")')
			eval('objCont'+arrPrjID[i-1]+'H=objCont'+arrPrjID[i-1]+'.offsetHeight')
			eval('objCont'+arrPrjID[i-1]+'.style.height=row1')
			
			if (i==1) eval('objCont'+arrPrjID[i-1]+'.style.top=distTop')
			else if (i>1) eval('objCont'+arrPrjID[i-1]+'.style.top=parseInt(objCont'+arrPrjID[i-2]+'T)+row1')
			eval('objCont'+arrPrjID[i-1]+'T=objCont'+arrPrjID[i-1]+'.style.top')
			
			eval('objCont'+arrPrjID[i-1]+'.style.visibility="visible"')
			
		} else if (ns4) {
			eval('objCont'+arrPrjID[i-1]+'=document.layers["scrollerContainer"].document.layers["scroller1"].document.layers["scroller2"].document.divCont'+arrPrjID[i-1])
			eval('objCont'+arrPrjID[i-1]+'H=objCont'+arrPrjID[i-1]+'.clip.height')
			eval('objCont'+arrPrjID[i-1]+'.clip.height=row1')
			
			if (i==1) eval('objCont'+arrPrjID[i-1]+'.top=distTop')
			else if (i>1) eval('objCont'+arrPrjID[i-1]+'.top=parseInt(objCont'+arrPrjID[i-2]+'T)+row1')
			eval('objCont'+arrPrjID[i-1]+'T=objCont'+arrPrjID[i-1]+'.top')
			
			eval('objCont'+arrPrjID[i-1]+'.visibility="visible"')
			
		} else {
			eval('objCont'+arrPrjID[i-1]+'=document.all["divCont'+arrPrjID[i-1]+'"]')
			eval('objCont'+arrPrjID[i-1]+'H=objCont'+arrPrjID[i-1]+'.clientHeight')
			eval('objCont'+arrPrjID[i-1]+'.style.height=row1')
			
			if (i==1) eval('objCont'+arrPrjID[i-1]+'.style.top=distTop')
			else if (i>1) eval('objCont'+arrPrjID[i-1]+'.style.top=parseInt(objCont'+arrPrjID[i-2]+'T)+row1')
			eval('objCont'+arrPrjID[i-1]+'T=objCont'+arrPrjID[i-1]+'.style.top')
			
			eval('objCont'+arrPrjID[i-1]+'.style.visibility="visible"')
		}
	}
	
	scrollerObjHeightInit=distTop
	if (ns6){
		document.getElementById('scroller2').style.height=distTop+(no*row1)
		scrollerObjHeight = parseInt(document.getElementById('scroller2').offsetHeight)
	} else if (ns4) {
		document.layers['scrollerContainer'].document.layers['scroller1'].document.layers['scroller2'].clip.height=distTop+(no*row1)
		scrollerObjHeight = parseInt(document.layers['scrollerContainer'].document.layers['scroller1'].document.layers['scroller2'].clip.height)
	} else {
		document.all['scroller2'].style.height=distTop+(no*row1)
		scrollerObjHeight = parseInt(document.all['scroller2'].clientHeight)
	}
	scrollerObjHeight+=distExtra
}

// expand the item from parameter:
function Expand(divID,isCloseOthers){
	//divID=parseInt(divID)
	
	//getting the index from array for the current Div:
	var x=0
	for (var indPr=1; indPr<=no; indPr++){if ((new String(arrPrjID[indPr-1])+"_")==(new String(divID+"_"))) {x=indPr;break;}}
	
	//not for projects page:
	if (isCloseOthers==1) CollapseAll()
	
	if (parseInt(eval("expanded"+divID))==0){
		if (isCollapse==1) eval("expanded"+divID+"=1")
		var currDiv=eval("objCont" + divID)
		var currDivH=parseInt(eval("objCont" + divID + "H"))
		
		if (ns6){
			currDiv.style.height=currDivH
			for (var i=x+1; i<=no; i++){
				//eval('objCont'+i+'.style.top=parseInt(objCont'+i+'.style.top)+currDivH')
				eval('objCont'+arrPrjID[i-1]+'.style.top=parseInt(objCont'+arrPrjID[i-2]+'.style.height) + parseInt(objCont'+arrPrjID[i-2]+'.style.top)')
			}
			document.getElementById('scroller2').style.height=scrollerObjHeightInit+GetItemsH()
			scrollerObjHeight = parseInt(document.getElementById('scroller2').offsetHeight)
			
			if (new String(eval("document.images['imgSer"+(x-1)+"']"))!="undefined") Swap(x-1,"on","imgSer")
			
		} else if (ns4){
			currDiv.clip.height=currDivH
			for (var i=x+1; i<=no; i++){
				//eval('objCont'+i+'.top=parseInt(objCont'+i+'.top)+currDivH')
				eval('objCont'+arrPrjID[i-1]+'.top=parseInt(objCont'+arrPrjID[i-2]+'.clip.height) + parseInt(objCont'+arrPrjID[i-2]+'.top)')
			}
			document.layers['scrollerContainer'].document.layers['scroller1'].document.layers['scroller2'].clip.height=scrollerObjHeightInit+GetItemsH()
			scrollerObjHeight = parseInt(document.layers['scrollerContainer'].document.layers['scroller1'].document.layers['scroller2'].clip.height)
			
		} else {
			currDiv.style.height=currDivH
			for (var i=x+1; i<=no; i++){
				//eval('objCont'+i+'.style.top=parseInt(objCont'+i+'.style.top)+currDivH')
				eval('objCont'+arrPrjID[i-1]+'.style.top=parseInt(objCont'+arrPrjID[i-2]+'.style.height) + parseInt(objCont'+arrPrjID[i-2]+'.style.top)')
			}
			document.all['scroller2'].style.height=scrollerObjHeightInit+GetItemsH()
			scrollerObjHeight = parseInt(document.all['scroller2'].clientHeight)
			
			if (new String(eval("document.images['imgSer"+(x-1)+"']"))!="undefined") Swap(x-1,"on","imgSer")
		}
		
	} else {
		//if (isCollapse==1) eval("expanded"+divID+"=0")
		if (isCollapse==1) Collapse(x)
	}
	
	//not for projects page:
	if (isCloseOthers==0){
		//checking if all items are closed:
		allclosed=1
		for (var i=1; i<=no; i++){if (eval("expanded"+arrPrjID[i-1])==1) {allclosed=0;break}}
		
		//calculating the top distance before the current item:
		var distBef=distTop
		if (allclosed!=1){
			for (var i=1; i<=x-1; i++){
				if (ns6){
					distBef+=parseInt(eval("objCont" + arrPrjID[i-1] + ".offsetHeight"))
				}else if (ns4){
					distBef+=parseInt(eval("objCont" + arrPrjID[i-1] + ".clip.height"))
				}else{
					distBef+=parseInt(eval("objCont" + arrPrjID[i-1] + ".clientHeight"))
				}
			}
		}
		//moving the clicked item to beginning top of scroll:
		if (ns6){
			document.getElementById('scroller2').style.top=(-1)*distBef
		}else if (ns4){
			document.layers['scrollerContainer'].document.layers['scroller1'].document.layers['scroller2'].top=(-1)*distBef
		}else{
			document.all['scroller2'].style.top=(-1)*distBef;
		}
	}
	
	ScollLinePosition()
}

// collapse the item from parameter:
function Collapse(divID){
	//divID=parseInt(divID)
	
	//getting the index from array for the current Div:
	var x=0
	for (var indPr=1; indPr<=no; indPr++){if ((new String(arrPrjID[indPr-1])+"_")==(new String(divID+"_"))) {x=indPr;break;}}
	
	eval("expanded"+divID+"=0")
	var currDiv=eval("objCont" + divID)
	var currDivH=parseInt(eval("objCont" + divID + "H"))
	if (ns6){
		currDiv.style.height=row1
		for (var i=x+1; i<=no; i++){
			//eval('objCont'+i+'.style.top=parseInt(objCont'+i+'.style.top)+currDivH')
			eval('objCont'+arrPrjID[i-1]+'.style.top=parseInt(objCont'+arrPrjID[i-2]+'.style.height) + parseInt(objCont'+arrPrjID[i-2]+'.style.top)')
		}
		document.getElementById('scroller2').style.height=scrollerObjHeightInit+GetItemsH()
		scrollerObjHeight = parseInt(document.getElementById('scroller2').offsetHeight)
		
		if (new String(eval("document.images['imgSer"+(x-1)+"']"))!="undefined") Swap(x-1,"on","imgSer")
		
	} else if (ns4){
		currDiv.clip.height=row1
		for (var i=x+1; i<=no; i++){
			//eval('objCont'+i+'.top=parseInt(objCont'+i+'.top)+currDivH')
			eval('objCont'+arrPrjID[i-1]+'.top=parseInt(objCont'+arrPrjID[i-2]+'.clip.height) + parseInt(objCont'+arrPrjID[i-2]+'.top)')
		}
		document.layers['scrollerContainer'].document.layers['scroller1'].document.layers['scroller2'].clip.height=scrollerObjHeightInit+GetItemsH()
		scrollerObjHeight = parseInt(document.layers['scrollerContainer'].document.layers['scroller1'].document.layers['scroller2'].clip.height)
		
	} else {
		currDiv.style.height=row1
		for (var i=x+1; i<=no; i++){
			//eval('objCont'+i+'.style.top=parseInt(objCont'+i+'.style.top)+currDivH')
			eval('objCont'+arrPrjID[i-1]+'.style.top=parseInt(objCont'+arrPrjID[i-2]+'.style.height) + parseInt(objCont'+arrPrjID[i-2]+'.style.top)')
		}
		document.all['scroller2'].style.height=scrollerObjHeightInit+GetItemsH()
		scrollerObjHeight = parseInt(document.all['scroller2'].clientHeight)
		
		if (new String(eval("document.images['imgSer"+(x-1)+"']"))!="undefined") Swap(x-1,"on","imgSer")
	}
	
	//swapping the item image to "off":
	if (ns6) {if (new String(eval("document.images['imgSer"+(x-1)+"']"))!="undefined") Swap(x-1,"off","imgSer")}
	else if (ns4) {}
	else {if (new String(eval("document.images['imgSer"+(x-1)+"']"))!="undefined") Swap(x-1,"off","imgSer")}
	
	ScollLinePosition()
}

// colapse all items:
function CollapseAll(){
	for (var i=1; i<=no; i++){
		if (ns6){
			eval('objCont'+arrPrjID[i-1]+'.style.height=row1')
			eval('objCont'+arrPrjID[i-1]+'.style.top=objCont'+arrPrjID[i-1]+'T')
		} else if (ns4){
			eval('objCont'+arrPrjID[i-1]+'.clip.height=row1')
			eval('objCont'+arrPrjID[i-1]+'.top=objCont'+arrPrjID[i-1]+'T')
		} else {
			eval('objCont'+arrPrjID[i-1]+'.style.height=row1')
			eval('objCont'+arrPrjID[i-1]+'.style.top=objCont'+arrPrjID[i-1]+'T')
		}
	}
}

// "itemsH" contains the height of the total items:
function GetItemsH() {
	itemsH=0
	for (var i=1; i<=no; i++){
		if (ns6){
			itemsH+=parseInt(eval('objCont'+arrPrjID[i-1]+'.style.height'))
		} else if (ns4){
			itemsH+=parseInt(eval('objCont'+arrPrjID[i-1]+'.clip.height'))
		} else {
			itemsH+=parseInt(eval('objCont'+arrPrjID[i-1]+'.style.height'))
		}
	}
	itemsH+=distExtra
	return itemsH
}

// resets the projects list:
function ResetList(){
	startScroller();
	InitBars();
	for (i=1; i<=no; i++) {
		eval("expanded"+arrPrjID[i-1]+"=0")
		if (ns6){
			eval('objCont'+arrPrjID[i-1]+'.style.height=row1')
			
			if (i==1) eval('objCont'+arrPrjID[i-1]+'.style.top=distTop')
			else if (i>1) eval('objCont'+arrPrjID[i-1]+'.style.top=parseInt(objCont'+(arrPrjID[i-2])+'T)+row1')
			eval('objCont'+arrPrjID[i-1]+'T=objCont'+arrPrjID[i-1]+'.style.top')
			
		} else if (ns4) {
			eval('objCont'+arrPrjID[i-1]+'.clip.height=row1')
			
			if (i==1) eval('objCont'+arrPrjID[i-1]+'.top=distTop')
			else if (i>1) eval('objCont'+arrPrjID[i-1]+'.top=parseInt(objCont'+(arrPrjID[i-2])+'T)+row1')
			eval('objCont'+arrPrjID[i-1]+'T=objCont'+arrPrjID[i-1]+'.top')
			
		} else {
			eval('objCont'+arrPrjID[i-1]+'.style.height=row1')
			
			if (i==1) eval('objCont'+arrPrjID[i-1]+'.style.top=distTop')
			else if (i>1) eval('objCont'+arrPrjID[i-1]+'.style.top=parseInt(objCont'+(arrPrjID[i-2])+'T)+row1')
			eval('objCont'+arrPrjID[i-1]+'T=objCont'+arrPrjID[i-1]+'.style.top')
		}
	}
	
	scrollerObjHeightInit=distTop
	if (ns6){
		document.getElementById('scroller2').style.height=distTop+(no*row1)
		scrollerObjHeight = parseInt(document.getElementById('scroller2').offsetHeight)
	} else if (ns4) {
		document.layers['scrollerContainer'].document.layers['scroller1'].document.layers['scroller2'].clip.height=distTop+(no*row1)
		scrollerObjHeight = parseInt(document.layers['scrollerContainer'].document.layers['scroller1'].document.layers['scroller2'].clip.height)
	} else {
		document.all['scroller2'].style.height=distTop+(no*row1)
		scrollerObjHeight = parseInt(document.all['scroller2'].clientHeight)
	}
	scrollerObjHeight+=distExtra
	
	
	//changing the left image:
	if (flash6) {
		//if (ns4) document.write('<DIV id="divFlash"><IMG src="images/prj_img1.jpg" width=385 height=359 name="imgBig"></DIV>')
		//else document.write('<DIV id="divFlash"><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="385" HEIGHT="359" id="imgBig" ALIGN=""><PARAM NAME=movie VALUE="flash/projects.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="flash/projects.swf" quality=high bgcolor=#FFFFFF  WIDTH="385" HEIGHT="359" NAME="imgBig" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT></DIV>')
		if (ns6){
			document.getElementById("divFlash").innerHTML='<IMG src="images/prj_img1.jpg" width=385 height=359>'
		} else if (ns4){
			document.divFlash.document.open()
			document.divFlash.document.write('<IMG src="images/prj_img1.jpg" width=385 height=359>')
			document.divFlash.document.close()
		} else {
			document.all["divFlash"].innerHTML='<IMG src="images/prj_img1.jpg" width=385 height=359>'
		}
	} else document.images["imgBig"].src="images/prj_img1.jpg"
	
	//changing the footer project name:
	document.images["imgPrjName"].src="images/prj1_footer.gif"
	
	//positioning all projects bars to 0 in the left:
	for (i=1; i<=no; i++){
		if (ns6) eval("document.getElementById('divCont"+ arrPrjID[i-1] +"Bar').style.left=0");
		else if (ns) eval("scrollerObj.document.layers['divCont"+ arrPrjID[i-1] +"'].document.layers['divCont"+ arrPrjID[i-1] +"Bar'].left=0");
		else eval("document.all['divCont"+ arrPrjID[i-1] +"Bar'].style.left=0");
	}
	
	ScollLinePosition()
}

function ScollLinePosition(){
	var scrollerObjLine,scrollerObjHeightLine
	//getting scroller object height(InnerHTML height)
	if (ns6) scrollerObjHeightLine = document.getElementById('scroller2').offsetHeight;
	else if (ns) scrollerObjHeightLine = parseInt(document.layers['scrollerContainer'].document.layers['scroller1'].document.layers['scroller2'].clip.height);
	else scrollerObjHeightLine = parseInt(document.all['scroller2'].clientHeight);
	//getting scroller div object
	if (ns6) scrollerObjLine=document.getElementById('scroller2').style
	else if (ns4) scrollerObjLine=document.layers['scrollerContainer'].document.layers['scroller1'].document.layers['scroller2']
	else scrollerObjLine=document.all['scroller2'].style
	
	cursorObj.top=Math.round((distArrows/(scrollerObjHeightLine-scrollerHeight)*Math.abs(parseInt(scrollerObjLine.top))))+scrLineTop;
	//if ((scrollerObjHeightLine + parseInt(scrollerObjLine.top)) < parseInt(cursorObj.top)) cursorObj.top=distArrows+scrLineTop-12
	
	if (parseInt(cursorObj.top)>=distArrows+scrLineTop) cursorObj.top=distArrows+scrLineTop
	if (parseInt(cursorObj.top)<=scrLineTop) cursorObj.top=scrLineTop
	//window.status="exp " + cursorObj.top
}
//-->
