// JavaScript Document



var is_msie = (navigator.appVersion.indexOf('MSIE')>0) ? true : false;

function launchGiftCard() {
	
var url = 'giftcard.html' ;

var width = '374';
var height = '268';

var windowName = 'calWin' ;
var featureString = ',' + 'status=no,toolbar=no,directories=no,location=no,resizable=no,scrolling=no,scrollbars=no,favorites=no,menubar=no';

var x = Math.round((screen.availWidth - width) / 2);//+8;
var y = 118;//Math.round((screen.availHeight - height) / 2);
windowStuff = 'left=' + x + ',top=' + y + ',width=' + width + ',height=' + height + featureString;
return open (url, windowName, windowStuff);
}


function hide_div(d) {
	document.getElementById(d).style.display = "none";
}

function show_div(d) {
	clearTimeout(about_t);
	document.getElementById(d).style.display = "block";
}


function show_hide_div(id,zindex) {
var el = document.getElementById(id);
	if (el.style.display != "none") {
	el.style.display = "none";
		if (zindex) {
		el.style.zIndex = "0";
		}
	}
	else {
	el.style.display = "";
		if (zindex) {
		el.style.zIndex = zindex;
		}
	}
}

var about_t;

function timed_hide(id) {
	if (!about_on)
	about_t = setTimeout("hide_div('"+id+"')",1000);
}























// gives up and down scroll buttons to images, spans, ... named up_name, down_name, respectively.
// will keep the default scroll_box's style overflow if it encounters errors (so make overflow: auto;)

// usage: put this after the scrollbox div:  var div_scroll1 = new TextScroll('div_scroll1', 'scroll_box');
function TextScroll(scrollname, div_name, up_name, down_name)
{
    this.div_name = div_name;
    this.name = scrollname;
    this.scrollCursor = 0;
    this.speed = 6;
    this.timeoutID = 0;
    this.div_obj = null;
    this.up_name = up_name;
    this.dn_name = down_name;

{
        if (document.getElementById) {
            div_obj = document.getElementById(this.div_name);
            if (div_obj) {
                this.div_obj = div_obj;
                this.div_obj.style.overflow = 'hidden';
            }
            div_up_obj = document.getElementById(this.up_name);
            div_dn_obj = document.getElementById(this.dn_name);
            if (div_up_obj && div_dn_obj) {
			
				if (is_msie) {
				div_up_obj.onmousedown = function() { eval(scrollname + ".scrollUp();") };
				div_up_obj.onmouseup = function() { eval(scrollname + ".stopScroll();") };
				div_up_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };
				
				div_dn_obj.onmousedown = function() { eval(scrollname + ".scrollDown();") };
				div_dn_obj.onmouseup = function() { eval(scrollname + ".stopScroll();") };
				div_dn_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };
				} else {
				div_up_obj.setAttribute("onmousedown", scrollname + ".scrollUp();")
				div_up_obj.setAttribute("onmouseup", scrollname + ".stopScroll();")
				div_up_obj.setAttribute("onmouseout", scrollname + ".stopScroll();")
				
				div_dn_obj.setAttribute("onmousedown", scrollname + ".scrollDown();")
				div_dn_obj.setAttribute("onmouseup", scrollname + ".stopScroll();")
				div_dn_obj.setAttribute("onmouseout", scrollname + ".stopScroll();")
				}
            }
        }
    }

this.stopScroll = function() {
        clearTimeout(this.timeoutID);
    }

this.scrollUp = function() {
        if (this.div_obj) {
            this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + ".scrollUp()", 60);
        }
    }

this.scrollDown = function() {
        if (this.div_obj) {
		this.scrollCursor += this.speed;
		this.div_obj.scrollTop = this.scrollCursor;
			if (this.div_obj.scrollTop == this.scrollCursor) {
			this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);
			} else {
			this.scrollCursor = this.div_obj.scrollTop;
			}
        }
    }

this.resetScroll = function() {
        if (this.div_obj) {
            this.div_obj.scrollTop = 0;
            this.scrollCursor = 0;
        }
    }
}


function eval_scroll_height() {
	if (document.getElementById('copy_inner').offsetHeight < 240) {
	hide_div('content_scroll');
	}
}





