var vote_comment_id = 0; //=======================================================// //------------------------ Vote -------------------------// //=======================================================// function voteRequest (result, content_id) { if(ajaxRequestFlag==1) return; var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/pictures.php") var params = "act_name=ActVote&content_id=" + content_id + "&result=" + result; ajax.setParams(params); ajax.setResponseMethod("voteResponse"); ajax.sendRequest(); hidePopup(); showPopupMessage('TplPopupMsg', 'Please wait...', 'Vote'); showFixedPopup('TplPopupMsg', 360, 250); }; function voteResponse (responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("ConTplPopupMsg").className = "success_msg"; document.getElementById("ConTplPopupMsg").innerHTML = "You have voted successfully. Thank you."; document.getElementById("vote").innerHTML = responseText; hidePopupTimeout('TplPopupMsg', 3000); } else if(responseText.match(/##error##/, responseText)) { responseText = responseText.replace("##error##", ""); document.getElementById("ConTplPopupMsg").className = "msg"; document.getElementById("ConTplPopupMsg").innerHTML = responseText; hidePopupTimeout('TplPopupMsg', 3000); } else if(responseText.match(/##login##/, responseText)) { ajax.showForm('FrmPopupLogin', '', 360, 250, 'fixed', 'You are not logged in. Please wait...'); } else { //alert(responseText); } } //================== start: Vote IP ==================// function voteIPRequest (result, content_id) { if(ajaxRequestFlag==1) return; var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/pictures.php") var params = "act_name=ActVoteIP&content_id=" + content_id + "&result=" + result; ajax.setParams(params); ajax.setResponseMethod("voteIPResponse"); ajax.sendRequest(); document.getElementById("FrmVoteIPMsg").innerHTML = "Please wait..."; }; function voteIPResponse (responseText) { document.getElementById("FrmVoteIPMsg").innerHTML = " "; if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("vote").innerHTML = responseText; hidePopup(); document.getElementById("ConTplPopupMsg").className = "success_msg"; document.getElementById("ConTplPopupMsg").innerHTML = "You have voted successfully. Thank you."; showFixedPopup('TplPopupMsg', 360, 250); hidePopupTimeout('TplPopupMsg', 3000); } else if(responseText.match(/##error##/, responseText)) { responseText = responseText.replace("##error##", ""); document.getElementById("FrmVoteIPMsg").innerHTML = responseText; reloadCaptchaCode('FrmVoteIP_captcha_code'); } else { //alert(responseText); reloadCaptchaCode('FrmVoteIP_captcha_code'); } } //================== end: Vote IP ==================// //================== start: Comment Vote IP ==================// function commentVoteIPRequest (result, comment_id) { if(ajaxRequestFlag==1) return; vote_comment_id = comment_id; var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/pictures.php") var params = "act_name=ActCommentVoteIP&comment_id=" + comment_id + "&result=" + result; ajax.setParams(params); ajax.setResponseMethod("commentVoteIPResponse"); ajax.sendRequest(); document.getElementById("FrmCommentVoteIPMsg").innerHTML = "Please wait..."; }; function commentVoteIPResponse (responseText) { document.getElementById("FrmCommentVoteIPMsg").innerHTML = " "; if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); hidePopup(); document.getElementById("comment_vote" + vote_comment_id).innerHTML = responseText; document.getElementById("ConTplPopupMsg").className = "success_msg"; document.getElementById("ConTplPopupMsg").innerHTML = "You have voted successfully. Thank you."; showFixedPopup('TplPopupMsg', 360, 250); hidePopupTimeout('TplPopupMsg', 3000); } else if(responseText.match(/##error##/, responseText)) { responseText = responseText.replace("##error##", ""); document.getElementById("FrmCommentVoteIPMsg").innerHTML = responseText; reloadCaptchaCode('FrmCommentVoteIP_captcha_code'); } else { // alert(responseText); reloadCaptchaCode('FrmCommentVoteIP_captcha_code'); } } //================== end: Comment Vote IP ==================// //=======================================================// //----------------- Add to favorites -------------------// //=======================================================// function favAddRequest (content_id) { if(ajaxRequestFlag==1) return; var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/pictures.php") var params = "act_name=ActFavAdd&content_id=" + content_id; ajax.setParams(params); ajax.setResponseMethod("favAddResponse"); ajax.sendRequest(); hidePopup(); showPopupMessage('TplPopupMsg', 'Please wait...', 'Add to Favorites'); showFixedPopup('TplPopupMsg', 360, 250); }; function favAddResponse (responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("ConTplPopupMsg").className = "success_msg"; document.getElementById("ConTplPopupMsg").innerHTML = responseText; document.getElementById("favLink").innerHTML = "Remove from Favorites"; document.getElementById("favLink").setAttribute('onclick', 'favRemoveRequest()'); var favCount = parseInt(document.getElementById("favCount").innerHTML); if(favCount!='NaN') document.getElementById("favCount").innerHTML = favCount + 1; else document.getElementById("favCount").innerHTML = 1; var total_fav_count = parseInt(document.getElementById("total_fav_count").innerHTML); if(total_fav_count!='NaN') document.getElementById("total_fav_count").innerHTML = total_fav_count + 1; else document.getElementById("total_fav_count").innerHTML = 1; hidePopupTimeout('TplPopupMsg', 3000); } else if(responseText.match(/##error##/, responseText)) { responseText = responseText.replace("##error##", ""); document.getElementById("ConTplPopupMsg").innerHTML = responseText; hidePopupTimeout('TplPopupMsg', 3000); } else if(responseText.match(/##login##/, responseText)) { ajax.showForm('FrmPopupLogin', '', 360, 250, 'fixed', 'You are not logged in. Please wait...'); } else { //alert(responseText); } } //=======================================================// //----------------- Remove from favorites -------------------// //=======================================================// function favRemoveRequest (content_id) { if(ajaxRequestFlag==1) return; var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/pictures.php") var params = "act_name=ActFavRemove&content_id=" + content_id; ajax.setParams(params); ajax.setResponseMethod("favRemoveResponse"); ajax.sendRequest(); hidePopup(); showPopupMessage('TplPopupMsg', 'Please wait...', 'Remove from Favorites'); showFixedPopup('TplPopupMsg', 360, 250); }; function favRemoveResponse (responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("ConTplPopupMsg").className = "success_msg"; document.getElementById("ConTplPopupMsg").innerHTML = responseText; document.getElementById("favLink").innerHTML = "Add to Favorites"; document.getElementById("favLink").setAttribute('onclick', 'favAddRequest()'); var favCount = parseInt(document.getElementById("favCount").innerHTML); if(favCount!='NaN') document.getElementById("favCount").innerHTML = favCount - 1; else document.getElementById("favCount").innerHTML = 0; var total_fav_count = parseInt(document.getElementById("total_fav_count").innerHTML); if(total_fav_count!='NaN') document.getElementById("total_fav_count").innerHTML = total_fav_count - 1; else document.getElementById("total_fav_count").innerHTML = 0; hidePopupTimeout('TplPopupMsg', 3000); } else if(responseText.match(/##error##/, responseText)) { document.getElementById("ConTplPopupMsg").innerHTML = " "; hidePopupTimeout('TplPopupMsg', 3000); } else if(responseText.match(/##login##/, responseText)) { ajax.showForm('FrmPopupLogin', '', 360, 250, 'fixed', 'You are not logged in. Please wait...'); } else { //alert(responseText); } } //=======================================================// //----------------- Unsubscribe -------------------// //=======================================================// var subscribe_user_id = 0; function unsubscribeRequest (user_id) { if(ajaxRequestFlag==1) return; subscribe_user_id = user_id; var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/pictures.php") var params = "act_name=ActUnsubscribe&user_id=" + user_id; ajax.setParams(params); ajax.setResponseMethod("unsubscribeResponse"); ajax.sendRequest(); hidePopup(); showPopupMessage('TplPopupMsg', 'Please wait...', 'Unsubscribe'); showFixedPopup('TplPopupMsg', 360, 250); }; function unsubscribeResponse (responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("subscribe").innerHTML = "Subscribe"; document.getElementById("subscribe").setAttribute('onclick', 'subscribeRequest(subscribe_user_id)'); subscribe_user_id = 0; document.getElementById("ConTplPopupMsg").className = "success_msg"; document.getElementById("ConTplPopupMsg").innerHTML = responseText; hidePopupTimeout('TplPopupMsg', 3000); } else if(responseText.match(/##error##/, responseText)) { responseText = responseText.replace("##error##", ""); document.getElementById("ConTplPopupMsg").innerHTML = responseText; hidePopupTimeout('TplPopupMsg', 3000); } else if(responseText.match(/##login##/, responseText)) { ajax.showForm('FrmPopupLogin', '', 360, 250, 'fixed', 'You are not logged in. Please wait...'); } else { //alert(responseText); } } //=======================================================// //----------------- Subscribe -------------------// //=======================================================// function subscribeRequest (user_id) { if(ajaxRequestFlag==1) return; subscribe_user_id = user_id; var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/pictures.php") var params = "act_name=ActSubscribe&user_id=" + user_id; ajax.setParams(params); ajax.setResponseMethod("subscribeResponse"); ajax.sendRequest(); hidePopup(); showPopupMessage('TplPopupMsg', 'Please wait...', 'Subscribe'); showFixedPopup('TplPopupMsg', 360, 250); }; function subscribeResponse (responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("subscribe").innerHTML = "Unsubscribe"; document.getElementById("subscribe").setAttribute('onclick', 'unsubscribeRequest(subscribe_user_id)'); subscribe_user_id = 0; document.getElementById("ConTplPopupMsg").className = "success_msg"; document.getElementById("ConTplPopupMsg").innerHTML = responseText; hidePopupTimeout('TplPopupMsg', 3000); } else if(responseText.match(/##error##/, responseText)) { responseText = responseText.replace("##error##", ""); document.getElementById("ConTplPopupMsg").innerHTML = responseText; hidePopupTimeout('TplPopupMsg', 3000); } else if(responseText.match(/##login##/, responseText)) { ajax.showForm('FrmPopupLogin', '', 360, 250, 'fixed', 'You are not logged in. Please wait...'); } else { //alert(responseText); } } //=======================================================// //----------------- Email to Friend ---------------------// //=======================================================// function popupEmailToFriendResponse(responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); showPopupMessage("FrmPopupEmailToFriend", responseText); hidePopupTimeout('FrmPopupEmailToFriend', 3000); } else if(responseText.match(/##error##/, responseText)) { responseText = responseText.replace("##error##", ""); document.getElementById("FrmPopupEmailToFriendMsg").innerHTML = responseText; reloadCaptchaCode(); } else { reloadCaptchaCode(); // alert(responseText); } } //=======================================================// //----------------- Report Abuse ---------------------// //=======================================================// function popupReportAbuseResponse(responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); showPopupMessage("FrmPopupReportAbuse", responseText); hidePopupTimeout('FrmPopupReportAbuse', 3000); } else if(responseText.match(/##error##/, responseText)) { responseText = responseText.replace("##error##", ""); document.getElementById("FrmPopupReportAbuseMsg").innerHTML = responseText; reloadCaptchaCode(); } else { reloadCaptchaCode(); // alert(responseText); } } //=======================================================// //----------------- Delete from favorites -------------------// //=======================================================// function favDeleteRequest(content_id) { if(ajaxRequestFlag==1) return; if(confirm("Are you sure want to delete?")==false) { return; } var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/member/favorites.php") var params = "act_name=ActFavDelete&content_id=" + content_id; ajax.setParams(params); ajax.setResponseMethod("favDeleteResponse"); ajax.sendRequest(); document.getElementById("ListFavoriteContentMsg").innerHTML = "Please wait..."; }; function favDeleteResponse (responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("ListFavoriteContent").innerHTML = responseText; var total_fav_count = parseInt(document.getElementById("total_fav_count").innerHTML); if(total_fav_count!='NaN') document.getElementById("total_fav_count").innerHTML = total_fav_count - 1; else document.getElementById("total_fav_count").innerHTML = 0; } else if(responseText.match(/##error##/, responseText)) { document.getElementById("ListFavoriteContentMsg").innerHTML = responseText; } else { //alert(responseText); } } function commentRequest() { document.getElementById("FrmCommentMsg").innerHTML = "Please wait..."; } function commentResponse(responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("LisComment").innerHTML = responseText; document.FrmComment.reset(); } else if(responseText.match(/##error##/, responseText)) { responseText = responseText.replace("##error##", ""); document.getElementById("FrmCommentMsg").innerHTML = responseText; } else { // alert(responseText); } } //=======================================================// //------------------------ showFrmPopupMsgSend ----------// //=======================================================// function showFrmPopupMsgSend (receiver_id) { if(ajaxRequestFlag==1) return; var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/member/ajax-show-form-popup-msg-send.php") var params = "receiver_id=" + receiver_id; ajax.setParams(params); ajax.setResponseMethod("loadFrmPopupMsgSend"); ajax.sendRequest(); hidePopup(); showPopupMessage('TplPopupMsg', 'Please wait...', 'Send message'); showFixedPopup('TplPopupMsg', 320, 250); }; function loadFrmPopupMsgSend (responseText) { hidePopup(); if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("FrmPopupMsgSend").innerHTML = responseText; showFixedPopup('FrmPopupMsgSend', 320, 250); } else if(responseText.match(/##error##/, responseText)) { responseText = responseText.replace("##error##", ""); document.getElementById("FrmPopupMsgSend").innerHTML = responseText; showFixedPopup('FrmPopupMsgSend', 320, 250); } else if(responseText.match(/##login##/, responseText)) { ajax.showForm('FrmPopupLogin', '', 320, 250, 'fixed', 'You are not logged in. Please wait...'); } else { //alert(responseText); } } function popupMsgSendResponse(responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("popupMsgSend").innerHTML = responseText; hidePopupTimeout('FrmPopupMsgSend', 3000); } else if(responseText.match(/##error##/, responseText)) { responseText = responseText.replace("##error##", ""); document.getElementById("FrmPopupMsgSendMsg").innerHTML = responseText; } else if(responseText.match(/##login##/, responseText)) { //ajax.showForm('FrmPopupLogin', '', 320, 250, 'fixed', 'You are not logged in. Please wait...'); } else { //alert(responseText); } } //=======================================================// //------------------------ showFrmPopupReportAbuse ----------// //=======================================================// function showFrmPopupReportAbuse (params) { if(ajaxRequestFlag==1) return; var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/ajax-show-form-popup-report-abuse.php") ajax.setParams(params); ajax.setResponseMethod("loadFrmPopupReportAbuse"); ajax.sendRequest(); hidePopup(); showPopupMessage('TplPopupMsg', 'Please wait...', 'Send message'); showFixedPopup('TplPopupMsg', 360, 250); }; function loadFrmPopupReportAbuse (responseText) { hidePopup(); if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("FrmPopupReportAbuse").innerHTML = responseText; showFixedPopup('FrmPopupReportAbuse', 360, 250); } else if(responseText.match(/##error##/, responseText)) { responseText = responseText.replace("##error##", ""); document.getElementById("FrmPopupReportAbuse").innerHTML = responseText; showFixedPopup('FrmPopupReportAbuse', 360, 250); } else if(responseText.match(/##login##/, responseText)) { ajax.showForm('FrmPopupLogin', '', 360, 250, 'fixed', 'You are not logged in. Please wait...'); } else { //alert(responseText); } } //=======================================================// //----------------- Delete content -------------------// //=======================================================// function deleteContentRequest(content_id) { if(ajaxRequestFlag==1) return; if(confirm("Are you sure want to delete?")==false) { return; } var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/index.php") var params = "act_name=ActUserContentDelete&content_id=" + content_id; ajax.setParams(params); ajax.setResponseMethod("deleteContentResponse"); ajax.sendRequest(); hidePopup(); showPopupMessage('TplPopupMsg', 'Please wait...', 'Content delete'); showFixedPopup('TplPopupMsg', 320, 250); }; function deleteContentResponse (responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("ConTplPopupMsg").className = "success_msg"; document.getElementById("ConTplPopupMsg").innerHTML = "Your content has been deleted successfully."; window.location.href = responseText; } else if(responseText.match(/##error##/, responseText)) { document.getElementById("ConTplPopupMsg").className = "msg"; document.getElementById("ConTplPopupMsg").innerHTML = responseText; hidePopupTimeout('TplPopupMsg', 3000); } else { alert(responseText); } } //================ START: Comment Voting ===================# function commentVoteRequest (result, comment_id) { if(ajaxRequestFlag==1) return; vote_comment_id = comment_id; var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/content.php") var params = "act_name=ActCommentVote&comment_id=" + comment_id + "&result=" + result; ajax.setParams(params); ajax.setResponseMethod("commentVoteResponse"); ajax.sendRequest(); hidePopup(); showPopupMessage('TplPopupMsg', 'Please wait...', 'Vote'); showFixedPopup('TplPopupMsg', 360, 250); }; function commentVoteResponse (responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("ConTplPopupMsg").className = "success_msg"; document.getElementById("ConTplPopupMsg").innerHTML = "You have voted successfully. Thank you."; document.getElementById("comment_vote" + vote_comment_id).innerHTML = responseText; hidePopupTimeout('TplPopupMsg', 3000); } else if(responseText.match(/##error##/, responseText)) { responseText = responseText.replace("##error##", ""); document.getElementById("ConTplPopupMsg").className = "msg"; document.getElementById("ConTplPopupMsg").innerHTML = responseText; hidePopupTimeout('TplPopupMsg', 3000); } else if(responseText.match(/##login##/, responseText)) { ajax.showForm('FrmPopupLogin', '', 360, 250, 'fixed', 'You are not logged in. Please wait...'); //responseText = responseText.replace("##login##", ""); //ajax.showForm('FrmCommentVoteIP', responseText, 360, 250, 'fixed', 'Please wait...'); } else { //alert(responseText); } } //================ END: Comment Voting ===================# //================ START: commentList ===================# function commentListRequest (url) { var ajax = new Ajax(); ajax.init(); ajax.setMethod("GET"); ajax.setUrl(url); ajax.setResponseMethod("commentListResponse"); ajax.sendRequest(); document.getElementById('actLisCommentMsg').innerHTML = "Please wait...

