var downIMG='';
var rightIMG='';
//javascript code
//promenljive
var klik=false;
function ShowHide(id)
{
element=document.getElementById(id);
if(element==null)
return false;
//alert('Usao "'+element.style.display+'"');
if(element.style.display=='none') //||element.style.display==""
{
element.style.display='block';
}
else
{
//alert('Usao za skrivanje');
element.style.display='none';
//alert('Sakrio!');
}
//alert('Izasao '+ element.style.display);
return true;
}
function slikaPop(src)
{
newWin = window.open('slika.php?src='+src,'pupslika','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable');
return false;
}//end function slikaPop()
//popup prozor
function WinOpenPopup(location, name, opt)
{
newWin = window.open(location, 'ime', opt);
return false;
}//end function WinOpenPopup
//-----------------------------------------------------
//Menjam klasu elementa
function chClassOnOver(el, c1, c2)
{
if(el.className==c1)
{
//alert('Klasa='+el.className+' to je c1');
el.className=c2;
}
else
{
//alert('Klasa='+el.className+' to je c2');
el.className=c1;
}
}
//---------------------------------------
//menjaj boju
//oldCol=this.style.backgroundColor;this.style.backgroundColor='#666666'
var oldC=null;
function chOnOver(element)
{
//alert('over: color='+element.style.backgroundColor+' Oldc='+oldC)
if(oldC==null) oldC = getBgCol(element);
element.style.backgroundColor='#666666';
//alert('over: color='+element.style.backgroundColor+' Oldc='+oldC)
}
function chOnOut(element)
{
element.style.backgroundColor=oldC;
//alert('OUT: color='+element.style.backgroundColor+' Oldcol='+oldC)
}
function imageFlip(element,secid)
{
el=document.getElementById(secid);
if(el==null)
return false;
if (el.style.display=='none')
{
element.innerHTML=downIMG;
//alert('DOLE');
}
else
{
element.innerHTML=rightIMG;
//alert('DESNO');
}
//alert(element.innerHTML+'\n'+rightIMG);//ovo nikad nije isto!!!!!
}
//Ne moze bez ovoga da nadje boju pozadine!!!!!!!!!!!
function getBgCol(el) {
if(el.currentStyle)
return el.currentStyle.backgroundColor;
if(document.defaultView)
return document.defaultView.getComputedStyle(el, '').getPropertyValue("background-color");
return "Don\'t know how to get color";
}
//-------------------------------
//filemanager
var newID=1000;
function addHtml(parentID,beforeID,newIDs)
{
parentDiv = document.getElementById(parentID);
sp2 = document.getElementById(beforeID);
sp1 = document.createElement("span");
parentDiv.insertBefore(sp1, sp2);
//
sp1.innerHTML = "";
sp1.innerHTML += '
';
//alert(sp1.innerHTML);
//alert(sp1.innerHTML);
sp1.id=newIDs;
newID++;
// alert(newID);
//document.close();
}
function deleteID(id)
{
e=document.getElementById(id);
e.innerHTML='';
return falce;
}
//-------------------------------
//END filemanager
//----------------------------------------
//AJAX funkcije
//pravi http objekat umesto ovoga: http = new XMLHttpRequest();
//if((http=getHTTPObject())==false) alert('Vas browser ne podrzava ajax kontrole koje bi vam znacajno olaksale koriscenje naseg sajta'); //unapred pravim objekat!
function getHTTPObject()
{
if (typeof XMLHttpRequest != 'undefined')
{
return new XMLHttpRequest();
}
try
{
return new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
return new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{}
}
return false;
}//end function getHTTPObject()
function updateData(http, param, url, id) {
var myurl = url;
http.open("GET", myurl + "?id=" + escape(param), true);
http.onreadystatechange = function useHttpResponse() {
if (http.readyState == 4) {
var textout = http.responseText;
document.getElementById(id).innerHTML=textout;
//document.write.textout;
}
}
http.send(null);
}
function updateDataNoParam(http, url, chid) {
var myurl = url;
http.open("GET", myurl, true);
http.onreadystatechange = function useHttpResponse() {
if (http.readyState == 4) {
var textout = http.responseText;
document.getElementById(chid).innerHTML=textout;
//document.write.textout;
}
}
http.send(null);
}