﻿


function ShowFullSize(imgfullSize, imgthumbnail,val)
     {   
        if (val==true)
        {
          document.getElementById(imgfullSize).style.display = "block";                
          document.getElementById(imgthumbnail).style.display = "none";   
         }
         else
         {
           document.getElementById(imgfullSize).style.display = "none";                
           document.getElementById(imgthumbnail).style.display = "block"; 
         }
     }
     
 
 function glosspop(term) {

	leftPos = 800 
	topPos = 800;
	
	if (screen) { 
		leftPos = (screen.width / 2) - 175; 
		topPos = (screen.height / 2) - 40;
	}
	
	newWindow = window.open('glossary.htm#' + term,'Glossary','scrollbars=yes,resizable=yes,width=650,height=300,left=' + leftPos + ',top=' + topPos);
	
	newWindow.focus();
}
function addDisclaimer(strText){


var outstr;
if ((strText.search(".org") > 0) || (strText.search(".edu") > 0) || (strText.search(".ca") > 0))
{
outstr= "../disclaimer.aspx?goto=" + escape(strText)

}
else
{
outstr = strText;
}
return outstr; 

}


function wrapURL(urlText, charLimit, breakChar){

var strData = urlText.split("/");

var strBuff = "";
var strText = "";

for(var i=0; i < strData.length; i++){

strBuff += strData[i]+ "/" ;
if(strBuff.length >= charLimit){
strText +=  strBuff + breakChar ;
strBuff = "";
}
}
strText += strBuff;
//var outstr = ((strText.charAt(strText.length-1,1) == "/") ? strText.substring(0,strText.length-1) : strText);
var outstr = strText;
var idx = strText.lastIndexOf('/');

if (idx > 0)
{
var outstr = strText.substring(0,idx);
}

//var outstr = ((strText.lastIndexOf("/", 0) > -1) ? strText.substring(0,strText.length-1) : strText);
return outstr; 
}


function getLinks() 
{    
var container = document.getElementById('cont');
if (container !=null)
{
   var anchors = container.getElementsByTagName("a");    
   
   for (var i = 0; i < anchors.length; i++) 
   {    var href = anchors[i].href;        
        var text = anchors[i].innerHTML;
        anchors[i].href = addDisclaimer(href); 
       /* if (text.length > 65)    
        {
        anchors[i].innerHTML = wrapURL(text,39,"<br>");
        }*/
     }    
 }
 }
 
function breaklinks(id) 
{    
   var anchor = document.getElementById(id);
   var href = anchor.href;        
   var text = anchors.innerHTML     
   anchor.innerHTML = wrapURL(text,39,"<br>")
 }
 
function openNewWin(URL) {

	leftPos = 300 
	topPos = 300;
	
	if (screen) { 
		leftPos = (screen.width / 2) - 175; 
		topPos = (screen.height / 2) - 40;
	}
	
	newWindow = window.open(URL,'scrollbars=yes,resizable=yes,width=350,height=80,left=' + leftPos + ',top=' + topPos);
	
	newWindow.focus();
}

function reviewpop(term) {

	leftPos = 800 
	topPos = 800;
	
	if (screen) { 
		leftPos = (screen.width / 2) - 175; 
		topPos = (screen.height / 2) - 40;
	}
	
	newWindow = window.open('../details.aspx#' + term,'Glossary','scrollbars=yes,resizable=yes,width=650,height=300,left=' + leftPos + ',top=' + topPos);
	
	newWindow.focus();
}
