/***********************************************************************
*
* Enbecom JavaScript Code - portions Copyright 2003 Enbecom Solutions
*
************************************************************************
*
* fave			-	Add Enbecom to Favourites
*
************************************************************************/
function fave() {
window.external.AddFavorite('http://www.enbecom.net', 'Enbecom Solutions - Domains, Hosting, Web Design, Interactive TV, Dedicated Servers')
}
/***********************************************************************
*
* getCookie		-	Generic Get Cookie routine
*
************************************************************************/

function getCookie(name) 
	{ 				// use: getCookie("name");
	var cookiecrumbs = document.cookie.split("; "); 	// break cookie into crumbs array
    for (var i=0; i < cookiecrumbs.length; i++) 
    	{
      nextcrumb = cookiecrumbs[i].split("="); 		// break into name and value
      if (nextcrumb[0] == name) 			// if name matches
        return unescape(nextcrumb[1]); 			// return value
    	}
   return null;
	}

/***********************************************************************
*
* getCartItem		-	Gets the Actinic Cart Value & No of Items
*
************************************************************************/

//CART_CONTENT = Cookie name
//1 = TOTAL_VALUE
//3 = CART_COUNT

function getCartItem(index)
	{
	var act_cart= getCookie("CART_CONTENT")
	temp =(act_cart != null) ? temp=act_cart.split("\t"):0;
	return (temp.length > 0) ? temp[index] : 0;
	}

/***********************************************************************
*
* SwapImage			-	swaps an image to the alternative
*
* Input:	sName		-	name of the image
*
*			sAltImage-	filename of the alternative image
*
************************************************************************/

function SwapImage(sName, sAltImage)
	{
	var nCount = 0;
	document.aSource = new Array;						// array for images
	if (document[sName] != null)						// if image name exists
		{
		document.aSource[nCount++] = document[sName];	// store image
		if(null == document[sName].sOldSrc)
			{
			document[sName].sOldSrc = document[sName].src;// store image source
			}
		document[sName].src = sAltImage;				// change image source to alternative
		}
	}

/***********************************************************************
*
* RestoreImage		-	restores an image to the original
*
************************************************************************/

function RestoreImage()
	{
	var nCount, aSource = document.aSource;
	if (aSource != null)									// if array of images exists
		{
		for(nCount=0; nCount < aSource.length; nCount++)	// restore all images
			{
			if ((aSource[nCount] != null) &&
				(aSource[nCount].sOldSrc != null))	// if we stored something for this image
				{
				aSource[nCount].src = aSource[nCount].sOldSrc;	// restore the original image
				}
			}
		}
	}

/***********************************************************************
*
* PreloadImages		-	restores an image to the original
*
************************************************************************/

function PreloadImages()
	{
	if(document.images)
		{
		if(!document.Preloaded)							// preload array defined?
			{
			document.Preloaded = new Array();		// no, define it
			}
		var nCounter , nLen = document.Preloaded.length, saArguments = PreloadImages.arguments;
		for(nCounter = 0; nCounter < saArguments.length; nCounter++)	// iterate through arguments
			{
			document.Preloaded[nLen] = new Image;
			document.Preloaded[nLen++].src = saArguments[nCounter];
			}
   	}
	}

function brows() {
var browsname = navigator.userAgent;
if ((browsname.indexOf("Opera 6")!=-1)
||(browsname.indexOf("Opera/6")!=-1)) {
return "Opera Browser";
}
else if (browsname.indexOf("Nokia")!=-1) {
return "Nokia Phone";
}
else if (browsname.indexOf("iPhone")!=-1) {
return "Apple iPhone";
}
else if (browsname.indexOf("Nintendo Wii")!=-1) {
return "Nintendo Wii";
}
else if (browsname.indexOf("MSIE")!=-1) {
return "Internet Explorer";
}
else if (browsname.indexOf("Firefox")!=-1) {
return "Firefox";
}
else if (browsname.indexOf("Chrome/")!=-1) {
return "Google Chrome";
}
else if (browsname.indexOf("Safari/")!=-1) {
return "Safari";
}
else if (navigator.appName == "Netscape") {
return "Netscape";
}
else {
return "not on our list of common ones";
}
}
function ifmobile() {
var browsname = navigator.userAgent;
var browsnametwo = browsname.toLowerCase();
if ((browsnametwo.indexOf("iphone")!=-1)) {
document.write('<table border="0" cellpadding="3" cellspacing="1" width="550" bgcolor="#000000"><tr><td bgcolor="#FFFFFF" align="center" width="550" style="text-align:center;font-size:50px;vertical-align:center;"><a href="http://m.enbecom.net">Using an iPhone? Visit m.enbecom.net</a></td></tr></table><br />');
}
}
function screh() {
var screhei = screen.height;
return screhei;
}
function screw() {
var screwid = screen.width;
return screwid;
}