

// closes the popup layer
function closeme(id)
{
	myVar = document.getElementById(id);
	myVar.className = "hidden";
}



function initJavaScript() {
	document.forms['chatForm'].elements['chatbarText'].setAttribute('autocomplete','off'); 
	//this non standard attribute prevents firefox' autofill function to clash with this script
}


//initiates the XMLHttpRequest object
//as found here: http://www.webpasties.com/xmlHttpRequest
function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}




function getPhotos()
{

	if (httpGetPhoto.readyState == 4 || httpGetPhoto.readyState == 0) 
	{
		//alert("got here");
		var tmpDiv = document.getElementById("win");
		tmpDiv.className = "seen"; 
		tmpDiv.innerHTML = "<a href=../scripts/\"#\" onclick=\"closeme('win');\" class=\"ex\"></a><h3>xocea portfolio</h3><iframe src=\"http://www.xocea.com/fig/\" width=\"800\" height=\"500\"  border=\"0\"  scrolling=\"no\"></iframe>";
		
        //httpGetPhoto.open("GET", PhotoUrl, true);
        //httpGetPhoto.onreadystatechange = handleHttpPhoto;
        //httpGetPhoto.send(null);
    }
}

function handleHttpPhoto()
{
	//alert(url);
	if (httpGetPhoto.readyState == 4) {	 
       	
       	var tmpDiv = document.getElementById("win");
        var resText = httpGetPhoto.responseText;
			
        alert(resText);
        
		tmpDiv.innerHTML = resText;
		tmpDiv.className = "seen";  
	}
}



function getGallery(url)
{
	
	if (httpGetPhoto.readyState == 4 || httpGetPhoto.readyState == 0) 
	{
		var tmpDiv = document.getElementById("win");
		tmpDiv.className = "seen"; 
		tmpDiv.innerHTML = "Loading...";
			//alert(FeedUrl + "?url=" + url);
               httpGetPhoto.open("GET", url, true);
               httpGetPhoto.onreadystatechange = handleHttpPhoto;
               httpGetPhoto.send(null);
    }
}

// initiates the two objects for sending and receiving data

var httpGetPhoto = getHTTPObject();
