
// common definitions for all Backside modules
// (c) 1995-2007 by Unka Bobby / BacksideOfLove.com


var ageplay_online = 01;		// include Ageplay material?
var readery_online = 01;		// is the readery online at all?
var PP_on = 01;			// are we using PP?

var redirects_online = 01; // check URL for outdated locations which should be redirected somewhere else (00 = just report)

var vaio = 00; // assume not vaio
		 
document.write ('<SCRIPT LANGUAGE="javascript" type="text/javascript" src="file:///C|/vaio.js">');
document.write ('</SCRIPT>');

var debug = 00;


function debug_report (debug_s) {
	document.write ('<br><br><br>');
	document.write ('<FONT COLOR="white" SIZE="3">DEBUG INFO: "' + debug_s + '"</FONT><br>');
	document.write ('<br><br><br>');
} // func


var were_online = 00;   // assume we're not online -- all modules should should try to load 
// HTTP://BACKSIDEOFLOVE.COM/JS/ONLINE_CHECK.JS which will reset this variable if loaded successfully


var backside_content_size_x = 630;
var backside_content_size_y = 430;
var backside_content_background_URL = "mainpage/content_background_template.jpg";

var readery_URL       = "http://backsideoflove.com/readery/index.html";
var spanking_URL      = "http://backsideoflove.com/spanking/index.html";
var ageplay_URL       = "http://backsideoflove.com/ageplay/index.html";
var carolyn_URL       = "http://backsideoflove.com/carolyn/index.html";


function check_redirects () {
	/////////////////////////////////////////////////////////////
	// all the old IDs for the Xine --> main Xine page
	/////////////////////////////////////////////////////////////
	if (  (part_of_URL('/loggedin')) || (part_of_URL('/rack')) ||
			(part_of_URL('0508')) || (part_of_URL('0509')) || (part_of_URL('0510')) || (part_of_URL('0511')) ||
			(part_of_URL('0607')) || (part_of_URL('0608')) || (part_of_URL('0609')) || (part_of_URL('0610'))  )	{
		if (redirects_online != 01) 
			debug_report ('<br /><br />************************************************<BR />TRIGGERED REDIRECTS: Xine<br />URL: ' + document.location + '<br />(NOT redirecting)<BR />************************************************<BR /><br />');
		else
			document.location = (backside_base_URL() + 'xine/index.html');
	} // if old xine location
	
	// relocated CONTACT forms
	if (  (part_of_URL('admin/contact')) )	{
		if (redirects_online != 01) 
			debug_report ('<br /><br />************************************************<BR />TRIGGERED REDIRECTS: Contacts<br />URL: ' + document.location + '<br />(NOT redirecting)<BR />************************************************<BR /><br />');
		else
			document.location = (backside_base_URL() + 'contacts/index.html');
	} // if old xine location

	// relocated GLOSSARY
	if (  (part_of_URL('backside/glossary')) )	{
		if (redirects_online != 01) 
			debug_report ('<br /><br />************************************************<BR />TRIGGERED REDIRECTS: Glossary<br />URL: ' + document.location + '<br />(NOT redirecting)<BR />************************************************<BR /><br />');
		else
			document.location = (backside_base_URL() + 'glossary.html');
	} // if old xine location

	// relocated /BACKSIDE/*.*
	if (  (part_of_URL('/backside/')) )	{
		if (redirects_online != 01) 
			debug_report ('<br /><br />************************************************<BR />TRIGGERED REDIRECTS: /backside/<br />URL: ' + document.location + '<br />(NOT redirecting)<BR />************************************************<BR /><br />');
		else
			document.location = (backside_base_URL() + 'index.html');
	} // if old xine location
} // func


function global_menu () {
	document.write ('<img height="15" width="100%" border="0" src="' + backside_base_URL() + 'images/pixel_transparent.gif">');
	document.write ('<table BGCOLOR="#4F0027" WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0">');
	document.write (	'<TR>');
	document.write (		'<td ALIGN="center" VALIGN="middle" class="global_TOC_header">');
	document.write (			'Backside of Love');
	document.write (		'</td>');
	document.write (	'</TR>');
	document.write (	'<TR>');
	document.write (		'<td ALIGN="center" VALIGN="middle" class="global_TOC">');
	document.write (			'<a TARGET="_blank" href="http://backsideoflove.com/index.html">Backside home</a><BR />');
	document.write (		'</td>');
	document.write (	'</TR>');
	document.write (	'<TR>');
	document.write (		'<td ALIGN="center" VALIGN="middle" class="global_TOC">');
	document.write (			'<a TARGET="_blank" href="http://backsideoflove.com/xine/index.html">magaXine<BR />');
	document.write (		'</td>');
	document.write (	'</TR>');
	document.write (	'<TR>');
	document.write (		'<td ALIGN="center" VALIGN="middle" class="global_TOC">');
	document.write (			'<a TARGET="_blank" href="http://backsideoflove.com/readery/index.html">bookstore</a><BR />');
	document.write (		'</td>');
	document.write (	'</TR>');
	document.write ('</table>');
} // func


