function collapse(obj){
  var e=document.getElementById(obj);
  if(!e)return true;
 if(e.style.display=="none"){
  e.style.display = "block"
 } else {
  e.style.display = 'none'
 }
 return true;
}


//show hide funtion for images swap
imgout=new Image(9,9);
imgin=new Image(9,9);
imgout_blue=new Image(9,9);
imgin_blue=new Image(9,9);

imgout.src="/images/common/icon_guided_plus_box.gif";
imgin.src="/images/common/icon_guided_minus_box.gif";
						
imgout_blue.src="/images/common/icon_plus_box_grey.gif";
imgin_blue.src="/images/common/icon_minus_box_grey.gif";


function filter(imagename,objectsrc){
	if (document.images){
		document.images[imagename].src=eval(objectsrc+".src");
	}
}

function collapseimg(id) { 
	
	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = 'block';
			filter(("img"+id),'imgin');			
		} else {
			filter(("img"+id),'imgout');
			document.getElementById(id).style.display = 'none';			
		}	
	} else { 
		if (document.layers) {	
			if (document.id.display == "none"){
				document.id.display = 'block';
				filter(("img"+id),'imgin');
			} else {
				filter(("img"+id),'imgout');	
				document.id.display = 'none';
			}
		} else {
			if (document.all.id.style.visibility == "none"){
				document.all.id.style.display = 'block';
			} else {
				filter(("img"+id),'imgout');
				document.all.id.style.display = 'none';
			}
		}
	}
}

function collapseimg_blue(id) { 
	
	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = 'block';
			filter(("img"+id),'imgin_blue');			
		} else {
			filter(("img"+id),'imgout_blue');
			document.getElementById(id).style.display = 'none';			
		}	
	} else { 
		if (document.layers) {	
			if (document.id.display == "none"){
				document.id.display = 'block';
				filter(("img"+id),'imgin_blue');
			} else {
				filter(("img"+id),'imgout_blue');	
				document.id.display = 'none';
			}
		} else {
			if (document.all.id.style.display == "none"){
				document.all.id.style.display = 'block';
			} else {
				filter(("img"+id),'imgout_blue');
				document.all.id.style.display = 'none';
			}
		}
	}
}


function showHideAll(showOrHide){
		if(showOrHide=='show'){
			for(var i=1;i<=jCount;i++){
				var showDiv="abstract"+i;
				var spanDiv="resultRow"+i;
				var imgId="imgabstract"+i;
				document.getElementById(showDiv).style.display='block';
				document.getElementById(spanDiv).innerText='Hide Abstract ';
				if (document.images){
					document.images[imgId].src="/images/common/icon_minus_box_grey.gif";
				}
			}	
			
		}else{
			for(var i=1;i<=jCount;i++){
				var showDiv="abstract"+i;
				var spanDiv="resultRow"+i;
				var imgId="imgabstract"+i;
				document.getElementById(showDiv).style.display='none';
				document.getElementById(spanDiv).innerText='Show Abstract ';
				if (document.images){
					document.images[imgId].src="/images/common/icon_plus_box_grey.gif";
				}
			}
		}	 	
	 }
 function changeText(showDiv)
 {
	if(document.getElementById(showDiv).innerText=='Show Abstract ')
	{
		document.getElementById(showDiv).innerText='Hide Abstract ';
	}
	else
	{
		document.getElementById(showDiv).innerText='Show Abstract ';
	}

 }
 function changeTootip(imageName)
 {
	if(document.getElementById(imageName)) {
		if(document.getElementById(imageName).alt=='hide')
		{
			document.getElementById(imageName).alt='show';
		}
		else
		{
			document.getElementById(imageName).alt='hide';
		}
	}
 }
