function findPosX(obj){
	var curleft = 0;
	
	if(obj.offsetParent)
		while(1) 
		{
			curleft += obj.offsetLeft;
			if(!obj.offsetParent)
			break;
			obj = obj.offsetParent;
		}
	else if(obj.x)
		curleft += obj.x;
		
	return curleft;
}

function check_email(){
	
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(document.getElementById('user_email').value))
		frm.submit();
	else
		alert('אימייל לא תקין');

}

function findPosY(obj){
	var curtop = 0;
	if(obj.offsetParent)
		while(1)
		{
			curtop += obj.offsetTop;
			if(!obj.offsetParent)
			break;
			obj = obj.offsetParent;
		}
	else if(obj.y)
		curtop += obj.y;
		
	return curtop;
}

function show_img(src){
	var td=document.getElementById('img_id');
	td.innerHTML='<div style="position: absolute; left: ' + (findPosX(td)-280) + 'px; top: ' + findPosY(td) + 'px;"><img src="' + src.replace(/small/gi, 'big') + '" border="1"></div>';
}

function show_note(cal_id, x, y){
	var w=437, h=301;
	window.open('show_note.asp?cal_id=' + cal_id + '&x_num=' + x + '&y_num=' + y, 'show_note', 'location=no,left=' + ((screen.width-w) / 2) + ',top=' + ((screen.height-h) / 2) + ',status=no,scrollbars=no,width=' + w + ',height=' + h);
}

function go_to(news_id){
	var w=437, h=301;
	window.open('show_news.asp?id=' + news_id, 'show_news', 'location=no,left=' + ((screen.width-w) / 2) + ',top=' + ((screen.height-h) / 2) + ',status=no,scrollbars=no,width=' + w + ',height=' + h);
	
}

function invite(){
	var w=711, h=380;
	window.open('invite.htm', 'show_note', 'location=no,left=' + ((screen.width-w) / 2) + ',top=' + ((screen.height-h) / 2) + ',status=no,scrollbars=no,width=' + w + ',height=' + h);

}