

function trazisto()
{
 if(document.forma12.sve.checked)
 {
   document.forma12.katpro.checked=true
   document.forma12.nazpro.checked=true
   document.forma12.opipro.checked=true

   document.forma12.katpro.disabled=true
   document.forma12.nazpro.disabled=true
   document.forma12.opipro.disabled=true
 } else {
   document.forma12.katpro.checked=false
   document.forma12.nazpro.checked=false
   document.forma12.opipro.checked=false

   document.forma12.katpro.disabled=false
   document.forma12.nazpro.disabled=false
   document.forma12.opipro.disabled=false
 }

}


function provjeri_izraz_s(koji)
{
  p1=forma12.poruka.value

  if(koji==1)
  {
     r=forma12.trazi.value;
  } else {
     r=forma13.trazi.value;
  }
  aa=r.length;

  if (aa<2)
  {
    alert(p1)

    if(koji==1)
    {
       r=forma12.trazi.value='';
       forma12.trazi.focus()
       return false
    } else {
       r=forma13.trazi.value='';
       forma13.trazi.focus()
       return false
    }
  } else {
    if(koji==1)
    {
       return true
    } else {
       return true
    }


  }
}



function provjeri_izraz(koji)
{
  if(koji==1)
  {
     r=forma12.trazi.value
     p1=forma12.poruka.value
  } else {
     r=forma13.trazi.value
     p1=forma13.poruka.value
  }
  aa=r.length;

  if (aa<2)
  {
    alert(p1)

    if(koji==1)
    {
       r=forma12.trazi.value=''
       forma12.trazi.focus()
       return false;
    } else {
       r=forma13.trazi.value=''
       forma13.trazi.focus()
       return false;
    }
  } else {
    if(koji==1)
    {
       forma12.submit()
    } else {
       forma13.submit()
    }
  }
}

function sb_start(y)
{
   y.submit()
}


function kolicina_val(y,minimum,poruka)
{


   kol=y.kolicina.value;

   if (minimum>kol)
     {
	alert(poruka+' '+minimum+' !   ')
	y.kolicina.value=minimum;
     }
   y.submit()
}

function izbaci(forma)
{

   g=forma.poruka.value;
   z=confirm(g);

   if (z)
      {
	forma.submit()
      }
}

function isprazni()
{

   g=document.izbacisve.poruka.value;
   z=confirm(g);

   if (z)
      {
	document.izbacisve.submit()
      }
}

function blokiraj()
{
   return false;
}



function newsletter()
{
	p1=document.newsletter.poruka.value
	b=document.newsletter.email.value

	g=b.match(/@/gi)
	h=b.match(/\./gi)

	if(g!=null && h!=null)
	{
	  document.newsletter.submit()
	} else {
	  alert(p1)
	  document.newsletter.email.value=''
	  document.newsletter.email.focus()
	}
}

function newsletter_s()
{
	p1=document.newsletter.poruka.value
	b=document.newsletter.email.value

	g=b.match(/@/gi)
	h=b.match(/\./gi)

	if(g!=null && h!=null)
	{
	  return true;
	} else {
	  alert(p1)
	  document.newsletter.email.value=''
	  document.newsletter.email.focus()
	  return false;
	}
}





function suradnja()
{
	document.suradnja.submit()
}

function promjena_kategorije()
{
    window.location="oglasi.php?id_g="+document.kategorije.trazena_kategorija.value+"&id_p="+document.kategorije.prikaz.value;
}


function addbookmark()
{
var bookmarkurl="http://www.lolas-sexy-europe.com"
var bookmarktitle="LOLAS SEXY EUROP"

if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}


function novi(smije,poruka)
  {
    if (smije==1)
    {
       window.location="upis.php";
    } else {
       alert(poruka)
    }
  }

function kopiraj(x,smije,poruka)
  {
    if (smije==1)
    {
    window.location="kopiraj.php?id="+x;
    } else {
       alert(poruka)
    }

  }

function izmjena(x)
  {
    window.location="upis.php?id="+x;
  }

function stranica(strana,kat)
  {
    window.location="kat.php?str="+strana+"&kat="+kat;
  }


