
function print_content(http_path)
{
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n';

		html += '<link href="'+http_path+'common/print.css" rel=stylesheet type=text/css>\n';

		html += '\n</HEAD>\n<BODY>\n';

		html += '<div id="print_frame">';

		var printamo = document.getElementById("print_frame");
		html += printamo.innerHTML;
		html = html.replace(/overflow-x:/gi,"");
		html = html.replace(/scroll;/gi,"");


		html += '</div>';
		html += '\n</BODY>\n</HTML>';
		var printProzor = window.open("","printaj");
		printProzor.document.open();
		printProzor.document.write(html);
		printProzor.document.close();

		printProzor.print();
	}
}

function adjust_size(){

	var left_size=document.getElementById("left_menu").offsetHeight
	var middle_size=document.getElementById("center_content").offsetHeight
	var right_size=document.getElementById("right_content").offsetHeight

	max_height=Math.max(right_size, middle_size, left_size)

	document.getElementById("left_menu").style.height = max_height +"px";
	document.getElementById("center_content").style.height = max_height - 20 +"px";
	document.getElementById("right_content").style.height = max_height +"px";

}

function show_hide(element_id){

	if (document.getElementById(element_id).style.display == 'none')
	document.getElementById(element_id).style.display = 'block'
	else
	document.getElementById(element_id).style.display = 'none'

}

function change_data(id, inner_html){
	id2 = id+"_2";
	document.getElementById(id).innerHTML = inner_html;
	document.getElementById(id2).innerHTML = "<a href=\""+inner_html+"\" target=\"_blank\">Pogledaj</a>";
}

function change_data2(id, ftp, http, file, i){
	id2 = id+"_2";
	document.getElementById(id).innerHTML = "<a href=\"javascript:set_delete_file('"+ftp+file+"', '"+i+"');\">Izbriši</a>";
	document.getElementById(id2).innerHTML = "<a href=\""+http+file+"\" target=\"_blank\">Pogledaj</a>";
}

function set_delete_file(file, i){
	id = "delete_file_input_"+i;
	form_id = "delete_file_form_"+i;
	document.getElementById(id).value = file;
	document.forms[form_id].submit();
	return false;
}

function set_delete_directory(directory, i){
	id = "delete_directory_input_"+i;
	form_id = "delete_directory_form_"+i;
	document.getElementById(id).value = directory;
	document.forms[form_id].submit();
	return false;
}

var min_font=8;
var max_font=18;

function increase_font_size() {
	var p = document.getElementsByTagName('p');
	for(i=0;i<p.length;i++) {
		if(p[i].style.fontSize) {
			var s = parseInt(p[i].style.fontSize.replace("px",""));
		} else {
			var s = 12;
		}
		if(s!=max_font) {
			s += 1;
		}
		p[i].style.fontSize = s+"px"
	}
}

function premium_increase_font_size() {
	var p = document.getElementsByTagName('p');
	for(i=0;i<p.length;i++) {
		if(p[i].style.fontSize) {
			var s = parseInt(p[i].style.fontSize.replace("px",""));
		} else {
			var s = 14;
		}
		if(s!=max_font) {
			s += 1;
		}
		p[i].style.fontSize = s+"px"
	}
}

function decrease_font_size() {
	var p = document.getElementsByTagName('p');
	for(i=0;i<p.length;i++) {
		if(p[i].style.fontSize) {
			var s = parseInt(p[i].style.fontSize.replace("px",""));
		} else {
			var s = 12;
		}
		if(s!=min_font) {
			s -= 1;
		}
		p[i].style.fontSize = s+"px"
	}
}

function premium_decrease_font_size() {
	var p = document.getElementsByTagName('p');
	for(i=0;i<p.length;i++) {
		if(p[i].style.fontSize) {
			var s = parseInt(p[i].style.fontSize.replace("px",""));
		} else {
			var s = 14;
		}
		if(s!=min_font) {
			s -= 1;
		}
		p[i].style.fontSize = s+"px"
	}
}

function open_add(theURL,winName,features) {
	window.open(theURL,winName,features);
}

var advertisement_id = 1;
var poll_id = 1;

function window_onload(){
	adjust_size();
	treasury_js();
	this_month();
}

function treasury_js(){
	if(pdf_treasury == 1){
		alert('Ne postoji dokument za izabrani datum!');
	}
	return;
}

