var	global_path	=	'';

function scroll(id,action){
	var end 	= 	0;
	var num 	= 	0;
	var	fl		=	0;
	var next	=	0;
	var act		=	parseInt(document.getElementById('act-'+id).value);
	while(end != 1){
		num 	=	num+1;
		if(!document.getElementById('pictures-'+id+'-'+num)){
			end 	=	1;
		}
	}
	num 	=	num-1;
	switch(action){
		case 'last':
		if(act == 1){
			next	=	num;
		}
		else {
			next	=	act-1
		}
		break;
		case 'next':
		if(act == num){
			next	=	1;
		}
		else {
			next	=	act+1
		}
		break;
	}

	while(fl < num){
		fl	=	fl+1;
		if(fl == next){
			document.getElementById('pictures-'+id+'-'+fl).style.display='block';
		}
		else {
			document.getElementById('pictures-'+id+'-'+fl).style.display='none';
		}
	}

	if(next == 1){
		document.getElementById('arrowLeft-'+id).style.display='none';
		document.getElementById('arrowRight-'+id).style.display='block';
	}
	else if(next == num){
		document.getElementById('arrowLeft-'+id).style.display='block';
		document.getElementById('arrowRight-'+id).style.display='none';
	}
	else {
		document.getElementById('arrowLeft-'+id).style.display='block';
		document.getElementById('arrowRight-'+id).style.display='block';
	}

	document.getElementById('act-'+id).value	=	next;

}

function addClicks(id) {

	advAJAX.post({
		url: global_path+"ajax.html",
		parameters : {
		"id" : id
		},
		onSuccess : function(obj) {
			//alert(obj.responseText);
		}
	});
}
function submitform(form_name){
	document.forms[form_name].submit();
}