var FLAZ_AJAX_LOADER = '
';
function submitComment(id) {
if (facPostComment('http://flaz.netsons.org/wp-comments-post.php', 'http://flaz.netsons.org/wp-content/themes/flaz30/postcomments.php?post='+id))
document.forms['postcomment'].submit();
}
function flickrShow() {
var elem = document.getElementById('flickr');
if (elem != null) {
// Create HTTP request
var xmlRequest = null;
try {
xmlRequest = new XMLHttpRequest();
} catch(e) {
try {
xmlRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
}
if (xmlRequest != null) {
xmlRequest.onreadystatechange = function() {
if (xmlRequest.readyState == 4 && xmlRequest.status == 200) {
//elem.innerHTML = xmlRequest.responseText;
//flazTitles(document.getElementsByTagName('li'));
//setTimeout('flickrShow()', 30 * 1000);
var flickr = xmlRequest.responseText.split('\n');
for (var i = 0; i < flickr.length; i++){
//alert(flickr[i].charCodeAt(flickr[i].length - 1));
if (flickr[i].charCodeAt(flickr[i].length - 1) == 13)
flickr[i] = flickr[i].substr(0, flickr[i].length - 1);
}
if ((flickr.length - 1) % 3 == 0) {
elem.innerHTML = '';
for (var i = 0; i < flickr.length - 1; i += 3) {
var li = document.createElement('li');
elem.appendChild(li);
var a = document.createElement('a');
a.setAttribute('href', flickr[i]);
a.setAttribute('title', flickr[i+1]);
li.appendChild(a);
flazTitle(a);
var img = document.createElement('img');
img.setAttribute('border', '0');
img.setAttribute('src', flickr[i+2]);
a.appendChild(img);
}
}
}
};
xmlRequest.open('GET', 'http://flaz.netsons.org/wp-content/themes/flaz30/flickr.php?' + Math.random());
xmlRequest.send(null);
}
}
}
function applyStyleForm(elem) {
if (elem.getAttribute('type') != 'submit' && elem.getAttribute('type') != 'image') {
var normalBorder = '1px solid #999';
var normalColor = '#999';
elem.onfocus = function() {
this.style.border = '1px inset #DDD';
this.style.color = '#333';
}
elem.onblur = function() {
this.style.border = normalBorder;
this.style.color = normalColor;
}
elem.style.border = normalBorder;
}
elem.style.color = normalColor;
}
function styleForm() {
var elems, i;
elems = document.getElementsByTagName('input');
for (i = 0; i < elems.length; ++i)
applyStyleForm(elems[i]);
elems = document.getElementsByTagName('textarea');
for (i = 0; i < elems.length; ++i)
applyStyleForm(elems[i]);
}
function getMouseCoords(e) {
var x, y;
if (document.all) {
x = event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
y = event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
y += 16;
}
else {
x = e.pageX;
y = e.pageY;
y += 19;
}
x += 7;
var elem = document.getElementById('title');
elem.style.left = (x) + 'px';
elem.style.top = (y) + 'px';
}
function titleShow(str) {
var elem = document.getElementById('title');
elem.innerHTML = str;
elem.style.visibility = 'visible';
elem.style.display = 'inline';
}
function titleHide() {
var elem = document.getElementById('title');
elem.style.visibility = 'hidden';
elem.style.display = 'none';
}
function flazTitle(elem) {
if (elem.getAttribute('title')) {
if (elem.getAttribute('title').length > 0) {
var str = elem.getAttribute('title').replace('\'', '`');
elem.onmouseover = new Function('titleShow(\'' + str + '\')');
elem.onmouseout = function() {
titleHide();
}
elem.removeAttribute('title');
}
}
}
window.onload = function() {
if (!document.all) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = getMouseCoords;
styleForm();
flickrShow();
// title
var elems = document.all ? document.all : document.getElementsByTagName('*');
if (elems) {
for (var i = 0; i < elems.length; i++)
flazTitle(elems[i]);
}
// download Last fm
var xmlRequest = null;
try {
xmlRequest = new XMLHttpRequest();
} catch(e) {
try {
xmlRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
}
if (xmlRequest != null) {
xmlRequest.onreadystatechange = function() {
if (xmlRequest.readyState == 4 && xmlRequest.status == 200) {
}
};
}
xmlRequest.open('GET', 'http://flaz.netsons.org/wp-content/themes/flaz30/lastfm.php');
xmlRequest.send(null);
}