// JavaScript Document var bHadPosted; var Cols; var CanPost; var ColWidth; var PostPadding = ""; function replaceIfFlash(version,element_id,replacement_string) { document.getElementById(element_id).innerHTML=replacement_string; }; function renderVideo(element_id,src,width,height,flashvars){ var agent=navigator.userAgent.toLowerCase();var is_iphone=(agent.indexOf("iphone")!=-1);if(is_iphone){document.getElementById(element_id).innerHTML=''}else{replaceIfFlash(10,element_id,'')} $(".video iframe").height(parseInt(ColWidth) * 0.8); $(".video iframe").width(parseInt(ColWidth)); $(".video iframe").css("height",parseInt(ColWidth) * 0.8 + "px"); $(".video embed").height(parseInt(ColWidth) * 0.8); $(".video embed").width(parseInt(ColWidth)); $(".video embed").css("height",parseInt(ColWidth) * 0.8 + "px"); }; function ShadowPad() { //alert(parseInt($("#post_padding").html() - (parseInt(ColWidth) * 0.04)) + "px"); //alert($("#post_padding").val() - $(".drop_shadow").css("height") + "px"); $(".post").css("margin-bottom","0px"); $(".post").css("margin-top","0px"); //$(".drop_shadow").css("margin-bottom",parseInt($("#post_padding").html() - (parseInt(ColWidth) * 0.04) - 1) + "px"); if (PostPadding == "") { PostPadding = parseInt((ColWidth * 0.04)); } //$(".drop_shadow").css("height", PostPadding + parseInt($("#post_padding").html() - (parseInt(ColWidth) * 0.04) - 1) + "px"); $(".drop_shadow").css("height", $("#post_padding").html() + "px"); $(".drop_shadow").css("margin-top","0 !important"); } $(document).ready(function() { switch("14346") { case "73366": break; default: newa.appendChild(newimg); document.body.appendChild(newa); //if ($("#" + Base64.decode("c3BvbnNvcg==") + " a").attr("href") != base64.decode("aHR0cDovL3d3dy5ib2F0aW5zdXJhbmNldWsuY28=")){$("#posts").css("display","none");} } if ($("#page_menu").html().indexOf("div") == -1) { $("#page_plus").hide(); } }) var NextNum = 1; function GetPosts(sCols, MinColWidth) { var MinusX; if (parseInt(sCols) > 7) { sCols = "7"; } if ("" != "") { sCols = ""; } //alert(document.getElementById("container").style.width); if(document.getElementById("container").style.width == "100%") { ColWidth = $(window).width() -17; MinusX = 40; //alert(ColWidth); }else if(document.getElementById("container").style.width == "80%") { ColWidth = ($(window).width() * 0.8); MinusX = 0; }else if(document.getElementById("container").style.width == "90%") { ColWidth = ($(window).width() * 0.9); MinusX = 0; }else if(document.getElementById("container").style.width == "95%") { ColWidth = ($(window).width() * 0.95); MinusX = 0; }else if(document.getElementById("container").style.width == "85%") { ColWidth = ($(window).width() * 0.85); MinusX = 0; }else if(document.getElementById("container").style.width == "50%") { ColWidth = ($(window).width() * 0.5); MinusX = 0; } else { MinusX = 40; ColWidth = parseInt(document.getElementById("container").style.width.replace("px","")) -17; } if (parseInt(((ColWidth / sCols))) > parseInt(MinColWidth)) { if ("" == "") { ColWidth = MinColWidth; }else { ColWidth = parseInt((ColWidth / sCols)); } } else { ColWidth = parseInt((ColWidth / sCols)); } //document.getElementById("posts").style.width = ((ColWidth * sCols) + (sCols * 20)) - MinusX + "px"; //al//ert((ColWidth * sCols)); document.getElementById("posts").style.width = (ColWidth * sCols) + "px"; // alert(ColWidth * sCols); Cols = sCols //alert(ColWidth); // Create columns 1st ColWidth = ColWidth - ((parseInt(document.getElementById("post_padding").innerHTML) * (parseInt(Cols) +1)) / parseInt(Cols)) //alert(ColWidth); for(i = 0; i < Cols; i ++) { if (document.getElementById("column" + i) == null) { var newdiv = document.createElement("div"); newdiv.setAttribute("id","column" + i); if (i == sCols -1) { newdiv.setAttribute("class","column columnlast"); }else { newdiv.setAttribute("class","column column" + i); } newdiv.setAttribute("style","width:" + ColWidth + "px;"); //if ($("#" + Base64.decode("c3BvbnNvcg==") + " a").attr("href") == Base64.decode("aHR0cDovL3d3dy5ib2F0aW5zdXJhbmNldWsuY28=")){ document.getElementById("posts").appendChild(newdiv); //} } } //GetMorePosts(); GetMorePosts(); } function DoOverlay() { //alert($(".photo").height()); //$(".photo .notes2middle").css("margin-left",parseInt(ColWidth / 2) - 60 + "px"); //$(".photo .notes2").css("margin-bottom",parseInt($(".photo .notes2 img").css("height") / 2) - 10 + "px"); //alert((parseInt(ColWidth) - (parseInt($(".photo .notes").width())) / 2)); //$("div").removeClass("notes2middle"); } function GetMorePosts() { //document.getElementById("posts_hidden").innerHTML = document.getElementById("posts_hidden").innerHTML.replace("audio_player_","xx_audio_player_"); var LoadFlashFile = false; if (CanPost == false) { return false; } CanPost = false; var HTMLage; var sasync = true; if (NextNum == 1) { sasync = false; }else { sasync = true; } var sPageName; if (document.getElementById("tag_page").innerHTML == "") { sPageName = "/page/"; }else { sPageName = "/tagged/" + document.getElementById("tag_page").innerHTML + "/page/"; } $.ajax({ url: sPageName + NextNum, async: sasync, success: function(data) { //alert(data.getElementById("posts_hidden").innerHTML); if (NextNum == 1) { async = false; data = document.getElementById("posts_hidden").innerHTML; } //data = data.replace(/audio_player_/g,"xx_audio_player_"); data = data.replace(//g,""); data = data.replace(/divabc/g,"div"); //data = data.replace(/xx_/g,""); data = data.replace(//g,""); data = data.replace(/<x>/g,""); data = data.replace(/<X>/g,""); if (data.indexOf("") >=0) { var sArr = data.split("") } else { var sArr = data.split("") } if (sArr[1].indexOf("") >=0) { var sArray = sArr[1].split(""); } else { var sArray = sArr[1].split(""); } x = 0 for(i = 0; i < sArray.length -1; i ++) { if (sArray[i].indexOf("audio") >= 0) { sArray[i] = sArray[i].replace("[Flash 9 is required to listen to audio.]",""); sArray[i] = sArray[i].replace("Flash 9 is required to listen to audio.]",""); sArray[i] = sArray[i].replace("[Flash 9 is required to listen to audio.]",""); sArray[i] = sArray[i].replace("Flash 9 is required to listen to audio.]",""); } if (sArray[i].indexOf("shadow_image") >= 0) { if (parseInt(document.getElementById("post_padding").innerHTML) < 10) { sArray[i] = sArray[i].replace("shadow_image","shadow_image_hide"); } } if (sArray[i].indexOf("notes2") >= 0) { console.log(parseInt(ColWidth / 2) - 60 + "px'"); sArray[i] = sArray[i].replace("notes2\"","notes2\"" + " style='margin-left:" + parseInt(parseInt(ColWidth / 2) - 60) + "px'"); // sArray[i] = sArray[i].replace("notes2\"","notes2\"" + " style='margin-left:15px'"); } if (sArray[i].indexOf("video") >= 0) { sArray[i] = sArray[i].replace("height=","height='" + parseInt(ColWidth) * 0.8 + "'" + " oldheight="); sArray[i] = sArray[i].replace("width=","oldwidth="); } if ("14346" == "45708") { //if (NextNum == 1) //{ //if (bHadPosted != true) //{ //$('#column' + x).append("
"); //bHadPosted = true; //} //} } var sAppend; sAppend = "
" if ($("#post_shadow").html() == "YES") { $('#column' + x).append(sArray[i] + sAppend); }else { $('#column' + x).append(sArray[i]); } $(".video iframe").height(parseInt(ColWidth) * 0.8); $(".video iframe").width(parseInt(ColWidth)); $(".video iframe").css("height",parseInt(ColWidth) * 0.8 + "px"); $(".video embed").height(parseInt(ColWidth) * 0.8); $(".video embed").width(parseInt(ColWidth)); $(".video embed").css("height",parseInt(ColWidth) * 0.8 + "px"); /* This is basic - uses default settings */ //alert($('.quote_title').html()); $("a#single_image").fancybox(); /* Using custom settings */ $("a#inline").fancybox({ 'hideOnContentClick': true }); //$(sArray[i]).appendTo('#column' + x); x = x + 1 if ($("#post_shadow").html() == "YES") { ShadowPad(); } if (x == Cols) { x = 0; } } CanPost = true; if (NextNum ==1) { NextNum = NextNum + 1; CanPost = true; GetMorePosts(); }else { if (NextNum ==2) { NextNum = NextNum + 1; CanPost = true; if (document.getElementById("tag_page").innerHTML == "") { GetMorePosts(); } }else { CanPost = true; NextNum = NextNum + 1; } } } }); }