function backside_base_URL () {
	if (vaio == 01) {
		return "file:///h:/_working/_Webmeistery/BacksideOfLove.com_X2/";
	}
	else {
		return "http://backsideoflove.com/";
	}
} // func


function part_of_URL (s) {
	var poU_s = ' ';
	poU_s = (document.location + poU_s);
	if (poU_s.indexOf(s) > -1)
		return 01;
	else
		return 00;
} // func


function redirect (url) {
	document.write ('<p>&nbsp;</p>');
	document.write ('<p align="left"> ');
	document.write ('<FONT COLOR="#808080" SIZE="1" FACE="Arial">Please <a STYLE="color: #808080;" href="' + url + '">click here</a> if this message lingers...</FONT>');
	document.location = url;
	document.write ('</div> ');
} // func


//////////////////////////////////////
var document_popUpWin=0;
function document_window (URL) {
	var winW = 1000, winH = 500;
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
			winW = window.innerWidth;
			winH = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) {
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
	}
	winW = (winW - 40);
	winH = (winH + 80);  // add height 'cause control-space isn't counted above
	if(document_popUpWin)  {
	    if(!document_popUpWin.closed) document_popUpWin.close();
	}
	document_popUpWin = open(URL, 'document_popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=' + winW + ',height=' + winH + ',left=0,top=0,screenX=0,screenY=0');
} // function document_window



var document_sized_popUpWin=0;
function document_window_sized (URL, w, h) {
	if(document_sized_popUpWin)  {
	    if(!document_sized_popUpWin.closed) document_sized_popUpWin.close();
	}
	document_sized_popUpWin = open(URL, 'document_popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=' + w + ',height=' + h + ',left=0,top=0,screenX=0,screenY=0');
} // func


