function ShowHideTabsBoxesDetails(tab1ID,tab2ID,order) 
	{
		if (order == "1")
			{
				document.getElementById("tabContent"+tab1ID).style.display = "block";
				document.getElementById("tabContent"+tab2ID).style.display = "none";
			}//end if
			else
				if (order == "2")
					{
						document.getElementById("tabContent"+tab1ID).style.display = "none";
						document.getElementById("tabContent"+tab2ID).style.display = "block";
					}//end else
					else
						{
							document.getElementById("tabContent"+tab1ID).style.display = "block";
							document.getElementById("tabContent"+tab2ID).style.display = "none";
						}//end else
				
	}//end ShowHideTabsBoxesDetails()
	
	
function ShowHideDivCartInfoDetails(divId,order) 
	{
		if (order == "1")
			{
				document.getElementById("div"+divId).style.display = "block";
			}//end if
			else
				if (order == "0")
					{
						document.getElementById("div"+divId).style.display = "none";
					}//end else
					else
						{
							document.getElementById("div"+divId).style.display = "none";
						}//end else
				
	}//end ShowHideDivCartInfoDetails()
	
//Create a boolean variable to check for a valid Internet Explorer instance.
var xmlhttp1 = false;
//Check if we are using IE.
try {
//If the Javascript version is greater than 5.
xmlhttp1 = new ActiveXObject("Msxml2.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer.");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using Internet Explorer.
xmlhttp1 = new ActiveXObject("Microsoft.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp1 = false;
}
}
//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp1 && typeof XMLHttpRequest != 'undefined') {
xmlhttp1 = new XMLHttpRequest();
//alert ("You are not using Microsoft Internet Explorer");
}	
	
function makeAddToCartRequest(serverPage, objID, homePageUrl,addedID) 
	{
		var obj = document.getElementById(objID);
		xmlhttp1.open("GET", serverPage);
		xmlhttp1.onreadystatechange = function() 
			{
				//obj.innerHTML = '<img src="'+homePageUrl+'app/img/icons/ajax-loader.gif" width="16" height="16" />';
				if (xmlhttp1.readyState == 4 && xmlhttp1.status == 200) 
					{
						obj.innerHTML = xmlhttp1.responseText;
						refreshCartInfoRequest(homePageUrl+'app/plugins/store/refresh-cart-info.php','cart-info',homePageUrl);
						
						//alert(obj.innerHTML);
						//for the ok confirmation
						if (obj.innerHTML.indexOf("accept.gif") != -1)
							{
								document.getElementById(objID).style.display = "block";
								setTimeout('hideDiv(\''+objID+'\')', 2000);
								
								//afisez iconita "bifa", aadded peste poza, pentru ca utilizatorul
								//sa stie ca produsul respectiv este adaugat in cos;
								//functioneaza doar pe paginile cu liste produse
								if (addedID != '')
									document.getElementById(addedID).style.display = "block";
							}//end if
					}
			}
		xmlhttp1.send(null);
	}
//---------------------------------------------------------------------------------------------------------------------	
	
	
//Create a boolean variable to check for a valid Internet Explorer instance.
var xmlhttp2 = false;
//Check if we are using IE.
try {
//If the Javascript version is greater than 5.
xmlhttp2 = new ActiveXObject("Msxml2.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer.");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using Internet Explorer.
xmlhttp2 = new ActiveXObject("Microsoft.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp2 = false;
}
}
//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp2 && typeof XMLHttpRequest != 'undefined') {
xmlhttp2 = new XMLHttpRequest();
//alert ("You are not using Microsoft Internet Explorer");
}	
	
function refreshCartInfoRequest(serverPage, objID, homePageUrl) 
	{
		var obj = document.getElementById(objID);
		xmlhttp2.open("GET", serverPage);
		xmlhttp2.onreadystatechange = function() 
			{
				obj.innerHTML = '<img src="'+homePageUrl+'app/img/icons/ajax-loader.gif" width="16" height="16" />';
				if (xmlhttp2.readyState == 4 && xmlhttp2.status == 200) 
					{
						
						obj.innerHTML = xmlhttp2.responseText;
						//for changing the cart icon - empty or full
						if (obj.innerHTML != "Cosul meu (gol)")
							{
								document.getElementById('cart-info-table').className="cart-info";
							}//end if
					}
			}
		xmlhttp2.send(null);
	}
	
