<!--
var edit_img = new Image();
edit_img.src = '/images/system/edit.gif';
var popup_message = 'The window you requested failed to open.\n\nIf you are using a popup blocker, please temporarily disable it or allow popups for this website.';
var overlays = new Array();
var ie = (document.all) ? true : false;
var preloadFlag = false;
var slideshow_timeout_id = 0;
var slideshow_current_index = 0;

// Prototype Functions
String.prototype.times = function(n)
{
	var s = '';

	for (var i = 0; i < n; i++)
	{
		s += this;
	}

	return s;
}

String.prototype.zeroPad = function(n)
{
	return '0'.times(n - this.length) + this;
}


function center(el)
{
	// GET BROWSER SIZE
	var pos = windowGetSize();
	var el_w = (el.clientWidth < 200) ? 200 : el.clientWidth;
	var el_h = (el.clientHeight < 100) ? 100 : el.clientHeight;

	var x = (pos[0] / 2) - (el_w / 2);
	var y = (pos[1] / 2) - (el_h / 2);
	el.style.left = x+'px';
	el.style.top = y+'px';
}

function csrGoto(url)
{
	this.location.href=url;
}

function hideOverlayElements(status)
{
	if(status == true)
	{
		var elements = document.getElementsByTagName('SELECT');
		for(var n=0; n < elements.length; n++)
		{
			if(elements[n].style.display != 'none')
			{
				elements[n].style.display = 'none';
				var name = (elements[n].id) ? elements[n].id : elements[n].name;
				overlays[overlays.length] = name;
			}
		}
	}
	else
	{
		for(var n=0; n < overlays.length; n++)
		{
			el = getElement(overlays[n]);
			if(el)
			{
				el.style.display = '';
			}
		}
		overlays = new Array();
	}
}

function popupMessage(msg)
{
	hideOverlayElements(true);
	var div = document.createElement('div');
	div.id = 'popupMessagejs';
	div.className = 'popup';
	div.innerHTML = msg+"<br /><br />[<a href='' onclick='popupMessageClose(); return false;'>Close</a>]";
	document.body.appendChild(div);
	center(div);

	popupMessageMove();
	window.onscroll = function(){ popupMessageMove();};
}

function popupMessageClose()
{
	hideOverlayElements(false);
	var el = document.getElementById('popupMessagejs');
	if(el)
	{
		document.body.removeChild(el);
	}
}

// ================================================================================================
// THESE FUNCTION FIXED THE POP UP FOR TELEPORT
// popupMessage IS BEING USED IN THE CLASSES _reporting AND _widget -cw
// ================================================================================================
function popupMessageNew(msg)
{
	hideOverlayElements(true);
	popup = document.getElementById('popupMessagejs');
	popup.innerHTML = msg+"<br /><br />[<a href='' onclick='popupMessageCloseNew(); return false;'>Close</a>]";
	popup.style.display = '';
	
	center(popup);

	popupMessageMove();
	window.onscroll = function(){ popupMessageMove();};
}

function popupMessageCloseNew()
{
	hideOverlayElements(false);
	var el = document.getElementById('popupMessagejs');
	if(el)
	{
		el.style.display = 'none';
	}
}
// ================================================================================================

// HAVE THE POPYP MESSAGE MOVE WITH SCROLLS
function popupMessageMove()
{
	origin = getScrollXY();
	var el = document.getElementById('popupMessagejs');
	if(el && el.style.display == '')
	{
		if(document.documentElement.clientHeight)
		{
			var height = document.documentElement.clientHeight;
			var width = document.documentElement.clientWidth;
		}
		else
		{
			var height = document.body.clientHeight;
			var width = document.body.clientWidth;
		}
		el.style.left = origin[0] + parseInt(((width - el.clientWidth)/2)) +'px';
		el.style.top = origin[1] + parseInt(((height - el.clientHeight)/2)) +'px';
	}
	return;
}

