var tb_pathToImage = "public/graph/loadingAnimation.gif";



function loadWaitScreen() {
	if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
		$("body","html").css({height: "100%", width: "100%"});
		$("html").css("overflow","hidden");
		if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
			$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
		}
	}else{//all others
		if(document.getElementById("TB_overlay") === null){
			$("body").append("<div id='TB_overlay'></div><div id='TB_window'>");
			$("#TB_window").css({display:"block"});
		}
	}
	$("body").append("<div id='TB_load'><img src='" + imgLoader.src + "' /></div>");//add loader to the page
	$('#TB_load').show();//show loader
}

function unloadWaitScreen() {
	$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').remove();});
	$("#TB_load").remove();
	if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
		$("body","html").css({height: "auto", width: "auto"});
		$("html").css("overflow","");
	}
	document.onkeydown = "";
	return false;
}

function ajaxBasketReload() {
	$.ajax({
		type: "POST",
		url: "index.php?mod=shop&action=ajaxBasketReload",
		async: false, 			
		success: function(data,textStatus) {
			$("#basket").html(data);
		}
	});
}

function ajaxStatusReload() {
	$.ajax({
		type: "POST",
		url: "index.php?mod=shop&action=ajaxStatusReload",
		data: "",
		async: false,
		success: function(data,textStatus) {
			$("#status > .core").html(data);
		}
	});
}

function ajaxBasketAdd(id,q) {
	$.ajax({
		type: "POST",
		url: "index.php?mod=shop&action=ajaxBasketAdd",
		data: "basketAdd[product_id]=" + id + "&basketAdd[q]=" + q,
		async: false, 			
		success: function(data,textStatus) {
			//$("#status > .core").html(data);
		}
	});
}

function ajaxBasketRemove(id) {
	$.ajax({
		type: "POST",
		url: "index.php?mod=shop&action=ajaxBasketRemoveItem",
		data: "product_id=" + id,
		async: false, 			
		success: function(data,textStatus) {
			//$("#status > .core").html(data);
		}
	});
}