<!--

//(c) Ian Muscat 2007

function IE(e)
{
	if (navigator.appName == "Microsoft Internet Explorer" && (event.button == "2" || event.button == "3"))
	{
		return false;
	}
}
function NS(e)
{
	if (document.layers || (document.getElementById && !document.all))
	{
		if (e.which == "2" || e.which == "3")
		{
			return false;
		}
	}
}
document.onmousedown=IE;document.onmouseup=NS;document.oncontextmenu=new Function("return false");

//-->


<!--
/* The variable below determines what the home page, or the root directory,
of your site is named. The default is "Home". To use the address of your
site (www.yoursite.com), leave the value blank (nothing between the double quotes). */

var homePage = "Home";

/* The variable below controls the character(s) that the script places between
the link levels. The default is set to be the > (greater than) HTML entity
with a space on either side. Change this to whatever you want, but if the
character has an HTML entity, be sure to use that. */

var sepChars = " &nbsp;<img src='../shop/img/arrowgray.gif'>&nbsp; ";

/* In most cases, the value below should just be a / sign. Or, you can use the
fully qualified http://www.yoursite.com address if you'd rather. Basically,
it just tells the script what all the link addresses will start with. */

var linkHome = "http://sendmamasgift.com/";

/* Leave the value below set to 'true' if you want the script to not list your
index page name (index.html) at the end of the links path. The values 'true' or
'false' should be used without quotes. */

var hideIndex = true;

/* Leave the value below set to 'true' if you want the script to convert any
underscores in directory or names to spaces. For instance, it would convert
"golive_actions" to "golive actions". The values 'true' or 'false' should be
used without quotes. */

var UToSpace = true;

/* Leave the value below set to 'true' if you want the script to convert any dashes
in directory or page names to spaces. For instance, it would convert "golive-actions"
to "golive actions". The values 'true' or 'false' should be used without quotes. */

var DToSpace = true;

/* The variable below allows you to change the capitalization of the directory and
pages names in your menu. The value should be a number between 0 and 3, without
quotation marks. Options are as follows: 0 = no change; 1 = initial caps;
2 = all upper case; 3 = all lower case */

var changeCaps = 3;

/* If set to true, the variable below will not display the file's extension for
any file names displayed in the menu. Otherwise, set to false to show extensions.
The values 'true' or 'false' should be used without quotes. */

var hideExt = true;

// build breadcrumb links...
function MPJSBackLinks(action) {
	var linkHTML = '';
	var thisURL = window.location + '';
	var urlPair = thisURL.split('//');
	if (urlPair.length > 1) thisURL = urlPair[1];
	var dirArray = thisURL.split('/');
	var linkArray = dirArray.slice(1);
	var linkDir = '/';
	var currentPage = '';
	if (linkHome != '' && linkHome != '/') {
		var thisTest = linkHome.split('//');
		if (thisTest.length > 1) linkHome = thisTest[1];
		startArray = linkHome.split('/');
		var backCount = 0;
		for (var n=0; n<startArray.length; n++) {
			if (startArray[n] == '..') backCount++;
			else break;
		}
		if (backCount > 0) {
			var part1 = dirArray.slice(0, (dirArray.length - backCount - 1));
			var part2 = startArray.slice(backCount);
			startArray = part1.concat(part2);
			} else {
			var newStart = new Array(dirArray[0]);
			for (var n=1; n<startArray.length; n++) {
				var thisTest = (typeof dirArray[n] != "undefined") ? dirArray[n] : false;
				if (thisTest && thisTest == startArray[n]) newStart[n] = startArray[n];
				else break;
			}
			startArray = newStart;
		}
		if (startArray.length > 1) {
			var lastOne = startArray[startArray.length - 1];
			if (lastOne != '') {
				var thisTest = lastOne.split('.');
				if (thisTest.length > 1) startArray[startArray.length - 1] = '';
				else startArray[startArray.length] = '';
			}
			if (homePage == '') homePage = startArray[startArray.length-2];
			linkArray = dirArray.slice(startArray.length - 1);
			if (startArray[0] != '') startArray[0] = "http://"+startArray[0];
			linkDir = startArray.join('/');
		} else linkArray = dirArray.slice(1);
		} else {
		linkArray = dirArray.slice(1);
		if (homePage == '') homePage = dirArray[0];
	}
	var backTrack = 1;
	if (linkArray[linkArray.length - 1] != '') {
		var lastOne = linkArray[linkArray.length - 1];
		var testName = lastOne.split('.');
		if (testName[0] == 'index' || testName[0] == 'default') {
			backTrack = 2;
			currentPage = linkArray[linkArray.length - 2];
		} else if (hideExt) currentPage = testName[0]
		else currentPage = lastOne;
		} else {
		backTrack = 2;
		currentPage = linkArray[linkArray.length - 2];
	}
	linkArray = linkArray.slice(0, linkArray.length - backTrack);
	var links = new Array();
	if (homePage != '') {
		homePage = MPBCParseText(homePage, UToSpace, DToSpace, changeCaps);
		links[links.length] = '<a href="'+linkDir+'">'+homePage+'</a>';
	}
	var baseDir = linkDir;
	for (var n=0; n<linkArray.length; n++) {
		baseDir += linkArray[n] + '/';
		var thisText = MPBCParseText(linkArray[n], UToSpace, DToSpace, changeCaps);
		links[links.length] = '<a href="'+baseDir+'">'+thisText+'</a>';
	}
	if (currentPage != '') links[links.length] = MPBCParseText(currentPage, UToSpace, DToSpace, changeCaps);
	var html = '<div class="foot">'+links.join(sepChars)+'<\/div>';
	return html;
}

