var ajaxed = 0;
var preloadImg = new Image();
preloadImg.src = "/images/heard_on.gif";

function imgpopup (theURL) {
	window.open("/showbigimage.php?src="+theURL,
		"Image",
		"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=200,height=200");
}
function pagePopup (theURL, width, height) {
  if (width == undefined) width = 200;
  if (height == undefined) height = 200;
	window.open(theURL,
		"PopupPage",
		"toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+width+",height="+height);
  return false;
}
function ajaxNormal(el, container){
  if (el.tagName == 'A' || el.tagName == 'FORM'){
    el.target = 'AJAX';
    if (el.tagName == 'A'){
      var s = el.href;
      if (s.indexOf(container) == -1){
        el.href = s + (s.indexOf('?') ? '&' : '?') + 'Iajax=1&ajaxContainer=' + container;
      }
    } else {
      if (el.method == 'GET'){
        var s = el.action;
        if (s.indexOf(container) == -1){
          el.action = s + (s.indexOf('?') ? '&' : '?') + 'Iajax=1&ajaxContainer=' + container;
        }
      }
    }
  }
  return true;
}
function ajaxRewritten(el, container){
  if (el.tagName == 'A' || el.tagName == 'FORM'){
    el.target = 'AJAX';
    if (el.tagName == 'A'){
      var s = el.href;
      if (s.indexOf(container) == -1){
        el.href = s + '/1/' + container;
      }
    } else {
      if (el.method == 'GET'){
        var s = el.action;
        if (s.indexOf(container) == -1){
          el.action = s + '/1/' + container;
        }
      }
    }
  }
  return true;
}
function ajaxForce(el, url, container){
  /////// allows to have different action urls for ajax and non ajax
  /////// to be implemented
  return false;
}

/*originalConfirmFunction = window.confirm;
window.confirm = function (str){
  var res = originalConfirmFunction(str);
  if (navigator.appVersion.indexOf("MSIE") != -1)
    window.event.returnValue = res; // IE 
  return res;
}*/