function stanje(program) {
  if (program=='jp') return 78015;
  if (program=='df') return 117665;
  if (program=='im') return 135329;
  if (program=='gc') return 345263;
  if (program=='cv') return 67418;
  if (program=='am') return 80153;
  if (program=='ms') return 169181;
  if (program=='is') return 43165;
  if (program=='14') return 34986;
  if (program=='bt') return 86520;
  if (program=='lc') return 43243;
  if (program=='pd') return 1162012;
  if (program=='ir') return 1414858;
  if (program=='sc') return 2634;
  if (program=='nh') return 57767;
  if (program=='bs') return 48795;
  if (program=='dc') return 55073;
  if (program=='a8') return 33235;
  if (program=='wm') return 27140;
  if (program=='ik') return 30143;
  if (program=='er') return 49602;  
}


function ostali(jez) {
pot = 'http://www.mihov.com/';

if (jez == 'slo') {
 je = 'sw/si';
 return ( '<A HREF="' + pot + je + '/jp.php">Mihov JPEGar</A><BR>' +
          '<A HREF="' + pot + je + '/df.php">Mihov DiskFree</A><BR>' +
          '<A HREF="' + pot + je + '/im.php">Mihov Index Maker</A><BR>' +
          '<A HREF="' + pot + je + '/gc.php">Mihov Gallery Creator</A><BR>' +
          '<A HREF="' + pot + je + '/cv.php">Mihov CodeView</A><BR>' +
          '<A HREF="' + pot + je + '/am.php">Mihov ASCII Master</A><BR>' +
          '<A HREF="' + pot + je + '/ms.php">Mihov Mail Sender</A><BR>' +
          '<A HREF="' + pot + je + '/is.php">Mihov Info Saver</A><BR>' +
          '<A HREF="' + pot + jez + '/nh.html">Mihov NSIS Helper</A><BR>' +
          '<A HREF="' + pot + je + '/14.php">Mihov Program No 14</A><BR>' +
          '<A HREF="' + pot + je + '/bt.php">Mihov Background Tester</A><BR>' +
          '<A HREF="' + pot + je + '/bs.php">Mihov Blank Screen</A><BR>' +
          '<A HREF="' + pot + je + '/lc.php">Mihov Link Checker</A><BR>' +
          '<A HREF="' + pot + je + '/pd.php">Mihov Picture Downloader</A><BR>' +
          '<A HREF="' + pot + je + '/dc.php">Mihov DPI to Pixel Calculator</A><BR>' +
          '<A HREF="' + pot + je + '/a8.php">Mihov Active 800x600</A><BR>' +
          '<A HREF="' + pot + je + '/ik.php">Mihov IP King</A><BR>' +
          '<A HREF="' + pot + je + '/er.php">Mihov EXIF Renamer</A><BR>' +
          '<A HREF="' + pot + je + '/sc.php">Mihov števec črk</A><BR>' +
          '<A HREF="' + pot + je + '/wm.php">Mihov Website Merger</A><BR>' +
          '<A HREF="' + pot + je + '/ir.php">Mihov Image Resizer</A><BR>'
        );
}

if (jez == 'eng') {
 je = 'sw/en'; 
 return ( '' +
          '<A HREF="' + pot + je + '/a8.php">Mihov Active 800x600</A><BR>' +
          '<A HREF="' + pot + je + '/am.php">Mihov ASCII Master</A><BR>' +
          '<A HREF="' + pot + je + '/bt.php">Mihov Background Tester</A><BR>' +
          '<A HREF="' + pot + je + '/bs.php">Mihov Blank Screen</A><BR>' +
          '<A HREF="' + pot + je + '/cv.php">Mihov CodeView</A><BR>' +
          '<A HREF="' + pot + je + '/df.php">Mihov DiskFree</A><BR>' +
          '<A HREF="' + pot + je + '/dc.php">Mihov DPI to Pixel Calculator</A><BR>' +
          '<A HREF="' + pot + je + '/er.php">Mihov EXIF Renamer</A><BR>' +
          '<A HREF="' + pot + je + '/gc.php">Mihov Gallery Creator</A><BR>' +
          '<A HREF="' + pot + je + '/ir.php">Mihov Image Resizer</A><BR>' +
          '<A HREF="' + pot + je + '/im.php">Mihov Index Maker</A><BR>' +
          '<A HREF="' + pot + je + '/is.php">Mihov Info Saver</A><BR>' +
          '<A HREF="' + pot + je + '/ik.php">Mihov IP King</A><BR>' +
          '<A HREF="' + pot + je + '/jp.php">Mihov JPEGar</A><BR>' +
          '<A HREF="' + pot + je + '/lc.php">Mihov Link Checker</A><BR>' +
          '<A HREF="' + pot + je + '/ms.php">Mihov Mail Sender</A><BR>' +
          '<A HREF="' + pot + jez + '/nh.html">Mihov NSIS Helper</A><BR>' +
          '<A HREF="' + pot + je + '/pd.php">Mihov Picture Downloader</A><BR>' +
          '<A HREF="' + pot + je + '/14.php">Mihov Program No 14</A><BR>' +
          '<A HREF="' + pot + je + '/sc.php">Mihov Stevec Crk</A><BR>' +
          '<A HREF="' + pot + je + '/wm.php">Mihov Website Merger</A><BR>'
        );
}

if (jez == 'deu') {
 je = 'sw/de';
 return ( '<A HREF="' + pot + je + '/jp.php">Mihov JPEGar</A><BR>' +
          '<A HREF="' + pot + je + '/df.php">Mihov DiskFree</A><BR>' +
          '<A HREF="' + pot + je + '/im.php">Mihov Index Maker</A><BR>' +
          '<A HREF="' + pot + je + '/gc.php">Mihov Gallery Creator</A><BR>' +
          '<A HREF="' + pot + je + '/cv.php">Mihov CodeView</A><BR>' +
          '<A HREF="' + pot + je + '/am.php">Mihov ASCII Master</A><BR>' +
          '<A HREF="' + pot + jez + '/ms.html">Mihov Mail Sender</A><BR>' +
          '<A HREF="' + pot + jez + '/is.html">Mihov Info Saver</A><BR>' +
          '<A HREF="' + pot + jez + '/nh.html">Mihov NSIS Helper</A><BR>' +
          '<A HREF="' + pot + je + '/14.php">Mihov Program No 14</A><BR>' +
          '<A HREF="' + pot + je + '/bt.php">Mihov Background Tester</A><BR>' +
          '<A HREF="' + pot + jez + '/bs.html">Mihov Blank Screen</A><BR>' +
          '<A HREF="' + pot + jez + '/lc.html">Mihov Link Checker</A><BR>' +
          '<A HREF="' + pot + je + '/pd.php">Mihov Picture Downloader</A><BR>' +
          '<A HREF="' + pot + je + '/dc.php">Mihov DPI to Pixel Calculator</A><BR>' +
          '<A HREF="' + pot + je + '/a8.php">Mihov Active 800x600</A><BR>' +
          '<A HREF="' + pot + je + '/ik.php">Mihov IP King</A><BR>' +
          '<A HREF="' + pot + 'sw/en' + '/er.php">Mihov EXIF Renamer</A><BR>' +
          '<A HREF="' + pot + 'sw/en' + '/sc.php">Mihov Stevec Crk</A><BR>' +
          '<A HREF="' + pot + je + '/wm.php">Mihov Website Merger</A><BR>' +
          '<A HREF="' + pot + je + '/ir.php">Mihov Image Resizer</A><BR>'
        );
}
}


