function OpenWin(URL)
{
	x = window.open(URL,"האמן","toolbar=no, scrollbars=yes, location=no, directories=no, menubar=no, resizable=no, copyhistory=no, width=418 , height=500")
}
	
function disableRKLK()
{
	if (event.button==2||event.button==3)
		{
		alert("!להורדת השיר, לחצו על הלחצן השמאלי של העכבר");
		return false;
		}
}
	
function textLimit(field, maxlen)
{
	if (field.value.length > maxlen)
		field.value = field.value.substring(0, maxlen);
}		

function disableForm(theform) 
{
	for (i = 0; i < theform.length; i++) 
		{
		var tempobj = theform.elements[i];
		if (tempobj.type.toLowerCase() == "submit")
			tempobj.disabled = true;
		}
	document.getElementById('aComment').innerHTML = "הטופס נשלח, אין צורך ללחוץ פעם נוספת.<br>במידה ולא מתרחש שום דבר במשך מס' דקות,<br>רענן את הדף, ונסה שוב."
}

function redirect(URL, page)
{
	if (page==1)
		{
		window.opener.location.href = URL;
		window.close();
		}
	else
		{
		window.location.href = URL;
		}

}
function ShowHide(obj)
{
	if (obj.style.display=="none")
		{
			obj.style.display="inline"
		}
	else
		{
			obj.style.display="none"
		}
}
function showObject(obj)
{
	obj.style.display="inline"
}
function hideObject(obj)
{
	obj.style.display="none"
}

function cGlow(obj, objColor, objMode)
// obj = the object itself
// objColor = the color to change into
// objMode = 1 - text element, 2 - <td> element
{
	if (objMode == 1)
	{
		obj.style.color = objColor;
	}
	else if (objMode == 2)
	{
		obj.style.background = objColor;
	}
}

function resizeMe(obj, mode)
// mode = 1: resize Height
// mode = 2: resize Width
{
	if (mode == 1){
		newProperty = document.body.scrollHeight;
		obj.style.height = newProperty + 10 + 'px';
	}
	if (mode == 2){
		newProperty = document.body.scrollWidth;
		obj.style.width = newProperty + 10 + 'px';
	}
	alert(newProperty);
}

function resize(frameName, widthMax, heightMax)
// the function resizes the Iframe
// it has to be added in the body onload of the IFrame's HTML's Body
// and must send the FrameName itself
// widthMax = maximum height of resizing (0 = no limit)
// widthMax = maximum height of resizing (0 = no limit)
{
	docHeight = document.body.scrollHeight
	docWidth = document.body.scrollWidth
	if (widthMax != 0 && docWidth > widthMax) { docWidth = widthMax }
	if (heightMax != 0 && docWidth > heightMax) { docHeight = heightMax }
	parent.document.getElementById(frameName).style.height = docHeight + 10;
	parent.document.getElementById(frameName).style.width = docWidth + 10;
}
