<!--
function show_list(element_id)
{
	obj = document.getElementById(element_id);
	if(obj.style.display=='none')
	{
		obj.style.display = 'block';
	}else{
		obj.style.display = 'none';
	}
}

function __init()
{
   document.getElementById('preloader').style.display='none';
	document.getElementById('html_body').style.display='block';
}

function select_model(img)
{
	setCookie('model_img',img);
}

function get_model_img()
{
	if(getCookie('model_img')!=null)
	{
		document.getElementById('model_img_slot').innerHTML = getCookie('model_img');
	}else{
		document.getElementById('model_img_slot').innerHTML = '';
	}
}

function cc_duom_plus(po_el)
{
	if(getCookie('ct')==null)
	{
		setCookie('ct','1000');
	}else{
		if(getCookie('ct')<1000)
		{
			setCookie('ct','1000');
		}else{
			setCookie('ct',parseInt(getCookie('ct'))+1);
		}
	}
	if(po_el=='none')
	{
		document.getElementById('cc_duom_txt').innerHTML += "<div style='text-align:left;background-color:#D1DCF3;' id=block"+getCookie('ct')+"><table width='100%' cellpadding='2' cellspacing='1' border='0'><tr><td><input type='button' class='cc_admin_button' value='&rarr;' style='background-color:#258D23;height:20px;font-size:14px;' onclick=cc_duom_plus('po_"+getCookie('ct')+"');></td><td width='200'><input type='text' name='duom_input"+getCookie('ct')+"' value='Pavadinimas' class='ch_text_input' style='width:200px;'></td><td width='50'><input type='text' name='duom_input_mat"+getCookie('ct')+"' value='' class='ch_text_input' style='width:50px;border:1px solid #CB8E15;'></td><td><input type='text' name='duom_input_v"+getCookie('ct')+"' value='' class='ch_text_input' style='width:100px;border:1px solid #2A53A5;'></td><td><input type='text' name='duom_input_vv"+getCookie('ct')+"' value='' class='ch_text_input' style='width:100px;border:1px solid #2A53A5;'></td><td><input type='text' name='duom_input_vvv"+getCookie('ct')+"' value='' class='ch_text_input' style='width:100px;border:1px solid #2A53A5;'></td><td>&nbsp;&nbsp;&nbsp;</td></tr></table></div><div style='text-align:left;display:none;background-color:#D1DCF3;' id='po_"+getCookie('ct')+"'></div>";
	}else{
		document.getElementById(po_el).innerHTML += "<table width='100%' cellpadding='2' cellspacing='1' border='0'><tr><td><input type='button' class='cc_admin_button' value='&rarr;' style='background-color:#258D23;height:20px;font-size:14px;' onclick=cc_duom_plus('po_"+getCookie('ct')+"');></td><td width='200'><input type='text' name='duom_input"+getCookie('ct')+"' value='Pavadinimas' class='ch_text_input' style='width:200px;'></td><td width='50'><input type='text' name='duom_input_mat"+getCookie('ct')+"' value='' class='ch_text_input' style='width:50px;border:1px solid #CB8E15;'></td><td><input type='text' name='duom_input_v"+getCookie('ct')+"' value='' class='ch_text_input' style='width:100px;border:1px solid #2A53A5;'></td><td><input type='text' name='duom_input_vv"+getCookie('ct')+"' value='' class='ch_text_input' style='width:100px;border:1px solid #2A53A5;'></td><td><input type='text' name='duom_input_vvv"+getCookie('ct')+"' value='' class='ch_text_input' style='width:100px;border:1px solid #2A53A5;'></td><td>&nbsp;&nbsp;&nbsp;</td></tr></table><div style='text-align:left;display:none;background-color:#D1DCF3;' id='po_"+getCookie('ct')+"'></div>";
		document.getElementById(po_el).style.display="block";
	}
	//alert(getCookie('ct')); 
}

function cc_komplektacija_plus(po_el)
{
	if(getCookie('ct')==null)
	{
		setCookie('ct','1000');
	}else{
		if(getCookie('ct')<1000)
		{
			setCookie('ct','1000');
		}else{
			setCookie('ct',parseInt(getCookie('ct'))+1);
		}
	}
	if(po_el=='none')
	{
		document.getElementById('cc_kompl_txt').innerHTML += "<div style='text-align:left;background-color:#D1DCF3;' id=block"+getCookie('ct')+"><table width='100%' cellpadding='2' cellspacing='1' border='0'><tr><td><input type='button' class='cc_admin_button' value='&rarr;' style='background-color:#258D23;height:20px;font-size:14px;' onclick=cc_komplektacija_plus('po_"+getCookie('ct')+"');></td><td><input type='text' name='cc_kompl_input"+getCookie('ct')+"' value='Pavadinimas' class='ch_text_input' style='width:400px;'></td><td>Taip/Ne <input type='checkbox' name='tn_cc_kompl_input"+getCookie('ct')+"'></td><td><input type='text' name='kn_cc_kompl_input"+getCookie('ct')+"' class='ch_text_input' style='width:40px;'></td><td>&nbsp;&nbsp;&nbsp;</td></tr></table></div><div style='text-align:left;display:none;background-color:#D1DCF3;' id='po_"+getCookie('ct')+"'></div>";
	}else{
		document.getElementById(po_el).innerHTML += "<table width='100%' cellpadding='2' cellspacing='1' border='0'><tr><td><input type='button' class='cc_admin_button' value='&rarr;' style='background-color:#258D23;height:20px;font-size:14px;' onclick=cc_komplektacija_plus('po_"+getCookie('ct')+"');></td><td><input type='text' name='cc_kompl_input"+getCookie('ct')+"' value='Pavadinimas' class='ch_text_input' style='width:400px;'></td><td>Taip/Ne <input type='checkbox' name='tn_cc_kompl_input"+getCookie('ct')+"'></td><td><input type='text' name='kn_cc_kompl_input"+getCookie('ct')+"' class='ch_text_input' style='width:40px;'></td><td>&nbsp;&nbsp;&nbsp;</td></tr></table><div style='text-align:left;display:none;background-color:#D1DCF3;' id='po_"+getCookie('ct')+"'></div>";
		document.getElementById(po_el).style.display="block";
	}
	//alert(getCookie('ct')); 
}
function setCookie(name, value) {
  var curCookie = name + "=" + escape(value);
  document.cookie = curCookie;
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}


function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function shouldset(passon){
if(document.getElementById('hexvalue').value.length == 7){setcolor(passon)}
}

function setcolor(elem){
document.getElementById('hexvalue').value=elem
document.getElementById('selcolor').style.backgroundColor=elem
}

function del_element(element)
{
	document.getElementById(element).innerHTML="";
    document.getElementById(element).style.display="none";
}

function voite(){
        for (Count = 0; Count < 6; Count++) {
        if (form.radiobutton[Count].checked)
            break;
    }
    if(Count==6){
		alert('Nenurodytas atsakymas!');
	} else {
		document.form.submit();
	}
}

function siulo(){
	var t=1;
	x=document.getElementsByName("textfield1");
	if(x[0].value==''){
		alert('Įveskite klausimą!');
	} else {
		for($i=1; $i<=6; $i++){
			y=document.getElementsByName("textfield"+$i);
			if(y[0].value==''){
				t++;
			}
		}
		if(t>4){
			alert('Nepakanka įvestų atsakymų!');
			javascript:history.go(0);
		} else {
			document.siulymoforma.submit();
		}
	}
}
//-->