"; window.location.href = "#comments"; }; function commentListResponse (responseText) { document.getElementById('actLisCommentMsg').innerHTML = " "; if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("LisComment").innerHTML = responseText; } else if(responseText.match(/##error##/, responseText)) { //alert(responseText); } else { //alert(responseText); } } //================ END: commentList ===================# //================ start: commentList ===================# function topCommentListRequest (url) { var ajax = new Ajax(); ajax.init(); ajax.setMethod("GET"); ajax.setUrl(url); ajax.setResponseMethod("topCommentListResponse"); ajax.sendRequest(); }; function topCommentListResponse (responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("ListTopProfileComment").innerHTML = responseText; } else if(responseText.match(/##error##/, responseText)) { //alert(responseText); } else { //alert(responseText); } } //================ end: commentList ===================# //================ start: commentList ===================# function latestCommentListRequest (url) { var ajax = new Ajax(); ajax.init(); ajax.setMethod("GET"); ajax.setUrl(url); ajax.setResponseMethod("latestCommentListResponse"); ajax.sendRequest(); }; function latestCommentListResponse (responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("ListLatestProfileComment").innerHTML = responseText; } else if(responseText.match(/##error##/, responseText)) { //alert(responseText); } else { //alert(responseText); } } //================ end: commentList ===================# //================ start: commentList ===================# function latestFriendListRequest (url) { var ajax = new Ajax(); ajax.init(); ajax.setMethod("GET"); ajax.setUrl(url); ajax.setResponseMethod("latestFriendListResponse"); ajax.sendRequest(); }; function latestFriendListResponse (responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("ListLatestFriend").innerHTML = responseText; } else if(responseText.match(/##error##/, responseText)) { //alert(responseText); } else { //alert(responseText); } } //================ end: commentList ===================# function checkFrmPopupReportAbuse(report_abuse_info) { var comment_element = "comment_" + report_abuse_info; document.getElementById('comment_Violence').style.display = "none"; try { document.getElementById('comment_Adult').style.display = "none"; } catch(e){} try { document.getElementById('comment_Porn').style.display = "none"; } catch(e){} document.getElementById('comment_Illegal').style.display = "none"; document.getElementById('comment_Copyright').style.display = "none"; document.getElementById(comment_element).style.display = "block"; } //=======================================================// //----------------- userBlockStatusRequest -------------------// //=======================================================// var userBlockStatusMsg; function userBlockStatusRequest(friend_id, msgElement) { if(ajaxRequestFlag==1) return; userBlockStatusMsg = msgElement; if(confirm("Are you sure?")==false) { return; } var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/member/msg-inbox.php") var params = "act_name=ActBlockUser&friend_id=" + friend_id; ajax.setParams(params); ajax.setResponseMethod("userBlockStatusResponse"); ajax.sendRequest(); window.location.href = "#msg"; document.getElementById(userBlockStatusMsg).innerHTML = "Please wait..."; } function userBlockStatusResponse (responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById(userBlockStatusMsg).innerHTML = responseText; window.location.reload(); } else if(responseText.match(/##error##/, responseText)) { document.getElementById(userBlockStatusMsg).innerHTML = responseText; } else { //alert(responseText); } } function closeBroadcastMessage() { document.getElementById("broadcast_msg").style.display = "none"; var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/ajax-close-broadcast-msg.php"); ajax.sendRequest(); }; //================ START: ListItem ===================# var ajx_cat_id = 0; function requestListItem (url, cat_id, elementID) { ajx_cat_id = cat_id; var ajax = new Ajax(); ajax.init(); ajax.setMethod("GET"); ajax.setUrl(url); ajax.setResponseMethod("responseListItem"); ajax.sendRequest(); document.getElementById("cat_msg_" + cat_id).innerHTML = "Please wait...

