//
//  Guardian Island
//
//  support routines for version 5.2
//  (c) Bobby Scott / Guardian Island / Virtual Fulfillment Arts
//


var version = "5.2.7";

var debug = 00;
var frameset_on = 00;

//-----------------------
// Tweak Panel options
//-----------------------
var sound_on         = 01;  // play room sounds
var room_images_on   = 01;  // display room depictions
var graffiti_wall_on = 01;  // display the graffiti wall?
var auto_display     = 01;   // should a given room be depicted based on its name?

var forum_root   = "http://ageplay.org/GI/";
var support_root = "http://ageplay.org/GI_5_support/";

var definition_URL = "http://backsideoflove.com/glossary.html";


if (debug) document.write ('<BR />GI_5_SUPPORT.JS - v.' + version + '<BR /><BR /><BR />');

//
// check for manual redirects, primarily for moving the old GI_support_5/help to GI_support/docs
//
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 display_room (area, room, temp1, temp2, temp3) {
	var auto_display = 01;   // should a given room be depicted based on its name?
	if (debug) document.write (area + '_' + room);
	var img_url = ('<IMG src="' + support_root + 'images/rooms/' + area + '_' + room + '.jpg" border="0" class="room_depiction_style" alt="Depiction of the ' + room + ' room in GI\'s ' + area + ' area">');
	if (debug) img_url = (img_url + '<BR />[' + area + '_' + room + '.jpg]');


    if ((area == "community") && (room == "innerkids")) {
         auto_display = 00;  // don't auto display this room
         document.write ('<table border="1" style="border-collapse: collapse" bgcolor="#050048" bordercolor="#999999" cellpadding="10"><tr>');
         document.write ('	<td>');
         document.write ('              		<table border="0" style="border-collapse: collapse" width="100%" bordercolor="#000080"><tr>');
         document.write ('              			  <td align=center valign=middle>');
         document.write ('              			  		<img src="http://ageplay.org/GI_support/rooms/images/GI_center_bottomland_01.jpg" border="0">');
         document.write ('              			  		<br>(Yak)');
         document.write ('	       			  		</td>');
         document.write ('	       			  		<td align=center valign=middle>');
         document.write ('	       			  			<img src="http://ageplay.org/GI_support/rooms/images/GI_center_bottomland_02.jpg" border="0">');
         document.write ('	       			  			<br>(Pizza)');
         document.write ('       			  			</td>');
         document.write ('       			  			<td align=center valign=middle>');
         document.write ('	       			  			<img src="http://ageplay.org/GI_support/rooms/images/GI_center_bottomland_03.jpg" border="0">');
         document.write ('	       			  			<br>(Wiggy)');
         document.write ('       			  			</td>');
         document.write ('		  			</tr></table>');
         document.write ('		  			<center>');
         document.write ('		  			<font color="#808080" face="Garamond" size="2">');
         document.write ('			  			Endless pizza buffet served up by Wiggy, where kids can chill and yak about whatever\'s on their minds (discussion area just for Innerkids -- Guardians, please give them their space here, you have your own space in the <a href="http://ageplay.org/GI/index.php/board,83.0.html">Loco Parentis Pub</a>)');
         document.write ('		  			</font>');
         document.write ('		  			</center>');
         document.write ('	  			</td>');
         document.write ('  			</tr></table>');
	} // community/innerkids

	// snuggery_beach
    if ((area == "snuggery") && (room == "beach")) {
          auto_display = 00;  // don't auto display this room
          function snuggery_outside_beach() {};
          var snuggery_outside_beach = new snuggery_outside_beach();
          var snuggery_outside_beach_number = 0;
          snuggery_outside_beach[snuggery_outside_beach_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_beach_01.jpg' width='550' height='380' border='0'>";
          snuggery_outside_beach[snuggery_outside_beach_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_beach_02.jpg' width='550' height='380' border='0'>";
          snuggery_outside_beach[snuggery_outside_beach_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_beach_03.jpg' width='550' height='380' border='0'>";
          snuggery_outside_beach[snuggery_outside_beach_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_beach_04.jpg' width='550' height='380' border='0'>";
          snuggery_outside_beach[snuggery_outside_beach_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_beach_05.jpg' width='550' height='380' border='0'>";
          snuggery_outside_beach[snuggery_outside_beach_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_beach_06.jpg' width='550' height='380' border='0'>";
          snuggery_outside_beach[snuggery_outside_beach_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_beach_07.jpg' width='550' height='380' border='0'>";
          snuggery_outside_beach[snuggery_outside_beach_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_beach_08.jpg' width='550' height='380' border='0'>";
          snuggery_outside_beach[snuggery_outside_beach_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_beach_09.jpg' width='550' height='380' border='0'>";
          snuggery_outside_beach[snuggery_outside_beach_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_beach_10.jpg' width='550' height='380' border='0'>";
          snuggery_outside_beach[snuggery_outside_beach_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_beach_11.jpg' width='550' height='380' border='0'>";
          var snuggery_outside_beach_random_number = Math.floor(Math.random() * snuggery_outside_beach_number);
          document.write(snuggery_outside_beach[snuggery_outside_beach_random_number]);
     } // snuggery_beach

     // snuggery_forest
     if ((area == "snuggery") && (room == "forest")) {
          auto_display = 00;  // don't auto display this room
          function snuggery_outside_forest() {};
          var snuggery_outside_forest = new snuggery_outside_forest();
          var snuggery_outside_forest_number = 0;
          snuggery_outside_forest[snuggery_outside_forest_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_forest_01.jpg' border='0'>";
          snuggery_outside_forest[snuggery_outside_forest_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_forest_02.jpg' border='0'>";
          snuggery_outside_forest[snuggery_outside_forest_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_forest_03.jpg' border='0'>";
          snuggery_outside_forest[snuggery_outside_forest_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_forest_04.jpg' border='0'>";
          snuggery_outside_forest[snuggery_outside_forest_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_forest_05.jpg' border='0'>";
          snuggery_outside_forest[snuggery_outside_forest_number++] = "<img src='http://ageplay.org/GI_5_support/images/rooms/snuggery_outside_forest_06.jpg' border='0'>";
          var snuggery_outside_forest_random_number = Math.floor(Math.random() * snuggery_outside_forest_number);
          document.write(snuggery_outside_forest[snuggery_outside_forest_random_number]);
     }  // snuggery_outside_forest

 
	if (auto_display) {
		document.write ('<table width="1" height="1" border="2" align="left" cellpadding="5" cellspacing="0" bordercolor="#660033" bgcolor="#000066" style="border-collapse: collapse;"><tr>');
     	document.write ('<td align="left" valign="middle">');
		document.write (img_url); // either stock image call or customized string inserted. elegant!  :)
		document.write ('</td></tr></table>');
	}  // if custom display wasn't triggered
		
} // display_room


//
var popUpWin=0;
function OpenWin(URLStr)	{
	var left  = 00;
	var right = 00;
	var width = 775;
	var height= 575;
	if(popUpWin)  {
		if(!popUpWin.closed) popUpWin.close();
	}
	popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}


/////////////////////////////////////////////////////////////////////////////////
function definition (defStr) {
	OpenWin (definition_URL + "#" + defStr);
}


function GI_copyright () {
	document.write ('<DIV class="GI_copyright_style"><IMG src="http://ageplay.org/GI_5_support/images/pixel_transparent.gif" height="275" width="100%" border="0" alt="invisible pixel for spacing" /><BR /><EM></EM><BR />&copy;1995-2012 <A href="http://ageplay.org/GI" target="_top">Guardian Island</A>&#8482; / <A href="http://ageplay.org/GI_5_support/contact/contact_UB.html" target="_blank">Unka Bobby</A> / <A href="http://backsideoflove.com" target="_blank">Backside Publishing</A><BR /><IMG src="http://ageplay.org/GI_5_support/images/pixel_transparent.gif" height="22" width="100%" border="0" alt="invisible pixel for spacing" /><BR /></DIV>');
}



// ( ; )