function change_page(page){
	document.getElementById("page").value = page;
	document.paging_form.submit();
}

function show_hide_budget(div_id){

	if (document.getElementById(div_id).style.display == 'none')
	document.getElementById(div_id).style.display = 'block'
	else document.getElementById(div_id).style.display = 'none'

}


    function create_http_request(){
        var request_;
        var browser = navigator.appName;
        if(browser == "Microsoft Internet Explorer"){
            request_ = new ActiveXObject("Microsoft.XMLHTTP");
        }
        else{
            request_ = new XMLHttpRequest();
        }
        return request_;
    }

    function vote(name, type){
        for (var i = 0; i < document.getElementsByName(name).length; i++)
        {
            if (document.getElementsByName(name)[i].checked)
            {
                var http_request = new Array();
                var new_date = new Date();
                http_request[new_date] = create_http_request();
                var params = "poll_ajax=true&anketa="+name+"&rezultat="+document.getElementsByName(name)[i].value+"&type="+type;
                http_request[new_date].open("POST", '<?php echo HTTP_PATH; ?>', true);
                http_request[new_date].setRequestHeader("Content-type", "application/x-www-form-urlencoded");
                http_request[new_date].setRequestHeader("Content-length", params.length);
                http_request[new_date].setRequestHeader("Connection", "close");

                http_request[new_date].onreadystatechange = function() {
                    if(http_request[new_date].readyState == 4 && http_request[new_date].status == 200) {
                        document.getElementById('anketa_rezultati').innerHTML = http_request[new_date].responseText;
                    }
                }
                http_request[new_date].send(params);                
                break;
            }
        }

    }



