<!--
function change_current (img_name, img_src)
{
 	 wide_class = 'current_image_wide';
	 tall_class = 'current_image_tall';
 	 newCurrent = new Image ();
	 newCurrent.src = img_src;
	 
	 h = newCurrent.height;
	 w = newCurrent.width;
	 ratio = w / h;
	 
	 if (ratio >= 1)
	 {
	 alert ("width:"+w+" height:"+h);
	  alert ("image src:"+img_src);
	  document[img_name].className = wide_class;
	 }
	 else
	 {
	 alert ("width:"+w+" height:"+h);
	 alert ("image src:"+img_src);
	  document[img_name].className = tall_class;
	 }
	 
   document[img_name].src = img_src;
}

function getArchiveResultsHtml (month, year, table, show)
{
 url = "http://www.mrscorpio.com/php/getarchivebymonth.php?month=" + month + "&year=" + year + "&table=" + table+ "&show=" + show;

 getSearchResults (url, table);
}

function getSearchResultsHtml (month, year, table, show)
{
 url = "http://www.mrscorpio.com/php/searchbymonth.php?month=" + month + "&year=" + year + "&table=" + table+ "&show=" + show;
 getSearchResults (url, table);
}

function getSearchResults (url, table)
{
// get http object based on browser
if (table == "mrscorpio_gallery")
{
xmlHttp=GetXmlHttpObject (replaceGalleryResults);
}
else if (table == "mrscorpio_posts")
{
xmlHttp=GetXmlHttpObject (replacePostResults);
}

xmlHttp.open ("GET", url , true);
xmlHttp.send (null);
}
function replacePostResults () 
{ 
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  { 
   document.getElementById("post_content").innerHTML=xmlHttp.responseText 
  } 
}

function replaceGalleryResults () 
{ 
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  { 
   document.getElementById("gallery_content").innerHTML=xmlHttp.responseText 
  } 
}

function getImageHtml (img_new_name)
{
// build url to php 
// php will build img element
// php decides on classname based on ratio
// gets image url from db based on inputted img name
url = "http://www.mrscorpio.com/php/imagereplace.php?name=" + img_new_name;

// get http object based on browser
xmlHttp=GetXmlHttpObject (replaceImage);
xmlHttp.open ("GET", url , true);
xmlHttp.send (null);

}

function replaceImage () 
{ 
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  { 
   document.getElementById("current_image").innerHTML=xmlHttp.responseText 
  } 
} 

function GetXmlHttpObject(handler)
{ 
var objXmlHttp=null

if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This example doesn't work in Opera") 
return 
}
if (navigator.userAgent.indexOf("MSIE")>=0)
{ 
var strName="Msxml2.XMLHTTP"
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP"
} 
try
{ 
objXmlHttp=new ActiveXObject(strName)
objXmlHttp.onreadystatechange=handler 
return objXmlHttp
} 
catch(e)
{ 
alert("Error. Scripting for ActiveX might be disabled") 
return 
} 
} 
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler 
return objXmlHttp
}
} 
//-->