enlargePicTries = 0;
function enlargePic(mypic) {
	var scrvar = "script";
	newPic = new Image();
	newPic.src = mypic;
	windowPic = window.open('','','resizable=0,status=0,scrollbars=0');
	windowPic.document.write("<"+scrvar+">\n");
	windowPic.document.write("var newPic = new Image();\n");
	windowPic.document.write("newPic.src = '"+newPic.src+"';\n");
	windowPic.document.write("window.resizeTo(newPic.width,newPic.height);\n");
	windowPic.document.write("</"+scrvar+">\n");
	windowPic.document.write("<body onload='window.resizeTo(newPic.width,newPic.height);' style='margin:0px;'>\n<img src="+newPic.src+">\n");
	windowPic.location.reload();
	}


function cngStyle (theClass,attr,prop) {  
	var allPageTags=document.getElementsByTagName("*");
	for (i=0; i<allPageTags.length; i++) { 
		if (allPageTags[i].className==theClass) { 
			allPageTags[i].style.setAttribute(attr,prop);
			}  
		} 
	} 

function gid (id) {
	return document.getElementById(id);
	}

function getFilter (filtername) {
	filtername = filtername.toLowerCase();
	if (filtername=="fade") filtername 	= "progid:DXImageTransform.Microsoft.Fade(Overlap=1.00)";
	if (filtername=="zigzag") filtername 	= "progid:DXImageTransform.Microsoft.Zigzag(GridSizeX=8,GridSizeY=8)";
	return filtername;
	}

function sDisplay (id) {

	if (document.getElementById(id).style.display=="none") document.getElementById(id).style.display = "";
		else document.getElementById(id).style.display = "none";

	}

function opnclac (vars,fvar) {
	window.open('calendar.php?'+vars+'&re='+fvar,'','resizable=0,status=0,scrollbars=0')
	}

function numbersOnly () {
	if (event.keyCode<48||event.keyCode>57) if (event.keyCode!=45) if (event.keyCode!=46) return false
	}

function safeString (mystar) {
	var parsed = true;
	var validchars = "abcdefghijklmnopqrstuvwxyz0123456789@-._אבגדהוזחטיכךלמםנןסעפףצץקרשת";
	for (var i=0; i < mystar.length; i++) {
		var letter = mystar.charAt(i).toLowerCase();
		if (validchars.indexOf(letter) == -1) parsed = false;
		}
	return parsed;
	}

function swapChk(strchk) {
	for(var i = 0;i<document.getElementsByTagName('INPUT').length;i++) {	
		if (document.getElementsByTagName('INPUT').item(i).name.indexOf(strchk) != -1) {
			if (document.getElementsByTagName('INPUT').item(i).checked) document.getElementsByTagName('INPUT').item(i).checked = 0;	
				else document.getElementsByTagName('INPUT').item(i).checked = 1;
			}
		}
	}

function confirmNsubmit(text,form) {
	myConfirm=confirm(text);
	if (myConfirm==true) form.submit();
	return (myConfirm);
	}

function confirmNhref(text,href) {
	myConfirm=confirm(text);
	if (myConfirm==true) location.href = href;
	return (myConfirm);
	}

function switchLang (cookie,lng) {
	var expdate = new Date();
	expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
	setCookie(cookie, lng, expdate);
	location.reload();
	}

function check_email(e) {
	ok ="1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	for(i=0; i < e.length ;i++){
		if(ok.indexOf(e.charAt(i))<0){ 
			return (false);
			}	
		} 
	if (document.images) {
		re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
		re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
		if (!e.match(re) && e.match(re_two)) {
			return (-1);
			} 
		}
	}

// -------------------------------------------------------------------------   
//                    Cookie Function's
// -------------------------------------------------------------------------   

	function deleteCookie(name, path, domain) {
	if (getCookie(name)) {
		document.cookie = name + "=" + 
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
		}
	}

	function setCookie(name, value, expires, path, domain, secure) {
		document.cookie= name + "=" + escape(value) +
		((expires) ? "; expires=" + expires.toGMTString() : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
	}

	function getCookie(name) {
		var dc = document.cookie;
		var prefix = name + "=";
		var begin = dc.indexOf("; " + prefix);
		if (begin == -1) {
			begin = dc.indexOf(prefix);
			if (begin != 0) return null;
			} else {
			begin += 2;
			}
		var end = document.cookie.indexOf(";", begin);
		if (end == -1) end = dc.length;
		return unescape(dc.substring(begin + prefix.length, end));
	}

// -------------------------------------------------------------------------   
//                    END Cookie Function's
// -------------------------------------------------------------------------   

var enlargePopup = window.createPopup();
function enlargeCustom(s,w,h) {
	var enlargePopBody = enlargePopup.document.body;
	enlargePopBody.style.backgroundColor = 'black';
	enlargePopBody.style.border = 'solid black 1px';
	enlargePopBody.onmousedown = enlargePopup.hide;
	enlargePopBody.onclick = enlargePopup.hide;
	enlargePopBody.oncontextmenu = enlargePopup.hide;
	enlargePopBody.innerHTML = "<img src="+s+" width="+w+" height="+h+">";
	if (s) enlargePopup.show(event.clientX-w, event.clientY, w, h, document.body);
	}
