// JavaScript Document


// collapsing sections i.e. Financial Reports, Articles and Abstracts
function trigger_effect(src_element,div_id, effect){
		Effect.toggle(div_id, effect, {duration: .15, afterFinish:function(){
		image = src_element.getElementsByTagName('img')[0];
		image.src = image.src.match('/images/icon.more.gif') ? '/images/icon.less.gif' : '/images/icon.more.gif';
		}});
		return true;
	}

// onload function to deploy one element: needs to be updated each year
function deployQuickLinks(theyear) {
	trigger_effect(document.getElementById('year'+theyear+'Parent'),document.getElementById('year'+theyear),'blind');
}

function deployElementOnLoad(zedivname) {
	trigger_effect(document.getElementById(zedivname+'Parent'),document.getElementById(zedivname),'blind');
}






function showPop(url,features) {
	var zegenpop = MM_openBrWindow(url,'newpage',features);
	zegenpop.focus();
//
}



function showGlossary(theword) {
	var zeitem;
	zeitem = MM_openBrWindow('../14.glossary/pop.glossary.asp?entry='+theword,'Glossary','width=318,height=190');
	zeitem.focus();
//
}

function showVideo(theurl) {
	var zevideo = MM_openBrWindow(theurl,'Clip','width=600,height=400,resizable=1');
	zevideo.focus();
//
}

function showPatientPopup(thepage) {
	var zepatpop = MM_openBrWindow(thepage,'Popup','width=550,height=450,scrollbars=yes,resizable=1');
	zepatpop.focus();
//
}


function showImg(zename,zew,zeh) {

	if ( typeof ze == "object") { 
		//alert("we got a window boy");
		ze.close();
	}
	
	ze = window.open('','Image','resizable=no,width='+zew+',height='+zeh);
	ze.focus();
	
	var zc;
	zc = '<html><head><title>Cryocath</title></head><body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">';
	zc += '<img src="'+zename+'" border="0" width="'+zew+'" height="'+zeh+'">'
	zc += '</body></html>';

	ze.document.write(zc);
	ze.document.close();	
}

function showPdf(zepdf) {
	zepdf = MM_openBrWindow(zepdf,'PDF','width=700,height=500,scrollbars=yes,resizable=yes');
	zepdf.focus();
}

function showPrez(zeprez) {
	if ( typeof zeprezWin == "object") { 
		//alert("we got a window boy");
		zeprezWin.close();
	}
	
	zeprezWin = MM_openBrWindow(zeprez,'Presentation','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=850,height=600,left=10,top=10');
	zeprezWin.focus();
}


function toggle(lyr) {
	var el = document.getElementById(lyr);
	var i = document.getElementById(lyr+'img');
	
	if (el.className == "discret") {
		el.className = "evident";
		i.src = "images/bluedown.gif";
	} else {
		el.className = "discret";
		i.src = "images/blue.gif";
	}
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function newWindow(theURL) {
	var myPop = window.open(theURL)
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	var zz;
	zz = window.open(theURL,winName,features);
	return zz;
}

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];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
