if(top.location != window.location) top.location.replace(window.location.href);

/*function NumToCurrency(sNumber,nDec) {
if (sNumber!=null && sNumber!='')
{
var Temp = new String(); var Top, Bottom, Num;
Temp = sNumber; Temp = Temp.replace(/[.]/ig,''); Temp = Temp.replace(/[,]/ig,'.'); Num = parseFloat(Temp.replace(/[^\d\.]/ig,''));
if (isNaN(Num)) return ''; else { Top = Math.floor(Num); Bottom = Math.round((Num - Math.floor(Num)) * Math.pow(10,nDec)); Bottom = Bottom.toString();
if (Bottom==100) {Bottom='00'; Top=Top+1} Top = Top.toString(); Temp='';
while (Bottom.length<nDec) { Bottom = '0' + Bottom; }
while (Top.length>3) { Temp = '.' + Top.slice(Top.length-3) + Temp; Top = Top.substr(0,Top.length-3); }
if (nDec>0) { Temp= Top + Temp + "," + Bottom; } else { Temp= Top + Temp; } 
if (sNumber.substring(0,1) == '-') { Temp='-'+Temp; } return Temp; } 
}*/

function domencaRe (URL){
question = confirm("Zapustili boste portal gradnje.com! Nadaljujem?")
if (question){ window.location.href = URL; }
}

function editComment(id, comment) {
document.post_image.mode.value = 'update_comment'; document.post_image.comment_id.value = id;
document.post_image.comment.value = comment; document.post_image.comment.focus();
}

function confirm_action($url, $msg) {
var is_confirmed = confirm($msg); if (is_confirmed) { window.location = $url; }
}

function confirm_popup($url, $msg) {
var is_confirmed = confirm($msg); if (is_confirmed) { window.location.top = $url; }
}

function openPopnew(url, name, width, height, otherfeatures) {
var str = "height=" + height + ",innerHeight=" + height; str += ",width=" + width + ",innerWidth=" + width;
if (window.screen) { var ah = screen.availHeight - 30; var aw = screen.availWidth - 10;
var xc = (aw - width) / 2; var yc = (ah - height) / 2;
str += ",left=" + xc + ",screenX=" + xc; str += ",top=" + yc + ",screenY=" + yc; }
newwin = window.open(url, name, str + ',' + otherfeatures);
if(parseInt(navigator.appVersion) >= 4) { setTimeout('newwin.focus();',250); }
}
// Popup windows
function openPop(url, width, height, s) {
x = (640 - width)/2; y = (480 - height)/2;
if (screen)	{ x = (screen.availWidth - width) / 2; y = (screen.availHeight - height) / 2;
if (height > screen.availHeight) { height = screen.availHeight - 100; width = width + 18; s = 1; }
}

if (navigator.appName == "Netscape")
	height = height + 50;
window.open(url, '', 'scrollbars=' + s + ',status=0,resizable=0,width=' + width + ',height=' + height + ',screenX=' + x + ',screenY=' + y + ',top=' + y + ',left=' + x);
}

// Button Rollovers
function changeColor(color){
if (!document.all) return;
var el=event.srcElement;
if (el.tagName=="INPUT"&&(el.type=="button"||el.type=="submit"||el.type=="reset")) event.srcElement.style.backgroundColor=color;
}

// Text Input Field Highlight
function setBgImage(element,imageFile) {
element.style.backgroundImage="url("+imageFile+")";
element.style.color="#44597C";
}

// Text Input Field Normal
function setBgImageOver(element,imageFile) {
element.style.backgroundImage="url("+imageFile+")";
element.style.color="#CE3907";
}

// Img preloader
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// Text blink
function blinkIt() {
if (!document.all) return; else { for(i=0;i<document.all.tags('blink').length;i++){ s=document.all.tags('blink')[i]; s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible'; } }
}

function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit)
field.value = field.value.substring(0, maxlimit);

else
countfield.value = maxlimit - field.value.length;
}
// Img preloader
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function populateselect(){
theform=document.yellow; sel1 = theform.category; sel2 = theform.subcategory; sel1.options.length = 0; sel1.options.length = datasets.length;
for (i=0;i<datasets.length;i++){ sel1.options[i].text = datasets[i][0]; sel1.options[i].value = datasets[i][0]; }
sel1.selectedIndex=0; changeselect(0);
}

function changeselect(){
theform=document.yellow; sel1 = theform.category;sel2 = theform.subcategory;
dataset=sel1.selectedIndex; sel2.options.length = 0; sel2.options.length = datasets[dataset].length-1;
for (i=1;i<((datasets[dataset].length));i++) { sel2.options[i-1].text = datasets[dataset][i]; sel2.options[i-1].value = datasets[dataset][i]; } sel2.selectedIndex=0;
}