//------------------------------------------------------------------------------------------------------------------------	
	
//Create a boolean variable to check for a valid Internet Explorer instance.
var xmlhttp3 = false;
//Check if we are using IE.
try {
//If the Javascript version is greater than 5.
xmlhttp3 = new ActiveXObject("Msxml2.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer.");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using Internet Explorer.
xmlhttp3 = new ActiveXObject("Microsoft.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp3 = false;
}
}
//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp3 && typeof XMLHttpRequest != 'undefined') {
xmlhttp3 = new XMLHttpRequest();
//alert ("You are not using Microsoft Internet Explorer");
}	
	
function makeEmptyCartRequest(serverPage, objID, homePageUrl) 
	{
		var obj = document.getElementById(objID);
		xmlhttp3.open("GET", serverPage);
		xmlhttp3.onreadystatechange = function() 
			{
				obj.innerHTML = '<img src="'+homePageUrl+'app/img/icons/ajax-loader.gif" width="16" height="16" />';
				if (xmlhttp3.readyState == 4 && xmlhttp3.status == 200) 
					{
						obj.innerHTML = xmlhttp3.responseText;
						refreshCartInfoRequest(homePageUrl+'app/plugins/store/refresh-cart-info.php','cart-info',homePageUrl);
					}
			}
		xmlhttp3.send(null);
	}
	
//------------------------------------------------------------------------------------------------------------------------	
	
	//Create a boolean variable to check for a valid Internet Explorer instance.
var xmlhttp4 = false;
//Check if we are using IE.
try {
//If the Javascript version is greater than 5.
xmlhttp4 = new ActiveXObject("Msxml2.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer.");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using Internet Explorer.
xmlhttp4 = new ActiveXObject("Microsoft.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp4 = false;
}
}
//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp4 && typeof XMLHttpRequest != 'undefined') {
xmlhttp4 = new XMLHttpRequest();
//alert ("You are not using Microsoft Internet Explorer");
}	
	
function makeShopingCartOrderRequest(serverPage, objID, homePageUrl) 
	{
		var obj = document.getElementById(objID);
		xmlhttp4.open("GET", serverPage);
		xmlhttp4.onreadystatechange = function() 
			{
				obj.innerHTML = '<img src="'+homePageUrl+'app/img/icons/ajax-loader.gif" width="16" height="16" />';
				if (xmlhttp4.readyState == 4 && xmlhttp4.status == 200) 
					{
						obj.innerHTML = xmlhttp4.responseText;
						refreshCartInfoRequest(homePageUrl+'app/plugins/store/refresh-cart-info.php','cart-info',homePageUrl);
					}
			}
		xmlhttp4.send(null);
	}
	
//-----------------------------------------------------------------------------------------------------------------------	
	
	//Create a boolean variable to check for a valid Internet Explorer instance.
var xmlhttp5 = false;
//Check if we are using IE.
try {
//If the Javascript version is greater than 5.
xmlhttp5 = new ActiveXObject("Msxml2.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer.");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using Internet Explorer.
xmlhttp5 = new ActiveXObject("Microsoft.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp5 = false;
}
}
//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp5 && typeof XMLHttpRequest != 'undefined') {
xmlhttp5 = new XMLHttpRequest();
//alert ("You are not using Microsoft Internet Explorer");
}	
	
function makeShopingCartDeleteProductRequest(serverPage, objID, homePageUrl) 
	{
		var obj = document.getElementById(objID);
		xmlhttp5.open("GET", serverPage);
		xmlhttp5.onreadystatechange = function() 
			{
				obj.innerHTML = '<img src="'+homePageUrl+'app/img/icons/ajax-loader.gif" width="16" height="16" />';
				if (xmlhttp5.readyState == 4 && xmlhttp5.status == 200) 
					{
						obj.innerHTML = xmlhttp5.responseText;
					}
			}
		xmlhttp5.send(null);
	}
	
