var PostListPosition = 226; function ChangeColor(td , command) { if(command == 'out') td.bgColor = '#05446F'; else td.bgColor = '#03243A'; } function ChangeColorBlogger(td , command) { if(command == 'out') { td.bgColor = '#05446F'; td.style.color = '#5AA0D4'; } else { td.bgColor = '#5AA0D4'; td.style.color = '#05446F'; } } function convertAND(txt) { return (txt.replace(/&/g , '[AND]')); } function getComment(id) { var Loader = document.getElementById('ViewLoader'); Loader.innerHTML = ''; var CommentArea = document.getElementById('CommentArea'); var xmlHttp = new Ajax(); xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState == 4) { Loader.innerHTML = ''; CommentArea.innerHTML = xmlHttp.responseText; CommentArea.style.display = 'block'; } } var Method = 'POST'; if(document.getElementById('Password')) { var Password = document.getElementById('Password').value; Password = convertAND(Password); var Param = 'pass=' + Password; } else { var Param = null; Method = 'GET'; } xmlHttp.open(Method , 'http://www.syuf-fyq.com/Blog/Comment/' + id + '/', true); if(Method == 'POST') xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.send(Param); } function getPost(id , seq) { var Loader = document.getElementById('PostLoader' + seq); var Method = 'POST'; if(document.getElementById('Password')) { var Password = document.getElementById('Password').value; Password = convertAND(Password); var Param = 'pass=' + Password; } else { var Param = null; Method = 'GET'; } Loader.innerHTML = ''; var EntrySection = document.getElementById('EntrySection'); var PostSection = document.getElementById('PostSection'); PostListPosition = document.body.scrollTop; var xmlHttp = new Ajax(); xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState == 4) { Loader.innerHTML = ' '; PostSection.style.display = 'none'; EntrySection.innerHTML = xmlHttp.responseText; EntrySection.style.display = 'block'; Scroll(226); } } xmlHttp.open(Method , 'http://www.syuf-fyq.com/Blog/View/' + id + '/' , true); if(Method == 'POST') xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.send(Param); } function goArchive(URL) { location.href = 'http://www.syuf-fyq.com/Blog' + URL; } function PutEmo(EmoCode , IsPopup) { var CommentBody = document.getElementById('CommentBody'); CommentBody.focus(); if(document.selection) { var Range = document.selection.createRange(); Range.text = EmoCode; } else if(CommentBody.selectionStart || CommentBody.selectionStart == 0) { var LeftString = CommentBody.value.substr(CommentBody.value[0] , CommentBody.selectionStart); var RightString = CommentBody.value.substr(CommentBody.selectionEnd , CommentBody.value.length - CommentBody.selectionEnd); CommentBody.value = LeftString + EmoCode + RightString; } if(IsPopup == true) { var EmoPopup = document.getElementById('EmoPopup'); EmoPopup.style.display = 'none'; EmoPopup.innerHTML = ''; } } function PutName(Name , Website) { document.getElementById('Name').value = Name; document.getElementById('Email').value = ''; document.getElementById('URL').value = Website; if(Website == '') { document.getElementById('Blog2').checked = true; document.getElementById('URL').disabled = true; } else { document.getElementById('Blog1').checked = true; document.getElementById('URL').disabled = false; } } function selectBlogger(URL) { location.href = URL; } function SearchName(Name) { Name = Name.value; var Suggestion = document.getElementById('NameSuggestion'); if(Name.length < 2) { Suggestion.style.display = 'none'; return; } Name = convertAND(Name); var xmlHttp = new Ajax(); xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState == 4) { var Response = xmlHttp.responseText; if(Response != '') { Suggestion.style.display = 'block'; Suggestion.innerHTML = Response; } } } Param = 'Name=' + Name; xmlHttp.open('POST' , 'http://www.syuf-fyq.com/Blog/Search/Name/', true); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.send(Param); } function SendComment(pid) { var Loader = document.getElementById('CommentLoader'); Loader.innerHTML = ''; var Name = document.getElementById('Name').value; var Email = document.getElementById('Email').value; var URL = ''; var Password = ''; if(document.getElementById('URL').disabled == false) { URL = document.getElementById('URL').value; } if(document.getElementById('Password')) { Password = document.getElementById('Password').value; } var CommentBody = document.getElementById('CommentBody').value; var ResponseSection = document.getElementById('ResponseSection'); if(Name == '' || Email == '' || CommentBody == '') { Loader.innerHTML = ''; ResponseSection.innerHTML = '
Please fill in all required fields!
'; return; } Name = convertAND(Name); Email = convertAND(Email); URL = convertAND(URL); Password = convertAND(Password); CommentBody = convertAND(CommentBody); var xmlHttp = new Ajax(); xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState == 4) { Loader.innerHTML = ''; document.getElementById('CommentBody').value = ''; ResponseSection.innerHTML = xmlHttp.responseText; } } Param = 'Name=' + Name + '&Email=' + Email + '&URL=' + URL + '&Password=' + Password + '&CommentBody=' + CommentBody; xmlHttp.open('POST' , 'http://www.syuf-fyq.com/Blog/Send/' + pid + '/', true); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.send(Param); } function viewPost() { var EntrySection = document.getElementById('EntrySection'); var PostSection = document.getElementById('PostSection'); var CommentArea = document.getElementById('CommentArea'); EntrySection.innerHTML = ''; CommentArea.innerHTML = ''; EntrySection.style.display = 'none'; CommentArea.style.display = 'none'; PostSection.style.display = 'block'; Scroll(PostListPosition); } function ViewAllEmoticons(e) { var EmoPopup = document.getElementById('EmoPopup'); EmoPopup.innerHTML = '
Loading Emoticons...
'; var LinkTop , LinkLeft; if(e.pageY || e.pageX) { LinkTop = e.pageY; LinkLeft = e.pageX; } else { LinkTop = e.clientY + document.body.scrollTop; LinkLeft = e.clientX + document.body.scrollLeft; } var PopupTop = (LinkTop) + "px"; var PopupLeft = (LinkLeft) + "px"; EmoPopup.style.position = 'absolute'; EmoPopup.style.top = PopupTop; EmoPopup.style.left = PopupLeft; EmoPopup.style.display = 'block'; var xmlHttp = new Ajax(); xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState == 4) { EmoPopup.innerHTML = xmlHttp.responseText; } } xmlHttp.open("GET" , "http://www.syuf-fyq.com/Blog/Emoticon/" , true); xmlHttp.send(null); } function Website(WebsiteURL) { if(WebsiteURL == true) document.getElementById('URL').disabled = false; else document.getElementById('URL').disabled = true; } function AddCode(element) { var Codes = new Array( new Array('' , '') , new Array('' , '') , new Array('' , '') , new Array('' , '') ); var PostBody = document.getElementById('CommentBody'); PostBody.focus(); if(document.selection) { var Range = document.selection.createRange(); Range.text = Codes[element][0] + Range.text + Codes[element][1]; } else if(PostBody.selectionStart || PostBody.selectionStart == 0) { var LeftString = PostBody.value.substr(PostBody.value[0] , PostBody.selectionStart); var CenterString = PostBody.value.substr(PostBody.selectionStart , PostBody.selectionEnd - PostBody.selectionStart); var RightString = PostBody.value.substr(PostBody.selectionEnd , PostBody.value.length - PostBody.selectionEnd); PostBody.value = LeftString + Codes[element][0] + CenterString + Codes[element][1] + RightString; } }