function confirmation(string,locationUrl) {
	var answer = confirm(string)
	if (answer){
		window.location = locationUrl;
	}
}
function changeInvoiceAddressType(value) {
	valoare=$('tipPersoana').value;
	if (valoare==1) {
		$('formularPersFizica').set('class','formular clsVizibil');
		$('formularPersJuridica').set('class','formular clsInvizibil');
	}
	else {
		$('formularPersFizica').set('class','formular clsInvizibil');
		$('formularPersJuridica').set('class','formular clsVizibil');
	}
}
function verifyInvoice() {
	if($('fac0').checked==true) {
		if(nrAdreseFacturare==0) {
			$('invoicemsg').set('text',"Nu aveti nici o adresa de facturare salvata. Va rugam sa mergeti in meniul contului personal si sa salvati cel putin o adresa de facturare");
			$('finishorder').disabled=true;
			$('finishorder').set('class','submit_disabled');
		}
	}
	else {
		$('finishorder').disabled=false;
		$('finishorder').set('class','submit');
		$('invoicemsg').set('text','');
	}
}
var scroll_max_history;
var scroll_history;
function getViewHistory() {
	var req = new Request({
		url: PUBLIC_URI+'getHistory.inc.php',
		onSuccess: function(txt){
			$('viewHistoryContent').set('html', txt);
			scroll_max_history=$('scroll_max_history').value;
			scroll_history= new Fx.Scroll('historyBooks', {
				wait: false,
				duration: 600,
				offset: {'x': 10, 'y': 0},
				wheelStops: false,
				transition: Fx.Transitions.Quad.easeInOut
			});
		},
		onFailure: function(){
			alert('Serviciul este momentan indisponibil.');
		}
	});
	req.send();
}
function deleteFromHistory(id) {
	$('viewHistoryContent').set('html','<img src="http://www.eusunt.ro/images/tpl_plain/toolbar/loading.gif" style="display:block; width:198; margin:0 auto;" />');
	$('backgroundOver').setStyle('visibility','visible');
	$('viewHistoryHolder').setStyle('visibility','visible');
	var req = new Request({
		url: PUBLIC_URI+'getHistory.inc.php?act=delete&id='+id,
		onSuccess: function(txt){
			$('viewHistoryContent').set('html', txt);
			scroll_max_history=$('scroll_max_history').value;
			scroll_history= new Fx.Scroll('historyBooks', {
				wait: false,
				duration: 600,
				offset: {'x': 0, 'y': 0},
				wheelStops: false,
				transition: Fx.Transitions.Quad.easeInOut
			});
		},
		onFailure: function(){
			alert('Serviciul este momentan indisponibil.');
		}
	});
	req.send();
}

function scroll_me_history(right) {
	var scroll_current_history = parseInt($('scroll_current_history').value);
	if (right == 1) {
		if (scroll_current_history >= scroll_max_history) scroll_to = 0;
		else scroll_to = scroll_current_history + 1;
	}
	else {
		if (scroll_current_history > 0) scroll_to = scroll_current_history - 1;
		else scroll_to = scroll_max_history;
	}
	scroll_history.toElement('div_history_'+scroll_to);
	$('scroll_current_history').value = scroll_to;
}
function scroll_me_to_history(valoare) {
	var scroll_current = parseInt($('scroll_current').value);
	$("moviePageIndicator_"+scroll_current).set("class","");
	$("moviePageIndicator_"+valoare).set("class","galleriesPagesActive");
	scroll.toElement('div_'+valoare);
	$('scroll_current').value = valoare;
}