function reklama(jez) {
     if (jez == 'eng') {
        i= Math.floor(5 * Math.random(0));
         // MAGIC CALENDAR MAKER
        if (i==0) { return ('<a href="http://www.magicproject.com/calendarmaker/index.php" target="new"><img src="http://www.magicproject.com/calendarmaker/title.gif" width="468" height="60" alt="Magic Calendar Maker can make handy calendars instantly!" border="0"></a>')};
         // MAGIC PROJECT
        if (i==1) { return ('<a href="http://www.magicproject.com" target="new"><img src="http://www.magicproject.com/banner/magic468.gif" width="468" height="60" alt="Magic Project Software to meet users needs!" border="0"></a>')};
         // MAGIC SCREENSAVER MASTER
        if (i==2) { return ('<a href="http://www.magicproject.com/screensavermaster" target="new"><img src="http://www.magicproject.com/banner/magic-sm-468.gif" width="468" height="60" alt="You can finally control your screensaver and your desktop just with mouse movements!" border="0"></a>')};
         // MAGIC MATCHING COLOR
        if (i==3) { return ('<a href="http://www.matchingcolor.com/" target="new"><img src="http://www.matchingcolor.com/matchingcolor_banner.gif" width="468" height="60" alt="Magic Matching Color will help you find the right colors for your web site instantly!" border="0"></a>')};
         // MAGIC MATCHING COLOR
        if (i==4) { return ('<a href="http://www.matchingcolor.com/" target="new"><img src="http://www.matchingcolor.com/matchingcolor_banner.gif" width="468" height="60" alt="Magic Matching Color will help you find the right colors for your web site instantly!" border="0"></a>')};


     }

     if (jez == 'slo') {
        i= Math.floor(4 * Math.random(0));
          // BREZPLACNO.COM
        if (i==0) { return ('<a href="http://www.brezplacno.com" target="_top" ><img src="http://www.mihov.com/r/brez-rekl1.gif" width="468" height="60" alt="Same brezplačne stvari na internetu!" border="0"></a>')};
          // BREZPLACNO.COM
        if (i==1) { return ('<a href="http://www.brezplacno.com" target="_top" ><img src="http://www.mihov.com/r/b-bp.gif" width="468" height="60" alt="Same brezplačne stvari na internetu!" border="0"></a>')};
         // MAGIC PROJECT
        if (i==2) { return ('<a href="http://www.magicproject.com" target="new"><img src="http://www.magicproject.com/banner/magic468.gif" width="468" height="60" alt="Magic Project Software to meet users needs!" border="0"></a>')};
         // MAGIC CALENDAR MAKER
        if (i==3) { return ('<a href="http://www.magicproject.com/calendarmaker/index.php" target="new"><img src="http://www.magicproject.com/calendarmaker/title.gif" width="468" height="60" alt="Magic calendar Maker can make handy calendars instantly!" border="0"></a>')};
     }

     if (jez == 'deu') {
        i= Math.floor(4 * Math.random(0));
         // MAGIC CALENDAR MAKER
        if (i==0) { return ('<a href="http://www.magicproject.com/calendarmaker/index.php" target="new"><img src="http://www.magicproject.com/calendarmaker/title.gif" width="468" height="60" alt="Magic calendar Maker can make handy calendars instantly!" border="0"></a>')};
         // MAGIC PROJECT
        if (i==1) { return ('<a href="http://www.magicproject.com" target="new"><img src="http://www.magicproject.com/banner/magic468.gif" width="468" height="60" alt="Magic Project Software to meet users needs!" border="0"></a>')};
         // MAGIC SCREENSAVER MASTER
        if (i==2) { return ('<a href="http://www.magicproject.com/screensavermaster" target="new"><img src="http://www.magicproject.com/banner/magic-sm-468.gif" width="468" height="60" alt="You can finally control your screensaver and your desktop just with mouse movements!" border="0"></a>')};
         // MAGIC MATCHING COLOR
        if (i==3) { return ('<a href="http://www.matchingcolor.com/" target="new"><img src="http://www.matchingcolor.com/matchingcolor_banner.gif" width="468" height="60" alt="Magic Matching Color will help you find the right colors for your web site instantly!" border="0"></a>')};

     }

//konec
}


