function PopUp(url,windowName)
{
var visina=500;
var sirina=450;
var leftPos = screen.availWidth/2-sirina/2;
var topPos =screen.availHeight/2-visina/2;
//var leftPos = 0;
//var topPos =0;

window.open(url, windowName, 'history=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=no,width=' + sirina + ',height=' + visina + ',top=' + topPos + ',left=' + leftPos);
}

function PopUp_txt(url,windowName)
{
var visina=200;
var sirina=200;
var leftPos = screen.availWidth/2-sirina/2;
var topPos =screen.availHeight/2-visina/2;
//var leftPos = 0;
//var topPos =0;

window.open(url, windowName, 'history=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=no,width=' + sirina + ',height=' + visina + ',top=' + topPos + ',left=' + leftPos);
}

function sendmail (address)
{
address = address.split("|"); // Change the * to any string for better personalization
address = address.join("@");
window.open ('mailto:'+address,'_self');
}


function poljetxt(elm, onoff)
{
	if (typeof(onoff) == "undefined" )
	{
		onoff = "blur";
	}

	if (!elm.base)
	{
		elm.base = elm.value;
	}

	if (elm.value == elm.base && onoff != "blur")
	{
		elm.value = "";
	}
	else if (elm.value == "" && onoff == "blur")
	{
		elm.value = elm.base;
	}
}

// POPUP SKRIPTA

// Set the horizontal and vertical position for the popup

//PositionX = 30;
//PositionY = 30;

PositionX = screen.availWidth/2-50;
PositionY = screen.availHeight/2-50;

//var leftPos = screen.availWidth/2-sirina/2;
//var topPos =screen.availHeight/2-visina/2;


// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 380;
defaultHeight = 380;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4)
{
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}

var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function slike(imageURL,imageTitle)
{
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document)
{
writeln('<html><head><title>1x2.hr</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["IMG"].width;');writeln('window.innerHeight=document.images["IMG"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor="000000" scroll="no" onload="reSizeToImage();doTitle();self.focus()" onclick="self.close()" onblur="self.close()">');
writeln('<img src="'+imageURL+'" name="IMG" style="display:block" alt="click to close"></body></html>');
close();		
}
}

function self_close(url,closeIt,delay)
{ 
//	opener.location.href = url;
	if (closeIt == true) setTimeout('self.close()',delay);
}

function total_refresh(url,closeIt,delay)
{ 
	opener.location.href = url;
//	if (closeIt == true) setTimeout('self.close()',delay);
}

var isIE=document.all?true:false;
var isDOM=document.getElementById?true:false;
var isNS4=document.layers?true:false;
var di='debug01';
var di2='debug02';
var di3='debug03';

/* _w : which ID (1) or (2) */
/* _h : (h)ide or (s)how */
function ChangeField(_w,_h) {
  if (isDOM)
  {
    if (_h=='s') document.getElementById(_w).style.display='block';
    if (_h=='h') document.getElementById(_w).style.display='none';
  }
  else if (isIE) {
    if (_h=='s') eval("document.all."+_w+".style.display='block';");
    if (_h=='h') eval("document.all."+_w+".style.display='none';");
  }
  else if(isNS4)
  {
    if (_h=='s') eval("document.layers['"+_w+"'].display='block';");
    if (_h=='h') eval("document.layers['"+_w+"'].display='none';");
  }
}


//								

var browser     = '';
var version     = '';
var entrance    = '';
var cond        = '';
var pathslike        = '';

