// JavaScript Document
//server='http://localhost/cinemaart/';
server='http://www.cinemaart.pl/';
file_server='http://www.cinemaart.nazwa.pl/fundcms_cinemaart/galleries/photos/'
//server='http://www.youngcinemaart.pl';
page='';

function getContent(remoteUrl,where,pars)
{
	//alert(categoryFlag);
preLoader(where);

var url = remoteUrl;

new Ajax.Updater(where, url, {method: 'post', parameters: pars});

}

function sendContact()
{

if (checkForm('contactBottomForm')==true)
{
	pars=$('contactBottomForm').serialize();
		getContent(server+page+'user/sendContact','contactBottomBox',pars);
	}
	
}

function preLoader(place)
{

$(place).innerHTML='<div style="display:block; padding-top:0px; height:40px;" align="center"><span class="bottom_form_label">TRWA GENEROWANIE ZGŁOSZENIA</span><br/><img src="'+server+'design/images/load.gif" /></div>';	

}


function sendFilm()
{
	//alert('Niestety opcja zgłaszania filmów jest niedostępna.');
	//return false;
if(checkForm('zglos_film')==true){
pars=$('zglos_film').serialize();
pars=pars+'&selectValueColor='+$('selectValueColor').innerHTML+'&selectValueCam='+$('selectValueCam').innerHTML;
//alert(pars);
//alert(server+page+'pdf_creation/');
preLoader('oko');
$('form_msg').innerHTML='';
$('zglos_film').submit();
//getContent(server+page+'pdf_creation/','oko',pars);	
}
else
{
$('form_msg').innerHTML='ERROR! Please fill all required fields.<br>Red marked';	
//alert();	
//$('zglos_film').submit();
}
}




function move_horizontal(x)
{
	
	x_offset=($('div_line').getStyle('left')).inspect();
	contener_width=($('table_with_thumbs').getStyle('width')).inspect();
	x_offset=x_offset.replace(/'/,'').replace(/'/,'').replace(/px/,'');
	contener_width=contener_width.replace(/'/,'').replace(/'/,'').replace(/px/,'');
//alert(x_offset);
	if(x==1){


	if(x_offset!=0)	
new Effect.Move('div_line', {x: +400, y: 0,duration:0.2,  mode: 'realtive',transition: Effect.Transitions.linear});
else return false;
//try_flag=try_flag+196;
	}
	else
	{

	if(x_offset<=0)
	
	new Effect.Move('div_line', {x: -400, y: 0,duration:0.2,  mode: 'realtive',transition: Effect.Transitions.linear});	
	

	}

}

function switch_foto(file,desc)
{

//alert($('photo').getWidth());
$('big_photo_img').src=file_server+file;
//$('light_href').writeAttribute('href',server+'design/pictures/'+path+'original/'+file);
$('photo_description').update(desc);
//alert($('photo').getWidth());
}
flag='';
function show_sub_menu(sum_menu_id)
{
	if($(sum_menu_id))
	{
		if($(flag)){	
	$(flag).hide();
	}
	Effect.Appear(sum_menu_id);
	flag=sum_menu_id;
	}
	else
	{
	if($(flag)){	
	$(flag).hide();
	}
	}
	
}
function adjust_height()
{
	
	x=$('body').getHeight()-60;
	
	
$('rope').setStyle({height:x+'px'}); 

}
