var xmlhttp

function showHomeThumbs(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
document.getElementById("msgWait").src="./images/aePre.gif";
($('.agegroupVal')).text("");
($('.agegroup')).text("");
($('.thumbCommentBox')).text("");
($('.thumbNumber')).text("");
($('.thImgs')).hide("slow");
xmlhttp.onreadystatechange=stateHomeChanged;
xmlhttp.open("GET",str,true);
xmlhttp.send(null);
}

function stateHomeChanged()
{
if (xmlhttp.readyState==4)
  {
	//alert(xmlhttp.responseText);
	document.getElementById("msgWait").src="./images/aePreFirst.png";
	document.getElementById("homeThumbs").innerHTML=xmlhttp.responseText;
	//($('.thImgs')).show("slow");
  }
}
function prevHomeThumbs(rUrl, pageNumber) {
	pUrl = rUrl+pageNumber;
	showHomeThumbs(pUrl);
}
function changestate(atype)
{
	paint = document.getElementById('paint');
	digital = document.getElementById('digital');
	photo = document.getElementById('photo');
	poem = document.getElementById('poem');
	artype1 = document.getElementById('paintvar')
	url = "setSessionVar.php?ae=1";
	if (atype == 'paints')
	{
		if(paint.value == 1)
		{
			paint.value = 0;
			url = url + "&paint=0";
			arttype1 = document.getElementById(atype);
			arttype1.style.background = '#ecefef';
			arttype1.style.color = '#3f4545';
			paintsImg = document.getElementById('paintImg');
			paintsImg.src = './images/unchecked.png';
		}
		else
		{
			paint.value = 1;
			url = url + "&paint=1";
			arttype1 = document.getElementById(atype);
			arttype1.style.background = '#3f4545';
			arttype1.style.color = '#ffffff';
			paintsImg = document.getElementById('paintImg');
			paintsImg.src = './images/checked.png';
		}
	}
	if (atype == 'digitals')
	{
		if(digital.value == 1)
		{
			digital.value = 0;
			url = url + "&digital=0";
			arttype1 = document.getElementById(atype);
			arttype1.style.background = '#ecefef';
			arttype1.style.color = '#3f4545';
			digitalImg = document.getElementById('digitalsImg');
			digitalImg.src = './images/unchecked.png';
		}
		else
		{
			digital.value = 1;
			url = url + "&digital=1";
			arttype1 = document.getElementById(atype);
			arttype1.style.background = '#3f4545';
			arttype1.style.color = '#ffffff';
			digitalImg = document.getElementById('digitalsImg');
			digitalImg.src = './images/checked.png';
		}
	}
	if (atype == 'photos')
	{
		if(photo.value == 1)
		{
			photo.value = 0;
			url = url + "&photo=0";
			arttype1 = document.getElementById(atype);
			arttype1.style.background = '#ecefef';
			arttype1.style.color = '#3f4545';
			photosImg = document.getElementById('photoImg');
			photosImg.src = './images/unchecked.png';
		}
		else
		{
			photo.value = 1;
			url = url + "&photo=1";
			arttype1 = document.getElementById(atype);
			arttype1.style.background = '#3f4545';
			arttype1.style.color = '#ffffff';
			photosImg = document.getElementById('photoImg');
			photosImg.src = './images/checked.png';
		}
	}
	if (atype == 'poems')
	{
		if(poem.value == 1)
		{
			poem.value = 0;
			url = url + "&poem=0";
			arttype1 = document.getElementById(atype);
			arttype1.style.background = '#ecefef';
			arttype1.style.color = '#3f4545';
			poemsImg = document.getElementById('poemImg');
			poemsImg.src = './images/unchecked.png';
		}
		else
		{
			poem.value = 1;
			url = url + "&poem=1";
			arttype1 = document.getElementById(atype);
			arttype1.style.background = '#3f4545';
			arttype1.style.color = '#ffffff';
			poemsImg = document.getElementById('poemImg');
			poemsImg.src = './images/checked.png';
		}
	}
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
 	 {
 	 alert ("Your browser does not support AJAX!");
 	 return;
 	 }
	xmlhttp.onreadystatechange=sessionVarChanged;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);

}

function sessionVarChanged()
{

if (xmlhttp.readyState==4)
  {
	//alert(xmlhttp.responseText);
	//alert("Done");
  }
}