// parse string through text filters
function MPBCParseText(thisText, UToSpace, DToSpace, changeCaps) {
	if (DToSpace) thisText = MPBCReplaceChar('-', ' ', thisText);
	if (UToSpace) thisText = MPBCReplaceChar('_', ' ', thisText);
	if (changeCaps) thisText = MPBCFixCaps(thisText, changeCaps);
	return thisText;
}

// find and replace single character in string...
function MPBCReplaceChar(oldChar, newChar, thisString) {
	var newString = '';
	for (var n=0; n<thisString.length; n++) {
		newString += (thisString.charAt(n) == oldChar) ? newChar : thisString.charAt(n);
	}
	return newString;
}

// determine changes in capitalization...
function MPBCFixCaps(thisString, changeCaps) {
	if (changeCaps == 1) thisString = MPBCUCWords(thisString);
	else if (changeCaps == 2) thisString = thisString.toUpperCase();
	else if (changeCaps == 3) thisString = thisString.toLowerCase();
	return thisString;
}

// capitalize the first letter of every word...
function MPBCUCWords(thisString) {
	var thisArray = thisString.split(' ');
	var newString = '';
	for (var n=0; n<thisArray.length; n++) {
		var firstChar = thisArray[n].charAt(0).toUpperCase();
		var theRest = thisArray[n].substring(1, thisArray[n].length);
		newString += firstChar+theRest+' ';
	}
	return newString.substring(0, newString.length);
}

//-->

<!-- Required for several pages, saves data before exiting page!
function submitform()
{
	document.form.submit()
}
function searchform()
{
	document.searchform.submit()
}

function jumptopage(pg)
{
	document.next.page.value=pg;
	document.next.submit()
}

function showwindow(thewidth,theheight,theurl)
{
	if (!window.pdWindow)
	{
		pdWindow = window.open(theurl,"PopOpt","width=" + thewidth + ",height=" + theheight + ",toolbar=0,status=0,location=0,menubar=0,scrollbars=yes,resizable=0");
		
	}
	else
	{
		if (!pdWindow.closed)
		{
			//pdWindow.focus();
			pdWindow.close();
			pdWindow = window.open(theurl,"PopOpt","width=" + thewidth + ",height=" + theheight + ",toolbar=0,status=0,location=0,menubar=0,scrollbars=yes,resizable=0");
		}
		else
		{
			pdWindow = window.open(theurl,"PopOpt","width=" + thewidth + ",height=" + theheight + ",toolbar=0,status=0,location=0,menubar=0,scrollbars=yes,resizable=0");
		}
	}
}

function quickadd(qaid,qaqty)
{
	document.quickadd.itemid.value=qaid;
	document.quickadd.qty.value=qaqty;
	document.quickadd.submit()
}

//-->

// used to display the ethiopian calendar
var month_of_year = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
var Calendar = new Date();
var year = Calendar.getFullYear();	    // Returns year
var month = Calendar.getMonth();    // Returns month (0-11)
var today = Calendar.getDate();    // Returns day (1-31)
var Current_date= month_of_year[month]+" "+ today +" "+year ; // Format January 1 2005


/*
Magic Wand cursor (By Kurt at kurt.grigg@virgin.net)
Modified and permission granted to
Dynamic Drive to feature script in archive
For full source, usage terms, and 100's
more DHTML scripts, visit http://dynamicdrive.com
*/