//------------------------------------------------------------------------------------------------------------------------

//Create a boolean variable to check for a valid Internet Explorer instance.
var xmlhttp6 = false;
//Check if we are using IE.
try {
//If the Javascript version is greater than 5.
xmlhttp6 = new ActiveXObject("Msxml2.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer.");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using Internet Explorer.
xmlhttp6 = new ActiveXObject("Microsoft.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp6 = false;
}
}
//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp6 && typeof XMLHttpRequest != 'undefined') {
xmlhttp6 = new XMLHttpRequest();
//alert ("You are not using Microsoft Internet Explorer");
}	
	
function refreshFinalTotalPrice(serverPage, objID, homePageUrl) 
	{
		
		var obj = document.getElementById(objID);
		xmlhttp6.open("GET", serverPage);
		xmlhttp6.onreadystatechange = function() 
			{
				if (homePageUrl != '')
					obj.innerHTML = '<img src="'+homePageUrl+'app/img/icons/ajax-loader.gif" width="16" height="16" />';
				if (xmlhttp6.readyState == 4 && xmlhttp6.status == 200) 
					{
						obj.innerHTML = xmlhttp6.responseText;
					}
			}
		xmlhttp6.send(null);
	}//end refreshFinalTotalPrice()

//------------------------------------------------------------------------------------------------------------------------


function deleteCartInfoDetailsProduct(idProduct,number,homePageUrl,totalPrice,quantity)
	{
		makeShopingCartDeleteProductRequest(homePageUrl+'app/plugins/store/delete-cart-info-details-product.php?id='+idProduct+'&totalPrice='+totalPrice+'&quantity='+quantity,'cartInfoDetailsLoader',homePageUrl);
		refreshCartInfoRequest(homePageUrl+'app/plugins/store/refresh-cart-info.php','cart-info',homePageUrl);
		hideDiv(number);
	}//end deleteCartInfoDetailsProduct()
	
	
function deleteFinalCartInfoDetailsProduct(idProduct,number,homePageUrl,totalPrice,quantity)
	{
		makeShopingCartDeleteProductRequest(homePageUrl+'app/plugins/store/delete-cart-info-details-product.php?id='+idProduct+'&totalPrice='+totalPrice+'&quantity='+quantity,'finalCartInfoDetailsLoader',homePageUrl);
		refreshCartInfoRequest(homePageUrl+'app/plugins/store/refresh-cart-info.php','cart-info',homePageUrl);
		hideDiv(number);
		refreshFinalTotalPrice(homePageUrl+'app/plugins/store/refresh-final-total-price.php','final-total-price',homePageUrl);
	}//end deleteFinalCartInfoDetailsProduct()
	
	
function overProductCategoriesTab(selectedTab,tabClass,activeClass)
	{
		if (document.getElementById(selectedTab).className != activeClass)
			document.getElementById(selectedTab).className=tabClass;
	}//end overProductCategoriesTab()
	
	