/* Old JS start */
function home() {
	if (navigator.userAgent.indexOf("Mozilla/3.0") != -1) version = "n3";
	else version = "n2";
	if (version == "n3") {
		window.close();
	}
	else {
		window.close();
	}
}
function makeNumValid( p_value ) {
	var strchar;
	var strctr;
	var strlen;
	var instr = p_value;
	var newstr;
	var tempstr;
	if( instr.indexOf('.') != instr.lastIndexOf('.') )
	return(-1);
	newstr = removeCommas( instr );
	strlen = newstr.length;
	exit = 0;
	tempstr = '';
	for( strctr=0; strctr <strlen; strctr++) {
		strchar = newstr.charAt(strctr);
		if( (strchar == '.') || (strchar == '0') || (strchar == '1') || (strchar == '2')
		|| (strchar == '3') || (strchar == '4') || (strchar == '5') || (strchar == '6')
		|| (strchar == '7') || (strchar == '8') || (strchar == '9'))
		tempstr = tempstr + strchar;
	}
	newstr = tempstr;
	if( exit == 1 )
	return(0);
	else
	return(newstr);
}
function roundFloat( s_value ) {
	var newval;
	s_value = parseFloat(s_value);
	newval = (Math.floor(s_value*100))/100;
	newval = newval + "";
	if ( newval.indexOf('.') == -1 )
	newval = newval + ".00";
	return(newval);
}
function removeCommas( t_value ) {
	var ctr;
	var newstr = t_value;
	var commapos;
	var strlen = t_value.length - 1;
	commapos = newstr.indexOf(',');
	while ( commapos != -1 ) {
		newstr = newstr.substring(0,commapos) +
		newstr.substring(commapos + 1, newstr.length );
		commapos = newstr.indexOf(',');
	}
	return(newstr);
}
function addCommas( u_value ) {
	var ctr;
	var decCtr=0;
	var decIndex;
	var decIncr = 3;
	var newstr = u_value;
	var strlen = u_value.length;
	decIndex = u_value.indexOf('.');
	if ( decIndex == -1 )
	decIndex = strlen;
	for ( ctr = decIndex-1; ctr > 0; ctr-- ) {
		decCtr++;
		if ( decCtr == 3 ) {
			newstr = newstr.substring(0,ctr) +
			"," +
			newstr.substring(ctr, strlen );
			strlen++;
			decCtr = 0;
		}
	}
	return(newstr);
}
function isDigit( v_value ) {
	if ( (v_value >= 0) || (v_value <= 9) )
	return(true);
	else
	return(false);
}
function resetTextField( textField ) {
	textField.value = roundFloat("0");
	textField.focus();
	textField.select();
}
//var v_MonthlyPaymentHold='';  hold montly payment for onchange event
function calcMonthlyPayment() {
	var v_HomePrice,
	v_InterestRate,
	v_DownPayment,
	v_InterestRate,
	v_Razdoblje,
	v_MonthlyPayment,
	v_Principle,
	v_formName = document.calc;
	// check values used to compute montly payment

	if ( confirmRazdobljeValues() ) {
		v_HomePrice = roundFloat( makeNumValid( v_formName.HomePrice.value ) );
		v_MonthlyPayment = roundFloat( makeNumValid( v_formName.MonthlyPayment.value ) );

		if (v_HomePrice != 0)  {
			v_DownPayment = 0;
			v_InterestRate = makeNumValid( v_formName.InterestRate.value ) / 100;
			v_Razdoblje = makeNumValid(v_formName.Razdoblje.options[v_formName.Razdoblje.selectedIndex].value);
			v_Principle = v_HomePrice - v_DownPayment;
			if ( v_Razdoblje == "" || v_Razdoblje == 0 )
			v_MonthlyPayment = v_Principle;
			else {
				v_MonthlyRate = v_InterestRate/12;
				if ( v_MonthlyRate != 0 )
				v_MonthlyPayment = Math.floor((v_Principle*v_MonthlyRate)/(1-Math.pow((1+v_MonthlyRate),
				(-1*(v_Razdoblje*12))))*100)/100;
				else  // no monthly rate
				v_MonthlyPayment = Math.floor((v_Principle / (v_Razdoblje*12)) * 100) / 100;
				if ( isNaN(v_MonthlyPayment) || v_MonthlyPayment <0 )
				v_MonthlyPayment = 0;
			}
			v_formName.MonthlyPayment.value = addCommas(roundFloat(v_MonthlyPayment));
		} else {

			v_InterestRate = makeNumValid( v_formName.InterestRate.value ) / 100;
			v_Razdoblje = makeNumValid(v_formName.Razdoblje.options[v_formName.Razdoblje.selectedIndex].value);
			v_Principle = v_MonthlyPayment;
			if ( v_Razdoblje == "" || v_Razdoblje == 0 )
			v_HomePrice = v_Principle;
			else {
				v_MonthlyRate = v_InterestRate/12;
				if ( v_MonthlyRate != 0 )
				v_HomePrice = Math.floor((v_Principle/v_MonthlyRate)*(1-Math.pow((1+v_MonthlyRate),
				(-1*(v_Razdoblje*12))))*100)/100;
				else  // no monthly rate
				v_HomePrice = Math.floor((v_Principle * (v_Razdoblje*12)) * 100) / 100;
				if ( isNaN(v_HomePrice) || v_HomePrice <0 )
				v_HomePrice = 0;
			}
			v_formName.HomePrice.value = addCommas(roundFloat(v_HomePrice));
		}

	}

}

