/****change, enlarge pictures and contents****/
function enlargePicture1()
{
	document.images['full_img'].src='picture_page/images/budda_full.gif';	
}
function enlargePicture2()
{
	document.images['full_img'].src='picture_page/images/tuck_bat_full.jpg';
}
function enlargePicture(thefullpicture) 
{
	document.images['full_img'].src=thefullpicture;
    document.images['full_img'].width  = 400;
    document.images['full_img'].height = 350;	
}

function loadMyPicture()
{
	window.open("my_picture_large.html","myPicturePage","left=240,top=30, width=548, height=440");
}
/*change fact screen, change page for a div*/
function changeFact(thediv,thecontent)
{
	//iframe does not work on IE
	//document.getElementById(thediv).innerHTML="<iframe src='picture_page/picture_fact/religious.html'></iframe>";
	document.getElementById(thediv).innerHTML='<p>'+thecontent+'</p>';
	//document.write('<div id="thediv"><br><br>Please wait...</div>');
    
}

//******************page resolution
//by:James R. Habermas
//reference: http://www.rit.edu/%7Ejrhicsa/03outline.html
function dynamicLayout()
{
	var browserWidth = getBrowserWidth();
		if(browserWidth<=800)
		{
			changeLayout("thin");
			//alert("thin");
		}
		else if((browserWidth > 801) && (browserWidth <= 1024))
		{
			changeLayout("wide");
			//alert("wide");
		}
		else if(browserWidth>1024)
		{
			changeLayout("default");
			//alert("default layout");
		}	
}
//by:James R. Habermas
//reference: http://www.rit.edu/%7Ejrhicsa/03outline.html
function getBrowserWidth()
{
    //window.innerWidth is for Netscape Navigator 4
    //
    if (window.innerWidth)
	    {
          return window.innerWidth;
		}  
    else if (document.documentElement && document.documentElement.clientWidth != 0)
		{
            return document.documentElement.clientWidth;
		}
    else if (document.body)
	   {
		     return document.body.clientWidth;
	    }      	
	return 0;
}//end of function to  getBrowserWidth()
// changeLayout is based on setActiveStyleSheet function by Paul Sowdon 
// http://www.alistapart.com/articles/alternate/
function changeLayout(description)
{
   var i, a;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++)
   //is it a link to a style sheet?
   {
   	//is there a title attribute?
   	//does it contain the word "alternate"?
	   if(a.getAttribute("title") == description)
	    {
			//alert("check attribute:"+description);
			a.disabled = false;
		}
	   else if(a.getAttribute("title") != "default")
	   {
	   		//if it is either wide or thin then disables the default
	   		//style sheet
			//alert("check attribute:"+description);
			 a.disabled = true;
		}
   }
}
//******************end page resolution
