// Break out of frames
eval(function(p,a,c,k,e,r){e=String;if(!''.replace(/^/,String)){while(c--)r[c]=k[c]||c;k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('2(0!=3){0.1.4(1.5)}',6,6,'parent|location|if|window|replace|href'.split('|'),0,{}))
// Toplist object
function tpL(cat,wgt,href,src,txt,off,dsc,flg){
this.cat=cat;this.wgt=wgt;this.href=href;this.src=src;this.txt=txt;this.off=off;this.dsc=dsc;this.flg=flg}

// Note: categories fe=fetish, bd=bdsm, as=asian, sp=spanking, fd=femdom, ge=general etc.
// Note: weightings 3=top, 2=medium, 1=low, 0=off (in fact any weighting is possible)
// Note: flag 4=A1+ 3=Hot, 2=Cool, 1=new, 0=No Flag

// toplists
tplA=new Array();
tplA.push(new tpL('sp', 1, 'http://www.acrossmyknee.com/autorank/in.php?id=spankmix', '088031amk.gif', 'Across My Knee', 0));
tplA.push(new tpL('sp', 1, 'http://www.bareassspanking.com/cgi-bin/autorank/rankem.cgi?action=in&id=spankmix', '088031bas.gif', 'Bare Ass Spanking', 0));
tplA.push(new tpL('sp', 1, 'http://www.clubhr.nu/cgi-bin/arp/rankem.cgi?id=msp2007', '088031chr.gif', 'Club HR Spanking', 0));
tplA.push(new tpL('sp', 1, 'http://www.disciplinetop.com/autorank/in.php?id=msp2007', '088031dsc.gif', 'Discipline Top', 0));
tplA.push(new tpL('sp', 1, 'http://www.domestic-spanking.com/autorank/in.php?id=spankmix', '088031dst.gif', 'Domestic Spanking', 0));
tplA.push(new tpL('sp', 1, 'http://www.femdom-spanking.com/autorank/in.php?id=msp2007', '088031fds.gif', 'Femdom Spanking', 0));
tplA.push(new tpL('sp', 1, 'http://www.hotsites.nu/cgi-bin/sites/rankem.cgi?id=msp2007', '088031hnu.gif', 'Hot Spanking Sites', 0));
tplA.push(new tpL('sp', 1, 'http://www.ispank.nu/php/in.php?id=msp2007', '088031isp.gif', 'ISpank', 0));
tplA.push(new tpL('sp', 1, 'http://www.masterspank.com/cgi-bin/sites/rankem.cgi?id=spankmix', '088031gb2.gif', 'Master Spank', 0));
tplA.push(new tpL('sp', 1, 'http://www.overherknee.com/autorank/in.php?id=msp2007', '088031ohk.gif', 'Over Her Knee', 0));
tplA.push(new tpL('sp', 1, 'http://www.punishment-book.com/cgi-bin/100/in.cgi?id=spankmix', '088031pbt.gif', 'Punishment Book', 0));
tplA.push(new tpL('sp', 1, 'http://www.spankingdigest.com/cgi-bin/arp/rankem.cgi?action=in&id=spankmix', '088031rmt.gif', 'Romantic Spanking', 0));
tplA.push(new tpL('sp', 1, 'http://www.shanelle.co.uk/spank/in.php?id=msp2007', '088031shn.gif', 'Shans Spanking Tops', 0));
tplA.push(new tpL('sp', 1, 'http://www.spanked4u.com/cgi-bin/links/rankem.cgi?id=msp2007', '088031s4u.gif', 'Spanked 4 U', 0));
tplA.push(new tpL('sp', 1, 'http://www.spankingarts.com/cgi-bin/in.cgi?spankmix', '088031art.gif', 'Spanking Art Top', 0));
tplA.push(new tpL('sp', 1, 'http://www.spankingpicture.net/cgi-bin/top/rankem.cgi?id=msp2007', '088031dun.gif', 'Spanking Dungeon', 0));
tplA.push(new tpL('sp', 1, 'http://www.spankingfun4u.com/cgi-bin/sites/in.cgi?id=msp2007', '088031fun.gif', 'Spanking Fun 4 U', 0));
tplA.push(new tpL('sp', 1, 'http://www.spankingguide.com/cgi-bin/in.cgi?id=msp2007', '088031gid.gif', 'Spanking Guide', 0));
tplA.push(new tpL('sp', 1, 'http://www.spanking100.net/cgi-bin/top100/rankem.cgi?id=spankmix', '088031blb.gif', 'Spanking Hotline', 0));
tplA.push(new tpL('sp', 1, 'http://www.spankinglist.com/cgi-bin/in.cgi?id=msp2007', '088031sls.gif', 'Spanking List', 0));
tplA.push(new tpL('sp', 1, 'http://www.spankingonline.com/cgi-bin/topsites/in.cgi?id=spankmix', '088031spo.gif', 'Spanking Online', 0));
tplA.push(new tpL('sp', 1, 'http://www.spankingscout24.com/cgi-bin/top/topsites.cgi?hitin=msp2007', '088031sct.gif', 'Spanking Scout', 0));
tplA.push(new tpL('sp', 1, 'http://www.spankingtop100.com/cgi-bin/topsites/rankem.cgi?id=spankmix', '088031spt.gif', 'Spanking Top 100', 0));
tplA.push(new tpL('sp', 1, 'http://www.temporarily-yours.nu/cgi-bin/spanking/topsites.cgi?msp2007', '088031tmp.gif', 'Spanking Topsites', 0));
tplA.push(new tpL('sp', 1, 'http://www.spankingyou.com/cgi-bin/autorank/rankem.cgi?id=msp2007', '088031you.gif', 'Spanking You Top', 0));
tplA.push(new tpL('sp', 1, 'http://www.spanklink.com/cgi-bin/toplist/in.cgi?id=msp2007', '088031spl.gif', 'SpankLink Tops', 0));
tplA.push(new tpL('sp', 1, 'http://www.spankovision.net/index.php?usr=msp2007', '088031sov.gif', 'Spank-o-Vision', 0));
tplA.push(new tpL('sp', 1, 'http://www.topspank.nu/php/in.php?id=msp2007', '088031top.gif', 'Top Spank 100', 0));
tplA.push(new tpL('sp', 1, 'http://www.touchyourtoes.net/autorank/in.php?id=spankmix', '088031ty1.gif', 'Touch Your Toes', 0));
tplA.push(new tpL('sp', 1, 'http://www.vip-spanking.net/toplist/in.php?id=3305', '088031vst.gif', 'VIP Spanking Top', 0));

// DEFAULT LINK
// Link object (in case links script doesn't load
if(typeof(window.Link) == 'undefined'){
 function Link(cat, flg, url, src, ht, wd, ttl, alt, dsc, wgt){ this.cat=cat; this.flg=flg; this.url=url; this.src=src; this.ht=ht; this.wd=wd; this.ttl=ttl; this.alt=alt; this.dsc=dsc; this.wgt=wgt;}
}
// Note: categories fe=fetish, bd=bdsm, as=asian, sp=spanking, fd=femdom, ge=general etc.
// Note: weightings 3=top, 2=medium, 1=low, 0=off (in fact any weighting is possible)
// Note: flag 4=A1+! 3=hot!, 2=cool!, 1=new!, 0=blank

// FLAGS
flgA = new Array();
flgA.push(''); // 0 = no flag
flgA.push('New'); // 1
flgA.push('Cool'); // 2
flgA.push('Hot'); // 3
flgA.push('A1'); // 4

if(!window.rlsLink) var rlsLink=new Link('sp',4,'http://links.verotel.com/cgi-bin/showsite.verotel?vercode=15151:9804000000581719','470062rls.gif','62','470','Real Life Spankings','Strict domestic discipline in real life!','Strict real life strict domestic discipline. Real people, real punishments. Interactive domestic discipline site with hundreds of high quality movies and pics to download. Updated every 3 days!',3);
var rlsStr = makeSpoDiv(rlsLink);

// Special offer (editable)
if(window.offer){
 var offersA = new Array('vip','spp','rlp');
 var thePass = new Link('sp',0,'http://www.affiliate-cash.de/kunden.php?nummer=610837684&progid=20753&customparm=nopop','470062vip.gif','62','470','VIP Spanking','9 premium spanking sites for less than $2.50 per day!','Now with 9 exclusive spanking sites + 5 exclusive bonus sites. VIP access to a massive collection of movies and pics  - with a single $75.00 pass saving you $$$!',1);
 if(window.spoA && window.spoA.length > 0){
  if(window.offer == 'random') window.offer = offersA[Math.floor(Math.random()*offersA.length)];
  var thePass = getSpoByAbr(window.offer);
 }
 var offStr = makeSpoDiv(thePass); // make offer ad
}

// Webmaster's Pick (editable)
if(window.pick && window.spoA && window.spoA.length > 0){
 var abrA = new Array('fhv','srv','rls','csp');
 var picksA = new Array(3);
 picksA.push(getSpoByAbr(abrA[0]));
 picksA.push(getSpoByAbr(abrA[1]));
 picksA.push(getSpoByAbr(abrA[2]));
 picksA.push(getSpoByAbr(abrA[3]));
 picksA.sort(randOrd);
 var pickAbr = picksA[0].src.substr(6,3);
 var pick0Str = '<h4>Webmaster\'s Picks</h4><div class="pickDiv">';
 pick0Str += '<a title="'+picksA[0].alt+'" href="'+picksA[0].url+'" rel="external nofollow">';
 pick0Str += '<img class="img450" style="background: url(../spo/450270'+pickAbr+'.jpg) top center no-repeat;"';
 pick0Str += ' src="../spo/450270'+pickAbr+'.gif" alt="'+picksA[0].alt+'"></a><p>'+picksA[0].dsc+'</p>';
 var pick1Str = '<div class="pick1Wrap">';
 for(var i=1; i < 3; i++){
  pick1Str += '<a title="'+picksA[i].alt+'" href="'+picksA[i].url+'" rel="external nofollow">';
  pick1Str += '<img class="img150" src="../spo/150150'+picksA[i].src.substr(6,3)+'.gif" alt="'+picksA[i].ttl+' - '+picksA[i].alt+'"></a>';
 }
 pick1Str += '</div></div>';
}

// Toplists (editable)
if(window.noofTpl){
 tplA.sort(randOrd);
 var tplStr = '<div class="tplWrap">';
 tplStr += '<p>Keep this site 100% free! Give us a vote on one of these great top lists on your way out.</p>';
 for(var i=0; i < noofTpl; i++){
  myTpl = tplA[i];
  tplStr += '<a title="'+myTpl.txt+'" href="'+myTpl.href+'" rel="external">';
  tplStr += '<img src="'+tplDir+myTpl.src+'" border="0" alt="'+myTpl.txt+'"></a>';
 }
 tplStr += '</div><!-- /.tplWrap -->';
}
// function tpL(cat,wgt,href,src,txt,off,dsc,flg){

// Sponsors (editable)
if(window.spoGuide && window.spoGuide > 0 && window.spoA && window.spoA.length > 0){
 var flgDscA = new Array('Newly added site.', 'Good site.', 'Very good site.', 'Excellent site');
 var spoGuideStr = "<h3>Webmaster's Spanking Paysite Guide</h3>\n";
 spoGuideStr += '<p style="margin: 0 auto 10px auto; text-align: left;">Key: ';
 for(var i=1; i < flgA.length; i++){
  spoGuideStr += makeFlag(i) + ' ' + flgDscA[i-1];
 }
 spoGuideStr += "</p>\n";
 spoA.sort(randOrd);
 var guideA = spoA.slice(0, spoGuide-1);
 guideA.sort(sortByFlag);
 for(var i=0; i < guideA.length; i++){
  theSpo = guideA[i];
  spoGuideStr += makeSpoDiv(theSpo) + "\n";
 }
}

if(window.spoA && window.spoA.length > 0){
 spoA.sort(randOrd);
 var weightedA = getWeightedIndices(spoA,'sp',1);// Generate weighted array
 var txtSpoStr ='';
 if(window.txtSpo > 0){
  var txtSpoStr = '<div class="sdbWrap"><h4>Pay Site Free Tours:</h4><ul class="sdBarLst">';
  for(var i = 0; i < txtSpo; i++){
   var selectedTxt = 0;
   var theTxt = rlsLink;
   if(window.weightedA){
    selectedIndex = Math.floor(Math.random()*weightedA.length);
    theTxt = spoA[weightedA[selectedTxt]];
   }
   txtSpoStr += '<li><a title="'+theTxt.alt+'" href="'+theTxt.url+'">'+theTxt.ttl+'</a></li>';
   if(window.weightedA){
    weightedA = filterArray(weightedA[selectedTxt],weightedA); // Remove all instances of selected
    if(weightedA.length < 1) weightedA = getWeightedIndices(spoA,'sp',2); // Regenerate weighted array
   }
  }
  txtSpoStr += "</ul></div>\n";
 }
 if(!window.noofSpo) var noofSpo = 10;
 var weightedA = getWeightedIndices(spoA,'sp',2);// Generate weighted array
 for(var i = 0; i < noofSpo; i++){
  var selectedIndex = 0;
  var theLink = rlsLink;
  if(window.weightedA){
   selectedIndex = Math.floor(Math.random()*weightedA.length);
   theLink = spoA[weightedA[selectedIndex]];
  }
  eval('var spo'+i+'Str = \''+makeSpoDiv(theLink)+'\';');// make spo ad
  if(window.weightedA){
   weightedA = filterArray(weightedA[selectedIndex],weightedA); // Remove all instances of selected
   if(weightedA.length < 1) weightedA = getWeightedIndices(spoA,'sp',2); // Regenerate weighted array
  }
 }
}else{
 for(var i = 0; i < 10; i++){
  eval('var spo'+i+'Str = \''+rlsStr+'\';');// default to rls ad
 }
}

// NO EDITING REQUIRED BELOW THIS LINE
function getSpoByAbr(abr){
 for(i=0;i<spoA.length;i++){
  if(spoA[i].src.substr(6,3) == abr) return spoA[i];
 }
 return false;
}

function randOrd(){
 return (Math.round(Math.random())-0.5);
}

function sortByFlag(a, b) {
    var y = a.flg;
    var x = b.flg;
    return ((x < y) ? -1 : ((x > y) ? 1 : 0));
}

function writeSlot(str){
 writeStr = eval(str+'Str');
 document.write(writeStr);
}

function makeSpoDiv(theLink){
 var flagTxt = (theLink.flg == 4 ? flgA[theLink.flg]+'+!' : flgA[theLink.flg]+'!');
 var theStr = '<div class="spoDiv">';
 theStr += '<a href="'+theLink.url+'" title="'+theLink.alt+'" rel="external nofollow"><b>'+theLink.ttl+'</b></a>';
 theStr += makeFlag(theLink.flg);
 theStr += '<br><a href="'+theLink.url+'" title="'+theLink.alt+'" rel="external nofollow">';
 theStr += '<img src="'+spoDir+theLink.src+'" alt="'+theLink.alt+'">';
 theStr += '</a><br>'+theLink.dsc+'</div>'
 return theStr;
}

function makeFlag(flgId){
 var flgStr = '';
 if(flgId  > 0 ){
  var flagTxt = (flgId == 4 ? flgA[flgId]+'+!' : flgA[flgId]+'!');
  flgStr = '&nbsp;<span class="flag '+flgA[flgId]+'">'+flagTxt+'</span>';
 }
 return flgStr;
}

function randOrd(a, b){return (Math.round(Math.random())-0.5);}

function getWeightedIndices(unweightedA,cat,wgt){
// source array, category, minimum weight
 var re_cat = new RegExp('(^|\\s)' + cat + '($|\\s)', 'g');
 weightedA = new Array();
 for(a=0;a<unweightedA.length;a++){
  thisLink = unweightedA[a];
  if(cat.search(re_cat) != -1 && thisLink.wgt >= wgt){
   for(w=0;w<thisLink.wgt;w++){
    weightedA.push(a);
   }
  }
 }
 return weightedA;
}

function filterArray(theIndex,inA){
 outA = new Array();
 for(f=0;f<inA.length;f++){
  if(inA[f] != theIndex) outA.push(inA[f]);
 }
 return outA;
}

// Add to favorites
var favStr = '<span class="bt">[CTRL+D] to bookmark</span>';
if(window.sidebar || window.external || (window.opera && window.print)){
 var favLinkTxt = (window.external)? 'Add to favorites' : 'Bookmark this site';
 favStr = '<a href="javascript:addBookmark(\''+site+'\',\''+homeUrl+'\')">'+favLinkTxt+'</a>';
}

function addBookmark(title,url){
 if(window.sidebar){
  window.sidebar.addPanel(title,url,'');
 }else if(window.external){
  window.external.AddFavorite(url,title);
 }else if(window.opera && window.print){
  var elem = document.createElement('a');
  elem.setAttribute('href',url);
  elem.setAttribute('title',title);
  elem.setAttribute('rel','sidebar');
  elem.click();
 }else{
  return true;
 }
}

var emailUrl = 'http://www.fetish-sm.org/acf_fetishpages/';

// Popups
function popEmail(){
 sndEml=window.open(emailUrl,"email_pop","width=440,height=230");
 return false;
}

tagA = new Array('domestic discipline', 'bare butt spanking', 'OTK spanking', 'corporal punishment', 'spanking clips', 'punishment spanking', 'spanked bottoms', 'hard caning', 'severe whipping', 'paddling', 'hairbrush spanking', 'spanked bottoms', 'bare-bottom', 'real spankings', 'adult spanking', 'judicial caning', 'caning movies', 'caned schoolgirl', 'bare-ass whipping', 'spanking videos');
classA = new Array(10, 10, 10, 10, 10, 12, 12, 12, 12, 14, 14, 14, 16, 16);
tagA.sort(randOrd);
classA.sort(randOrd);
var noofTags = 10;
var srchUrl = 'http://proscriptio.skinvideo.com/redir/317/19027962/anaco/';
var srchName = 'SkinVideo19027962';
var bigTag = Math.floor(Math.random()*(noofTags));
var tagStr = '<div class="sdbWrap"><h4 title="Spanking video clips search at SkinVideo">Spanking Clips Search</h4><div id="cloud">'+"\n";
for(var i=0; i < noofTags; i++){
 var fontPx = (i == bigTag)? 22 : classA[Math.floor(Math.random()*(classA.length))];
 tagStr += '<a name="' + srchName + '" class="tag' + fontPx + '" href="' + srchUrl + '">' + tagA[i] + "</a>\n";
 tagA[i].wgt = Math.floor(Math.random()*(5));

}
tagStr += '</div><!-- /.cloud --></div><!-- /.sdbWrap -->';
