function CancelUpload() {
  alert("ביטול העלאה");
    if (confirm("הלבטל את העלאה?")) {
      window.location = "index.php";
    }
    else
      alert("העלאה ממשיכה."); {
    }
}

var checkobj
function agreesubmit(el){
checkobj=el
if (document.all||document.getElementById){
for (i=0;i<checkobj.form.length;i++){  //hunt down submit button
var tempobj=checkobj.form.elements[i]
if(tempobj.type.toLowerCase()=="submit")
tempobj.disabled=!checkobj.checked
}
}
}

function defaultagree(el){
if (!document.all&&!document.getElementById){
if (window.checkobj&&checkobj.checked)
return true
else{
alert("Please read and accept terms to submit form")
return false
}
}
}

function agreeTerms()
{
document.getElementById("upload").disabled=false
document.getElementById("checkBox").checked=true
}
function denyTerms()
{
document.getElementById("upload").disabled=true
document.getElementById("checkBox").checked=false
}

var W3CDOM = (document.createElement && document.getElementsByTagName);

function initFileUploads() {
	if (!W3CDOM) return;
	var fakeFileUpload = document.createElement('div');
	fakeFileUpload.className = 'fakefile';
	fakeFileUpload.appendChild(document.createElement('input'));
	var image = document.createElement('img');
	image.src='button_select.gif';
	fakeFileUpload.appendChild(image);
	var x = document.getElementsByTagName('input');
	for (var i=0;i<x.length;i++) {
		if (x[i].type != 'file') continue;
		if (x[i].parentNode.className != 'fileinputs') continue;
		x[i].className = 'file hidden';
		var clone = fakeFileUpload.cloneNode(true);
		x[i].parentNode.appendChild(clone);
		x[i].relatedElement = clone.getElementsByTagName('input')[0];
		x[i].onchange = x[i].onmouseout = function () {
			this.relatedElement.value = this.value;
		}
	}
}
var ie4 = false; if(document.all) { ie4 = true; }
function getObject(id) { if (ie4) { return document.all[id]; } else { return document.getElementById(id); } }
function toggle(link, divId) { var lText = link.innerHTML; var d = getObject(divId);
 if (lText == '+') { link.innerHTML = '-'; d.style.display = 'block'; }
 else { link.innerHTML = '+'; d.style.display = 'none'; } }

	function toggle(id) {
	var obj = "";
	if(document.getElementById)
		obj = document.getElementById(id);
		else if(document.all)
		obj = document.all[id];
		else if(document.layers)
		obj = document.layers[id];
		else
		return 1;
		if (!obj){
			return 1;
		}
		else if (obj.style) 
		{
			obj.style.display = ( obj.style.display != "none" ) ? "none" : "";
		}else{ 
			obj.visibility = "show"; 
		}
	}


var saveWidth = 0;
function scaleImg(what){
	what = document.getElementById(what);
	if (navigator.appName=="Netscape")
		winW = window.innerWidth;
	if (navigator.appName.indexOf("Microsoft")!=-1)
		winW = document.body.offsetWidth;
	if (what.width>(400) || saveWidth>(400))
	{
		if (what.width==(400))
			what.width=saveWidth;
		else
		{
			saveWidth = what.width;
			what.style.cursor = "pointer";
			what.width=(400);
		}
	}
}

function setToFavoritesVins(title,url){
   if (window.sidebar)
      window.sidebar.addPanel(title, url, "");
   else if(window.opera && window.print){
      var elem = document.createElement("a");
      elem.setAttribute("href",url);
      elem.setAttribute("title",title);
      elem.setAttribute("rel","sidebar");
      elem.click();
   }else if(document.all)
      window.external.AddFavorite(url, title);
}