// JavaScript Document
server='http://www.youngcinemaart.pl/';
file_server='http://www.cinemaart.nazwa.pl/fundcms/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 showMakers()
{
if ($('makers').visible()==true)
{
Effect.Fade('makers');
	
}
else
{
Effect.Appear('makers');
	
	
	}
	
}

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/,'');

	if(x==1){


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

	if(x_offset<=0)
	if (Math.abs(x_offset)<=contener_width-240){ 
	new Effect.Move('div_line', {x: -280, 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());
}

