var myWidth = 0, myHeight = 0;

function swapImage(el,state)
{
	isrcnow = el.src
	li = isrcnow.lastIndexOf('/') + 1;
	ipath = isrcnow.substr(0,li);
	isrcnow = isrcnow.substr(li,isrcnow.length - li);
	if (state==0) isrcnew = isrcnow.replace('_over.','.');
	if (state==1) isrcnew = isrcnow.replace('.','_over.');
	el.src = ipath + isrcnew;
}

function resize()
{
	var cont = document.getElementById('container');
	//var cheight = cont.offsetHeight;
	//cont.style.paddingTop = '100px';
	//browserSize();
	//centerme(cont);
}

function centerme(object)
 {
	 var adjuster = 0;
	 if (myHeight <= 685) { adjuster = 50}
	var ml = "-" + parseInt(object.offsetWidth / 2) + "px";
	var mt = "-" + (parseInt(object.offsetHeight / 2) - adjuster) + "px";
  object.style.marginLeft = ml;
  object.style.marginTop = mt;
  window.status = myHeight;
 }
 
 function browserSize()
 {
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }

 }
 
 var clicked
var xmlhttp
var target
var thismethod
//clicked = null;


function loadXMLDoc(url,el,method)
{
//alert(url);
xmlhttp=null
// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
if (xmlhttp!=null)
  {
  target = el;
  xmlhttp.onreadystatechange=state_Change
  xmlhttp.open("POST",url,true)
  xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
  xmlhttp.send('')
  }
else
  {
  alert("Your browser does not support XMLHTTP.")
  }
}


function state_Change()
{
	if (xmlhttp.readyState==4)
	{
		if (xmlhttp.status==200)
		{
		//getinfo();
		document.getElementById(target).innerHTML = xmlhttp.responseText;
		//eval('target.' + thismethod + '=xmlhttp.responseText');
		if (thismethod = 'value')
		{
			//window.status = xmlhttp.responseText;
		}
		}
		else
		{
		alert("Problem retrieving page data:" + xmlhttp.statusText)
		}
	}
}

function setlinkwhite(el)
{
	var anchors = document.getElementsByTagName("div");
	for (var anchor = 0; anchor<anchors.length;anchor++){
	   var item = anchors[anchor];
	   myitem = item.id;
	   if (myitem.lastIndexOf('link') == 0) 
	   {
		   //alert(myitem);
		   item.style.color = '#5e4f4b';
	   }
	   //alert(item.href)
	}
	document.getElementById(el).style.color = '#ffffff';
}
