﻿function popUp(URL, COUNTER, WIDTH, HEIGHT) 
{
	height_f = 300; //100-(document.body.clientHeight-document.images[0].height);
	width_f  = 300; //100-(document.body.clientWidth-document.images[0].width);
	day = new Date();
	id = day.getTime();
	page = window.open(URL, 'gallery', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width='+width_f+',height='+height_f);
	page.title = "nm";
	
}
	
function popImgToHTML(IMAGE_NAME, TEXT,ALT)
{
	var generator=window.open('','name','height=500,width=500');
  
  	generator.document.write('<html><head><title>גלריה</title>');
	generator.document.write('<meta http-equiv="Content-Type" content="text/html;charset=utf-8">');
  	generator.document.write('<link rel="stylesheet" href="gallery.css">');
  	generator.document.write('</head> <body>');
  	generator.document.write('<img class="gal_full_pic" src='+IMAGE_NAME+' alt="'+ALT+'" >');
  	generator.document.write('<p class="gal_foot">'+TEXT+ '</p>');
	generator.document.write('<p class="gal_foot"> <a href="javascript:self.close()"> סגור</a> </p>');
	generator.document.write('</body></html>');
	generator.document.close();
}

function clientSideInclude(id, url) {
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("MSXML2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
 if (!element) {
  alert("שגיאה במידע " + id);
  return;
 }
  if (req) {
    // Synchronous request, wait till we have it all
    req.open('GET', url, false);
    req.send(null);
    element.innerHTML = req.responseText;
  } else {
    element.innerHTML =
   "הדפדפן לא תומך באובייקט הנדרש ";
  }
}
