/**
 * SHOP FRONTEND SCRIPTS
 *
 * @copyright Straka Jan
 */
/* 
 * DIALOG fn
 */
function dlg_confirm(text){
	
	return window.confirm(text);
}

/**
 * todo document
 */
function elmDisplay(elm){
	//show or hide element elm due the class atribut
	var elclass = document.getElementById(elm).className;
	
	//search if have nodisplay
	if(elclass.search('nodisplay')!=-1){
		
		//ok remove
		elclass = elclass.replace(' nodisplay',''); //odstraň nodisplay	
	}
	else{
		
		//not add
		elclass = elclass + " nodisplay";
	}
	
	document.getElementById(elm).className = elclass;
	
}

	/**
	 * set or unset element as disabled
	 *
	 * no control for valid element
	 */
	function elm_disable(elm, state){
	
		if(state==true){
			//disabled
			document.getElementById(elm).disabled = true;
		}
		else{
			document.getElementById(elm).disabled = false;
		}
	}

/**
 * for auto shift basket pcs
 * @checekd
 */
function IBBasShift(el_id, direction){

	var elem = document.getElementById(el_id), pcs = parseInt(elem.value, 10);
	if (!isNaN(pcs)) {
		//je číslo proces
		if(direction=='up') {pcs++;}
		if(direction=='down') {pcs--;}
	}
	else{
		//if not set to 1
		pcs = 1;
	}
	if(pcs<1) {pcs = 1;}
	//set input box
	elem.value = pcs;
	return false;
}
