    
    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.forms['fform'].submit();
		return false;
	}
	
	function go_to_page(a) {
		document.getElementById('psl').value = a;
		document.forms['fform'].submit();
        return false;
	}
	
	function addToCart(a) {
		document.getElementById('preke').value = a;
		document.forms['ff'].submit();
	}
	
	
	
	
	function insertEqu(a) {
		document.getElementById('adde').value = a;
		document.forms['equ_form'].submit();

	}

    function removeEqu(val){
		document.getElementById('dele').value=val;
		document.forms['equ_form'].submit();

	}
    
    //
    // XHTML 1.1 Strict 
    // nuorodu atidarymas naujame lange 
    //
    window.onload = function() {
        var links = document.getElementsByTagName('a');
        for (var i=0;i < links.length;i++) {
            if (links[i].className == 'new-window') {
                links[i].onclick = function() {
                    window.open(this.href);
                    return false;
                };
            }
        }
    }

	//
	//
	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);
    }