function changelistFunalCartProductsQuantity(divForShow,divForHide,event,inputTextFieldId,hiddenFieldId,homePageUrl,idProduct,productPrice,divListProductTotalPrice)
	{
		if (event == "mouseover")
			{
				document.getElementById(divForHide).style.display = "none";
				document.getElementById(divForShow).style.display = "block";
			}//end if
			else
				{
					var re5digit=/^\s*?\d+\s*$/;
					//verific daca valoarea campului input text s-a modificat fata de valoarea initiala, adica
					//daca am scris ceva
					if (document.getElementById(inputTextFieldId).value != document.getElementById(hiddenFieldId).value)
						{
							//verific ca valoarea campului input text sa fie valid, adica numar si daca este diferita de 1
							if ( (document.getElementById(inputTextFieldId).value.search(re5digit) != -1) && (document.getElementById(inputTextFieldId).value != 0) )
								{
									//este numar
									initialValue=document.getElementById(hiddenFieldId).value;
									//actualizez valoarea campului hidden cu noua valoare
									document.getElementById(hiddenFieldId).value=document.getElementById(inputTextFieldId).value;
									//actualizez div-ul divForShow
									document.getElementById(divForShow).innerHTML=document.getElementById(inputTextFieldId).value;
									//actualizez div-ul cu pretul total al produsului
									document.getElementById(divListProductTotalPrice).innerHTML=(document.getElementById(inputTextFieldId).value*productPrice).toFixed(2)+' ron';
									
									makechangeFinalCartProductsQuantityRequest(homePageUrl+'app/plugins/store/change-final-cart-products-quantity.php?id='+idProduct+'||'+productPrice+'||'+document.getElementById(inputTextFieldId).value+'||'+initialValue,'finalCartInfoDetailsLoader',homePageUrl);
									
									document.getElementById(divForHide).style.display = "none";
									document.getElementById(divForShow).style.display = "block";
									
								}//end if
								else
									{
										//nu este numar, nu inchid div-ul
									}//end else
						}//end if
						else
							{
								//nu am modificat nimic, inchid div-ul cu input
								document.getElementById(divForHide).style.display = "none";
								document.getElementById(divForShow).style.display = "block";
							}//end else
				}//end else
		
		
		
	}//end changelistFunalCartProductsQuantity()
	
	
function checkProductQuantityInputField(id,validClass,errorClass)
	{
		//IMPORTANT:
		//PE VIITOR trebuie pusa conditita ca sa nu poata incepe cu 001, 00...x
		//momentan daca scriu 0 - zero - si apoi orice cifra el considera ca este ok
		//nu este bine asa, treuie corectat pe viitor
		
		var re5digit=/^\s*?\d+\s*$/;
		if ( (document.getElementById(id).value.search(re5digit) == -1) || (document.getElementById(id).value == 0) )
			document.getElementById(id).className=errorClass;
			else
				document.getElementById(id).className=validClass;
	}//end checkProductQuantityInputField()
	
	
//------------------------------------------------------------------------------------------------------------------------

//Create a boolean variable to check for a valid Internet Explorer instance.
var xmlhttp9 = false;
//Check if we are using IE.
try {
//If the Javascript version is greater than 5.
xmlhttp9 = new ActiveXObject("Msxml2.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer.");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using Internet Explorer.
xmlhttp9 = new ActiveXObject("Microsoft.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp9 = false;
}
}
//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp9 && typeof XMLHttpRequest != 'undefined') {
xmlhttp9 = new XMLHttpRequest();
//alert ("You are not using Microsoft Internet Explorer");
}	
	
function makechangeFinalCartProductsQuantityRequest(serverPage, objID, homePageUrl) 
	{
		
		var obj = document.getElementById(objID);
		xmlhttp9.open("GET", serverPage);
		xmlhttp9.onreadystatechange = function() 
			{
				if (homePageUrl != '')
					obj.innerHTML = '<img src="'+homePageUrl+'app/img/icons/ajax-loader.gif" width="16" height="16" />';
				if (xmlhttp9.readyState == 4 && xmlhttp9.status == 200) 
					{
						obj.innerHTML = xmlhttp9.responseText;
						
						//daca returnez spatiu gol (&nbsp;), inseamna ca a reusit modificarea sesiunilor si/sau cookie-urilor
						//actualizez restul
						if (obj.innerHTML == '&nbsp;')
							{
								refreshChangeFinalCartSendQuery(homePageUrl+'app/plugins/store/refresh-change-final-cart-send-query.php','changeFinalCartSendQuery');
								refreshCartInfoRequest(homePageUrl+'app/plugins/store/refresh-cart-info.php','cart-info',homePageUrl);
							}//end if
							else
								{
									//nimic
								}//end else
					}
			}
		xmlhttp9.send(null);
	}//end makechangeFinalCartProductsQuantityRequest()

//------------------------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------------------------

