  
////////korpa/////////
var nek;
var path1
function displaySubs(id,vr,path){
nek=vr;
path1=path

    var url=path+"/korpa_add.php?id="+id+"&vr="+vr+"&tabela=proizvodi_new";
   
    if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();// Mozilla/Safari
    }else if (window.ActiveXObject) {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");// IE
    }

    xmlHttp.onreadystatechange=AJAXresponse;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null)
  //document.getElementById("resultik").style.display="none"; 
}

function AJAXresponse(){
 
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
   document.getElementById("result").innerHTML=xmlHttp.responseText;
// ddrivetip(xmlHttp.responseText);
}
    else{
        document.getElementById("result").innerHTML = '<img src="'+path1+'/images/16.gif">';
    }
}

var nek;
function displaySubs1(id,vr,path){
nek=vr; 
    var url=path+"/korpa_add_top.php?id="+id+"&vr="+vr+"&tabela=proizvodi_new";
   
    if (window.XMLHttpRequest) {
        xmlHttpa = new XMLHttpRequest();// Mozilla/Safari
    }else if (window.ActiveXObject) {
        xmlHttpa = new ActiveXObject("Microsoft.XMLHTTP");// IE
    }

    xmlHttpa.onreadystatechange=AJAXresponsej;
    xmlHttpa.open("GET",url,true);
    xmlHttpa.send(null)
}

function AJAXresponsej(){
 
    if (xmlHttpa.readyState==4 || xmlHttpa.readyState=="complete"){
   document.getElementById("result1").innerHTML=xmlHttpa.responseText;
// ddrivetip(xmlHttp.responseText);

}
    else{
        document.getElementById("result1").innerHTML = '<img src="'+path1+'/images/16.gif">';
    }
}
///////end korpa//////
///go session//
function gosession(){

    var url="sess.php";
   
    if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();// Mozilla/Safari
    }else if (window.ActiveXObject) {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");// IE
    }

    xmlHttp.onreadystatechange=AJAXresponseS;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null)
}

function AJAXresponseS(){
 
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
 ddrivetip(xmlHttp.responseText,200)
   
}
   
}
////////////////
/***********************************************
* Cool DHTML tooltip script II- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

//document.write('<div id="dhtmltooltip" style="height:15px;"></div>') //write out tooltip DIV
//document.write('<img id="dhtmlpointer" src="pixel.jpg">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip




jQuery.noConflict();
     
     // Use jQuery via jQuery(...)
    jQuery(document).ready(function(){

	jQuery(".btn-slide").click(function(){
		jQuery("#header_down").slideToggle("slow");
		jQuery(this).toggleClass("active"); return false;
	});
	
	 
});
jQuery(document).ready(
				function(){
					
					
					jQuery('ul#portfolio').innerfade({
						speed: 'slow',
						timeout: 6000,
						type: 'sequence',
						containerheight: '186px'
					});
					
					

			});
     // Use Prototype with $(...), etc.
    
function lol(width,height)
{
var path;
var xPos;
var yPos;

xPos = (window.screen.width/2) - (width/2 + 10);
yPos = (window.screen.height/2) - (height/2 + 50);
var win2 = window.open("pogoji.php","Window2","status=no,height="+height+",width="+width+",resizable=yes,left=" + xPos + ",top=" + yPos + ",screenX=" + xPos + ",screenY=" + yPos + ",toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no");
win2.focus();
}
function lol1(id,width,height)
{
var path;
var xPos;
var yPos;

xPos = (window.screen.width/2) - (width/2 + 10);
yPos = (window.screen.height/2) - (height/2 + 50);
var win2 = window.open("view_demo.php?id="+id+"","Window2","status=no,height="+height+",width="+width+",resizable=yes,left=" + xPos + ",top=" + yPos + ",screenX=" + xPos + ",screenY=" + yPos + ",toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no");
win2.focus();
}

function aktiviraj(odpr,sid){

 document.getElementById("link").style.display="block";
    var url="glas.php?id="+odpr+"&sid="+sid;
   
    if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();// Mozilla/Safari
    }else if (window.ActiveXObject) {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");// IE
    }

    xmlHttp.onreadystatechange=AJAXresponseS;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null)
//}

}
function AJAXresponseS(){

    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
   document.getElementById("results").innerHTML=xmlHttp.responseText;
}  else{
        document.getElementById("results").innerHTML = '<span style="font-weight:bold;">Glasam...</span>';
    }
}
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
 function ds_getleft(el) {
	var tmp = el.offsetLeft;
	el = el.offsetParent
	while(el) {
		tmp += el.offsetLeft;
		el = el.offsetParent;
	}
	return tmp;
}
function ds_gettop(el) {
	var tmp = el.offsetTop;
	el = el.offsetParent
	while(el) {
		tmp += el.offsetTop;
		el = el.offsetParent;
	}
	return tmp;
}
function galerija(id,vr,slika,jez){

   	var arrayPageSize = getPageSize();
   	document.getElementById("fade").style.height = (arrayPageSize[1] + 'px');
   	pi=(arrayPageSize[0]-700)/2;
   	document.getElementById("galerijica").style.left=pi+"px";
   		document.getElementById("galerijica").style.top="5px";
    /*
    if(n==2)
    document.getElementById("result").innerHTML=document.getElementById("result");
    else
    {*/
  
    var url="http://www.korekt-plus.si/"+jez+"slike.php?id="+id+"&nid="+vr+"&slika="+slika;
   
    if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();// Mozilla/Safari
    }else if (window.ActiveXObject) {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");// IE
    }

    xmlHttp.onreadystatechange=AJAXresponsegg;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null)
//}
}
function AJAXresponsegg(){

    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
   document.getElementById("galerijica").innerHTML=xmlHttp.responseText;
}
    else{
        document.getElementById("galerijica").innerHTML = '<div style="width:690px;height:500px;">Ucitavam...</div>';
    }
}

 var path2;
 function podkat(path,id,t){
  path2=path;
  the_left = ds_getleft(t);
	the_top = ds_gettop(t) + t.offsetHeight;
  element=document.getElementById("resultik");
  element.style.display="block";
	element.style.top=the_top-30 + 'px';
	element.style.left=the_left-470 + 'px';
	
jQuery('#resultik').html('<img src='+path2+'/images/16.gif width="26" height="26" alt="">');
    var url=path+"/pod_kat.php?id="+id;
   jQuery('#resultik').load(url);
  	return false;
}
function whichElement(e)
{
var targ;

if (!e)
  {
  var e=window.event;
  }
if (e.target)
  {
  targ=e.target;
  }
else if (e.srcElement)
  {
  targ=e.srcElement;
  }
if (targ.nodeType==3) // defeat Safari bug
  {
  targ = targ.parentNode;
  }
var tname;
tname=targ.tagName;
//alert(tname)
if(tname=="DIV" || tname=="IMG" || tname=="BODY" || tname=="A" || tname=="UL" || tname=="TABLE"|| tname=="TR" || tname=="TD"){
document.getElementById("resultik").style.display="none";
}


}
function show_form()
{
document.getElementById("forma").style.display="block";

}
function hidden_form()
{
document.getElementById("forma").style.display="none";

}