"; //window.location.href = "#cat_msg_" + cat_id; elementID.parentNode.innerHTML = '..'; }; function responseListItem (responseText) { cat_id = ajx_cat_id; document.getElementById("cat_msg_" + cat_id).innerHTML = " "; if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("ListItem_" + cat_id).innerHTML = responseText; } else if(responseText.match(/##error##/, responseText)) { //alert(responseText); } else { //alert(responseText); } } //================ END: ListItem ===================# //================ START: ListHomeItem ===================# function requestListHomeItem (url, cat_id, elementID) { var ajax = new Ajax(); ajax.init(); ajax.setMethod("GET"); ajax.setUrl(url); ajax.setResponseMethod("responseListHomeItem"); ajax.sendRequest(); elementID.parentNode.innerHTML = '..'; }; function responseListHomeItem (responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("ListHomeItem").innerHTML = responseText; } else if(responseText.match(/##error##/, responseText)) { //alert(responseText); } else { //alert(responseText); } } //================ END: ListHomeItem ===================# function showItemDetails (item_id) { if(ajaxRequestFlag==1) return; hidePopup(); showPopupMessage('TplPopupMsg', 'Please wait...', 'Item Details'); showFixedPopup('TplPopupMsg', 500, 320); ajax.showTpl('TplPopupItemDetails', 'item_id=' + item_id, 500, 320); }; //=======================================================// var ajax_add2cart_item_id = 0; function requestAddToCart(item_id) { if(ajaxRequestFlag==1) return; ajax_add2cart_item_id = item_id; var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/index.php") var frmName = "FrmAddToCart" + item_id; ajax.setParamsByForm(frmName); ajax.setResponseMethod("responseAddToCart"); ajax.sendRequest(); document.getElementById('add2cart_msg' + ajax_add2cart_item_id).className = "add2cart_loader"; }; function responseAddToCart (responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById('add2cart_msg' + ajax_add2cart_item_id).className = "add2cart_tick"; requestViewCart(); } else if(responseText.match(/##error##/, responseText)) { // } else { //alert(responseText); } } function requestCartItemRemove(item_id) { if(ajaxRequestFlag==1) return; if(!confirm('Are you sure?')) return; var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/index.php") var params = "act_name=ActCartItemRemove&item_id=" + item_id; ajax.setParams(params); ajax.setResponseMethod("responseCartItemRemove"); ajax.sendRequest(); document.getElementById('TplCartMsg').innerHTML = "Pease wait..."; }; function responseCartItemRemove (responseText) { document.getElementById('TplCartMsg').innerHTML = " "; if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("TplCart").innerHTML = responseText; requestViewCart(); } else if(responseText.match(/##error##/, responseText)) { // } else { //alert(responseText); } } function requestViewCart() { var ajax = new Ajax(); ajax.init(); ajax.setUrl("http://www.stampshobby.com/ajax-view-cart.php") var params = ""; ajax.setParams(params); ajax.setResponseMethod("responseViewCart"); ajax.sendRequest(); document.getElementById('view_cart').innerHTML = "Pease wait..."; }; function responseViewCart (responseText) { if(responseText.match(/##success##/, responseText)) { responseText = responseText.replace("##success##", ""); document.getElementById("view_cart").innerHTML = responseText; } else if(responseText.match(/##error##/, responseText)) { // } else { //alert(responseText); } }