

function checkEmail()
{
	var arg = arg;
	var x = document.enovice.email.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)) 
	{
		return true;
	}
	else
	{
		alert('Vnesli ste napacen email naslov! Prosimo vnesite pravilnega.');
		return false;
	}	
}

function checkRadio(forma,radio)
{
	var form = forma;
	var rad = radion;
	if(NoneWithCheck(document.form.rad))
	{
		alert('Najprej oznacite enega od odgovorov!');
		return false;
	}
	
	function NoneWithCheck(ss) {
		for(var i = 0; i < ss.length; i++) {
			if(ss[i].checked) { return false; }
		}
		return true;
	}
}
function checkTxtField()
{
	if(WithoutContent(document.onlineorder.st_izvodov_1.value) && WithoutContent(document.onlineorder.st_izvodov_2.value) && WithoutContent(document.onlineorder.st_izvodov_3.value) && WithoutContent(document.onlineorder.st_izvodov_4.value))
	{
		alert('Vnesite narocilo in izpolnite polja z osebnimi podatki, ki so oznacena z zvezdico!');
		return true;
	}
	
	function WithoutContent(ss)
	{
		if(ss.length > 0) { return false; }
		else { return true; }
	}
}

function ResetForm(id_form)
{

 var first=-1
  for (i=0;i<id_form.length;i++){
    var obj = id_form.elements[i]
    if (obj.type=="text") {
      eval(obj.value="")
      if (first==-1) {first=i}
    }
  }
  id_form.elements[first].focus()
  return true
}

function addValue(cId,cValue)
{
	document.getElementById(cId).value = cValue;
}

function addMValues(aId,aValue)
{
	var n = aId.length;
	for (i=0; i<n; i++)
	{
		cid = aId[i];
		document.getElementById(cid).value = aValue[i];
	}
}

function checkPoll(cSex)
{
	nAnsValue = -1;
	nCount = document.getElementById('anketa').ans.length;
	
	for (i=0;i<nCount;i++) {
		oAns = document.getElementById('anketa').ans[i];
		
		if (oAns.checked == true) {
			nAnsValue = oAns.value;
			break;
		}
	}

	if (nAnsValue > 0) {
		document.getElementById('sex').value = cSex;
		document.getElementById('anketa').submit();
	} else {
		alert('Pozabili ste izbrati odgovor.');
	}
}

function checkForShow()
{
	if(document.onlineorder.poseba[0].checked==true)
	{
		Show('yes','div_poseba');
	}
	if(document.onlineorder.dostava[0].checked==true)
	{
		Show('yes','div_dostava');
	}
}

function Show(i_name,id_name) 
{
	//alert(i_name);
	document.getElementById(id_name).style.display='none';
	if (i_name=='yes') 
	{
		document.getElementById(id_name).style.display='block';
	}
}


function Display(e_id,e_display)
{
    document.getElementById(e_id).style.display='none';
    if (e_display=='show') {
        document.getElementById(e_id).style.display='block';
    }
}

function quantityCart(item,itemvalue,formid)
{
	if (document.getElementById(item).value != itemvalue) {
		document.getElementById(formid).submit();
	} else {
		return false;
	}
}

function formSubmit(e_id)
{
    document.getElementById(e_id).submit();
	//alert(document.getElementById(e_id));
}

function ShowSignup(checkbox_id,display_id)
{
	document.getElementById(display_id).style.display = "";		
	if(	document.getElementById(checkbox_id).checked)
	{
		document.getElementById(display_id).style.display = "";
	}
	else
	{
		document.getElementById(display_id).style.display = "none";

	}
}

function HideSignup(checkbox_id,display_id)
{
	document.getElementById(display_id).style.display = "";		
	if(	document.getElementById(checkbox_id).checked)
	{
		document.getElementById(display_id).style.display = "none";
	}
	else
	{
		document.getElementById(display_id).style.display = "";

	}
}

function ShowHide(e_id)
{
    if (document.getElementById(e_id).style.display = "none") {
        document.getElementById(e_id).style.display = "block";
    } else {
        document.getElementById(e_id).style.display = "none";
    }
}

<!--
/*
Plugin detection & banner display
*/

var plugin = 0;
var forcheck = false;
if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
        if (navigator.plugins && navigator.plugins["Shockwave Flash"])
			plugin = 1;
			
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
   && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
        document.write('<script language="VBScript"\> \n');
        document.write('on error resume next \n');
        document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")))\n');
        document.write('if ( plugin <= 0 ) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
        document.write('if ( plugin <= 0 ) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
		document.write('//plugin= 1;\n');
        document.write('</script\> \n');
}

function flashBannerStr(bannerName, bannerWidth, bannerHeight, bannerLink, bannerSRC) {
                var BannerLinkEncode;
                bannerLinkEncode = escape(bannerLink);
                s = new String();
                s = s + '<object id="flash'+bannerName+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
                s = s + ' codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0" ';
                s = s + ' id="' + bannerName + '" width="' + bannerWidth + '" height="' + bannerHeight + '"\> \n';
                s = s + ' <param name="movie" value="' + bannerSRC +'?clickthru=' + bannerLinkEncode +'" /> \n';
                s = s + ' <param name="quality" value="high"/> \n';
                s = s + ' <embed src="' + bannerSRC +'?clickthru=' + bannerLinkEncode +'" quality="high" ';
                s = s + ' swLiveConnect="false" width="' + bannerWidth + '" height="' + bannerHeight + '" ';
                s = s + ' type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">';
                s = s + ' </embed> \n';
                s = s + ' </object>\n';
        return(s);
}


function flashBanner(bannerName,bannerSRC,bannerIMG, bannerWidth, bannerHeight, bannerLink){
	if ( plugin && bannerSRC!="") {
		document.write(flashBannerStr(bannerName, bannerWidth, bannerHeight, bannerLink, bannerSRC));

	}
	else if (!(navigator.appname && navigator.appname.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
		document.write('<a href="' + bannerLink + '" onclick="this.target=\'_blank\'"><img src="' + bannerIMG + '" width="' + bannerWidth + '" height="' + bannerHeight + '" border="0" /></a>');
	}
}


function openWindowPrint(cHtml,cWidth,cHeight)
{
	var scr= screen.availWidth;
	scr= (scr - 400)/2;
	openW=window.open(cHtml,"openW","'scrolling=no,menubar=yes,toolbar=0,scrollbars=0,resizable=1,left="+scr+",top=100,width="+cWidth+",height="+cHeight,true);

	return false;
}


function menudisplay(cUrl, bHover, cId)
{
	var scr = getElementById(cId);
	scr.style.color = 'blue';
}


function searchBlur(obj)
{
	if (obj.value == '') {
		obj.value='Vpišite iskalni niz ...';
	}
}

function searchFocus(obj)
{
	if (obj.value=='Vpišite iskalni niz ...') {
		obj.value='';
	}
}