    
    function addEvent(elm, evType, fn, useCapture) {
    	if (elm.addEventListener) {
    		elm.addEventListener(evType, fn, useCapture);
    		return true;
    	}
    	else if (elm.attachEvent) {
    		var r = elm.attachEvent('on' + evType, fn);
    		return r;
    	}
    	else {
    		elm['on' + evType] = fn;
    	}
    }
        
    
    //
    // produktu katalogo skriptai
    //

	function order(a) {
		document.getElementById('ord').value = a;
		document.getElementById('fform').submit();
		return false;
	}
	
	function go_to_page(a) {
		document.getElementById('psl').value = a;
		document.getElementById('fform').submit();
        return false;
	}
	
	
	

	
	
	
	function addToEqu(a) {
		document.getElementById('equ').value = a;
		document.getElementById('fform').submit();
	}

    function removeEqu(val){
		document.getElementById('dele').value=val;
		document.getElementById('fe').submit();
	}
	
	function insertEqu(val){
		document.getElementById('adde').value=val;
		document.getElementById('fe').submit();
	}


	
	//
	//
	function clear_input(obj) {
		if ((obj.value = "Prisijungimo vardas") || (obj.value = "Slaptažodis")) obj.value = "";
	}
	
	
	
    //
    // popup lango atidarymas
    //
    function open_wnd(exp_bar,width,height,url,status_bar) {
        winName = "_blank";
        theURL = url;
        page_height = (height != '')?height:600;
        page_width = (height != '')?width:500;
        toolbar = (exp_bar == 1)?'yes':'no';
        statusbar = (status_bar == 1)?'yes':'no';
        page_top = Math.round((screen.height-page_height)/2);
        page_left = Math.round((screen.width-page_width)/2);
        size = "width="+page_width+",height="+page_height+",top="+page_top+",left="+page_left;
        features = 'status='+statusbar+',toolbar='+toolbar+',scrollbars=auto,resizable=yes,'+size;
        window.open(theURL,winName,features);
    }
	
	
	
	
	
	
	
	
	
	
	

	
	//
	// jQUERY kodas prasideda
	//
	$(document).ready(function() { 


		//
		// keiciam prekes kaina pasirenkant variantus
		//
		if ($("#price_id"))
		$("#price_id").change( function () { 

			current_s = "Lt";

			price_id = $("#price_id").val();
		    $("#price_span").html(prices[price_id]+' '+current_s); 
		    $("#action_price_span").html(action_prices[price_id]+' '+current_s); 
			
		    
		});
		
	});
	
	
	
	
	