// trims leading & trailing spaces
function trim(str){
    var x="", y="";
    for (var i=0; i<str.length; i++){
    	y=str.substring(i,i+1);
    	if( y!=" " && y!="\n" && y!="\t" ){x = x + y}
	}
    return x
}
function rtrim(str){
	var x=""
	for (var i=str.length-1; i >-1; i--){
		var x = str.charAt(i)
		alert(i+"="+x)
		if( x!=" " && x!="\n" && x!="\t" ) return str.substr(0,i+1)
	}
	return ""
}
function ltrim(str){
    for (var i = 0; i < str.length; i++){
		var x = str.charAt(i)
		alert(i+"="+x)
		if( x!=" " && x!="\n" && x!="\t" ) return str.substr(i)
    }
return ""
}
function right(string, many){
    var l = string.length
    if(l<=0 || many<=0) return string;
    return string.substr(l-many)
}
function left(string, many){
    var l = string.length
    if(l<=0 || many<=0) return string;
    return string.substr(0,many)
}
//writeCookie("Age","56")
//readCookie("Age")
//writeCookie("Visitor","Jane")
//readCookie("Visitor")
function readCookie(tag){
    var c = unescape(document.cookie) + ";"
    if( c == ";" ) return false
    var x = c.indexOf(tag)
    if( x == -1 ) return false
    var y = c.indexOf(";", x)
	value = c.substring(x+tag.length+1, y)
    //alert("This is " + tag + "= "+ value)
    return value
}
function writeCookie(tag,value){
    var threeDays = 3 * 24 * 60 * 60 * 1000      	// date/time in milliseconds
	var twoMinutes = 1 * 1 *   2 * 60 * 1000      	// date/time in milliseconds    
    var today = new Date()                      			 // today's date
    today.setTime(today.getTime() + twoMinutes)   	// add lifetime to cookie
    ExpiresWhen = today.toGMTString()            		// convert to GMT
    document.cookie = tag + "=" + escape(value) + '; expires=' + ExpiresWhen
}

var d = new Date()            // alert (d.getDate())
var r = d.getSeconds()       // time of day for random seed
var D = 30                        // number of items in the arrays
var H = new Array(D)
var C = new Array(D)
var B = new Array(D)
var S = new Array(D)
var T = new Array(D)
H[0]="electronic commerce (EC)"
B[0]=" ... buying, selling or exchanging products, services, and information via computer networks"
H[1]="electronic business<br />(e-business)"
B[1]=" ... servicing customers, collaborating with business partners and conducting electronic transactions within an organization via computer networks <span style='font-style:italic'> in addition to the EC processes</span>"
H[2]="e-business value chain"
B[2]="attract and interact with customers, act on purchase requests, and react to information requests"
H[3]="click and mortar"
B[3]="organizations conducting EC activities but do primary business in physical world"
H[4]="electronic market"
B[4]="online marketplace where buyers &amp; sellers meet to exchanges goods, services and information"
H[5]="business-to-consumer (B2C)"
B[5]="EC model in which businesses sell to individual shoppers"
H[6]="business-to-business (B2B)"
B[6]="EC model in which all of the participants are businesses or other organizations"
H[7]="e-tailing"
B[7]="online retailing, usually B2C"
H[8]="consumer-to-consumer (C2C)"
B[8]="EC model in which consumers sell directly to other consumers"
H[9]="business-to-employees (B2E)"
B[9]="EC model in which an organization delivers services, information, or products to its employees"
H[10]="average salaries"
B[10]="$49,000 for IS and $29,000 for non-IS"
H[11]="mass customization"
B[11]="goods produced in large quantities to fit each customer: EC enables orders to reach production facilities quickly"
H[12]="CPM"
B[12]="cost per thousand: applies to Web traffic fees and cost of manufacturing"
H[13]="EC agents"
B[13]="a software response to the large volume of products, vendors and information on the Web (a tool) "
H[14]="thin client"
B[14]="a computer with minimal hardware used in a network where the server does the bulk of processing and storage"
H[15]="hit"
B[15]="a request for data from a Web page or other file such as multimedia data (see visit, click)"
H[16]="visit"
B[16]="a series of requests during one navigation of a Web site, ended by a pause of a certain length (see hit)"
H[17]="click"
B[17]="a count made each time a visitor clicks an ad banner to access the advertiser's site (see hit)"
H[18]="Web mining"
B[18]="an application of data mining (statistics) to discover patterns and trends of both content and usage of Web sites"
H[19]="transaction or access logs"
B[19]="a record of visitor activities (pages visited, duration, browser, OS) on a Web site"
H[20]="cookie"
B[20]="a tiny data file used to record visitor's preferences for Web site customization"
H[21]="artificial intelligence (AI)"
B[21]="a term applied to problem-solving software (see real intelligence)"
H[22]="fat client"
B[22]="a computer with sufficient hardware to do the bulk of processing and storage; used in a client-server network "
H[23]="Internet (the Net)"
B[23]="a vast network of interconnected networks  (approximately 70,000 networks & 700,000,000 users -- see Web)"
H[24]="World Wide Web"
B[24]="a hugely popular Internet service founded approximately in 1991 by Tim Berners-Lee (see Internet)"
H[25]="mobile commerce (m-commerce)"
B[25]="electronic commerce conducted via wireless devices (see EC)"
H[26]="English auction"
B[26]="buyers bidding in sequence on <strong>only one item</strong> with price <em>increasing</em> over time"
H[27]="Dutch auction"
B[27]="buyers bidding on <strong>many identical items</strong> with price <em>declining</em> over time"
H[28]="Yankee auction"
B[28]="buyers bidding on <strong>many identical items</strong> with <em>only the highest bid</em> winning"
H[29]="free-fall auction"
B[29]="buyers bidding in sequence on <strong>only one item</strong> priced high at the start of a fixed-time bidding process with <em>last (lowest) bid</em> winning"
for(var i=0; i < D; i++) T[i] = false
var x = ","   // used to debug
for(var i=0; i < D; i++){
    var v
    v = Math.min( Math.round(Math.random(r)*D), D-1)
    while (T[v]) {
        v = Math.min( Math.round(Math.random(r)*D), D-1)
    }
    T[v] = true
    S[i]= v
    x = x + v + ","
}
// alert(x)
for(var i=0; i < D; i++){
        C[i] = "<div class='callout'><div>" + H[S[i]] + "</div>" + B[S[i]] + "</div>"
}