/* Horvat Tibor (c) 2001. */
/* E-mail: tibor@skala-su.co.yu */

/* PopUP Window */

function setupDescriptions() {
var x = navigator.appVersion;
y = x.substring(0,4);
if (y>=4) setVariables();
}
var x,y,a,b;
function setVariables(){
if (navigator.appName == "Netscape") {
h=".left=";
v=".top=";
dS="document.";
sD="";
}
else 
{
h=".pixelLeft=";
v=".pixelTop=";
dS="";
sD=".style";
   }
}
var isNav = (navigator.appName.indexOf("Netscape") !=-1);
function popLayer(a){
desc = "<table cellpadding=3 border=1 bgcolor=F7F7F7><td>";

if (a==1) desc += "E-mail: office@skalagreen.com";
if (a==2) desc += "Web: http://www.skalagreen.com";
if (a==3) desc += "3";
if (a==4) desc += "4";
if (a==5) desc += "5";
if (a==6) desc += "6";
if (a==7) desc += "7";
if (a==8) desc += "8";
desc += "</td></table>";

if(isNav) {
document.object1.document.write(desc);
document.object1.document.close();
document.object1.left=x+25;
document.object1.top=y;
}
else {
object1.innerHTML=desc;
eval(dS+"object1"+sD+h+(x+25));
eval(dS+"object1"+sD+v+y);
   }
}
function hideLayer(a){
if(isNav) {
eval(document.object1.top=-300);
}
else object1.innerHTML="";
}
function handlerMM(e){
x = (isNav) ? e.pageX : event.clientX;
y = (isNav) ? e.pageY : event.clientY;
}
if (isNav){
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = handlerMM;

/* End */

/* SwapImage Begin */

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];}}
}

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.0
  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 && document.getElementById) x=document.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];}
}

/* SwapImage End */

//	DATUM
    days = new Array(7)
    days[1] = "Nedelja";
    days[2] = "Ponedeljak";
    days[3] = "Utorak"; 
    days[4] = "Sreda";
    days[5] = "Certvrtak";
    days[6] = "Petak";
    days[7] = "Subota";

    months = new Array(12)
    months[1] = "Januar";
    months[2] = "Februar";
    months[3] = "Mart";
    months[4] = "April";
    months[5] = "Maj";
    months[6] = "Juni";
    months[7] = "Juli";
    months[8] = "Avugust";
    months[9] = "Septembar";
    months[10] = "Oktobar"; 
    months[11] = "Novembar";
    months[12] = "Decembar";

    today = new Date(); day = days[today.getDay() + 1]
    month = months[today.getMonth() + 1]
    date = today.getDate()
    year=today.getYear(); 
if (year < 2000)
year = year + 1900;
//	DATUM

function readCookie() {
     if (document.cookie == "") {
	writeCookie();
        alertMessage();
     } else {
	var the_cookie = document.cookie;
	the_cookie = unescape(the_cookie);
	the_cookie_split = the_cookie.split(";");
	for (loop=0;loop<the_cookie_split.length;loop++) {
		var part_of_split = the_cookie_split[loop];
		var find_name = part_of_split.indexOf("nfti_date")
		if (find_name!=-1) {
			break;
		} // Close if
	} // Close for
	if (find_name==-1) {
		writeCookie();
	} else {
		var date_split = part_of_split.split("=");
		var last = date_split[1];
		last=fixTheDate(last);
//		alert ("Welcome\nYour last visit was on: "+last);
//		writeCookie();
	} // Close if (find_name==-1)
      }
} // Close function readCookie()

// FocusFirst
function FocusFirst_Login() {
	if (document.forms[0] != null) {
		if (document.forms[0].elements[0] != null)
			document.forms[0].elements[1].focus();
	}
}
// Login
function FocusFirst() {
	if (document.forms[0] != null) {
		if (document.forms[0].elements[0] != null)
			document.forms[0].elements[0].focus();
	}
}
// FocusFirst

// Pop-Up Queen Gil
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=200,height=200');");
}
// Pop-Up Queen Gil

// Disable right mouse button
function Mouse(){
with(window.event)
{
if (button !=0 && button !=1)
{
alert("http://www.skalagreen.co.yu")
}
}
}
document.onmousedown=Mouse;
// Disable right mouse button

// STAMPANJE
function doprint(URL){
var URL
if (!window.print){
alert("Potrebno je bar IE4 ili noviji!")
return
}
alert("Optimizovano za Paper size A4 ")
window.print(URL)
}
// STAMPANJE


//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")


function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=500,left = 337,top = 129');");
}
