Возможный косяк.
Виктор, для тебя. Посмотри функцию выделенную оранжевым.
/*
* index.js
* Polya's blog project's JScript file
* Copyright by Victor Didenko aka Vicar aka le'Aio
*/
function fnOnLoadPage() {
fnValignBottom();
}
function setCookie(cookieName, cookieContent, cookieExpireTime) {
if (cookieExpireTime > 0) {
var expDate = new Date();
expDate.setTime(expDate.getTime() + cookieExpireTime*1000*60*60);
var expires = expDate.toGMTString();
document.cookie = cookieName+"="+escape(cookieContent)+"; path="+escape('/')+"; expires="+expires;
} else
document.cookie = cookieName+"="+escape(cookieContent)+"; path="+escape('/')+"";
}
/*function getCookie(cookieName) {
var ourCookie = document.cookie;
if (!ourCookie || ourCookie == "") return "";
ourCookie = ourCookie.split(";");
var i = 0;
var Cookie;
while (i < cookie =" ourCookie[i].split(" cookie =" Cookie.substring(1);" cookie ="="" value ="="">;:]|(^\s*$)/).test(f.name.value)) {
alert("bad name");
return false;
}
if (f.email.value != "")
if (!(/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,6}$/i).test(f.email.value)) {
alert("bad e-mail");
return false;
}
setCookie('cookiename', f.name.value, 5000); setCookie('cookiemail', f.email.value, 5000);
var s = document.getElementById(ncid); s.innerHTML = parseInt(s.innerHTML) + 1;
postid = ncid.replace("s", "p"); setTimeout("fnShowComment('"+postid+"')", 0); //setTimeout("fnShowComment('"+postid+"')", 1);
return true;
}
function fnLoadHTML(sURL) {
var request = null;
if (!request) try { request = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) {}
if (!request) try { request = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) {}
if (!request) try { request = new XMLHttpRequest(); } catch (e) {}
if (!request) return "";
request.open('GET', sURL, false);
request.send(null);
return request.responseText;
}
function fnButtonDown(bt) {
if (bt.className == 'top_bt') {
switch (bt.id) {
case 'top_log':
if (document.all.logindialog.style.visibility == 'visible') {
document.all.logindialog.style.visibility = 'hidden';
} else {
document.all.logindialog.style.posTop = 74;
document.all.logindialog.style.posLeft = 100;
document.all.logindialog.style.visibility = 'visible';
bt.src = 'images/top/top3_login_gl.gif';
document.selection.createRange().select(); document.loginform.login.focus();
}
break;
}
}
}
function fnShowComment(postid) {
var p = document.getElementById(postid);
p.innerHTML = "loading... please wait";
if (p.style.visibility == 'visible') {
p.style.visibility = 'hidden';
} else {
p.style.visibility = 'visible';
var pathtoload = "comm"+"ents.ph"+"p?id="; var comments = fnLoadHTML(pathtoload + postid);
p.innerHTML = comments;
}
}
function fnSHAddComment(postid) {
var p = document.getElementById(postid);
(p.style.display != 'block') ? p.style.display = 'block' : p.style.display = 'none';
}
function fnHover(isover) {
var it = event.srcElement;
if (it.className == 'top_bt') {
it.src = (isover) ? 'images/top/top3_login_gl.gif' : 'images/top/top3_login.gif';
if (document.all.logindialog.style.visibility == 'visible') it.src = 'images/top/top3_login_gl.gif';
if (event.type == 'click') fnButtonDown(it);
}
fnValignBottom();
}
Все было бы отлично, но переменной ты присваиваешь очень странную вещь=)) var it = event.srcElement; .
Насколько я знаю, обычно там дописывают свойство. В любом случае консоль выдает ошибку ссылаясь на то,что эвент не определен. И еще, в функции "добавления коммента до отправки", ты два раза отправляешь пользоветелю куки, эти наглые печеньки.
Пока что всё.








