$(document).ready(function () {
	$('#fContact').validate();
	$('a.lightbox').lightBox();
	$('#gallery a').lightBox({fixedNavigation:true});
	$('ul.sf-menu').superfish({
		delay:       1000,
		animation:   {opacity:.95,height:'show'},
		speed:       'fast',
		autoArrows:  false,
		dropShadows: false
	}); 
});

function AddSel(PRD_id, Session_id)
{
	$(document).ready(function () {
		$.ajax({
			type: "POST",
			cache: "false",
			url: "/ajax.req.php?id=addSel",
			data: {"PRD_id": PRD_id, "Session_id": Session_id},
			success: function(dataReturn) {
				getSel(Session_id);
				getLSel(PRD_id, Session_id);
			}
		});
	}); 
}

function DelSel(PRD_id, Session_id)
{
	$(document).ready(function () {
		$.ajax({
			type: "POST",
			cache: "false",
			url: "/ajax.req.php?id=delSel",
			data: {"PRD_id": PRD_id, "Session_id": Session_id},
			success: function(dataReturn) {
				getSel(Session_id);
				getLSel(PRD_id, Session_id);
			}
		});
	}); 
}


function getSel(Session_id)
{
	if(document.getElementById('LayerSel')) {
		$.ajax({
			type: "POST",
			cache: "false",
			url: "/ajax.req.php?id=getSel",
			data: {"Session_id": Session_id},
			beforeSend: function() {
				$("#loaderSel").show();
			},
			success: function(dataReturn) {
				$("#loaderSel").hide();
				$("#LayerSel").html(dataReturn);
			}
		});
	}
}

function getLSel(PRD_id, Session_id)
{
	if(document.getElementById('LinkSel')) {
		$.ajax({
			type: "POST",
			cache: "false",
			url: "/ajax.req.php?id=getLSel",
			data: {"PRD_id": PRD_id, "Session_id": Session_id},
			success: function(dataReturn) {
				$("#LinkSel").html(dataReturn);
			}
		});
	}
}
