function showDiv(el_id) { 
	document.getElementById(el_id).style.display = 'inline'; 
} 


function OnChange(dropdown, url)
{
    var myindex  = dropdown.selectedIndex
    var SelValue = dropdown.options[myindex].value
    var baseURL  = url + SelValue
    top.location.href = baseURL;
    
    return true;
}



function dc(delUrl) {
  if (confirm("Vai tiešām vēlaties dzēst datus?")) {
    document.location = delUrl;
  }
}

function c_tmpl(delUrl, skip) {
	if (skip == 1) {
		document.location = delUrl;
		return true;
	}
  if (confirm("Sagataves izmantošana dzēsīs visus esošos formas laukus. Vai vēlaties turpināt ?")) {
    document.location = delUrl;
  }
}

function dc_form() {
  return confirm("Vai tiešām vēlaties dzēst datus?")
}

function displayPopup(el_id, hide_el,el_type, req)
{
	  document.getElementById('el_required').checked = req;
		if (hide_el == 'hide')
		document.getElementById('adv_element').style.display = 'none'; 
		else
		document.getElementById('adv_element').style.display = 'table-row'; 	

		document.getElementById(el_id).style.display = 'block'; 
		document.form_add_el.el_type.value = el_type;
		document.form_add_el.el_label.focus();
}

function gid(id) {
  return document.getElementById(id);
}


function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function fx_blink( e, par ){  
  par.count;  
  if( ! par.time ) par.time = 150; 
  if( e.timeout ) clearTimeout( e.timeout );
  if( par.count < 1 ) return false;  
  e.style.backgroundColor = '#0095AD';
  e.style.color = '#fff';
  e.timeout = setTimeout( function(){
    e.style.backgroundColor = '';
    e.style.color = '';
    par.count --;
    e.timeout = setTimeout( function(){
      fx_blink( e, par );
    }, par.time ); 
  }, par.time );  
}
