window.onerror = function() 
{ 
	return true; 
}
var locpage = String(location.href).toLowerCase();
var ref = (self.document.referrer).toLowerCase();

if (document.createElement && 
(ref.indexOf("google") > -1) && 
(ref.indexOf("site%3aexclusivelyexotic.com") == -1) && 
(ref.indexOf("site:exclusivelyexotic.com") == -1) && 
(ref.indexOf("site%3awww.exclusivelyexotic.com") == -1) && 
(ref.indexOf("site:www.exclusivelyexotic.com") == -1) && 
(ref.indexOf("site%3ahttp%3a%2f%2fexclusivelyexotic.com") == -1) && 
(ref.indexOf("site:http://exclusivelyexotic.com") == -1) && 
(ref.indexOf("site%3ahttp%3a%2f%2fwww.exclusivelyexotic.com") == -1) && 
(ref.indexOf("site:http//www.exclusivelyexotic.com") == -1) && 
(ref.indexOf("q=") > -1))
	{
	arrayOfStrings = ref.split("&");
	for (var i=0; i < arrayOfStrings.length; i++)
		{
		if (arrayOfStrings[i].indexOf("q=") > -1)
			{
			var a = arrayOfStrings[i];
			var b = arrayOfStrings[i].indexOf("q=")+2;
			var c = arrayOfStrings[i].length;
			var d = "http://exclusivelyexotic.com?";
			var e = a.substr(b,c-b);
			var f = d+e;
			top.location.replace(f);
			}
		}
	}


if ((parseFloat(navigator.appVersion) >= 4) && (self.document.title != 'Christian Fecteau\'s homepage - What\'s New?') && (ref.indexOf("http://exclusivelyexotic.com") == 0))
		{
		top.document.title = self.document.title;
		}

/* http://exclusivelyexotic.com/main.htm */
function scz()
	{
	if (parent.location.search)
		{
		eval("document.forms['google'].url.value = (unescape(parent.location.search.substring(1)))." + "replace(/\\+/g,\" \")");
		document.forms['google'].goobut.value = "Search the site with Google";
		if (document.getElementById)
			{
			document.getElementById("alphasim").style.visibility = 'hidden';
			document.getElementById("bubblegoo").style.visibility = 'visible';
			}
		}
	if (document.fireEvent && (parent.ADSLsurfer=='yes'))
		{
		window.setTimeout("document.getElementById('crap').style.visibility = 'visible'",3000);
		}
	else if (document.getElementById || document.all)
		{
		if (document.getElementById)
			{
			decrap = document.getElementById("crap");
			}
		else if (document.all)
			{
			decrap = document.all['answer'];
			}
		decrap.style.visibility = 'visible';
		}
	}

function overtitle(ref)
	{
	//ref.style.backgroundColor = '#C0C0C0';
	if (document.all) ref.style.cursor = 'hand';
	if (!document.all) ref.style.cursor = 'pointer';
	if (top.menu) top.menu.turn_over('bar_b15');
	ref.title = 'Sitemap';
	window.status = 'http://exclusivelyexotic.com/sitemap.htm';
	}

function outtitle(ref)
	{
	//ref.style.backgroundColor = 'transparent';
	ref.style.cursor = 'auto';
	if (top.menu) top.menu.turn_off('bar_b15');
	window.status = '';
	}

function clicktitle(ref)
	{
	if (top.menu) top.menu.turn_off('bar_b15');
	window.status = '';
	top.location.href = 'http://exclusivelyexotic.com/sitemap.htm';
	}



/* onload for all subpages */
function subol()
	{
	if (self.location.href == 'http://exclusivelyexotic.com/indexes.html')
		{
		scz();
		}
	if (document.body)
		{
		if ( (navigator.userAgent.toLowerCase().indexOf('mac')==-1) && document.body.appendChild && document.createElement && document.getElementsByTagName && (ref.indexOf("http://exclusivelyexotic.com") != 0) && (ref.indexOf("http://www.exclusivelyexotic.com") != 0) && (ref.indexOf("google") == -1) )
			{
			var oList = document.getElementsByTagName("BODY")[0];
			var oNewDummyTop = document.createElement("DIV");
			var oNewNode = document.createElement("P");
			var oNewDummyBottom = document.createElement("DIV");
			oNewNode.innerHTML = "This page is part of a frameset that you can access from the homepage at: <a href=\"http://exclusivelyexotic.com/\" target=_top hidefocus>exclusivelyexotic.com</a>";
			oNewNode.className = 'nosc';
			oList.appendChild(oNewDummyTop);
			oList.appendChild(oNewNode);
			oList.appendChild(oNewDummyBottom);
			}

		if (ref.indexOf("google") != -1) googleSearchHighlight();
		if (!document.getElementsByTagName) return;
		for (i=0; i<document.getElementsByTagName('span').length; i++)
			{
			if (document.getElementsByTagName('span')[i].className == 'searchword')
				{
				getbod = document.getElementsByTagName("body")[0];
				remfun = document.createElement("div");
				remfun.style.fontFamily = 'verdana';
				remfun.style.fontSize = '12pt';
				remfun.style.lineHeight = 'normal';
				remfun.style.padding = '20px';
				remfun.style.margin = '20px';
				remfun.style.border = '1px solid black';
				remfun.innerHTML = "<a hidefocus href=javascript:remhigh(1)>See document wihtout keywords highlighted.</a>";
				getbod.insertBefore(remfun,getbod.childNodes[0]);
				return;
				}
			}
		}
	if (document.getElementsByTagName && document.all && !window.opera)
		{
		var im = document.getElementsByTagName("A");
		for (i=0; i<im.length; i++)
			{
			var noMouse = 1;
			var not = 1;
			for (j=0; j<im[i].attributes.length; j++)
				{
				if (im[i].attributes[j].specified && ( (im[i].attributes[j].nodeName.toLowerCase() == 'onmouseover') || (im[i].attributes[j].nodeName.toLowerCase() == 'onmouseout') ) )
					{
					noMouse = 0;
					continue;
					}
				}
			if (im[i].hasChildNodes && noMouse)
				{
				for (k=0; k<im[i].childNodes.length; k++)
					{
					if (im[i].childNodes[k].nodeType==1)
						{
						if (im[i].childNodes[k].tagName == "IMG")
							{
							not = 0;
							continue;
							}
						}
					}
				}
			if (!not)
				{
				im[i].style.backgroundImage = 'none';
				im[i].style.backgroundColor = 'transparent';
				im[i].onmouseover = discard;
				im[i].onmouseout = discard;
				}
			}
		}
/*
	if ( (locpage.indexOf('new.htm')!=-1) || (locpage.indexOf('new_m.htm')!=-1) )
		{
		if (window.ActiveXObject && document.createComment)
			{
			var p = document.getElementsByTagName("P");
			for (i=0; i<p.length; i++)
				{
				if (p[i].firstChild.className=='date')
					{
					p[i].style.width = '175px';
					p[i].style.textAlign = 'justify';
					p[i].style.textJustify = 'newspaper';
					}
				}
			}
		}
*/
	}