function confirmRazdobljeValues() {
	var v_form = document.calc,
	v_HomePrice = v_form.HomePrice.value,
	v_MonthlyPayment = v_form.MonthlyPayment.value,
	v_DownPayment = 0, // v_form.DownPayment.value,
	v_InterestRate = v_form.InterestRate.value,
	v_Razdoblje = v_form.Razdoblje.options[v_form.Razdoblje.selectedIndex].value,
	v_tHomePrice,
	v_tMonthlyPayment,
	v_tDownPayment,
	t_tInterestRate,
	v_tRazdoblje,
	v_errorflag = 0,
	v_errorstr,
	v_returnval;
	// get values from fields
	v_tHomePrice = parseFloat(makeNumValid(v_HomePrice));
	v_tMonthlyPayment = parseFloat(makeNumValid(v_MonthlyPayment));
	if ( v_tHomePrice == '' || isNaN(v_tHomePrice) ) {
		v_form.HomePrice.value = 0;
		v_tHomePrice = 0;
	}
	if ( v_tMonthlyPayment == '' || isNaN(v_tMonthlyPayment) ) {
		v_form.MonthlyPayment.value = 0;
		v_tMonthlyPayment = 0;
	}
	v_tDownPayment = 0 // parseFloat(makeNumValid(v_DownPayment));
	v_tInterestRate = parseFloat(makeNumValid(v_InterestRate));
	v_tRazdoblje = Math.round(makeNumValid(v_Razdoblje));
	if ( v_tDownPayment <0 ) { // N3.x fix; -1 bleeds thru when 0
		v_tDownPayment = 0;
	}
	if ( v_tInterestRate == '' || isNaN(v_tInterestRate) ) {
		v_tInterestRate = 0;
	}
	// Traženi kredit <0 or  > 100,000,000
	if ( v_tMonthlyPayment >= 100000000 || v_tMonthlyPayment < 0 ) {
		v_errorstr = "Nažalost,  " + v_MonthlyPayment + " DM je kriva vrijednost.\nMolimo Vas da unesete vrijednost između 0,00 DM and 1,000,000.00 DM";
		v_form.MonthlyPayment.value = '';
		v_errorflag = 1;
		// Tražena rata <0 or  > 100,000,000
	} else if ( v_tHomePrice >= 100000000 || v_tHomePrice < 0 ) {
		v_errorstr = "Nažalost,  " + v_HomePrice + " DM je kriva vrijednost.\nMolimo Vas da unesete vrijednost između 0,00 DM and 1,000,000.00 DM";
		v_form.HomePrice.value = '';
		v_errorflag = 1;
		// Kamata <1 or > 25
	} else if ( v_tInterestRate <1 || v_tInterestRate > 25 ) {
		v_errorstr = "Nažalost.  Kamata od " + v_InterestRate + " je pogrešna.\nMolimo Vas da unesete vrijednost između 1% i 25%.";
		v_form.InterestRate.value = '';
		v_errorflag = 1;
		// Razdoblje <5 ; textfield limited to 2 chars so not > 99 by default
	}
	else if ( v_tRazdoblje <1 ) {
		v_errorstr = "Sorry.  Your Razdoblje of " + v_Razdoblje + " is invalid.\nPlease enter a minimum value of 5 godina.";
		v_form.Razdoblje.value = '';
		v_errorflag = 1;
		// zadani kredit i rata
	} else if (v_tHomePrice != 0 && v_tMonthlyPayment!=0) {
		v_errorstr = "Ako zadajete iznos kredita ostavite praznim visinu rate, obrnuto ako zadajete visinu rate ostavite prazan iznos kredita";
		v_errorflag = 1;
	}
	// display error and clear result
	if ( v_errorflag ) {
		alert ( v_errorstr );
		//clearMonthlyPayment();
		v_returnval = 0;
	} else {
		v_returnval = 1;
	}
	return ( v_returnval );
}