//Create a boolean variable to check for a valid Internet Explorer instance.
var xmlhttp10 = false;
//Check if we are using IE.
try {
//If the Javascript version is greater than 5.
xmlhttp10 = new ActiveXObject("Msxml2.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer.");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using Internet Explorer.
xmlhttp10 = new ActiveXObject("Microsoft.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp10 = false;
}
}
//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp10 && typeof XMLHttpRequest != 'undefined') {
xmlhttp10 = new XMLHttpRequest();
//alert ("You are not using Microsoft Internet Explorer");
}	
	
function refreshChangeFinalCartSendQuery(serverPage, objID, homePageUrl) 
	{
		
		var obj = document.getElementById(objID);
		xmlhttp10.open("GET", serverPage);
		xmlhttp10.onreadystatechange = function() 
			{
				if (homePageUrl != '')
					obj.innerHTML = '<img src="'+homePageUrl+'app/img/icons/ajax-loader.gif" width="16" height="16" />';
				if (xmlhttp10.readyState == 4 && xmlhttp10.status == 200) 
					{
						obj.innerHTML = xmlhttp10.responseText;
					}
			}
		xmlhttp10.send(null);
	}//end refreshChangeFinalCartSendQuery()

//------------------------------------------------------------------------------------------------------------------------

//Create a boolean variable to check for a valid Internet Explorer instance.
var xmlhttp12 = false;
//Check if we are using IE.
try {
//If the Javascript version is greater than 5.
xmlhttp12 = new ActiveXObject("Msxml2.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer.");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using Internet Explorer.
xmlhttp12 = new ActiveXObject("Microsoft.XMLHTTP");
//alert ("You are using Microsoft Internet Explorer");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp12 = false;
}
}
//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp12 && typeof XMLHttpRequest != 'undefined') {
xmlhttp12 = new XMLHttpRequest();
//alert ("You are not using Microsoft Internet Explorer");
}	
	
function makeAddToAvailabilityListRequest(serverPage, objID, homePageUrl,addedID) 
	{
		var obj = document.getElementById(objID);
		xmlhttp12.open("GET", serverPage);
		xmlhttp12.onreadystatechange = function() 
			{
				//obj.innerHTML = '<img src="'+homePageUrl+'app/img/icons/ajax-loader.gif" width="16" height="16" />';
				if (xmlhttp12.readyState == 4 && xmlhttp12.status == 200) 
					{
						obj.innerHTML = xmlhttp12.responseText;
						
						//alert(obj.innerHTML);
						//for the ok confirmation
						if (obj.innerHTML.indexOf("accept.gif") != -1)
							{
								document.getElementById(objID).style.display = "block";
								setTimeout('hideDiv(\''+objID+'\')', 2000);
								
							}//end if
					}
			}
		xmlhttp12.send(null);
	}//end makeAddToAvailabilityListRequest()
//---------------------------------------------------------------------------------------------------------------------	


function overProductInfoTab(selectedTab,tabClass,activeClass)
	{
		if (document.getElementById(selectedTab).className != activeClass)
			document.getElementById(selectedTab).className=tabClass;
	}//end overProductInfoTab()
	
	
function selectProductInfoTab(selectedTab,numberOfTabs,activeClass,inactiveClass,homePageUrl,productInfoTabId,idProduct)
	{
		//make the request
		makerequest(homePageUrl+'app/plugins/store/show-page-type-20-tabs-request-content.php?tab='+selectedTab+'&id='+idProduct,productInfoTabId,homePageUrl);
		
		change(selectedTab,activeClass);
		
		for (i=1; 1<=numberOfTabs; i++)
			{
				if ( ('tab'+i) != selectedTab)
					{
						change('tab'+i,inactiveClass);
					}//end if
					
			}//end for
	}//end selectProductInfoTab()
	
	
