function makesure() {
	if (confirm('Ali si prepričan, da želiš zbrisati?')) {
	return true;
	} else {
	return false;
	}
}

function checkformkontakt ( form ) // to je za kontaktne forme
{
  if (!isValidEmail(form.email.value)) {
	alert("Prosimo vnesite veljaven elektronski naslov!");
	form.email.focus();
	return false ;
  }
  if (form.teh.value == "") {
	alert("Prosimo vnesite vsebino sporočila!");
	form.teh.focus();
	return false ;
  }

  return true ;
}


function checkformzaposlovanje ( form ) // to je za formo zaposlovanje
{
  if (form.ime.value == "") {
	alert("Prosimo vnesite ime in priimek!");
	form.ime.focus();
	return false ;
  }
  if (form.naslov.value == "") {
	alert("Prosimo vnesite vaš naslov!");
	form.naslov.focus();
	return false ;
  }
  if (!isValidEmail(form.email.value)) {
	alert("Prosimo vnesite veljaven elektronski naslov!");
	form.email.focus();
	return false ;
  }
  if (form.tel.value == "") {
	alert("Prosimo vnesite vašo telefonsko številko!");
	form.tel.focus();
	return false ;
  }
  if (form.teh.value == "") {
	alert("Prosimo vnesite vsebino sporočila!");
	form.teh.focus();
	return false ;
  }

  return true ;
}



function isValidEmail(str) {

return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);



}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/ 

var w=1
var h=1

if (document.getElementById || document.all)
document.write('<div id="trailimageid" style="position:absolute;visibility:hidden;left:0px;top:-1000px;width:1px;height:1px;border:1px solid #888888;background:#DDDDDD;"><img id="ttimg" src="img/s.gif" /></div>')

function gettrailobj()
{
	if (document.getElementById) return document.getElementById("trailimageid").style
	else if (document.all) return document.all.trailimagid.style
}

function truebody()
{
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function hidetrail()
{
	document.onmousemove=""
	document.getElementById('ttimg').src='img/s.gif'
	gettrailobj().visibility="hidden"
	gettrailobj().left=-1000
	gettrailobj().top=0
}


function showtrail(width,height,file)
{
	if(navigator.userAgent.toLowerCase().indexOf('opera') == -1 && navigator.userAgent.toLowerCase().indexOf('safari') == -1)
	{
		w=width
		h=height
		
		// followmouse()
	
		gettrailobj().visibility="visible"
		gettrailobj().width=w+"px"
		gettrailobj().height=h+"px"
		document.getElementById('ttimg').src=file
		document.onmousemove=followmouse
	}
}


function followmouse(e)
{

	if(navigator.userAgent.toLowerCase().indexOf('opera') == -1 && navigator.userAgent.toLowerCase().indexOf('safari') == -1)
	{

		var xcoord=20
		var ycoord=20

		if (typeof e != "undefined")
		{
			xcoord+=e.pageX
			ycoord+=e.pageY
		}
		else if (typeof window.event !="undefined")
		{
			xcoord+=truebody().scrollLeft+event.clientX
			ycoord+=truebody().scrollTop+event.clientY
		}

		var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
		var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)

		if (xcoord+w+3>docwidth)
		xcoord=xcoord-w-(20*2)

		if (ycoord-truebody().scrollTop+h>truebody().clientHeight)
		ycoord=ycoord-h-20;

		gettrailobj().left=xcoord+"px"
		gettrailobj().top=ycoord+"px"

	}

}



/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe", "myframe2"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 50 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

/* zavihki, potreben tudi css */

function showHide(id) {
	el = document.getElementById(id)
	; el.style.display = el.style.display == 'block' ? 'none' : 'block';
}

function showAll(p) {
	if ( isNaN(p) ) {
		var i = 0; 
		do {
			if ( document.getElementById(p+i) ) {
				document.getElementById(p+i).style.display = 'block';
			} 
			i++;
		} while ( document.getElementById(p+i) );
	}
}


function hideAll(p) {
	if ( isNaN(p) ) {
		var i = 0;
		do {
			if ( document.getElementById(p+i) ) {
				document.getElementById(p+i).style.display = 'none';
			} 
			i++; 
		} while ( document.getElementById(p+i) );
	}
}
// end of frame resize functions

function navigation(srp)
{
	document.getElementById('tab1').className = 'kontaktSubMenuUnselect';
	document.getElementById('tab2').className = 'kontaktSubMenuUnselect';
	document.getElementById('tab3').className = 'kontaktSubMenuUnselect';
	document.getElementById('tab4').className = 'kontaktSubMenuUnselect';
	document.getElementById('tab5').className = 'kontaktSubMenuUnselect';
	document.getElementById('tab6').className = 'kontaktSubMenuUnselect';
	document.getElementById(srp).className = 'kontaktSubMenuSelect';
}


function changeBorder(objID) {
	
		document.getElementById(objID).className = 'tabelaBackOver';
		document.getElementById(objID).style.cursor='pointer';
	}
function restoreBorder(objID)	{
	
		document.getElementById(objID).className = 'tabelaBack';

}