///////////////////////////////////
function definition (term) {
	var url_str = ("http://backsideoflove.com/glossary.html#" + term);
	
	
	
	var popUpWin = 0;
	var width    = 700;
	var height   = 500;
	var left     = 01;
	var top      = 01;
 	if(popUpWin) {
	    if(!popUpWin.closed) popUpWin.close();
	}
	popUpWin = open(url_str, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
} // definition



var message_popUpWin = 0;
////////////////////////////////////////////
function messageWindow(title, msg)  {
	var width="300", height="125";
	var left = (screen.width/2) - width/2;
	var top = (screen.height/2) - height/2;
	var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;

	if(message_popUpWin)  {
	    if(!message_popUpWin.closed) message_popUpWin.close();
	} // if

	var message_popUpWin = window.open("","msgWindow", styleStr);
	var head = '<HTML><head><TITLE>'+title+'</TITLE></HEAD><BODY BGCOLOR="#000033" TEXT="yellow" margintop="0" marginright="0">';
	
	var body = '<TABLE border="0" bordercolor="pink" height="120" width="290" cellpadding="10" cellspacing="0"><TR><TD align="center" valign="middle"><FONT face="Trebuchet MS" color="yellow" size="3">'+msg+'</FONT><BR /><BR />[ <A href="javascript:window.close()"><FONT color="#808080" size="1" face="Arial">close</FONT></A> ]</TD></TR></TABLE> <script language="javascript" type="text/javascript">setTimeout("window.close()", 4000);</script></BODY></HTML>';
	
	
//	body = (body + '<FORM><input type="button" value="   Done   " ONCLICK="document.close()"></FORM></BODY>';
	message_popUpWin.document.write(head + body);
}


// mf ff fm rl nf dd ds xx ** !! verb med water age diaper
// must be in lower case
// display_content_keys("mf ff fm rl nf dd ds xx ** !! verb med water age diaper");
function display_content_keys (keys) {
     document.write ('<DIV ALIGN="right" CLASS="content_key_style" >');
     document.write ('<table align="right" BORDER="0" WIDTH="10" HEIGHT="1" BGCOLOR="#2A0021" CELLSPACING="0" CELLPADDING="0">');
     document.write ('<tr>');
     document.write ('<td NOWRAP class="content_key_style" nowrap align="right" valign="top">');
     document.write (' content: ');

      var s = " ";
     s = (s + keys);

     i = s.indexOf("mf");
          if (i != -1) document.write (' <a title="Male-dominant / Female-submissive themes" href="javascript:document_window(\'http://backsideoflove.com/admin/content.html#MF\')">MF</a> ');

     i = s.indexOf("ff");
          if (i != -1) document.write (' <a TARGET="_blank" title="Female-dominant / Female-submissive themes" href="http://backsideoflove.com/help/content.html#FF">FF</a> ');

     i = s.indexOf("fm");
          if (i != -1) document.write (' <a TARGET="_blank" title="Female-dominant / Male-submissive themes" href="http://backsideoflove.com/help/content.html#FM">FM</a> ');

     i = s.indexOf("rl");
          if (i != -1) document.write (' <a TARGET="_blank" title="Real-life event" href="http://backsideoflove.com/help/content.html#RL">RL</a> ');

     i = s.indexOf("nf");
          if (i != -1) document.write (' <a TARGET="_blank" title="Non-fiction piece" href=" http://backsideoflove.com/backside/admin/content.html#NF">NF</a> ');

     i = s.indexOf("dd");
          if (i != -1) document.write (' <a TARGET="_blank" title="Domestic Discipline" href=" http://backsideoflove.com/backside/admin/content.html#DD">DD</a> ');

     i = s.indexOf("ds");
          if (i != -1) document.write (' <a TARGET="_blank" title="Dominance/submission (other than just Domestic Discipline)" href="http://backsideoflove.com/help/content.html#DS">Ds</a> ');

     i = s.indexOf("xx");
          if (i != -1) document.write (' <a TARGET="_blank" title="Explicit sexuality depicted" href="http://backsideoflove.com/help/content.html#XX">XX</a> ');

     i = s.indexOf("**");
          if (i != -1) document.write (' <a TARGET="_blank" title="Anal-erotic content"href="http://backsideoflove.com/help/content.html#**">**</a> ');

     i = s.indexOf("!!");
          if (i != -1) document.write (' <a TARGET="_blank" title="Edgeplay - Intense, edgier themes, not for everyone" href=" http://backsideoflove.com/backside/admin/content.html#!!">!!</a> ');

     i = s.indexOf("verb");
          if (i != -1) document.write (' <a TARGET="_blank" title="Strong verbal content (scolding, embarrassment, etc.)" href="http://backsideoflove.com/help/content.html#VERB">Verb</a> ');

     i = s.indexOf("med");
          if (i != -1) document.write (' <a TARGET="_blank" title="Medical themes" href="http://backsideoflove.com/help/content.html#MED">Med</a> ');

     i = s.indexOf("water");
          if (i != -1) document.write (' <a TARGET="_blank" title="*Mild* watersport (enemas, non-scat bathroom scenes, etc)" href="http://backsideoflove.com/help/content.html#WATER">Water</a> ');

     i = s.indexOf("age");
          if (i != -1) document.write (' <a TARGET="_blank" title="Adult Ageplay themes" href="http://backsideoflove.com/help/content.html#AGE">Age</a> ');

     i = s.indexOf("diap");
          if (i != -1) document.write (' <a TARGET="_blank" title="Adults wearing diapers" href="http://backsideoflove.com/help/content.html#DIAPERS">Diapers</a> ');

    document.write (' </td></tr></table>');
     document.write ('</DIV>');
}

////////////////////////////////////////////////////
// problem-reporting definitions

var report_email_subject = '(problem.contact)';
var report_email_to = 'problem.contact@backsideoflove.com';
var report_email_from = 'problem.contact@backsideoflove.com';
var report_email_form_URL = 'http://virtualfulfillmentarts.com/scgi-bin/FormMail.pl';
var report_email_redirect_URL = 'http://backsideoflove.com/close_window.html';


// msg = displayed to user
// prob = prob descr. emailed to me
// file = URL it occured in (usually passed as "document.location"
function report_problem (msg, prob, filename) {
	var width="500";
	var height="200";
	var left = (screen.width/2) - width/2;
	var top = (screen.height/2) - height/2;
	var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
	var prob_win = window.open("","msgWindow", styleStr);

	prob_win.document.write ('<HTML><head><TITLE>BacksideOfLove.com</TITLE></head><BODY BGCOLOR="#000033" TEXT="#808080" LINK="#000000" VISITED="#805656>');
	prob_win.document.write ('<table width="90%" height="100%" ALIGN="center" BORDER="1"><tr><td ALIGN="center" VALIGN="middle" STYLE="text-align:center;">');

	prob_win.document.write ('<p align="center"> ');
	prob_win.document.write ('</p>');

	prob_win.document.write ('<p align="center">');
	prob_win.document.write (msg);
	prob_win.document.write ('</p>');

	prob_win.document.write ('<p align="center"> ');
	prob_win.document.write ('</p>');

	prob_win.document.write ('<p align="center">');
	prob_win.document.write ('<DIV ALIGN="center">');
	prob_win.document.write ('<FORM NAME="problem_report_form" ACTION=' + report_email_form_URL + ' METHOD=post>');
	prob_win.document.write ('	<input type=hidden value=1 name=print_blank_fields>');
	prob_win.document.write ('	<input type=hidden value="' + report_email_from + '" name=email>');
	prob_win.document.write ('	<input type=hidden value="' + report_email_subject + '" name=subject>');
	prob_win.document.write ('	<input type=hidden value="' + report_email_to + '" name=recipient>');
	prob_win.document.write ('	<input type=hidden value="' + prob + '" name=Problem>');
	prob_win.document.write ('	<input type=hidden value="' + filename + '" name=Filename>');
	prob_win.document.write ('	<input type=hidden value="' + report_email_redirect_URL + '" name=redirect>');
	prob_win.document.write ('	<input type="submit" value="Click here to continue" name="submit" ALIGN="center" >');
	prob_win.document.write ('</FORM>');

	prob_win.document.write ('</DIV>');
	prob_win.document.write ('</p>');

	prob_win.document.write ('</td></tr></table>');

	prob_win.document.write ('</BODY></HTML>');

}

check_redirects(); // above