function pozovi(x)
  {
     window.location=x;
  }

function udi(x,y)
  {
     z=x+'?ulazni_jezik='+y
     window.location=z;
  }

function set(x)
  {
     window.location="set.php?ide="+x;
  }

function vrati(x)
{
    window.location=x;
}

function pregled(x)
{
    window.location="pregled.php?id="+x;
}

function brisanje(x,y,smije,poruka)
{

    if (smije==1)
    {
	z=confirm(y);

	if (z)
	   {
	      window.location="brisanje.php?id="+x;
	   }
    } else {
       alert(poruka)
    }

}


function forma_korisnik()
{

p1=novi_korisnik.poruka1.value
p2=novi_korisnik.poruka2.value
p3=novi_korisnik.poruka3.value

    if (novi_korisnik.password.value=='' || novi_korisnik.password_potvrda.value==''  || novi_korisnik.email.value=='' || novi_korisnik.nadimak.value=='')
    {
       alert(p1)

       return false;
    }

    if (novi_korisnik.password.value!=novi_korisnik.password_potvrda.value)
    {
       alert(p2)
       novi_korisnik.password_potvrda.value="";
       novi_korisnik.password.value="";

       return false;
    }

    if (novi_korisnik.password.value.length<6)
    {

       alert(p3)

       novi_korisnik.password_potvrda.value="";
       novi_korisnik.password.value="";

       return false;
    }


    return true;
}

function forma_kupac(p1,p2,p3,p4,p5,p6,p7)
{

    if (kupac.ime_frm.value=='')
    {
       alert(p1)

       return false;
    }
    if (kupac.prezime_frm.value=='')
    {
       alert(p2)

       return false;
    }
    if (kupac.ulica_frm.value=='')
    {
       alert(p3)

       return false;
    }
    if (kupac.email_frm.value=='')
    {
       alert(p4)

       return false;
    }
    if (kupac.grad_frm.value=='')
    {
       alert(p5)

       return false;
    }
    if (kupac.posta_frm.value=='')
    {
       alert(p6)

       return false;
    }
    if (kupac.drzava_frm.value==0)
    {
       alert(p7)

       return false;
    }


    return true;
}

function prijava_korisnika()
{

    if (logiranje.korisnik.value=='')
    {
       alert(logiranje.p1.value)
       logiranje.korisnik.focus()
	   return
    }

    if (logiranje.sifra.value=='')
    {
       alert(logiranje.p2.value)
       logiranje.sifra.focus()
  	   return
    }
	
	logiranje.submit()

}

function prijava_korisnika2()
{

    if (logiranje2.korisnik.value=='')
    {
       alert(logiranje2.p1.value)
       logiranje2.korisnik.focus()
	   return
    }

    if (logiranje2.sifra.value=='')
    {
       alert(logiranje2.p2.value)
       logiranje2.sifra.focus()
  	   return
    }
	
	logiranje2.submit()

}



function forma_oglas(p1,p2,p3,p4,p5)
{

    if (oglas.pseudonim.value=='')
    {
       alert(p1)

       return false;
    }

    if (oglas.email.value=='')
    {
       alert(p2)

       return false;
    }

    if (oglas.tekst_oglasa.value=='')
    {
       alert(p3)

       return false;
    }

    if (oglas.kategorija.value==0)
    {
       alert(p4)

       return false;
    }

    duzina=oglas.fotografija.value.length;
    format_foto=oglas.fotografija.value.substr(duzina-3,3);

    if (oglas.fotografija.value!='')
    {
      if (format_foto!='jpg')
      {
	 alert(p5)

	 return false;
      }
    }

    return true;
}


function forma_salji_log()
{
	
	p1=document.salji_log.poruka.value
	b=document.salji_log.email.value

	g=b.match(/@/gi)
	h=b.match(/\./gi)

	if(g!=null && h!=null)
	{
	  document.salji_log.submit()
	} else {
	  alert(p1)
	  document.salji_log.email.value=''
	  document.salji_log.email.focus()
      return false
	}		
}