function windowGetSize()
{
	var myWidth = 0, myHeight = 0;
	if(typeof(window.innerWidth) == 'number')
	{
		// Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} 
	else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) 
	{
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} 
	else if(document.body && (document.body.clientWidth || document.body.clientHeight))
	{
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	return new Array(myWidth, myHeight);
}


function changeImages(tab) 
{
	var http = (is_secure()) ? 'https://www.' : 'http://www.';
	var elem = eval('document.'+tab);
	if (document.images && (preloadFlag == true)) 
	{
		if(elem.src.indexOf('-over') > 0)
		{
			elem.src = http+'giftcards.com/images/'+tab+'.gif';
		}
		else
		{
			elem.src = http+'giftcards.com/images/'+tab+'-over.gif';
		}
	}
}


// function accepts event, and a button/image
// that will have its click function called.
function ClickOnReturn(e, b) 
{
	var key;
	var keychar;

	if(window.event || !e.which) 
	{
		// IE 
		key = e.keyCode; // for IE, same as window.event.keyCode
	} 
	else if(e) 
	{
		// netscape
		key = e.which;
	} 
	else 
	{
		return true;
	}
	if ((key==10 || key==13) && b) 
	{
		b.click();
	}
	return true;
}


function description(msg)
{
	var http = (is_secure()) ? 'https://www.' : 'http://www.';
	el = document.getElementById('tab_description');
	if(el)
	{
		el.innerHTML = "<img src='"+http+"giftcards.com/images/li.gif'>"+msg+"</li>";
	}
}


function findPos(obj) 
{
	var curleft = curtop = 0;
	if (obj.offsetParent) 
	{
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) 
		{
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}


function formatAsMoney(mnt)
{
	mnt = (Math.round(mnt*100))/100;
	return (mnt == Math.floor(mnt)) ? mnt + '.00' : ( (mnt*10 == Math.floor(mnt*10)) ? mnt + '0' : mnt);
}


function getElement(name)
{
	var el = false;
	if(ie == true)
	{
		el = document.getElementsByName(name)[0];
	}
	if(!el)
	{
		el = document.getElementById(name);
	}

	if((el == false || el == null) && ie != true)
	{
		var count = 0;
		var el = null;
		while(el == null)
		{
			count++;
			switch(count)
			{
				case 1:
					el = document.getElementsByName(name)[0];
					break;
				case 2:
					el = document.getElementById(name);
					break;
			}
			if(count == 4)
			{
				el = false;
			}
		}
	}

	if(el == false || el == null)
	{
//		alert('JS getElement Error');
	}
	return el;
}


function getPosition(type, el)
{
	x = el.offsetLeft;
	y = el.offsetTop;
	var count = 0;

	while(el.offsetParent)
	{
		x = x + el.offsetParent.offsetLeft;
		y = y + el.offsetParent.offsetTop;

		el = el.offsetParent;
	}

	// MOZILLA ADJUSTMENTS
	if(ie != true)
	{
		x = x + 24;
		y = y + 5;
	}

	var result = (type == 'x') ? x : y;
	return result;
}

function loadYUI(files_array, callback_function, function_params)
{
	var params = "";
	for(var el in function_params)
	{
		if(function_params[el].indexOf('new Array') >= 0)
		{
			params += function_params[el] + ", ";
		}
		else
		{
			params += "'" + function_params[el] + "', ";
		}
	}

	// Instantiate and configure Loader:
	var loader = new YAHOO.util.YUILoader({
		require: files_array,
		base: '/js/yui/build/',
		loadOptional: true,

		onSuccess: function() {
			eval(callback_function + "(" + params.substring(0, params.length - 2) + ")" );
		},

		timeout: 10000
	});
	loader.insert();
}

function imageBlowupClose()
{
	var image = document.getElementById('image_blowup');
	if(typeof(image) != 'undefined')
	{
		image.parentNode.removeChild(image);
	}
}

function imageBlowupShow(src, trigger)
{
    var close_attributes = {
        height: { to: 45 },
        width: { to: 72 }
    };

	var open_attributes = {
		height: { to: 153 },
		width:	{ to: 243 }
	};

	var dir = 0;
	
	YAHOO.util.Event.on(trigger, 'mouseover', function() 
	{	
		if(dir == 1)
		{
			var anim = new YAHOO.util.Anim(src, close_attributes);
			anim.animate();
			dir = 0;
		}
		else
		{
			var anim = new YAHOO.util.Anim(src, open_attributes);
			anim.animate();
			dir = 1;
		}
	});
	YAHOO.util.Event.on(src, 'mouseout', function() 
	{	
		if(dir == 1)
		{
			var anim = new YAHOO.util.Anim(src, close_attributes);
			anim.animate();
			dir = 0;
		}
		else
		{
			var anim = new YAHOO.util.Anim(src, open_attributes);
			anim.animate();
			dir = 1;
		}
	});
}


function is_secure()
{
	var url = window.location.href.substring(0, 5)
	if(url == 'https')
	{
		return true;
	}
	return false
}


function newImage(arg) 
{
	if (document.images) 
	{
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}


function openWin(url, w, h, scrollbars) 
{
	if(!w)
		w = '400';
	if(!h)
		h = '400';
	if(!scrollbars)
		scrollbars = '0';

	scrollbars = '1';
	
	// PREVENT A WINDOW WITH THE SAME NAME AS OPENER FROM OPENING
	opener_name = window.name.substr(9);
	randomnumber = opener_name;
	while(randomnumber == opener_name)
	{
		var randomnumber=Math.floor(Math.random(87423750923756027)*100001)
	}
	
	aWindow = window.open('/images/spacer.gif',"thewindow"+randomnumber,'toolbar=0,location=0,directories=0,status=0,menubar=0, width='+w+', height='+h+', scrollbars='+scrollbars+', resizable=1');
	if(url.toString().indexOf('www.') >= 0)
	{
		aWindow.location.href = url;
	}
	else
	{
		aWindow.window.document.location = url;
	}
	aWindow.moveTo(25, 25);
	if(aWindow)
	{
		aWindow.focus();
		if(aWindow.location.toString().indexOf('.com/admin/cs/') >= 0)
		{
			// CLOSE WINDOW AFTER 15 MINUTES
			auto_close = aWindow.setTimeout("window.close()", 900000);
		}
	}
	else
	{
		alert(popup_message);
	}
}

function autoCloseWindow()
{
	if(!window.focus)
	{
		alert('closing');
	}
}

	

function phoneLookup(phone)
{
	openWin('http://www.whitepages.com/search/Reverse_Phone/?phone='+phone, '600', '800');
}


function preloadImages() 
{
	if (document.images) 
	{
		var http = (is_secure()) ? 'https://www.' : 'http://www.';
		tab_business_over = newImage(http+"giftcards.com/images/tab_business-over.gif");
		tab_business_over = newImage(http+"giftcards.com/images/tab_business-over.gif");
		preloadFlag = true;
	}
}

function progress(display, message)
{
	var prog_container = document.getElementById('progressContainer');
	if(!prog_container)
	{
		return;
	}

	if(display == true)
	{
		progress_message = document.getElementById('progressMessage');
		if(!progress_message)
		{
			return;
		}
		progress_message.innerHTML = (message) ? message : 'Loading...';
		center(prog_container);
		prog_container.style.display = '';
	}
	else
	{
		prog_container.style.display = 'none';
	}
}


function resize_popup()
{
	//el = document.getElementById('popupAnchor');
	var el = getElement('popupAnchor');
	if(el)
	{
		//el2 = document.getElementById('popupAnchorEnd');
		var el2 = getElement('popupAnchorEnd');
		if(el2)
		{
			var height = el2.offsetTop + 40;
		}
		else
		{
			var height = el.offsetHeight + 36;
		}
		height += 25;

		if(ie != true)
		{
			for(n=0; n < el.childNodes.length; n++)
			{
				if(el.childNodes[n].tagName == 'TABLE' && el.childNodes[n].getAttribute != '')
				{
					var width = parseInt(el.childNodes[n].getAttribute('width'));
					width = parseInt(width + 25);
					break;
				}
			}
		}
		else
		{
			var width = el.offsetWidth + 10;
		}
		width += 10;

		window.resizeTo(width, height);
		window.focus();
	}
}







function round(number, X) 
{
	// rounds number to X decimal places, defaults to 0
	X = (!X ? 0 : X);
	return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
}


function show_hide(el, display)
{
	elem = document.getElementById(el);
	if(!elem)
	{
		elem = document.all[el];
	}
	if(elem)
	{
		// HIDE ELEMENT
		if(display == 'hide')
		{
			elem.style.display = 'none';
		}

		// SHOW ELEMENT
		else if(display == 'show')
		{
			elem.style.display = '';
		}

		// AUTO HIDE/SHOW
		else
		{
			stat = elem.style.display;
			if(stat == '')
			{
				elem.style.display = 'none';
			}
			else
			{
				elem.style.display = '';
			}
		}
		return true;
	}
	return false;
}


function tab_mouseover(el, initial_state)
{
	var elem = eval('document.'+el);
	if(initial_state != '-over' && elem.src.indexOf('-over') < 0)
	{
		changeImages(el);
	}
	msgs = new Array();
	//	msgs['tab_business'] = 'Click here for all of your business solutions'; 
	//msg = (msgs[el]) ? msgs[el] : document.getElementsByName(el)[0].alt;
	msg = document.getElementById(el).alt;
	description(msg);
	window.status = msg.replace('&trade;', '(TM)');
}


function slideshowNext(cont)
{
	var obj = document.getElementById('slideshow');

	if(obj && typeof(slideshow_image_array) != 'undefined')
	{
		slideshow_current_index++;
		slideshow_current_index = slideshow_current_index % slideshow_image_array.length;
		obj.src = slideshow_image_array[slideshow_current_index];
	}

	if(cont)
	{
		slideshowStart();
	}
}

function slideshowPrev()
{
	var obj = document.getElementById('slideshow');

	if(obj && typeof(slideshow_image_array) != 'undefined')
	{
		slideshow_current_index--;

		// CHECK FOR 0
		if(slideshow_current_index < 0)
		{
			slideshow_current_index = slideshow_image_array.length - 1;
		}

		slideshow_current_index = slideshow_current_index % slideshow_image_array.length;
		obj.src = slideshow_image_array[slideshow_current_index];
	}
}

function slideshowStart()
{
	slideshow_timeout_id = setTimeout("slideshowNext(true)", 5000);
}


function slideshowStop()
{
	clearTimeout(slideshow_timeout_id);
}


function tab_mouseout(el, initial_state)
{
	var elem = eval('document.'+el);
	if(initial_state != '-over' && elem.src.indexOf('-over') > 0)
	{
		changeImages(el);
	}
	if(document.getElementById('tab_description'))
	{
		document.getElementById('tab_description').innerHTML = '&nbsp;';
	}
	window.status = '';
}


function toolTipHide()
{
	var tool_tip = document.getElementById('tool_tip');
	if(tool_tip)
	{
		//tool_tip.innerHTML = '';
		tool_tip.style.display = 'none';
	}
}


function toolTipShow(el_id, message_id)
{
	var tool_tip = document.getElementById('tool_tip');
	var obj = document.getElementById(el_id);

	// MAKE SURE THAT THE TOOL TIP DIV AND MESSAGE EXIST
	if(tool_tip && obj && typeof(tool_tip_messages) != 'undefined')
	{
		tool_tip.style.left = parseInt(getPosition('x', obj)) + (obj.offsetWidth) - 20 + 'px';
		tool_tip.style.top = parseInt(getPosition('y', obj) - 5) + 'px';
		tool_tip.innerHTML = tool_tip_messages[message_id];
		tool_tip.style.display = '';
	}
}


function validateForm(form)
{
	var errors = new Array();

	// CREATE ARRAY OF REQUIRED FIELDS
	for(n=0; n < form.length; n++)
	{
		form_el = form.elements[n];
		if(form_el.getAttribute("required") == 'true' && form_el.style.display != 'none' && form_el.name != 0)
		{
			if(form_el.value == null || form_el.value.length == 0 || (form_el.type == 'checkbox' && form_el.checked != true))
			{
				errors.push(form_el.name);
			}
			/*
			else if(form_el.name.indexOf('_verify') != -1)
			{
				var substr = '_verify';
				var el2_name = form_el.name.substr(0, (form_el.name.length - substr.length - 1))+']';
				var el2 = document.getElementsByName(el2_name)[0];
				alert(el2.value);
				alert(form_el.value);
				if(el2 && el2.value != form_el.value)
				{
					errors.push(form_el.name);
					errors.push(el2.name);
				}			
			}
			*/
			else
			{
				form_el.className = 'input';
			}
		}
	}

	// CHECK FOR ERRORS
	if(errors.length > 0)
	{
		for(n=0; n < errors.length; n++)
		{
			form.elements[errors[n]].className = 'input_alert';
		}
		alert('There are errors in your data.\nPlease enter all of the required data and try again.');
		return false;
	}
	return true;
}

// NAME: validateFormNew
// TYPE: function
// PURPOSE: display buttons when all required fields are populated
// RETURNS: N/A
function validateFormNew(form, elements)
{
	if(empty(form))
	{
		return false;
	}
	var completed = 1;

	// CREATE ARRAY OF REQUIRED FIELDS
	for(n=0; n < form.length; n++)
	{
		form_el = form.elements[n];
		if(form_el.getAttribute("required") == 'true' && form_el.style.display != 'none' && form_el.name != 0)
		{
			if(form_el.value == null || form_el.value == 0 || form_el.value.length == 0 || (form_el.type == 'checkbox' && form_el.checked != true))
			{
				completed = 0;
			}
		}
	}

	for(var n = 0; n < elements.length; n++)
	{
		var el = document.getElementById(elements[n]);
		if(el)
		{
			if(completed == 1)
			{
				el.src = '/images/btn_next_step_glow.gif';
				if(elements[n] == 'next')
				{
					el.onclick = function(){ /*form.submit();*/ next(); };
				}
				else if(elements[n] == 'cart')
				{
					el.onclick = function(){ form.submit(); };
				}
				else if(elements[n] == 'checkout')
				{
					el.onclick = function(){ form.submit(); };
				}
			}
			else if(el.src.indexOf('_glow') > 0)
			{
				el.src = '/images/btn_next_step.gif';
				el.onclick = function (){ void(0); return false; };
			}
		}
	}
}

function widgetTabSelect(id)
{
	var elements = document.getElementsByTagName('DIV');
	if(elements)
	{
		for(var n=0; n < elements.length; n++)
		{
			if(elements[n].id.indexOf('widgetTab_') > -1)
			{
				elements[n].style.display = 'none';
				if(elements[n].id == 'widgetTab_'+id)
				{
					elements[n].style.display = '';
				}					
			}
		}
	}
}

// If zipcode contains between 1 and 5 digits, return them with the left side padded with zeroes to make 5 digits. Else return false
function zipcodeVerify(zipcode)
{
	var trimmed = new String(zipcode);

	// Remove non-digits
	trimmed = trimmed.replace(/[^0-9]/g, "");

	// Remove leading zeroes
	trimmed = trimmed.replace(/^0+/, "");

	// The zipcode is invalid if it contains less than 1 or more than 5 digits
	if((trimmed.length < 1) || (trimmed.length > 5))
	{
		return(false);
	}

	// Pad beginning of string with zeroes to make 5 digits
	trimmed = trimmed.zeroPad(5);

	return(trimmed);
}



// IMAGE ROLLOVER FOR ECARD AND BUSINESS PAGES
function MM_preloadImages() { //v3.0  
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
		var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v3.0
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
		if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//Disables Google Toolbar's Autofill css overrides
if(window.attachEvent)
    window.attachEvent("onload",setListeners);

  function setListeners(){
    inputList = document.getElementsByTagName("INPUT");
    for(i=0;i<inputList.length;i++){
      inputList[i].attachEvent("onpropertychange",restoreStyles);
      inputList[i].style.backgroundColor = "";
    }
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++){
      selectList[i].attachEvent("onpropertychange",restoreStyles);
      selectList[i].style.backgroundColor = "";
    }
  }

  function restoreStyles(){
    if(event.srcElement.style.backgroundColor != "")
      event.srcElement.style.backgroundColor = "";
  }




// ######################################################################################
// Drag & Drop
// ######################################################################################
	var ie=document.all;
	var nn6=document.getElementById&&!document.all;
	var isdrag=false;
	var x,y;
	var dobj;

	function movemouse(e)
	{
		if (isdrag)
		{
			dobj.style.left = (nn6 ? tx + e.clientX - x : tx + event.clientX - x)+'px';
			dobj.style.top  = (nn6 ? ty + e.clientY - y : ty + event.clientY - y)+'px';
			return false;
		}
	}

	function selectmouse(e) 
	{
		// CHECK FOR RIGHT MOUSE CLICK
		if((nn6 && (e.which == 3 || e.which == 2)) || (ie && (event.button == 2 || event.button == 3)) )
		{
			return false;
		}

		var fobj = nn6 ? e.target : event.srcElement;
		if(ie && fobj.tagName == 'HTML')
		{
			return false;
		}
		var topelement = nn6 ? "HTML" : "BODY";

		while (fobj.tagName != topelement && fobj.className != "guiSubScreen")
		{
			fobj = nn6 ? fobj.parentNode : fobj.parentElement;
		}

		if (fobj.className=="guiSubScreen")
		{
			isdrag = true;
			dobj = fobj;
			tx = parseInt(dobj.style.left+0);
			ty = parseInt(dobj.style.top+0);
			x = nn6 ? e.clientX : event.clientX;
			y = nn6 ? e.clientY : event.clientY;
//			alert(tx+' - '+ty+'\n'+x+' - '+y);
			document.onmousemove=movemouse;
			return false;
		}
	}

	document.onmousedown=selectmouse;
	document.onmouseup=new Function("isdrag=false");
// ######################################################################################


// ######################################################################################
// LIGHT BOX
// ######################################################################################

// HAVE THE LIGHTBOX MOVE WITH SCROLLS
function lightboxMove()
{
	origin = getScrollXY();

	var allEls = document.all? document.all : document.getElementsByTagName("*");

	for(var n=0; n<allEls.length; n++)
	{
		if(allEls[n].className == 'lightboxContent' && allEls[n].style.display == '')
		{
			if(document.documentElement.clientHeight)
			{
				var height = document.documentElement.clientHeight;
				var width = document.documentElement.clientWidth;
			}
			else
			{
				var height = document.body.clientHeight;
				var width = document.body.clientWidth;
			}
			allEls[n].style.left = origin[0] + parseInt(((width - allEls[n].clientWidth)/2)) +'px';
			allEls[n].style.top = origin[1] + parseInt(((height - allEls[n].clientHeight)/2)) +'px';
			
			return;
		}
	}
}

// DISPAY LIGHTBOX
function lightboxShow(id)
{
	var contentID = id+"Content";
	var lb = document.getElementById(id);
	var lbc = document.getElementById(contentID);
	// SHOW LIGHTBOX BACKGROUND
	var wh = getPageSize();
	wh[1] = wh[1] + 100;
	if(lb && wh)
	{
		lb.style.height = wh[1]+'px';
		lb.style.width = wh[0]+'px';
	}
	lb.style.display='';
	lbc.style.display='';
	lightboxMove();
	window.onscroll = function(){ lightboxMove();};
}

function lightboxClose(id)
{
	contentID = id+"Content";
	var lb = document.getElementById(id);
	lb.style.display = 'none';
	var lbc = document.getElementById(contentID);
	lbc.style.display = 'none';
}

function getPageSize()
{			
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

// GET THE LEFT/TOP POINT OF A WINDOW AFTER SCROLLING
function getScrollXY() {
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' )
	{
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	}
	else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
	{
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	}
	else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
	{
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
	return [scrOfX, scrOfY];
}

// ######################################################################################


// ================================================================================================
// ANIMATION
// ================================================================================================
	var timerID = new Array();
	var startTime = null;
	var obj = null;
	var endHeight = null;
	var dir = 1;
	var slideAniLen = 500;

	function animate(objname, action)
	{
		obj = document.getElementById(objname);
		if(obj)
		{
			dir = (obj.style.display != 'none')? -1 : 1;

			endHeight = parseInt(obj.style.height);
			startTime = (new Date()).getTime();

			if(dir == 1)
			{
				obj.style.height = '1px';
			}

			obj.style.display = 'block';
			timerID = setInterval(action + "()",5);
		}
	}
	 
	function slide()
	{
		var elapsed = (new Date()).getTime() - startTime;

		if(elapsed > slideAniLen)
		{
			endSlide()
		}
		else
		{
			var d = Math.round(elapsed / slideAniLen * endHeight);
			if(dir == -1)
			{
				d = endHeight - d;
			}
			obj.style.height = d + 'px';
		}
		return;
	}


	function empty(variable)
	{
		if(typeof(variable) == 'undefined' || variable == '' || variable == 0 || variable == null)
		{
			return true;
		}
		return false;
	}


	function endSlide()
	{
		clearInterval(timerID);

		if(dir == -1)
		{
			obj.style.display = 'none';
		}

		obj.style.height = endHeight + 'px';

		timerID = null;
		startTime = null;
		endHeight = null;
		return;
	}

// ================================================================================================

// -->
