//Ussage: <A href='bob.html' onClick='return popUp('url', 600, 420);'>
function popUp(URL, w, h) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" + w + ",height=" + h + "');");
	return false;
}

function popUp2(URL, w, h) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=0,statusbar=1,menubar=1,resizable=1,width=" + w + ",height=" + h + "');");
	return false;
}

//Ussage: <A href='bob.html' onClick='return popUp3(this, 600, 420);'>
function popUp3(el, w, h) {
	var URL = el.href;
	var day = new Date();
	var id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=0,statusbar=1,menubar=1,resizable=1,width=" + w + ",height=" + h + "');");
	return false;
}

clicks = 0;
function isFirstClick() {
	clicks++;
	if(clicks > 1) return false;
	return true;
}

function printOrderForm(text) {
	text=document
	print(text)
}

function ol(u, name, args)
{
	window.open(u,"_blank");
	return false;
}

//**********
//** Script by John Resig
//** Modified by the good folks at QuirksMode.org
//** http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html
function addEvent( obj, type, fn )
{
	if (obj.addEventListener)
		obj.addEventListener( type, fn, false );
	else if (obj.attachEvent)
	{
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}

function removeEvent( obj, type, fn )
{
	if (obj.removeEventListener)
		obj.removeEventListener( type, fn, false );
	else if (obj.detachEvent)
	{
		obj.detachEvent( "on"+type, obj[type+fn] );
		obj[type+fn] = null;
		obj["e"+type+fn] = null;
	}
}
//** End Script by John Resig
//**********



//**********
//** Script by Simon Willison
//** http://www.webreference.com/programming/javascript/onloads/
//**
//** Replace "window.onload=" with a call to this function
//**
//** Example 1:
//**   addLoadEvent(nameOfSomeFunctionToRunOnPageLoad);  //instead of window.onload = nameOfSomeFunctionToRunOnPageLoad;
//**
//** Example 2:
//**	addLoadEvent(function() {
//**		//more code to run on page load 
//**	});
//**
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}
//** End Script by Simon Willison
//**********