function forma_salji_log_s()
{
	
	p1=document.salji_log.poruka.value
	b=document.salji_log.email.value

	g=b.match(/@/gi)
	h=b.match(/\./gi)

	if(g!=null && h!=null)
	{
	  document.salji_log.submit()
	} else {
	  alert(p1)
	  document.salji_log.email.value=''
	  document.salji_log.email.focus()
	}		
}



function izmjena_sifre(p1,p2,p3)
{

    if (izmjena_lozinke.password.value=='' || izmjena_lozinke.password_potvrda.value=='')
    {
       alert(p1)
       return false;
    }

    if (izmjena_lozinke.password.value!=izmjena_lozinke.password_potvrda.value)
    {
       alert(p2)

       izmjena_lozinke.password_potvrda.value="";
       izmjena_lozinke.password.value="";

       return false;
    }


    if (izmjena_lozinke.password.value.length<6)
    {

       alert(p3)

       izmjena_lozinke.password_potvrda.value="";
       izmjena_lozinke.password.value="";

       return false;
    }



    return true;
}

/****
* Banner Ad Rotater v3.02
* Anarchos > anarchos3@hotmail.com
* http://anarchos.xs.mw/bannerad.phtml
**/

function Banner(refreshTime, width, height, altText, start, random){
	this.objName = "bannerAd" + (Banner.count++);
	eval(this.objName + "=this");
	if (!refreshTime) this.refreshTime = 5000; else this.refreshTime = refreshTime*1000;
	if (!width) this.width = 460; else this.width = width;
	if (!height) this.height = 68; else this.height = height;
	if (random == null) this.random = 1; else this.random = random;
	this.altText = altText;
	this.ads = [];
	if (start) this.currentAd = start-1; else start = null;
	this.mySize = 0;

	this.Ad = function(src, href, target, mouseover) {
		var tempImage = new Image();
		tempImage.src = src;
		this.ads[this.mySize] = new Object();
		var ad = this.ads[this.mySize];
		ad.src = src;
		if (typeof(target) == "undefined" || target == null) ad.target = "_self"; else ad.target = target;
		ad.href = href;
		ad.mouseover = mouseover;
		this.mySize++;
	}

	this.link = function(){
		var	ad = this.ads[this.currentAd];
		if (ad.target == "_self"){
			location.href = ad.href;
		}
		else if (ad.target == "_blank" || ad.target == "_new"){
			open(ad.href,this.objName + "Win");
		}
		else top.frames[ad.target].location.href = ad.href;
	}

	this.showStatus = function(){
		var ad = this.ads[this.currentAd];
		if (ad.mouseover) status = ad.mouseover;
		else status = ad.href;
	}

	this.randomAd = function(){
		var n;
		do { n = Math.floor(Math.random() * (this.mySize)); }
		while(n == this.currentAd);
		this.currentAd = n;
	}

	this.output = function(){
		var tempCode = "";
		if (this.mySize > 1){
			if (this.currentAd == null) this.randomAd();
			if (this.currentAd >= this.mySize) this.currentAd = this.mySize - 1;
			tempCode = '<a href="javascript:'+this.objName+'.link();"';
			tempCode += ' onMouseOver="' + this.objName + '.showStatus(); return true"';
			tempCode += ' onMouseOut="status=\'\';return true">';
			tempCode += '<img src="' + this.ads[this.currentAd].src + '" width="' + this.width;
			tempCode += '" name="' + this.objName + 'Img" height="' + this.height + '" ';
			if (this.altText) tempCode += 'alt="'+this.altText + '" ';
			tempCode += 'border="0" /></a>';
			document.write(tempCode);
			this.nextAd();
		} else document.write("Error: two banners must be defined for the script to work.");
	}

	this.newAd = function(){
		if (!this.random){
			this.currentAd++;
			if (this.currentAd >= this.mySize)
			   this.currentAd = 0;
		}
		else {
			this.randomAd();
		}
		this.nextAd();
	}

	this.nextAd = function(){
		document.images[this.objName+ 'Img'].src = this.ads[this.currentAd].src;
		setTimeout(this.objName+'.newAd()',this.refreshTime)
	}
}
Banner.count = 0;