function tellfriend(jez) {
    if (jez == 'eng') 
        return ('Tell your friend about this site! Let him download all the freeware, too!');
    if (jez == 'slo') 
        return ('Povej prijateljem za to stran! Naj si še oni zastonj naložijo Mihove programe!');
    if (jez == 'deu') 
        return ('Erzählen Sie Ihrem Freunden von dieser Seite. Lassen Sie auch Ihnen das ganze Freeware herunterladen!');
}


function moreinfo(jez, prog) {
    if (jez == 'eng') 
        return ('Subscribe to Miha\'s utilities Google group and receive an e-mail when the programs are updated and new versions are released (in English).<form action="http://groups-beta.google.com/group/mihov/boxsubscribe">Email:<input type=text name=email><input type=submit name="sub" value="Subscribe"></form>');
    if (jez == 'slo') 
        return ('Naročite se na Googlov poštni seznam Mihovih programčkov in vedno, ko bo izšla nova različica programa, boste prejeli kratko obvestilo o tem (v angleškem jeziku).<form action="http://groups-beta.google.com/group/mihov/boxsubscribe">Email:<input type=text name=email><input type=submit name="sub" value="Subscribe"></form>');
    if (jez == 'deu') 
        return ('Registrieren Sie sich auf der Google Mailing Liste um Neues von Mihas Utilities zu erfahren (auf Englisch).<form action="http://groups-beta.google.com/group/mihov/boxsubscribe">Email:<input type=text name=email><input type=submit name="sub" value="Subscribe"></form>');
}