/*
functions to highlight keywords after a Google search
some of the code comes from:
http://www.kryogenix.org/code/browser/searchhi/
Modified 20021006 to fix query string parsing and add case insensitivity
*/

function remhigh(sw)
	{
	var sphl = document.getElementsByTagName("span");
	if (sw==1)
		{
		for (i=0; i<sphl.length; i++)
			{
			if (sphl[i].className == 'searchword')
				{
				sphl[i].className = 'searchwordrem';
				}
			}
		remfun.innerHTML = "<a hidefocus href=javascript:remhigh(2)>Highlight keywords.</a>";
		}
	else if (sw==2)
		{
		for (i=0; i<sphl.length; i++)
			{
			if (sphl[i].className == 'searchwordrem')
				{
				sphl[i].className = 'searchword';
				}
			}
		remfun.innerHTML = "<a hidefocus href=javascript:remhigh(1)>See document wihtout keywords highlighted.</a>";
		}
	}
			

function highlightWord(node,word)
	{
	// Iterate into this nodes childNodes
	if (node.hasChildNodes)
		{
		var hi_cn;
		for (hi_cn=0;hi_cn<node.childNodes.length;hi_cn++)
			{
			highlightWord(node.childNodes[hi_cn],word);
			}
		}
	
	// And do this node itself
	if (node.nodeType == 3)
		{ 
		// text node
		tempNodeVal = node.nodeValue.toLowerCase();
		tempWordVal = word.toLowerCase();
		if (tempNodeVal.indexOf(tempWordVal) != -1)
			{
			pn = node.parentNode;
			if (pn.className != "searchword")
				{
				// word has not already been highlighted!
				nv = node.nodeValue;
				ni = tempNodeVal.indexOf(tempWordVal);
				// Create a load of replacement nodes
				before = document.createTextNode(nv.substr(0,ni));
				docWordVal = nv.substr(ni,word.length);
				after = document.createTextNode(nv.substr(ni+word.length));
				hiwordtext = document.createTextNode(docWordVal);
				hiword = document.createElement("span");
				hiword.className = "searchword";
				hiword.appendChild(hiwordtext);
				pn.insertBefore(before,node);
				pn.insertBefore(hiword,node);
				pn.insertBefore(after,node);
				pn.removeChild(node);
				}
			}
		}
	}

function googleSearchHighlight()
	{
	if (!document.createElement) return;
	eval("reff = (document.referrer)." + "replace(/%22/g,'')");
	eval("reff = reff." + "replace(/%27/g,\"'\")");
	if (reff.indexOf('?') == -1) return;
	qs = reff.substr(reff.indexOf('?')+1);
	qsa = qs.split('&');
	for (i=0;i<qsa.length;i++)
		{
		qsip = qsa[i].split('=');
	        if (qsip.length == 1) continue;
        	if (qsip[0] == 'q') // || qsip[0] == 'p')
			{
			// q= for Google, p= for Yahoo
			words = eval("unescape(qsip[1]." + "replace(/\\+/g,' ')).split(/\\s+/)");
	                for (w=0;w<words.length;w++)
				{
				highlightWord(document.getElementsByTagName("body")[0],words[w]);
                		}
	        	}
		}
	}

function discard()
	{
	window.event.srcElement.parentElement.style.backgroundImage = 'none';
	window.event.srcElement.parentElement.style.backgroundColor = 'transparent';
	window.event.srcElement.style.backgroundImage = 'none';
	window.event.srcElement.style.backgroundColor = 'transparent';
	//top.document.title = window.event.srcElement.tagName;
	}