if (document.all){
	with (document){
		write('<div id="starsDiv" style="position:absolute;top:0px;left:0px">')
		write('<div style="position:relative; width:1px;height:1px;background:#ffffff;font-size:1px;visibility:visible"></div>')
		write('<div style="position:relative; width:1px; height:1px; background:#fff000; font-size:1px;visibility:visible"></div>')
		write('<div style="position:relative; width:1px; height:1px; background:#ffa000; font-size:1px;visibility:visible"></div>')
		write('<div style="position:relative; width:1px; height:1px; background:#ff00ff; font-size:1px;visibility:visible"></div>')
		write('<div style="position:relative; width:1px; height:1px; background:#00ff00; font-size:1px;visibility:visible"></div>')
		write('<div style="position:relative; width:1px; height:1px; background:#0000ff; font-size:1px;visibility:visible"></div>')
		write('<div style="position:relative; width:1px; height:1px; background:#FF0000; font-size:1px;visibility:visible"></div>')
		write('<div style="position:relative; width:2px; height:2px; background:#ffffff; font-size:2px;visibility:visible"></div>')
		write('<div style="position:relative; width:2px; height:2px; background:#fff000; font-size:2px;visibility:visible"></div>')
		write('<div style="position:relative; width:2px; height:2px; background:#ffa000; font-size:2px;visibility:visible"></div>')
		write('<div style="position:relative; width:2px; height:2px; background:#ff00ff; font-size:2px;visibility:visible"></div>')
		write('<div style="position:relative; width:2px; height:2px; background:#00ff00; font-size:2px;visibility:visible"></div>')
		write('<div style="position:relative; width:2px; height:2px; background:#0000ff; font-size:2px;visibility:visible"></div>')
		write('<div style="position:relative; width:3px; height:3px; background:#FF0000; font-size:3px;visibility:visible"></div>')
		write('</div>')
	}
}


var Clrs=new Array(6)
Clrs[0]='ff0000';
Clrs[1]='00ff00';
Clrs[2]='000aff';
Clrs[3]='ff00ff';
Clrs[4]='fff000';
Clrs[5]='fffff0';



if (document.layers)
{window.captureEvents(Event.MOUSEMOVE);}
var yBase = 200;
var xBase = 200;
var step;
var currStep = 0;
var Xpos = 1;
var Ypos = 1;

if (document.all)
{
	function MoveHandler(){
		Xpos = document.body.scrollLeft+event.x;
		Ypos = document.body.scrollTop+event.y;
	}
	document.onmousemove = MoveHandler;
}

else if (document.layers)
{
	function xMoveHandler(evnt){
		Xpos = evnt.pageX;
		Ypos = evnt.pageY;
	}
	window.onMouseMove = xMoveHandler;
}

function animateLogo() {
	if (document.all)
	{
		yBase = window.document.body.offsetHeight/4;
		xBase = window.document.body.offsetWidth/4;
	}
	else if (document.layers)
	{
		yBase = window.innerHeight/4;
		xBase = window.innerWidth/4;
	}
	
	if (document.all)
	{
		for ( i = 0 ; i < starsDiv.all.length ; i++ )
		{step=3;
			starsDiv.all[i].style.top = Ypos + yBase*Math.cos((currStep + i*4)/12)*Math.cos(0.7+currStep/200);
			starsDiv.all[i].style.left = Xpos + xBase*Math.sin((currStep + i*3)/10)*Math.sin(8.2+currStep/400);
			for (ai=0; ai < Clrs.length; ai++)
			{
				var c=Math.round(Math.random()*[ai]);
			}
			starsDiv.all[i].style.background=Clrs[c];
		}
	}
	
	else if (document.layers)
	{
		for ( j = 0 ; j < 14 ; j++ ) //number of NS layers!
		{step = 4;
			var templayer="a"+j
			document.layers[templayer].top = Ypos + yBase*Math.sin((currStep + j*4)/12)*Math.cos(0.7+currStep/200);
			document.layers[templayer].left = Xpos + xBase*Math.sin((currStep + j*3)/10)*Math.sin(8.2+currStep/400);
			for (aj=0; aj < Clrs.length; aj++)
			{
				var c=Math.round(Math.random()*[aj]);
			}
			document.layers[templayer].bgColor=Clrs[c];
		}
	}
	currStep+= step;
	setTimeout("animateLogo()", 10);
}
animateLogo();
// -->