if (browser == '')
{
if (navigator.appName.indexOf('Microsoft') != -1)
browser = 'IE'
else if (navigator.appName.indexOf('Netscape') != -1)
browser = 'Netscape'
else browser = 'NN';
}
if (version == '')
{
version= navigator.appVersion;
paren = version.indexOf('(');
whole_version = navigator.appVersion.substring(0,paren-1);
version = parseInt(whole_version);
}
if (browser == 'IE' && version >= 4) entrance = 'da';
if (browser == 'IE' && version < 4) entrance = 'ne';
if (browser == 'Netscape' && version >= 2.02) entrance = 'da';
if (browser == 'Netscape' && version < 2.02) entrance = 'ne';
if (entrance=='da')
	{
// gumbi za footer
name0a = new Image; name0a .src = pathslike + 'images/buttons/home.gif';
name0b = new Image; name0b .src = pathslike + 'images/buttons/home_.gif';
name1a = new Image; name1a .src = pathslike + 'images/buttons/supply.gif';
name1b = new Image; name1b .src = pathslike + 'images/buttons/supply_.gif';
name2a = new Image; name2a .src = pathslike + 'images/buttons/demand.gif';
name2b = new Image; name2b .src = pathslike + 'images/buttons/demand_.gif';
name3a = new Image; name3a .src = pathslike + 'images/buttons/onama.gif';
name3b = new Image; name3b .src = pathslike + 'images/buttons/onama_.gif';
name4a = new Image; name4a .src = pathslike + 'images/buttons/kontakt.gif';
name4b = new Image; name4b .src = pathslike + 'images/buttons/kontakt_.gif';
name5a = new Image; name5a .src = pathslike + 'images/buttons/realestate.gif';
name5b = new Image; name5b .src = pathslike + 'images/buttons/realestate_.gif';
	}

function mis_moj(imgName,imgStatus)
{
if (entrance == 'da')
	{
	imgOff = eval(imgName + imgStatus);
	document[imgName].src = imgOff;
	}
}

var bo_ns_id = 0;
var strBrwsr= navigator.userAgent.toLowerCase();
var is_fix_needed = is_fix_needed();


function startFlashFix(){
  if(is_fix_needed){
    document.write('<div id="bo_ns_id_' + bo_ns_id + '"><!-- ');
  }
}

function endFlashFix(){
  if(is_fix_needed){
    document.write('</div>');
    var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
    var theCode = theObject.innerHTML;
    theCode = theCode.substring(4,9+theCode.indexOf("</object>"));
    document.write(theCode);
  }
}

function is_fix_needed(){
  if( strBrwsr.indexOf("msie") > -1 && isXPorLater() ){
  	return true;   
  }else if( strBrwsr.indexOf("opera") > -1 && parseInt(navigator.appVersion.charAt(0))>=9 ){ 
  	return true;	
	}else return false;
}

// WinXP(5.1) == IE 6.0 or later; 
// WinVista(6.0) == IE 7.0 or later
// so it's easier to check Win version
function isXPorLater(){
	var pos;
	if( (pos = strBrwsr.indexOf("windows nt")) > -1 )
			if( parseFloat(strBrwsr.substr(pos+10,4)) >= 5.1 ) return true;
return false;	
}

function changeStackBgColor(level, rollNum, rollover, multiStyle)
{ 
	var blockColor = '';
	var txtColor = '';
	var picColor = '';

	if (document.getElementById) {
		if (rollover == 'on') {
			if (multiStyle != null) {
				picColor = linkhex[multiStyle];
				txtColor = txthex[multiStyle];
				blockColor = blockhex[multiStyle];
			}
			else {
				picColor = linkhex;
				txtColor = txthex;
				blockColor = blockhex;
			}
		}
		else {
			if (multiStyle != null) {
				picColor = pichex[multiStyle];
				txtColor = linkhex[multiStyle];
				blockColor = pichex[multiStyle];
			}
			else {
				picColor = pichex;
				txtColor = linkhex;
				blockColor = pichex;
			}
		}

		if (document.getElementById('a' + rollNum + level)) {divStyle('a' + rollNum + level).backgroundColor=blockColor;}
		if (document.getElementById('b' + rollNum + level)) {divStyle('b' + rollNum + level).borderColor=picColor;}
		if (document.getElementById('c' + rollNum + level)) {divStyle('c' + rollNum + level).color=txtColor}
		if (document.getElementById('d' + rollNum + level)) {divStyle('d' + rollNum + level).borderColor=picColor;}
	}
}

// POPUP SKRIPTA

// Set the horizontal and vertical position for the popup

PositionX = 0;
PositionY = 0;

//var leftPos = screen.availWidth/2-sirina/2;
//var topPos =screen.availHeight/2-visina/2;


// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 850;
defaultHeight = 850;


// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4)
{
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}

var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle)
{
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document)
{
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');
writeln('window.innerWidth=document.images["Cibona.com"].width;');writeln('window.innerHeight=document.images["Cibona.com"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onclick="self.close()" onblur="self.close()">');
writeln('<img name="Cibona.com" src="'+imageURL+'" style="display:block" alt="click to close"></body></html>');
close();
}
}
