// Script to tell what browser is being used
var isNav4 = false; 
var isNav = false;
var isNav6 = false;
var isIE4 = false;
var isIE5 = false;
var isIE6 = false;
var isIE = false;
//alert (parseInt(navigator.appVersion));
	if(parseInt(navigator.appVersion) >= 4 && navigator.appName=="Netscape")
	{
		isNav=true;
		if(parseInt(navigator.appVersion) == 4) 
		isNav4 = true;
		if(parseInt(navigator.appVersion)==5)
		isNav6 = true;
	}
		else if(navigator.appName=="Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 4)
		{
		isIE=true;
		if(navigator.appVersion.indexOf("MSIE 4") != -1)
		isIE4=true;
		if(navigator.appVersion.indexOf("MSIE 5") != -1)
		isIE5=true;
		if(navigator.appVersion.indexOf("MSIE 6") != -1)
		isIE6=true;
		}


// Function to redirect if Netscape 4
function BrowserType()
{
	if (isNav4) {
	parent.location = "http://www.itchydesign.com/error/error.html";
	}
}



// Image Swap Function
function Iswp(Na,Sw,imgpath) 
{
	if (Sw=="1")  { 
		var flag1= "~"; } 		
	else { 			
		flag1=""; 
		}
	var Im = imgpath + flag1+ Na + ".gif";
	document[Na].src = Im;
}



// Image pre-load function

function prld(nms,imgpath) {
pieces = nms.split(",");
count = pieces.length;
countx2 = eval(pieces.length * 2);
pre = new Array(countx2);
	for (i =0; i < count; i++) {
	pre[i] = new Image();
	pre[i].src = imgpath + pieces[i] + ".gif";
	} 
		for (i = count; i < countx2; i++) {
		pre[i] = new Image();
		pre[i].src =  imgpath + "~" + pieces[eval(i - 5)] + ".gif";
		}	
}



// Element Constructor

function CrossDiv(obj) 
{

	if(isNav4)
	{
	this.name = obj;
	this.elem = document.layers[obj];
	this.css = this.elem;
	this.x = this.css.left;
	this.y = this.css.top;
	this.h = this.css.clip.height;
	this.w = this.css.clip.width;
	}
		else if(isNav6)
		{	
		this.name = obj;
		this.elem = document.getElementById(obj);
		this.css = document.getElementById(obj).style;
		this.x = this.css.left;
		this.y = this.css.top;
		this.h = this.css.height;
		this.w = this.css.width;
		}

			else if(isIE4)
			{
			this.name = obj;
			this.css = document.all[obj].style;
			this.elem = document.all[obj];
			this.x = this.css.pixelLeft;
			this.y = this.css.pixelTop;
			this.h = this.css.pixelHeight;
			this.w = this.css.pixelWidth;
			}
	
				else if(isIE5 || isIE6)
				{
				this.name = obj;
				this.css = document.all[obj].style;
				this.elem = document.all[obj];
				this.x = this.elem.offsetLeft;
				this.y = this.elem.offsetTop;
				this.h = this.elem.offsetHeight;
				this.w = this.elem.offsetWidth;
				}
}


//function to move object
function moveItTo(x, y) 
{
	if(isNav4)
	{
	this.css.left = x;
	this.css.top = y;
	this.x = x;
	this.y = y;
	}
		else if(isIE)
		{
		this.css.pixelLeft = x;
		this.css.pixelTop = y;
		this.x = x;
		this.y = y;
		}
		
		else if(isNav6)
		{
		this.css.left = x;
		this.css.top = y + 'px';
		this.x = x;
		this.y = y;
		}	
				

}

CrossDiv.prototype.moveTo = moveItTo;


// Function to send values to crossDiv object
function scrllbx(ObjNm,d) {
var txtlyr = new CrossDiv(ObjNm);
var xpos = txtlyr.x;
var ypos = parseInt(txtlyr.y);
var hgt = txtlyr.h;
var moveby = eval(ypos +d+ 20);
if (ypos == 8 && d == "+"){
return;
}
	if (parseInt(hgt) > 171) {
	txtlyr.moveTo(xpos, moveby);
	}
	}

//function to resize Internet Explorer to stop spaces between graphics

//function ieResize()
//{
//	if (document.body.clientWidth)
//		{
//		window.resizeBy(-1,-1);
//		window.resizeBy(1,1);
//            }
//}
