function showInfoDialog(infoType, infoText) {
	if (infoType=="error") {
		var log=$("#error-dialog-content");
		$("#dialog-error").show();
		$("#dialog-info").hide();
	} else {
		var log=$("#info-dialog-content");
		$("#dialog-error").hide();
		$("#dialog-info").show();
	}
	
	$("#info-dialog").dialog({
		bgiframe: true,
		modal: true,
		width: 440,
		position: 'center',
		open: function(event, ui) {
			log.html(infoText);
			$("#info-dialog").removeAttr('class');
		},
		close: function(event, ui) {
			$('#info-dialog').dialog('destroy');
		},
		buttons: {
			Ok: function() {
				$(this).dialog('close');
			}
		}
	});
	$('#info-dialog').dialog('open');
}

function replyComment(commentID) {
	$('#parentComment').val(commentID);
}

function changeLang(lang) {
	window.location='/?lang='+lang;
}

function changeProductsOrder(direction) {
	$("#order_direction").val(direction);
	document.orderBy.submit();
}

function reloadCaptcha(formType) {
	$.get(
		"/project/reload-captcha/",
		function(data){
			$("#captcha-uid").val(data);
			$("#captcha-img").attr("src", '/var/captcha/'+data+'.png');
                        $("#captcha_text").val('');
		}
		);

}

$(document).ready(
	function(){
		$("#info-dialog").hide();
		$("a[rel='colorbox']").colorbox({
			transition:"fade",
			opacity:0.7,
			maxWidth:800,
			maxHeight:600
		});


	}
	);

