var pagetitle= "Zmesaj.si";
var xmlHttp // xmlHttp variable

function GetXmlHttpObject(){ // This function we will use to call our xmlhttpobject.
var objXMLHttp=null // Sets objXMLHttp to null as default.
if (window.XMLHttpRequest){ // If we are using Netscape or any other browser than IE lets use xmlhttp.
objXMLHttp=new XMLHttpRequest() // Creates a xmlhttp request.
}else if (window.ActiveXObject){ // ElseIf we are using IE lets use Active X.
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") // Creates a new Active X Object.
} // End ElseIf.
return objXMLHttp // Returns the xhttp object.
} // Close Function

function getalbums(aid){ // This function we will use to check to see if a username is taken or not.
$("#innerhhhh").animate({opacity:0},600);
setTimeout(function(){$("#innerhhhh").html("<center><div class='videoload'></div></center>").animate({opacity:1},600);

},301);
xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Brskalnik je zastarel!") // Alert Them!
return // Returns.
} // End If.

var url="/pvideo.php?aid="+aid // Url that we will use to check the username.
xmlHttp.open("GET",url,true) // Opens the URL using GET
xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 1) { // If the onreadystatechange is equal to 4 lets show the response text.
 // Updates the div with the response text from check.php
}
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
document.getElementById("innerhhhh").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
Cufon.refresh();
} // End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
Cufon.refresh();
} // Close Function.


function getvideo(vid,nad){ // This function we will use to check to see if a username is taken or not.
window.location.href="/videi.php?video="+vid;
return false;
$("#innerhhhh").animate({opacity:0},300);
setTimeout(function(){$("#innerhhhh").html("<center><div class='videoload'></div></center>").animate({opacity:1},300);

},301);


xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Brskalnik je zastarel!") // Alert Them!
return // Returns.
} // End If.

var url="/pvideo.php?vid="+vid+"&nad="+nad // Url that we will use to check the username.
xmlHttp.open("GET",url,true) // Opens the URL using GET
xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 1) { // If the onreadystatechange is equal to 4 lets show the response text.
 // Updates the div with the response text from check.php
}
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
document.getElementById("innerhhhh").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
document.title=pagetitle+": "+$("h1").text();
//     alert(disqus_identifier);
var disqus_identifier=vid;

   var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
   dsq.src = 'http://zmesajsi.disqus.com/embed.js';
   (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
   
   

Cufon.refresh();
} // End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
Cufon.refresh();
} // Close Function.


function sendmail(mail,ime,vid){ // This function we will use to check to see if a username is taken or not.

document.getElementById("innermail").innerHTML = "<center><div class='videoload'></div></center>";
xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Brskalnik je zastarel!") // Alert Them!
return // Returns.
} // End If.

var url="/sendmail.php?mail="+mail+"&vid="+vid+"&ime="+ime // Url that we will use to check the username.
xmlHttp.open("GET",url,true) // Opens the URL using GET
xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 1) { // If the onreadystatechange is equal to 4 lets show the response text.
; // Updates the div with the response text from check.php
}
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
document.getElementById("innermail").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
} // End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
} // Close Function.



function rate(ocena,vid){ // This function we will use to check to see if a username is taken or not.
xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.
if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.
alert ("Brskalnik je zastarel!") // Alert Them!
return // Returns.
} // End If.

var url="/oceni.php?rate="+ocena+"&vid"+vid // Url that we will use to check the username.
xmlHttp.open("GET",url,true) // Opens the URL using GET
xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
if (xmlHttp.readyState == 1) { // If the onreadystatechange is equal to 4 lets show the response text.
document.getElementById("shasha").innerHTML = "<div class='videoload'></div>"; // Updates the div with the response text from check.php
}
if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.
document.getElementById("shasha").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php
} // End If.
}; // Close Function
xmlHttp.send(null); // Sends NULL instead of sending data.
} // Close Function.

