function popitup(url){
	newwindow=window.open(url,'name','height=300,width=350');
	if (window.focus) {newwindow.focus()}
	return false;
}

function sprememba_barve(izbrano){
	var neki=document.getElementById(izbrano);
	neki.style.color='#FF9C00';
}
function vrni_barvo(izbrano){
	var neki=document.getElementById(izbrano);
	neki.style.color='#B0B6B9';
}

function show(id){
	var el = document.getElementById(id);
	el.style.display='block';
	var aa = document.getElementById(id);
}
function show_geslo(id, id2){
	var el = document.getElementById(id);
	var el2 = document.getElementById(id2);
	el.style.display='none';
	el2.style.display='';
}
function show_tip(id){
	var el = document.getElementById('tip_p');
	switch(id)
	{	
		default:
			el.innerHTML = 'Povpraševanje';
			break;
		case '1':
			el.innerHTML = 'Povpraševanje utovor';
			break;
		case '2':
			el.innerHTML = 'Povpraševanje tovor';
			break;
		
	}
}

function Validator1(theForm)
{  
  if (theForm.podjetje.value == "" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.podjetje.focus();
    return (false);
  }
  if (theForm.email.value == "" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.email.focus();
    return (false);
  }
  var good_email = theForm.email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
  if (!good_email)
  {
  	alert("Prosim vpišite veljeven e-mail naslov!");
    theForm.email.focus();
    return (false);
  }
  if (theForm.tip_povpr.value != "1" && theForm.tip_povpr.value != "2" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.tip_povpr.focus();
    return (false);
  }
  if (theForm.tip.value == "" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.tip.focus();
    return (false);
  }
  if (theForm.pakiranje.value == "" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.pakiranje.focus();
    return (false);
  }
  if (theForm.tona.value == "" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.tona.focus();
    return (false);
  }
  if (theForm.m3.value == "" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.m3.focus();
    return (false);
  }
  if (theForm.dimenzije.value == "" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.dimenzje.focus();
    return (false);
  }
  if (theForm.teza.value == "" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.teza.focus();
    return (false);
  }
  if (theForm.lay.value == "" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.lay.focus();
    return (false);
  }
  if (theForm.can.value == "" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.can.focus();
    return (false);
  }
  if (theForm.in2.value == "" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.in2.focus();
    return (false);
  }
  if (theForm.out.value == "" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.out.focus();
    return (false);
  }
  if (theForm.pretvorba.value == "" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.pretvorba.focus();
    return (false);
  }
  if (theForm.paluba.value == "" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.paluba.focus();
    return (false);
  }
  if (theForm.zlaganje.value == "" )
  {
    alert("Polja označena z * so obvezna!.");
    theForm.zlaganje.focus();
    return (false);
  }
  
}

// POVECAVA FONTOV //

// Copyright 2003 Eddie Traversa
// http://www.dhtmlnirvana.com/
// free to use as long as this copyright notice stays intact
var tags = new Array( 'div','td','tr','p','b','table','strong','span','emphasis','a','h1','h2','h3','pre','sub','sup','i','th','cp','ul','ol','li','dt','dd');
var pixelArray =  new Array('9','10','11','13','15','17','19','21');
var emArray =  new Array('0.7','0.9','1.0','1.5','2.0','2.5','3');
var initSize = parseInt(getCookie("fontsize"));

function getInitSize() {
	if (!initSize) { 
		initSize = 2;
		var now = new Date();
		now.setTime(now.getTime() + 2 * 24 * 60 * 60 * 1000);
		setCookie("fontsize", initSize, now);
	} else if (initSize != 2) {
		tmp = initSize-2;
		initSize = 2;
		fontSizer(tmp, 'px');
	}
}

function fontSizer(inc,unit) {
	if (!document.getElementById) 
		return;
	var size = initSize;
		size += inc;
	if (size < 0 ) {
		size = 0;
	}
	if (size > 5 ) {
		size = 5;
	}
		var diff = size - initSize;
		initSize = size;
		var now = new Date();
		now.setTime(now.getTime() + 2 * 24 * 60 * 60 * 1000);
		setCookie("fontsize", initSize, now);
		
		getBody = document.getElementsByTagName('body')[0];
		//getBody = document.getElementById('povecaj');
	for (i = 0 ; i < tags.length ; i++ ) {
		//if(!document.getElementById('povecava_no')){
			getallTags = getBody.getElementsByTagName(tags[i]);
		//}
		for (k = 0 ; k < getallTags.length ; k++) {
			//if (getallTags[k].className != 'fixed' && getallTags[k].className != 'gl_nav') {
					if (getallTags[k].style.fontSize.length > 0) {
						px = toInt(getallTags[k].style.fontSize);
						getallTags[k].style.fontSize = (unit=='px') ? (pixelArray[size]*1 + px-pixelArray[size-diff])+unit : (emArray[size]*1 + px-emArray[size-diff])+unit;
					} else
						getallTags[k].style.fontSize = (unit=='px') ? pixelArray[size]+unit : emArray[size]+unit;
				//}
			
		}
	}
}