function link(jez) {
    if (jez =='eng')
        return('Now you can link to Miha\'s utilities from your page! Use text links, buttons or banners - all prepared just for you! Click on <a href="link-eng.html">this link</a> to learn how!');
    if (jez =='slo')
        return('Dodajte povezavo iz Vaše strani na mojo stran! Uporabite lahko za to pripravljene povezave, gumbe in reklame. <a href="link-slo.html">Poglejte si kako</a>!');
    if (jez =='deu')
        return('Jetzt können Sie die Verbindung zur Mihas Programme von Ihrer Seite aus aufstellen! Gebrauchen Sie textuelle oder graphische Verbindungen, die ich nur für Sie besorgt habe. Klicken Sie <a href="link-deu.html">hier</a> um zu lernen wie!');
}


function lastversion(jez) {
    if (jez =='eng')
        return('The latest updates of all my programs can always be found on the <a href="http://www.mihov.com/update/" class="sre">update page</a>!');
    if (jez =='slo')
        return('Najnovejše verzije vseh mojih programov vedno najdete na strani <a href="http://www.mihov.com/update/" class="sre">novih verzij</a>!');
    if (jez =='deu')
        return('Letzte Versionen von allen meinen Programmen kann man immer <a href="http://www.mihov.com/update/" class="sre">hier</a> finden!');
}


function ordercd(jez) {
    if (jez =='eng')
        return('By buying the CD with ALL my programs (over 18!) you not only get great value but you also support the idea of free software and a young author. By ordering this CD you incourage me to write new versions of the programs, add new features to my programs, and keep me on the \'freeware track\' - not escaping into the world of shareware. Do you agree? Click <a href="ordercdnow.html">here</a> for details now!');
    if (jez =='slo')
        return('Zdaj lahko naročite CD, ki vsebuje VSE programe, ki sem jih naredil. Več kot deset programov na eni zgoščenki in ni se Vam treba več ukvarjati z downloadanjem vsakega programa posebej, kaj šele s počasnimi internetnimi povezavami! Če Vas zanima, si oglejte <a href="ordercd.html">podrobnosti</a>!');
    if (jez =='deu')
        return('Jetzt können Sie eine CD bestellen, die das ganze Freeware (über 18 Programme) von mir enthält. Ja, dass stimmt, Sie kriegen mehr als zehn Programme an einer CD, und müssen sich nicht mit den Herunterladen jedes einzelnen von denen beschäftigen. Interessiert? Klicken Sie <a href="ordercd.html">hier</a> für Detaile!');
}


function emailCheck (emailStr) {
var napaka="The e-mail address doesn't seem to be valid!"
//if (jez == 'slo') napaka= "Vpisan naslov ne izgleda pravilen!"
var emailPat=/^(.+)@(.+)$/
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
var validChars="\[^\\s" + specialChars + "\]"
var quotedUser="(\"[^\"]*\")"
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
var atom=validChars + '+'
var word="(" + atom + "|" + quotedUser + ")"
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
	alert(napaka)
	return false
}
var user=matchArray[1]
var domain=matchArray[2]
if (user.match(userPat)==null) {
    alert(napaka)
    return false
}
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
	        alert(napaka)
		return false
	    }
    }
    return true
}
var domainArray=domain.match(domainPat)
if (domainArray==null) {
	alert(napaka)
    return false
}
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 || 
    domArr[domArr.length-1].length>3) {
   alert(napaka)
   return false
}
if (len<2) {
   var errStr=napaka
   alert(errStr)
   return false
}
return true;
}
