// <![CDATA[
/****************************************************************************************************
*  Inkjet Output                                                                                    *
*  www.inkjetoutput.com                                                                             *
*  © Copyright 2005 Inkjet Output & Lightbox, Inc.                                                  *
*                                                                                                   *
*  Code and Development by John E. Flesch (www.hi-eight.com)                                        *
*****************************************************************************************************
*
*  File:				global.js
*  Author:				John E. Flesch
*  Last Modified:		May 2005
*
****************************************************************************************************/

favicon = new Image();
favicon.src="http://www.inkjetoutput.com/favicon.ico"; 

var io = {
	host : "http://www.inkjetoutput.com",
	store : "/store/",
	launch : function(a,w,h,l,t,s,r,n,e,b,d) {
		var _message = "A pop-up blocker has prevented this window from opening.\n\nWould you like to view this page in the current\nbrowser window instead?\n\n(Clicking \"Cancel\" will allow you to temporarily\ndisable your pop-up blocker and click the link again.)";
		var _toolbars = (!io.isNull(b)) ? b : 0;
		//var _resizable = (!io.isNull(r)) ? r : 0;
		var _resizable = 1;
		var _dependent = (!io.isNull(d)) ? d : 0;
		var _href = io.isObject(a) ? a.href : a;
		var _name = (!io.isNull(a.id)) ? a.id : (!io.isNull(a.name)) ? a.name : (!io.isNull(n)) ? n : _href.substring(_href.lastIndexOf("/")+1, _href.lastIndexOf("."));
		var _width = io.isNumber(w) ? w : screen.availWidth;
		var _height = io.isNumber(h) ? h : screen.availHeight;
		var _left = io.isNumber(l) ? l : parseInt((screen.availWidth/2)-(_width/2));
		var _top = io.isNumber(t) ? t : parseInt((screen.availHeight/2)-(_height/2));
		var _scrollbars = io.isUndefined(s) ? 1 : s;
		var _features = (_name != "_blank") ? "width="+_width+",height="+_height+",top="+_top+",left="+_left+",scrollbars="+_scrollbars+",resizable="+_resizable+",menubar="+_toolbars+",toolbar="+_toolbars+",personalbar="+_toolbars+",location="+_toolbars+",directories="+_toolbars+",status="+_toolbars+",dependent="+_dependent : "scrollbars=1,menubar=1,toolbar=1,personalbar=1,location=1,directories=1,status=1,dependent=0";
		var _window = window.open(_href,_name,_features);
		if ((!io.isObject(_window)) || (!_window)) {
			var _blocked = (_message) ? confirm(_message) : false;
			if (_blocked === true) { window.location.href = _href; }
		} else {
			_window.focus();
			if (e) { window.location.href = e; }
		}
	},
	isBoolean : function(a) { return (typeof a == "boolean"); },
	isEven : function(a) { return (io.isNumber(a) && (!(a % 2))); },
	isOdd : function(a) { return Boolean(io.isNumber(a) && ((a % 2))); },
	isFunction : function(a) { return (typeof a == "function"); },
	isNull : function(a) { return (!a); },
	isNumber : function(a) { return ((typeof a == "number") && isFinite(a)); },
	isObject : function(a) { return ((a && typeof a == "object") || io.isFunction(a)); },
	isString : function(a) { return (typeof a == "string"); },
	isUndefined : function(a) { return (typeof a == "undefined"); },
	statusBar : function(msg) {
		window.status = msg;
	}
}

function addLoadEvent(func) {
  var onLoad = window.onload;
  if (typeof(window.onload) != "function") {
    window.onload = func;
  } else {
    window.onload = function() {
      onLoad();
      func();
    }
  }
}

function parent(loc) {
	window.opener.location = loc;
	window.close();
	return false;
}

function printme() {
	window.print();  
}