function submitProductReview(serverPage, objID, homePageUrl, productId)
	{
		var obj = document.getElementById(objID);
		
		//inlocuieste ENTER-urile cu <br />
		serverPage=nl2br(serverPage);
		
		if (homePageUrl != '')
			obj.innerHTML = '<img id="imageLoader" src="'+homePageUrl+'app/img/icons/ajax-loader.gif" width="16" height="16" style="margin: 0px; padding: 0px; vertical-align: middle;" />';
					
		xmlhttp.open("GET", serverPage);
		xmlhttp.onreadystatechange = function() 
			{
				if (xmlhttp.readyState == 4 && xmlhttp.status == 200) 
					{
						obj.innerHTML = xmlhttp.responseText;
						tmp=obj.innerHTML;
						/*Update v1.0 beta - pentru a nu aparea iconita de loading la apelare, in alte div-uri*/
						obj='';
						
						//Daca reuseste, atunci dau refres si la div-ul cu lista comentariilor, de jos
						if (tmp.indexOf("s-a adaugat") != -1)
							{
								//fac refresh la lista cu comentariile
								makerequest(homePageUrl+'app/plugins/store/refresh-show-product-reviews.php?id='+productId, 'show-product-reviews', homePageUrl, 'fadeIn');
								
							}//end if
							else
								{
									//nimic
								}//end else
					}//end if
			}//end
		xmlhttp.send(null);
	}//end submitProductReview()
	
	
function deleteProductComment(serverPage, objID, homePageUrl, commentProductId, fadeEffect)
	{
		var obj = document.getElementById(objID);
		
		if (homePageUrl != '')
			obj.innerHTML = '<img id="imageLoader" src="'+homePageUrl+'app/img/icons/ajax-loader.gif" width="16" height="16" />';
					
		xmlhttp.open("GET", serverPage);
		xmlhttp.onreadystatechange = function() 
			{
				if (xmlhttp.readyState == 4 && xmlhttp.status == 200) 
					{
						obj.innerHTML = xmlhttp.responseText;
						tmp=obj.innerHTML;
						
						/*Update v1.0 beta - pentru a nu aparea iconita de loading la apelare, in alte div-uri*/
						obj='';
						
						//verific daca s-a returnat mesajul de confirmare, adica daca s-a sters comentariul
						if (tmp.indexOf("&nbsp;") != -1)
							{
								//inchid div-ul cu comentariul respectiv
								if (fadeEffect == "fadeIn")
									{
										fadeIn(commentProductId);
									}//end if
									else
										if (fadeEffect == "fadeOut")
											{
												fadeOut(commentProductId);
											}//end if
											else
												{
													//nu am setat efectul de fade, inchid simplu div-ul
													hideDiv(commentProductId);
												}//end else
							}//end if
							else
								{
									//nothing
								}//end else
					}//end if
			
			}//end 
		xmlhttp.send(null);
	}//end deleteProductComment()
	
	
	function checkNewProdForLatestProdBox(homePageUrl)
		{	
			//verific daca exista id-ul ultimului produs adaugat in baza de date si daca box-ul este activ, adica este afisat pe pagina
			if ( (document.getElementById('latestProductId').value != "") && (document.getElementById('latest-products-box').style.display == "block") )
				{
					var obj = document.getElementById('topPageLoader');
								
					xmlhttp.open("GET", homePageUrl+'app/plugins/store/check-new-products-for-latest-products-box.php?id='+document.getElementById('latestProductId').value);
					xmlhttp.onreadystatechange = function() 
						{
							if (xmlhttp.readyState == 4 && xmlhttp.status == 200) 
								{
									obj.innerHTML = xmlhttp.responseText;
									//verific daca s-a returnat mesajul de confirmare, aduca a aparut un nou produs in baza de date
									if (obj.innerHTML.indexOf("&nbsp;") != -1)
										{
											//s-a adaugat un produs nou, actualizez casuta, box-ul cu ultimele produse adaugate
											makerequest(homePageUrl+'app/plugins/store/latest-products-box.php','latest-products-box',homePageUrl,"fadeIn"); 
										}//end if
										else
											{
												//nu fac nimic, pt ca nu s-a adaugat nici un produs nou
											}//end else
									/*Update v1.0 beta - pentru a nu aparea iconita de loading la apelare, in alte div-uri*/
									obj='';
								}//end if
						}//end 
					xmlhttp.send(null);
				}//end if
				else
					{
						//nimic
					}//end else
		}//end checkNewProdForLatestProdBox()
		
		
	function closeProductsBox(boxId,userId,homePageUrl)
		{
			if (userId != "")
				{
					var obj = document.getElementById('topPageLoader');
								
					xmlhttp.open("GET", homePageUrl+'app/plugins/users/close-boxes.php?id='+boxId+'||'+userId);
					xmlhttp.onreadystatechange = function() 
						{
							if (xmlhttp.readyState == 4 && xmlhttp.status == 200) 
								{
									obj.innerHTML = xmlhttp.responseText;
									fadeOut(boxId);
									fadeOut(boxId+'-title');
									/*Update v1.0 beta - pentru a nu aparea iconita de loading la apelare, in alte div-uri*/
									obj='';
								}//end if
						}//end
					xmlhttp.send(null);
				}//end if
				else
					{
						fadeOut(boxId);
					}//end else
		}//end closeProductsBox()
		