function MM_validateForm_bhs() { //v4.0
	if (document.getElementById){
		var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm_bhs.arguments;
		for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
		if (val) { nm=val.name; if ((val=val.value)!="") {
			if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
			if (p<1 || p==(val.length-1)) errors+='- '+nm+' mora biti ispravna mail adresa.\n';
			} else if (test!='R') { num = parseFloat(val);
			if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
			if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
			min=test.substring(8,p); max=test.substring(p+1);
			if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
			} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' je neophodno polje.\n'; }
		} if (errors) alert('Sljedece greske su uocene:\n'+errors);
		document.MM_returnValue = (errors == '');
	} }


	function MM_validateForm_eng() { //v4.0
		if (document.getElementById){
			var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm_eng.arguments;
			for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
			if (val) { nm=val.name; if ((val=val.value)!="") {
				if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
				if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
				} else if (test!='R') { num = parseFloat(val);
				if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
				if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
				min=test.substring(8,p); max=test.substring(p+1);
				if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
				} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
			} if (errors) alert('The following error(s) occurred:\n'+errors);
			document.MM_returnValue = (errors == '');
		} }

		function check(formname, submitbutton) {
			var errors = '';
			errors += checkDate(formname, 'Datum', 'Datum prijave');
			errors += checkRadio(formname, 'Pozicija', 'Prijava na poziciju');
			errors += checkRadio(formname, 'Mjesto', 'Mjesto rada');
			errors += checkText(formname, 'Prezime', 'Prezime');
			errors += checkText(formname, 'Ime', 'Ime');
			errors += checkDate(formname, 'Datum_rodjenja', 'Datum rodjenja');
			errors += checkNum(formname, 'JMBG', 'JMBG');
			errors += checkText(formname, 'Adresa', 'Adresa');
			errors += checkText(formname, 'Telefon', 'Telefon');
			errors += checkRadio(formname, 'Status', 'Status');
			errors += checkText(formname, 'Naziv_institucije', 'Naziv institucije');
			errors += checkRadio(formname, 'Strucna_sprema', 'Strucna sprema');
			errors += checkText(formname, 'Strani_jezik', 'Strani jezik');
			errors += checkRadio(formname, 'Radno_iskustvo', 'Radno iskustvo');
			checkThisForm(formname, submitbutton, errors);
		}

		function checkThisForm(formname, submitbutton, errors) {
			if (errors == '') {
				document.forms[formname].submit();
				//document.forms[formname].submitbutton.disabled = true;
				//eval(formname+'.'+submitbutton+'.disabled=true');
				//eval('document.'+formname+'.submit()');
			} else {
				alert(errors);
			}
		}

		function checkText(formname, textboxname, displaytext) {
			var localerror = '';
			if(Trim(eval('document.'+formname+'.'+textboxname+'.value'))=='') {
				localerror =  '- '+displaytext+' je obavezno\n';
			} else localerror = '';
			return localerror;
		}

		function checkNum(formname, textboxname, displaytext) {
			var localerror = '';
			if(isNaN(eval('document.'+formname+'.'+textboxname+'.value'))) {
				localerror =  '- '+displaytext+' unesite broj\n';
			}
			else if (Trim(eval('document.'+formname+'.'+textboxname+'.value'))=='') {
				localerror =  '- '+displaytext+' je obavezan\n';
			}
			else localerror = '';
			return localerror;
		}

		function checkSpaces(formname, textboxname, displaytext) {
			var valid = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_'; // define valid characters
			var localerror = '';
			if(!isValid(Trim(eval('document.'+formname+'.'+textboxname+'.value')), valid)) {
				localerror =  '- '+displaytext+' Should Not Contain Spaces.\n';
			} else localerror = '';
			return localerror;
		}


		function checkDate(formname, textboxname, displaytext) {
			var valid = '0123456789.'; // define valid characters
			var localerror = '';
			if(!isValid(Trim(eval('document.'+formname+'.'+textboxname+'.value')), valid)){
				// else if (Trim(eval('document.'+formname+'.'+textboxname+'.value'))=='')
				localerror =  '- '+displaytext+' unesite u formatu: dd.mm.gggg\n';
			}
			else if (Trim(eval('document.'+formname+'.'+textboxname+'.value'))=='') {
				localerror =  '- '+displaytext+' je obavezan\n';
			}
			else localerror = '';
			return localerror;
		}


		function checkSelect(formname, selectboxname, displaytext) {
			var localerror = '';
			if(eval('document.'+formname+'.'+selectboxname+'.selectedIndex')==0) {
				localerror =  '- '+displaytext+' is Required.\n';
			} else localerror = '';
			return localerror;
		}

		function getRadio(formname, radioname, displaytext) {
			for (var i=0; i < eval('document.'+formname+'.'+radioname+'.length'); i++) {
				if (eval('document.'+formname+'.'+radioname+'[i].checked')) {
					var rad_val = eval('document.'+formname+'.'+radioname+'[i].value');
					return rad_val;
				}
			}
		}

		function checkRadio(formname, radioname, displaytext) {
			var localerror = '';
			var rad_val    = '';
			for (var i=0; i < eval('document.'+formname+'.'+radioname+'.length'); i++) { //check every radio button by that name
				if (eval('document.'+formname+'.'+radioname+'[i].checked'))  { //if it is checked
					rad_val += '-';
				}	else rad_val += '';
			}
			if (rad_val=='') {
				localerror =  '- '+displaytext+' je obavezno\n';
			}
			return localerror;
		}



		function autoComplete (field, select, property) {
			var found = false;
			for (var i = 0; i < select.options.length; i++) {
				if (select.options[i][property].toUpperCase().indexOf(field.value.toUpperCase()) == 0) {
					found=true; break;
				}
			}
			if (found) {
				select.selectedIndex = i;
			} else {
				select.selectedIndex = -1;
			}
			if (field.createTextRange) {
				if (!found) {
					field.value=field.value.substring(0,field.value.length-1);
					return;
				}
				var cursorKeys ="8;46;37;38;39;40;33;34;35;36;45;";
				if (cursorKeys.indexOf(event.keyCode+";") == -1) {
					var r1 = field.createTextRange();
					var oldValue = r1.text;
					var newValue = found ? select.options[i][property] : oldValue;
					if (newValue != field.value) {
						field.value = newValue;
						var rNew = field.createTextRange();
						rNew.moveStart('character', oldValue.length) ;
						rNew.select();
					}
				}
			}
		}

		function Trim(s) {
			while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r')) {
				s = s.substring(1,s.length);
			}
			while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r')) {
				s = s.substring(0,s.length-1);
			}
			return s;
		}

		function isValid(string,allowed) {
			//  var valid = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; // define valid characters
			for (var i=0; i< string.length; i++) {
				if (allowed.indexOf(string.charAt(i)) == -1) return false;
			}
			return true;
		}

		/***********************************************
		* Contractible Headers script- © Dynamic Drive (www.dynamicdrive.com)
		* This notice must stay intact for legal use. Last updated Mar 23rd, 2004.
		* Visit http://www.dynamicdrive.com/ for full source code
		***********************************************/

		// USE:

		//<h3 onClick="expandcontent('sc1')" style="cursor:hand; cursor:pointer">What is JavaScript?</h3>
		//<div id="sc1" class="switchcontent">
		//JavaScript is a scripting language originally developed by Netscape to add interactivity and power to web documents. It is purely client side, and runs completely on the client's browser and computer.
		//</div>

		var enablepersist="off" //Enable saving state of content structure using session cookies? (on/off)
		var collapseprevious="yes" //Collapse previously open content when opening present? (yes/no)

		if (document.getElementById){
			document.write('<style type="text/css">')
			document.write('.switchcontent{display:none;}')
			document.write('</style>')
		}

		function getElementbyClass(classname){
			ccollect=new Array()
			var inc=0
			var alltags=document.all? document.all : document.getElementsByTagName("*")
			for (i=0; i<alltags.length; i++){
				if (alltags[i].className==classname)
				ccollect[inc++]=alltags[i]
			}
		}

		function contractcontent(omit){
			var inc=0
			while (ccollect[inc]){
				if (ccollect[inc].id!=omit)
				ccollect[inc].style.display="none"
				inc++
			}
		}

		function expandcontent(cid){
			if (typeof ccollect!="undefined"){
				if (collapseprevious=="yes")
				contractcontent(cid)
				document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
			}
		}

		function revivecontent(){
			contractcontent("omitnothing")
			selectedItem=getselectedItem()
			selectedComponents=selectedItem.split("|")
			for (i=0; i<selectedComponents.length-1; i++)
			document.getElementById(selectedComponents[i]).style.display="block"
		}

		function get_cookie(Name) {
			var search = Name + "="
			var returnvalue = "";
			if (document.cookie.length > 0) {
				offset = document.cookie.indexOf(search)
				if (offset != -1) {
					offset += search.length
					end = document.cookie.indexOf(";", offset);
					if (end == -1) end = document.cookie.length;
					returnvalue=unescape(document.cookie.substring(offset, end))
				}
			}
			return returnvalue;
		}

		function getselectedItem(){
			if (get_cookie(window.location.pathname) != ""){
				selectedItem=get_cookie(window.location.pathname)
				return selectedItem
			}
			else
			return ""
		}

		function saveswitchstate(){
			var inc=0, selectedItem=""
			while (ccollect[inc]){
				if (ccollect[inc].style.display=="block")
				selectedItem+=ccollect[inc].id+"|"
				inc++
			}

			document.cookie=window.location.pathname+"="+selectedItem
		}

		function do_onload(){
			uniqueidn=window.location.pathname+"firsttimeload"
			getElementbyClass("switchcontent")
			if (enablepersist=="on" && typeof ccollect!="undefined"){
				document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0"
				firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
				if (!firsttimeload)
				revivecontent()
			}
		}

		function showThickbox() {
			$(document).ready(function() {
				tb_show("Internet Bankarstvo full demo video", http_path+"/templates/default/common/video.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}

		function showThickbox0() {
			$(document).ready(function() {
				tb_show("1.1. Kako se prijaviti", http_path+"/templates/default/common/video0.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}

		function showThickbox1() {
			$(document).ready(function() {
				tb_show("1.2. Kako se prijaviti", http_path+"/templates/default/common/video1.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}

		function showThickbox2() {
			$(document).ready(function() {
				tb_show("2. Postavke", http_path+"/templates/default/common/video2.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}

		function showThickbox3() {
			$(document).ready(function() {
				tb_show("3. Opste funkcionalnosti", http_path+"/templates/default/common/video3.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}

		function showThickbox4() {
			$(document).ready(function() {
				tb_show("4. Pregled stanja racuna", http_path+"/templates/default/common/video4.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}

		function showThickbox5() {
			$(document).ready(function() {
				tb_show("5. Pregled prometa", http_path+"/templates/default/common/video5.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}


		function showThickbox6() {
			$(document).ready(function() {
				tb_show("6. Placanje-Opsti nalog", http_path+"/templates/default/common/video6.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}


		function showThickbox7() {
			$(document).ready(function() {
				tb_show("7. Placanje-Zak obaveze", http_path+"/templates/default/common/video7.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}

		function showThickbox8() {
			$(document).ready(function() {
				tb_show("8.1. Placanje - Interni prenosi", http_path+"/templates/default/common/video8.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}


		function showThickbox9() {
			$(document).ready(function() {
				tb_show("8.2. Placanje - Uplata na karticu ", http_path+"/templates/default/common/video9.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}

		function showThickbox10() {
			$(document).ready(function() {
				tb_show("8.3. Placanje - Uplata rate kredita u Raiffeisen banci ", http_path+"/templates/default/common/video10.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}


		function showThickbox11() {
			$(document).ready(function() {
				tb_show("8.4. Placanje- Prenos sredstva na stedne i depozitne racune u Raiffeisen banci", http_path+"/templates/default/common/video11.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}


		function showThickbox12() {
			$(document).ready(function() {
				tb_show("9. Kreiranje uzoraka", http_path+"/templates/default/common/video12.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}


		function showThickbox13() {
			$(document).ready(function() {
				tb_show("10. Pregled naloga", http_path+"/templates/default/common/video13.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}


		function showThickbox_en0() {
			$(document).ready(function() {
				tb_show("1.1. How to sign in", http_path+"/templates/default/common/video0_en.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}



		function showThickbox_en1() {
			$(document).ready(function() {
				tb_show("1.2. How to sign in", http_path+"/templates/default/common/video1_en.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}


		function showThickbox_en2() {
			$(document).ready(function() {
				tb_show("2. Settings", http_path+"/templates/default/common/video2_en.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}


		function showThickbox_en3() {
			$(document).ready(function() {
				tb_show("3. General service", http_path+"/templates/default/common/video3_en.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}



		function showThickbox_en4() {
			$(document).ready(function() {
				tb_show("4. Account balance review", http_path+"/templates/default/common/video4_en.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}



		function showThickbox_en5() {
			$(document).ready(function() {
				tb_show("5. Account turnover review", http_path+"/templates/default/common/video5_en.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}



		function showThickbox_en6() {
			$(document).ready(function() {
				tb_show("6. Payment - General payment order", http_path+"/templates/default/common/video6_en.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}



		function showThickbox_en7() {
			$(document).ready(function() {
				tb_show("7. Payment of legal duties", http_path+"/templates/default/common/video7_en.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}


		function showThickbox_en8() {
			$(document).ready(function() {
				tb_show("8.1. Payment - internal transfers", http_path+"/templates/default/common/video8_en.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}


		function showThickbox_en9() {
			$(document).ready(function() {
				tb_show("8.2. How to make a payment into a card account", http_path+"/templates/default/common/video9_en.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}


		function showThickbox_en10() {
			$(document).ready(function() {
				tb_show("8.3. How to make a repayment on a loan", http_path+"/templates/default/common/video10_en.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}




		function showThickbox_en11() {
			$(document).ready(function() {
				tb_show("8.4. How to transfer funds", http_path+"/templates/default/common/video11_en.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}



		function showThickbox_en12() {
			$(document).ready(function() {
				tb_show("9. Creating templates ", http_path+"/templates/default/common/video12_en.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}



		function showThickbox_en13() {
			$(document).ready(function() {
				tb_show("10. Order review", http_path+"/templates/default/common/video13_en.html?keepThis=true&TB_iframe=true&height=500&width=650", "");
			});
		}


		/* Old JS end */
