/* ADD ONLOAD FUNCTIONS */addLoadEvent(ClearImageLoaders);function togglefavorite(NewState, Id){if(NewState == 'add'){if(document.getElementById('favorite-' + Id)){element_html('favorite-'+Id, '<b>A</b>dd Favorite');} else {document.getElementById("star-" + Id).className = 'Ov_Star';}} else {if(document.getElementById('favorite-' + Id)){element_html('favorite-'+Id, '<b>R</b>emove Favorite');} else {document.getElementById("star-" + Id).className = 'Ov_Star_On';}}}function RemoveElement(Element) {if(document.getElementById(Element)){var Child = document.getElementById(Element);if(Child.parentNode){Child.parentNode.removeChild(Child);}}}function ClearImageLoaders(){var Elements = document.getElementsByClassName('Ov_Load');for (var i = 0; i < Elements.length; i++) {RemoveElement(Elements[i].id);}}var Animate = function(a){/* SET VARIABLES */Id = arguments[0];NumImgs = arguments[3];CurrCount = 4;ImgArray = arguments;Timeout = '';/* COVER IMAGE */Cover = document.getElementById('Top-'+Id);Orig_src = Cover.src;/* ADD IN EXISTING THUMBNAIL */arguments[4+NumImgs] = Orig_src;/* CREATE OVER IMAGE */Ov_Div = document.getElementById('Ov-'+Id);Over = new Image(arguments[1], arguments[2]);Over.src = Orig_src;Over.width = arguments[1];Over.height = arguments[2];Over.className = "Ov_Over";Over.id = "over"+Id;Ov_Div.appendChild(Over);/* CREATE UNDER IMAGE */Under = new Image(arguments[1], arguments[2]);Under.src = Orig_src;Under.width = arguments[1];Under.height = arguments[2];Under.className = "Ov_Under";Under.id = "under"+Id;Ov_Div.appendChild(Under);/* PRELOAD NEXT IMAGE */var prlimg = new Image();prlimg.src = ImgArray[5];/* CLEAR COVER IMAGE */Cover.src = 'http://www.savemyporn.com/layout/images/spacer.gif';/* START ANIMATION */if(NumImgs>0){Timeout=setTimeout("AnimateSwap()", 500);}};function AnimateSwap(){if(document.getElementById('over'+Id)){/* PRELOAD NEXT */var PrlPic = new Image();PrlPic.src = ImgArray[(CurrCount+1)];/* NEW IMAGE to UNDER */Under.src = ImgArray[CurrCount];/* FADE OVER */Effect.Fade('over'+Id, { duration: 0.8 });/* GET READY FOR NEXT SWAP */if((CurrCount-4)>NumImgs){CurrCount = 5;Under.src = ImgArray[4];} else {CurrCount++;}clearInterval();setTimeout("AniResetImage()", 900);setTimeout("AniShowImage()", 1200);Timeout=setTimeout("AnimateSwap()", 1300);}}function RemoveUnder(Id){var Div = document.getElementById('Ov-'+Id);var Image = document.getElementById('under'+Id);var Image2 = document.getElementById('over'+Id);Div.removeChild(Image);Div.removeChild(Image2);}function AniResetImage(){Over.src = Under.src;}function AniShowImage(){if(document.getElementById('over'+Id)){Effect.Appear('over'+Id, { duration: 0 });}}function AnimateReset(){clearInterval(Timeout);/* PUT COVER BACK */Cover.src = Orig_src;/* REMOVE UNDERS */var Div = document.getElementById('Ov-'+Id);var Image = document.getElementById('under'+Id);var Image2 = document.getElementById('over'+Id);Div.removeChild(Image);Div.removeChild(Image2);}function addLoadEvent(func) {  var oldonload = window.onload;  if (typeof window.onload != 'function') {    window.onload = func;  } else {    window.onload = function() {      if (oldonload) {        oldonload();      }      func();    }  }}function AddUnloadEvent(func) {  var oldunload = window.unload;  if (typeof window.unload != 'function') {    window.unload = func;  } else {    window.unload = function() {      if (oldunload) {        olunload();      }      func();    }  }}function SearchSwap2(Flag){if(document.getElementById('q2')){var Element = document.getElementById('q2');if(Element.value==''){Element.value='Search Here';}else if(Element.value=='Search Here'){Element.value='';}if(Flag == 1){Element.style.color='#000000';} else {Element.style.color='#9c9a8d';}}}function SearchSwap(Flag){if(document.getElementById('q')){var Element = document.getElementById('q');if(Element.value==''){Element.value='Search Here';}else if(Element.value=='Search Here'){Element.value='';}if(Flag == 1){Element.style.color='#000000';} else {Element.style.color='#e3e3bd';}}}function ajax(Url){window.frames['hiframe'].location=Url;}var ActualWidth = new Array;function ScaleImage(Id, MaxWidth){var IMG = document.getElementById(Id);ActualWidth[Id] = IMG.width;if(IMG.width>MaxWidth){IMG.style.width = MaxWidth+'px';}}function show_message(Id, Message){window.clearTimeout(window.timeoutid);element_html(Id, Message);Effect.SlideDown(Id, { duration: 0.3 });}function close_message(Id){window.timeoutid = setTimeout(function(){  Effect.SlideUp(Id, { duration: 0.3 }); }, 2500);/*window.setTimeout(function(){ element_html(Id, ''); Effect.show(Id); }, 3000);*/}function ToggleImage(Id, Max){Element = document.getElementById(Id);var actualWidth = ActualWidth[Id];if(!actualWidth){return false;}if(actualWidth > Element.width){Element.style.width = actualWidth+'px';ContainerResize(actualWidth);return true;}if(actualWidth <= Max){Element.style.width = actualWidth+'px';ContainerResize(Max);return true;}Element.style.width = Max+'px';ContainerResize(Max);}function ContainerResize(Width){document.getElementById('ImgContainter').style.width = (parseInt(Width)+5)+'px';}function s_h(Show, Hide){show(Show);hide(Hide);}function getSelectionId2(text, li) {change_value('q2', addslashes(li.id));document.q_form2.submit();}function getSelectionId(text, li) {change_value('q', addslashes(li.id));document.q_form.submit();}function addslashes(str) {return str.replace('"','\"');}function menu_swap(Element){/* GET ID */var temp = new Array();temp = Element.id.split('-');var TheId = temp[1];/* CHANGE STYLES & HIDE/SHOW */for (x = 1; x < 5; x++){force_style('subnav hide', 'subnav-'+x);force_style('a', 'nav-'+x);}force_style('a on', 'nav-'+TheId);force_style('subnav', 'subnav-'+TheId);/* HIDE SUB-MENUS */}function resetform(Element){if(Element.value==''){Element.value='type here to search';}else if(Element.value=='type here to search'){Element.value='';}}function s_q(Str){Str.replace("'","");Str.replace('"',"");return Str;}function addvalue(Name, Value){change_value(Name, element_value(Name) + "." + Value);}function deletevalue(Name, Value){change_value(Name,  element_value(Name).replace("."+Value, ""));}function change_image(name, NewImage){document.getElementById(name).src = NewImage;}function preload_images(Array){for (var i = 0; i < Array.length; i++) {  pic1= new Image(100,25);  pic1.src=Array[i];}}function preload_image(Image_Path){pic= new Image(5,5);pic.src=Image_Path;}function selectText(Element){Element.select();}function change_value(name, value){document.getElementById(name).value = value;}function change_title(name, value){document.getElementById(name).title = value;}function element_html(name, html){document.getElementById(name).innerHTML = html;}function inner_html(name){return document.getElementById(name).innerHTML;}function hide(Element){document.getElementById(Element).style.display = 'none';}function show(Element){document.getElementById(Element).style.display = 'block';}function element_display(name, display){ document.getElementById(name).style.display = display;}function element_value(name){return document.getElementById(name).value;}function element_width(name, new_width){document.getElementById(name).style.width = new_width;}function element_ok(name, message){document.getElementById(name).innerHTML = '<font class="orange">'+message+'</font>';}function element_bad(name, message){document.getElementById(name).innerHTML = '<font class="red">'+message+'</font>';}function throbber_on(name){show(name);element_html(name, '<img src="http://www.savemyporn.com/layout/images/throbber.gif">');}function throbber_message(name, message){show(name);element_html(name, '<img src="http://www.savemyporn.com/layout/images/throbber.gif" align="left">&nbsp;&nbsp;&nbsp;'+message);}function setfocus(name){document.getElementById(name).focus();}function throbber_off(name){var innerhtml = document.getElementById(name).innerHTML;innerhtml = innerhtml.replace('<img src="http://www.savemyporn.com/layout/images/throbber.gif">', "");element_html(name, innerhtml);}function loop_force_showhide(s_prefix,show,h_prefix,hide){for (x = 0; x < show.length; x++){forceshow(s_prefix+show[x]);}for (x = 0; x < hide.length; x++){forcehide(h_prefix+hide[x]);}}function loop_showhide(prefix,array){for (x = 0; x < array.length; x++){showhide(prefix+array[x]);}}function loop_show(prefix,array){for (x = 0; x < array.length; x++){forceshow(prefix+array[x]);}}function loop_hide(prefix,array){for (x = 0; x < array.length; x++){forcehide(prefix+array[x]);}}function showhide(ElementName){ElementId = document.getElementById(ElementName);     if (ElementId.style.display == 'none')     {          ElementId.style.display = 'block';     }     else     {          ElementId.style.display = 'none';     }}function forceshow(ElementName){ElementId = document.getElementById(ElementName);ElementId.style.display = 'block';}function forcehide(ElementName){ElementId = document.getElementById(ElementName);ElementId.style.display = 'none';}function loop_setstyle(style, s_prefix, array){for (x = 0; x < array.length; x++){force_style(style, s_prefix+array[x]);}}function force_style(style, ElementName){ElementId = document.getElementById(ElementName);ElementId.className=style;}function textCounter(field, countfield, maxlimit) {if (field.value.length > maxlimit){field.value = field.value.substring(0, maxlimit);} else {countfield.value = maxlimit - field.value.length;}}function ValidateMediaType(Element){var name = Element.value;var name = name.toLowerCase();var temp = new Array();temp = name.split('.');var type = temp[temp.length-1];if((type != "wmv") && (type != "mpeg") && (type != "mpg") && (type != "avi") && (type != "divx") && (type != "mp4") && (type != "flv") && (type != "asf")  && (type != "mov")  && (type != "rm")){alert('"' +type + '" Is an incorrect File Type');Element.value = "";}}function CleanComment(comment) {var reg = new RegExp("<([^<>\s]*)(\s[^<>]*)?>", "g");    return comment.replace(reg,"");}function donothing(){}function ResizeIt(offset){if (parseInt(navigator.appVersion)>3) {if (navigator.appName=="Netscape") {winH = window.innerHeight;}if (navigator.appName.indexOf("Microsoft")!=-1) {winH = document.body.offsetHeight;}}document.getElementById('iframe').style.height = (winH - offset)+'px';}function ValidateUrl(Url) {    var v = new RegExp();    v.compile("^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$");    if (!v.test(Url)) {        return true;    } else {    return false;    }}function popconfirm(message){var agree=confirm(message);if (agree){return true ;} else {return false ;}}function gotourl(url) {window.location = url;}function confirmmove(url){var agree=confirm("Are you sure you to Leave this page?");if (agree){window.location = url;return true ;} else {return false ;}}function confirmSubmit(message){var agree=confirm("Are you sure you to " + message);if (agree) {return true ;} else {return false ;}}function ShareThis(social_site, url, title, content){if (url != ''){if(social_site == 'delicious'){var url = 'http://del.icio.us/post?v=4&noui&jump=close&url=' + url + '&title=' + title;} else if (social_site == 'digg'){var url = 'http://digg.com/submit?phase=2&url=' + url + '&title=' + title + '&bodytext=' + content;} else if (social_site == 'dropjack'){var url = 'http://www.dropjack.com/submit.php?url=http://redirect.alexa.com/redirect?' + url + '&title=' + title;} else if (social_site == 'sphinn'){var url = 'http://sphinn.com/login.php?return=/submit.php?url=http://redirect.alexa.com/redirect?' + url + '&title=' + title;} else if (social_site == 'furl'){var url = 'http://furl.net/storeIt.jsp?u=http://redirect.alexa.com/redirect?' + url + '&t=' + title;} else if (social_site == 'netscape'){var url = 'http://www.netscape.com/submit/?U=http://redirect.alexa.com/redirect?' + url + '&T=' + title;} else if (social_site == 'yahoo'){var url = 'http://myweb2.search.yahoo.com/myresults/bookmarklet?u=' + url + '&t=' + title + '&ei=UTF-8';} else if (social_site == 'stumbleupon'){var url = 'http://www.stumbleupon.com/submit?url=' + url + '&title=' + title;} else if (social_site == 'google_bmarks'){var url = 'http://www.google.com/bookmarks/mark?op=edit&bkmk=http://redirect.alexa.com/redirect?' + url + '&title=' + title;} else if (social_site == 'technorati'){var url = 'http://www.technorati.com/faves?add=http://redirect.alexa.com/redirect??' + url;} else if (social_site == 'blinklist'){var url = 'http://blinklist.com/index.php?Action=Blink/addblink.php&Url=http://redirect.alexa.com/redirect?' + url + '&Title=' + title;} else if (social_site == 'newsvine'){var url = 'http://www.newsvine.com/_wine/save?u=http://redirect.alexa.com/redirect?' + url + '&h=' + title;} else if (social_site == 'magnolia'){var url = 'http://ma.gnolia.com/bookmarklet/add?url=http://redirect.alexa.com/redirect?' + url + '&title=' + title;} else if (social_site == 'reddit'){var url = 'http://reddit.com/submit?url=' + url + '&title=' + title;} else if (social_site == 'windows_live'){var url = 'https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url=http://redirect.alexa.com/redirect?' + url + '&title=' + title + '&top=1';} else if (social_site == 'tailrank'){var url = 'http://tailrank.com/share/?link_href=http://redirect.alexa.com/redirect?' + url + '&title=' + title;} else if (social_site == 'facebook'){var url = 'http://www.facebook.com/sharer.php?u=' + url + '&t=' + title;}window.open(url, 'ShareThis');}}function ajax(Url){window.frames['hiframe'].location=Url;}function ajaxload(url, ElementEndUpdate) {    var httpRequest;    loading();    if (window.XMLHttpRequest) {        httpRequest = new XMLHttpRequest();        if (httpRequest.overrideMimeType) {            httpRequest.overrideMimeType('text/html');        }    }    else if (window.ActiveXObject) {        try {            httpRequest = new ActiveXObject("Msxml2.XMLHTTP");        }        catch (e) {            try {                httpRequest = new ActiveXObject("Microsoft.XMLHTTP");            }            catch (e) {}        }    }    if (!httpRequest) {        alert('Giving up :( Cannot create an XMLHTTP instance');        return false;    }    httpRequest.onreadystatechange = function() { AjaxEnd(httpRequest, ElementEndUpdate); };    httpRequest.open('GET', url, true);    httpRequest.send('');}function AjaxEnd(httpRequest, ElementEndUpdate) {    if (httpRequest.readyState == 4) {        if (httpRequest.status == 200) {        element_html(ElementEndUpdate, httpRequest.responseText);        if(AjaxEndFunction){        AjaxEndFunction();        }        loaded();        } else {            calert('There Was An Error Processing Your Request. Please Try again.');        }    }}function loading() {show('loading');}function loaded() {hide('loading');}