//---------------------------------------------------------------------------------------------
//Create a boolean variable to check for a valid Internet Explorer instance.
		var xmlhttpshowRandomProductsBox = false;
		//Check if we are using IE.
		try {
		//If the Javascript version is greater than 5.
		xmlhttpshowRandomProductsBox = new ActiveXObject("Msxml2.XMLHTTP");
		//alert ("You are using Microsoft Internet Explorer.");
		} catch (e) {
		//If not, then use the older active x object.
		try {
		//If we are using Internet Explorer.
		xmlhttpshowRandomProductsBox = new ActiveXObject("Microsoft.XMLHTTP");
		//alert ("You are using Microsoft Internet Explorer");
		} catch (E) {
		//Else we must be using a non-IE browser.
		xmlhttpshowRandomProductsBox = false;
		}
		}
		//If we are using a non-IE browser, create a javascript instance of the object.
		if (!xmlhttpshowRandomProductsBox && typeof XMLHttpRequest != 'undefined') {
		xmlhttpshowRandomProductsBox = new XMLHttpRequest();
		//alert ("You are not using Microsoft Internet Explorer");
		}
//-----------------------------------------------------------------------------------------------
		
function showRandomProductsBox(homePageUrl)
	{
		var obj = document.getElementById('random-products-box');
		
		/* update - bug fix
		 * pentru a se actualiza lista cu produsele aleatoare, am adaugt variabila tmpTime ca variabila
		 * get la scriptul php, se pare ca doar daca primeste o varianila temporara diferita la fiecare
		 * actualizare, atunci se actualizeaza si lista cu produsele aleatoare;
		 * nu am inteles de ce javascriptul pe IE nu-si modifica continutul xmlhttpshowRandomProductsBox.responseText 
		 * daca nu as fi adaugat o variabila care se schimba; vaiabila respectiva nu o folosesc in scriptul php;
		 */
		var tmpTime = new Date();
		serverPage= homePageUrl+'app/plugins/store/random-products-box.php?tmpTime='+tmpTime.getTime();
		
		//update - bug fix
		//doar daca mai este deschis div-ul, atunci afisez, altfel nu mai fac nimic
		if (obj.style.display == "block")
			{		
				xmlhttpshowRandomProductsBox.open("GET", serverPage);
				xmlhttpshowRandomProductsBox.onreadystatechange = function() 
					{
						if (xmlhttpshowRandomProductsBox.readyState == 4 && xmlhttpshowRandomProductsBox.status == 200)
							{
								obj.innerHTML = xmlhttpshowRandomProductsBox.responseText;
								
								/*Update v1.0 beta - pentru a nu aparea iconita de loading la apelare, in alte div-uri*/
								obj='';
								fadeIn('random-products-box');
							}//end if
					}//end
				xmlhttpshowRandomProductsBox.send(null);
		}//end if
		else
			{
				//nothing
			}//end else
	}//end showRandomProductsBox()
		
