/*
 * quicklinks.js
 * Save value of last opened quicklinks on session
 */

var xmlhttp;
var now = new Date();
var count = now.getTime();

function saveLastLink(type)
{
	id = count++;// to handle ajax refresh cache problem on IE
	isIE6 = navigator.userAgent.toLowerCase().indexOf('msie 6') != -1;
	var isMSIE = /*@cc_on!@*/false;
	if(!isMSIE) {
		xmlhttp=GetXmlHttpObject(id);
		if (xmlhttp==null)
		{
			alert ("Browser does not support HTTP Request");
			return;
		}
		var url="quicklinks.php?type="+type+"&sid="+Math.random();
		xmlhttp.onreadystatechange=stateChanged;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}

}

function stateChanged () { 
  if ( this.readyState == 4 ) {
    if ( this.status == 200 ) {
      document.getElementById("saved_QL").innerHTML = this.responseText;
    }
  }
}

function GetXmlHttpObject () {
  var xmlHttp = null;
  try {
    // Firefox, Opera 8.0+, Safari
     xmlHttp = new XMLHttpRequest();
  } catch (e) {
    // Internet Explorer
	
    try {
       xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
       xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  return xmlHttp;
}