function toInt(str) {
	for (j = 0; j <= str.length; j++) {
		if (j == str.length || str.charAt(j) < '0' || str.charAt(j) > '9') {
			return str.substring(0,j)*1;
		}
	}
}

//////////////////////

// cookeis //
/*
   name - name of the cookie
   value - value of the cookie
   [expires] - expiration date of the cookie
     (defaults to end of current session)
   [path] - path for which the cookie is valid
     (defaults to path of calling document)
   [domain] - domain for which the cookie is valid
     (defaults to domain of calling document)
   [secure] - Boolean value indicating if the cookie transmission requires
     a secure transmission
   * an argument defaults when it is assigned null as a placeholder
   * a null placeholder is not required for trailing omitted arguments
*/

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}


/*
  name - name of the desired cookie
  return string containing value of specified cookie or null
  if cookie does not exist
*/

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));
}


/*
   name - name of the cookie
   [path] - path of the cookie (must be same as path used to create cookie)
   [domain] - domain of the cookie (must be same as domain used to
     create cookie)
   path and domain default if assigned null or omitted if no explicit
     argument proceeds
*/

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";
  }
}

// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"

function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

// END cookeis //

var xmlhttp=false;

///  TA KOMENTIRANA KODA MORA TU OBVEZNO BIT!!!!

/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
  try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
   try {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
   } catch (E) {
    xmlhttp = false;
   }
  }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  xmlhttp = new XMLHttpRequest();
}

function loadFragmentInToElement(fragment_url, element_id) {
    var element = document.getElementById(element_id);
    //element.innerHTML = 'Loading ...';
   xmlhttp.open("GET", fragment_url, true);
    xmlhttp.onreadystatechange = function() {
      if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
      element.innerHTML = xmlhttp.responseText;
      }
    }
    xmlhttp.send(null);
}


function get_acal(val){
	loadFragmentInToElement('acal.php?' + val, 'acal_container');	
}

function confirmSubmitRaziskave(theForm)
{
	if ((theForm.raziskave_1_1.value == "" && theForm.raziskave_1_2.value == "" && theForm.raziskave_1_3.value == ""  && theForm.raziskave_1_4.value == "" && theForm.raziskave_1_5.value == "" && theForm.raziskave_1_6.value == "" && theForm.raziskave_1_7.value == "" && theForm.raziskave_1_8.value == "" && theForm.raziskave_1_9.value == "" && theForm.raziskave_1_10.value == "") || theForm.raziskave_2.value == "" || theForm.raziskave_3.value == "" || theForm.raziskave_4.value == "" || (theForm.raziskave_5.value == "" && theForm.raziskave_5_4.value == "") || theForm.raziskave_6_1.value == "" || theForm.raziskave_6_2.value == "" || theForm.raziskave_6_3.value == ""  || theForm.raziskave_6_4.value == "" || theForm.raziskave_6_5.value == "" || theForm.raziskave_6_6.value == "" || theForm.raziskave_6_7.value == "" || theForm.raziskave_6_8.value == "" || theForm.raziskave_6_9.value == "" || theForm.raziskave_6_10.value == ""){
		var agree=confirm("Niste izpolnili vseh polj. Ali res želite oddati odgovore?");
		if (agree)
			return true ;
		else
			return false ;
	}
}

function confirmSubmitProdaja(theForm)
{
	if (theForm.prodaja_1.value == "" || (theForm.prodaja_2_1.value == "" && theForm.prodaja_2_2.value == "" && theForm.prodaja_2_3.value == ""  && theForm.prodaja_2_4.value == "" && theForm.prodaja_2_5.value == "" && theForm.prodaja_2_6.value == "" && theForm.prodaja_2_7.value == "" && theForm.prodaja_2_8.value == "" && theForm.prodaja_2_9.value == "" && theForm.prodaja_2_10.value == "") || theForm.prodaja_3.value == "" || (theForm.prodaja_4.value == "" && theForm.prodaja_4_4.value == "")){
		var agree=confirm("Niste izpolnili vseh polj. Ali res želite oddati odgovore?");
		if (agree)
			return true ;
		else
			return false ;
	}
}
function confirmSubmitNabava(theForm)
{
	if ((theForm.nabava_1_1.value == "" && theForm.nabava_1_2.value == "" && theForm.nabava_1_3.value == ""  && theForm.nabava_1_4.value == "" && theForm.nabava_1_5.value == "" && theForm.nabava_1_6.value == "" && theForm.nabava_1_7.value == "" && theForm.nabava_1_8.value == "" && theForm.nabava_1_9.value == "" && theForm.nabava_1_10.value == "" && theForm.nabava_1_11.value == "" && theForm.nabava_1_12.value == "" && theForm.nabava_1_13.value == "") || theForm.nabava_2.value == "" || (theForm.nabava_3.value == "" && theForm.nabava_3_4.value == "") || theForm.nabava_4_1.value == "" || theForm.nabava_4_2.value == "" || theForm.nabava_4_3.value == ""  || theForm.nabava_4_4.value == "" || theForm.nabava_4_5.value == "" || theForm.nabava_4_6.value == "" || theForm.nabava_4_7.value == "" || theForm.nabava_4_8.value == "" || theForm.nabava_4_9.value == "" || theForm.nabava_4_10.value == "" || theForm.nabava_4_11.value == "" || theForm.nabava_4_12.value == ""){
		var agree=confirm("Niste izpolnili vseh polj. Ali res želite oddati odgovore?");
		if (agree)
			return true ;
		else
			return false ;
	}
}

