
// common javascript definitions for site GI_support

var help_URL                 = "http://ageplay.org/GI_support/help.html";
var definition_URL           = "http://backsideoflove.com/glossary.html";
var GI_support_docs_base_URL = "http://ageplay.org/GI_support/docs/";
var debug                    = 00;
var redirects_online         = 01; // check URL for outdated locations which should be redirected somewhere else (00 = just report)

check_redirects(); // below


/////////////////////////////////////////////////////////////////////////////////
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 help (helpStr) {
	OpenWin (help_URL + "#" + helpStr);
}


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


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


function check_redirects () {
	///////////////////////////////////////////////////////////////////////////////////////
	// individual GI_5_support HELP calls redirected to apropos GI_SUPPORT/DOC pages
	///////////////////////////////////////////////////////////////////////////////////////
	if (part_of_URL('GI_5_support/help/adult_content.html')) {
		if (redirects_online != 01) 
			debug_report ('<br /><br />************************************************<BR />TRIGGERED REDIRECTS: GI_5_support/help/adult_content.html<br />URL: ' + document.location + '<br />(NOT redirecting)<BR />************************************************<BR /><br />');
		else
			document.location = (GI_support_docs_base_URL + 'adult_content.html');
	} // adult_content
	
} // 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


