
var height;
$(document).ready(function(){
//	height = (findPosY(document.getElementById('footer_id')))+200;
	height = $('div').filter('.footer:last').position().top+200;
});

function changeClass(obj, id, imgid){
	var objects = document.getElementById('works_numbers_'+id).getElementsByTagName('DIV');
	for(var i=0; i<objects.length;i++){
		if(objects[i].className=="title_border") objects[i].className="title_border_non";
		if(objects[i].className=="title_main") objects[i].className="title_main_non";
		if(objects[i].className=="work_num") objects[i].className="work_num_non";
	}
	
	try{
		var objects = $('#img_holder_'+id).find('span');
		objects.each(function(i){
			if(this.id != 'span_'+id+'_'+imgid) this.style.display = "none";
			else this.style.display = "block";
		});
	}catch(e){}
	
	try{
		var objects = document.getElementById('img_holder_'+id).getElementsByTagName('IMG');
		for(var i=0; i<objects.length;i++){
			if(objects[i].id == 'img_'+id+'_'+imgid) objects[i].style.display = "block";
			else if(objects[i].id) objects[i].style.display = "none";
		}
	}catch(e){}
	
	var objects = obj.getElementsByTagName('DIV');
	for(var i=0; i<objects.length;i++){
		if(objects[i].className=="title_border_non") objects[i].className="title_border";
		if(objects[i].className=="title_main_non") objects[i].className="title_main";
		if(objects[i].className=="work_num_non") objects[i].className="work_num";
	}
}

function showProject(id, title) {
//	if (document.getElementById('curr_title').value == "") document.getElementById('curr_title').value = document.title;
//	document.getElementById('content_holder').style.paddingTop = padding+'px';
//	document.getElementById('content_bg').style.height = height+'px';
	var padding = (sHoff())+200;
	
	$('<div></div>').height(height).appendTo($('body')).attr('id','content_bg').show();
//	$('div').height(height).appendTo($('body')).attr('id','content_bg').show();
	$('<div></div>').attr('id','content_wrapper').appendTo($('body')).load('/_ajax/project.get.ajax.php',{'id':id},function(){
		$('#content_holder').css('padding-top',padding + 'px');
		$('#.big_content').show();
		$(this).fadeIn();
	});
	
	document.getElementById('curr_prj').curr_id.value = id;
//	document.title = document.getElementById('curr_title').value + " | "+ title;
}

function hideProject(id) {
	$('#content_wrapper').fadeOut('slow',function(){
		$(this).remove();
	});
	$('#content_bg').fadeOut('slow',function(){
		$(this).remove();	
	});
	document.getElementById('curr_prj').curr_id.value = '';
//	document.title = document.getElementById('curr_title').value;
}

function chkPrjForm(frm){
	if(frm.doal_temp_2181.value != ''){
		document.getElementById('frmPrj_SendArea').innerHTML = 'שולח...';
		return true;
	}else{
		alert('יש להזין כתובת אימייל תקינה');
		frm.doal_temp_2181.focus();
	}
	return false;
}