function start(){
	var bla=document.getElementById('neki_pac');
	var strong=document.getElementsByTagName("strong");
	var td=document.getElementsByTagName("td");
	var span=document.getElementsByTagName("span");
	var tag=document.getElementsByTagName("a");
	//var stevilka = strong[a].style.fontSize.substr(0,2)+k;
	//var vsi= strong.length+td.length;
	//for(k < 0;){alert(stevilka);
		for(a=0;a<strong.length;a++){
			stevilka=strong[a].style.fontSize.substr(0,2)
			strong[a].style.fontSize=strong[a].style.fontSize
		}
		for(a=0;a<td.length;a++){
			stevilka=td[a].style.fontSize.substr(0,2)
			td[a].style.fontSize=td[a].style.fontSize
		}
		for(a=0;a<span.length;a++){
			stevilka=span[a].style.fontSize.substr(0,2)
			span[a].style.fontSize=Number(stevilka)+'px'
		}
		for(a=0;a<tag.length;a++){
			stevilka=tag[a].style.fontSize.substr(0,2)
			tag[a].style.fontSize=Number(stevilka)+'px'
		}
	//}
	
	
}




function fonter(){
	var bla=document.getElementById('neki_pac');
	var strong=document.getElementsByTagName("strong");
	var td=document.getElementsByTagName("td");
	var span=document.getElementsByTagName("span");
	var tag=document.getElementsByTagName("a");
	//var stevilka = strong[a].style.fontSize.substr(0,2)+k;
	//var vsi= strong.length+td.length;
	//for(k < 0;){alert(stevilka);
		for(a=0;a<strong.length;a++){
			stevilka=strong[a].style.fontSize.substr(0,2)
			strong[a].style.fontSize=Number(stevilka)+1+'px'
		}
		for(a=0;a<td.length;a++){
			stevilka=td[a].style.fontSize.substr(0,2)
			td[a].style.fontSize=Number(stevilka)+1+'px'
		}
		for(a=0;a<span.length;a++){
			stevilka=span[a].style.fontSize.substr(0,2)
			span[a].style.fontSize=Number(stevilka)+1+'px'
		}
		for(a=0;a<tag.length;a++){
			stevilka=tag[a].style.fontSize.substr(0,2)
			tag[a].style.fontSize=Number(stevilka)+1+'px'
		}
	//}
	
	
}
/*
function doloci(){
	var bla=document.getElementById('neki_pac');
	var strong=document.getElementsByTagName("strong");
	var td=document.getElementsByTagName("td");
	var span=document.getElementsByTagName("span");
	var tag=document.getElementsByTagName("a");
		for(a=0;a<strong.length;a++){
			stevilka=strong[a].style.fontSize.substr(0,2)
			strong[a].style.fontSize=Number(stevilka)+1+'px'
		}
		for(a=0;a<td.length;a++){
			stevilka=td[a].style.fontSize.substr(0,2)
			td[a].style.fontSize=Number(stevilka)+1+'px'
		}
		for(a=0;a<span.length;a++){
			stevilka=span[a].style.fontSize.substr(0,2)
			span[a].style.fontSize=Number(stevilka)+1+'px'
		}
		for(a=0;a<tag.length;a++){
			stevilka=tag[a].style.fontSize.substr(0,2)
			tag[a].style.fontSize=Number(stevilka)+1+'px'
		}	
}*/
/*function Button2_Click(object sender, System.EventArgs e)
{
	txtText.TextMode=TextBoxMode.Password;			
}*/

function changeProp()
{
    oProp.type = sText.type;
}
function changeCSSProp()
{
    if(oSelect.selectedIndex==0) oStyleProp.style.color= "white";
    else oStyleProp.style.color = "black";
    oStyleProp.style.backgroundColor = oSelect.value;
}
function Results(){
    sSrc.innerText = event.srcElement.id;
    sProperty.innerText = event.propertyName;
}