/****************************************************************************************************
*  FlashObject Embed                                                                                *
*  Geoff Stearns (geoff@deconcept.com, http://www.deconcept.com/)                                   *
*  http://blog.deconcept.com/2005/03/31/proper-flash-embedding-flashobject-best-practices/          *
*  v1.1.0 - 03-31-2005                                                                              *
****************************************************************************************************/
var FlashObject = function(swf, id, w, h, ver, c) { this.swf = swf; this.id = id; this.width = w; this.height = h; this.version = ver; this.align = "middle"; this.params = new Object(); this.variables = new Object(); this.redirect = ""; this.sq = document.location.search.split("?")[1] || ""; this.bypassTxt = "<p>Already have Macromedia Flash Player? <a href='?detectflash=false&"+ this.sq +"'>Click here if you have Flash Player "+ this.version +" installed</a>.</p>"; if (c) this.color = this.addParam('bgcolor', c); this.addParam('quality', 'high'); this.doDetect = getQueryParamValue('detectflash');}
var FOP = FlashObject.prototype; FOP.addParam = function(name, value) { this.params[name] = value;}
FOP.getParams = function() { return this.params;}
FOP.getParam = function(name) { return this.params[name];}
FOP.addVariable = function(name, value) { this.variables[name] = value;}
FOP.getVariable = function(name) { return this.variables[name];}
FOP.getVariables = function() { return this.variables;}
FOP.getParamTags = function() { var paramTags = ""; for (var param in this.getParams()) { paramTags += '<param name="' + param + '" value="' + this.getParam(param) + '" />';}
return (paramTags == "") ? false:paramTags;}
FOP.getHTML = function() { var flashHTML = ""; if (navigator.plugins && navigator.mimeTypes.length) { flashHTML += '<embed type="application/x-shockwave-flash" src="' + this.swf + '" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '"'; for (var param in this.getParams()) { flashHTML += ' ' + param + '="' + this.getParam(param) + '"';}
if (this.getVariablePairs()) { flashHTML += ' flashVars="' + this.getVariablePairs() + '"';}
flashHTML += '></embed>';} else { flashHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '">'; flashHTML += '<param name="movie" value="' + this.swf + '" />'; if (this.getParamTags()) { flashHTML += this.getParamTags();}
if (this.getVariablePairs() != null) { flashHTML += '<param name="flashVars" value="' + this.getVariablePairs() + '" />';}
flashHTML += '</object>';}
return flashHTML;}
FOP.getVariablePairs = function() { var variablePairs = new Array(); for (var name in this.getVariables()) { variablePairs.push(name + "=" + escape(this.getVariable(name)));}
return (variablePairs.length > 0) ? variablePairs.join("&"):false;}
FOP.write = function(elementId) { if(detectFlash(this.version) || this.doDetect=='false') { if (elementId) { document.getElementById(elementId).innerHTML = this.getHTML();} else { document.write(this.getHTML());}
} else { if (this.redirect != "") { document.location.replace(this.redirect);} else if (this.altTxt) { if (elementId) { document.getElementById(elementId).innerHTML = this.altTxt +""+ this.bypassTxt;} else { document.write(this.altTxt +""+ this.bypassTxt);}
}
}
}
function getFlashVersion() { var flashversion = 0; if (navigator.plugins && navigator.mimeTypes.length) { var x = navigator.plugins["Shockwave Flash"]; if(x && x.description) { var y = x.description; flashversion = y.charAt(y.indexOf('.')-1);}
} else { result = false; for(var i = 15; i >= 3 && result != true; i--){ execScript('on error resume next: result = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript'); flashversion = i;}
}
return flashversion;}
function detectFlash(ver) { return (getFlashVersion() >= ver) ? true:false;}
function getQueryParamValue(param) { var q = document.location.search || document.location.href.split("#")[1]; if (q) { var detectIndex = q.indexOf(param +"="); var endIndex = (q.indexOf("&", detectIndex) > -1) ? q.indexOf("&", detectIndex) : q.length; if (q.length > 1 && detectIndex > -1) { return q.substring(q.indexOf("=", detectIndex)+1, endIndex);} else { return "";}
}
}
if(Array.prototype.push == null){ Array.prototype.push = function(item) { this[this.length] = item; return this.length;}
}
// ]]>