function toggleCategories(div_id) {
	div_visibility = document.getElementById(div_id).style.display;
	// alert(div_visibility);
	if(div_visibility == 'none') {
		document.getElementById(div_id).style.display = '';

	} else {
		document.getElementById(div_id).style.display = 'none';
	}

	return false;
}

function openPopup(win, src, width, heigth, resizable, scrollbars){
	var x = parseInt(screen.width / 2.0) - (width / 2.0);
	var y = parseInt(screen.height / 2.0) - (heigth / 2.0);

	var w = win.open(src, "newwin",
	"width=" + width + ",height=" + heigth + ",top=" + y + ",left=" + x + ",status, resizable=" + resizable
	+ ",alwaysRaised=yes,dialog=yes, modal=yes,scrollbars=" + scrollbars);
}

function linkHover(id){
	document.getElementById(id).style.color = '#5ca0c7';
	document.getElementById(id).style.textDecoration="underline";
}

function linkClear(id){
	document.getElementById(id).style.color = '#666666';
	document.getElementById(id).style.textDecoration="none";
}

function checkEmpty(id){
	if(document.getElementById(id).value.length == 0){
		alert('Va rugam completati o valoare!');
		return false;
	}
	return true;
}

function openWindow(parentWind, url){
	var w = parentWind.open(url, "newwin",
		"width=" + (screen.width - 200)
		+ ", height=" + (screen.height - 200)
		+ ", top=0, left=0, resizable=yes, scrollbars=yes"
		);
	w.focus();
}

function openLinkInParent(url){
	opener.location = url;
	opener.focus();
}


function show_only_products_that_are_in_stoc(){
	if ($('checkbox_for_products_that_are_in_stock').checked == true){
		doxxx = "show_only_in_stoc_products";
	}else{
		doxxx = "show_all_products";
	}
	
	var url = 'show_only_products_in_stoc.php';
	var params = 'do='+doxxx;
	var myAjax = new Ajax.Request(
		url,
		{method: 'get', parameters: params, onComplete: function(transport){
			rasp = transport.responseText;
			alert('rasp='+rasp);
			
		}}
	);
}
