 function include(file) {
   if (document.createElement && document.getElementsByTagName) {
     var head = document.getElementsByTagName('head')[0];

     var script = document.createElement('script');
     script.setAttribute('type', 'text/javascript');
     script.setAttribute('src', file);

     head.appendChild(script);
   } else {
     alert('netinkama naršyklė');
   }
 }

include('http://www.virtual.lt/protekta/padangos/info.txt');

//dedame i masiva tuos id kuriuos norime matyti filtre
//PASTABA papildant filtrą naujais elementais reikia nepamirsti papildyti ir php masyva
var induaukstis=new Array("0", "1", "3", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15");
var induplotis=new Array("0", "5", "8", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "24", "25", "26", "27", "28", "30", "31", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "76", "77", "78", "80", "82", "83", "84", "88", "89", "91", "92", "93", "94", "95", "96", "98", "99", "101", "102", "103", "105", "106", "107", "108", "109", "110", "111", "112", "113", "116", "117", "118", "121", "122", "123", "124", "125", "126", "127");
var indudydis=new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "47", "17", "19", "20", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42");

var krovaukstis=new Array("0", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "22", "17");
var krovplotis=new Array("0", "19", "22", "24", "25", "26", "28", "31", "34", "37", "40", "42", "46", "74", "76", "79", "80", "81", "84", "85", "141", "86", "87", "88", "89", "90", "91", "92", "96", "97", "99", "100", "104", "107", "128", "129", "130", "131", "132");
var krovdydis=new Array("0", "16", "18", "19", "21", "22", "23", "24", "25", "26", "43", "44", "45");

var ukioaukstis=new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15");
var ukioplotis=new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "16", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "63", "64", "65", "69", "70", "71", "72", "73", "75", "76", "77", "78", "80", "82", "84", "141", "86", "87", "90", "92", "93", "94", "95", "96", "98", "143", "99", "101", "102", "103", "105", "106", "107", "108", "109", "110", "111", "144", "112", "113", "114", "115", "116", "117", "118", "119", "120", "121", "122", "145", "123", "124", "125", "126", "127");
var ukiodydis=new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "47", "17", "19", "20", "22", "23", "24", "25", "26", "27", "28", "29", "30", "32", "33", "34", "35", "36", "37", "38", "39", "49", "48");

var lengaukstis=new Array("0", "18", "19", "1", "3", "5", "6", "7", "8", "9", "10", "11", "20", "21");
var lengplotis=new Array("0", "133", "134", "135", "136", "137", "138", "139", "74", "76", "140", "79", "81", "83", "85", "141", "87", "88", "90", "91", "142");
var lengdydis=new Array("0", "9", "10", "11", "13", "16", "17", "19", "20", "22", "23", "46", "24", "25", "27", "29");

//pasiimam post per php, del filtro reiksmiu isiminimo
var postweight= document.jshidden.jsweight.value;
var postheight= document.jshidden.jsheight.value;
var postsize= document.jshidden.jssize.value;

var postname= document.jshidden.jsname.value;

//atsimena reiksmes
function selectop(i, se, ind) {
	var s="";
	if (i == se && ind == postname) {
		s = 'selected'
	}
	return s
}

function option(array, select, ind, mas) {
	var tis="";
	for(var i=0;i<mas.length;i++){
	    tis += '<option ' + selectop(mas[i], select, ind) + ' value="' + mas[i] + '">' + array[mas[i]] + '</option>';
	}
	return tis
}

function padselect (name, array, sel, ind, mas) {
	var tire="";
		tire += '<div class="tire-size">' + '<select class="select-tire" name="' + name + '">' + option(array, sel, ind, mas) + '</select>' + '</div>';
	return tire;
}

var thetext1=new Array()
thetext1[0]="";
thetext1[1]='<div class="tire-title2">Plotis&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Aukštis&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Skersmuo</div>' + padselect ('weight', plotis, postweight, 1, ukioplotis) + padselect ('height', aukstis, postheight, 1, ukioaukstis) + padselect ('size', dydis, postsize, 1, ukiodydis);
thetext1[2]='<div class="tire-title2">Plotis&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Aukštis&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Skersmuo</div>' + padselect ('weight', plotis, postweight, 2, krovplotis) + padselect ('height', aukstis, postheight, 2, krovaukstis) + padselect ('size', dydis, postsize, 2, krovdydis);
thetext1[3]='<div class="tire-title2">Plotis&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Aukštis&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Skersmuo</div>' + padselect ('weight', plotis, postweight, 3, induplotis) + padselect ('height', aukstis, postheight, 3, induaukstis) + padselect ('size', dydis, postsize, 3, indudydis);
thetext1[4]='<div class="tire-title2">Plotis&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Aukštis&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Skersmuo</div>' + padselect ('weight', plotis, postweight, 4, lengplotis) + padselect ('height', aukstis, postheight, 4, lengaukstis) + padselect ('size', dydis, postsize, 4, lengdydis);
thetext1[5]='<div class="tire-title2">Plotis&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Aukštis&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Skersmuo</div>' + padselect ('weight', plotis, postweight, 5, lengplotis) + padselect ('height', aukstis, postheight, 5, lengaukstis) + padselect ('size', dydis, postsize, 5, lengdydis);
thetext1[6]='';
function displaydesc(which, descriptionarray, container){
if (document.getElementById)
document.getElementById(container).innerHTML=descriptionarray[which.selectedIndex]
}

displaydesc(document.form1.type, thetext1, 'textcontainer1')