function txwidget(siteGUID, rows, cols, style, w, h, category) { if (typeof rows != 'number') rows = 2; if (typeof cols != 'number') cols = 3; cell_width = 160; cell_height = 190; table_width = 7 + cell_width * cols; table_height = 7 + cell_height * rows; if (typeof w != 'number') w = table_width; if (typeof h != 'number') h = table_height; if (typeof style == 'undefined') style = ''; if (typeof category == 'undefined') category = 'default'; var pages = 10; var cookietag = "widget_page-" + siteGUID + "-" + rows + "-" + cols + "-" + category; var page = GetCookie(cookietag); if (page == null) { // randomly choose a starting page var currentTime = new Date(); page = currentTime.getTime() % pages; } else { page++; if (page >= pages) page = 0; } SetCookie(cookietag, page); var site = "http://scribol.environmentalgraffiti.com/"; var url = encodeURI(site + "txwidget/" + siteGUID + "/" + rows + "/" + cols + "/" + page + "/") + encodeURIComponent(category) + "/" + encodeURIComponent(style); var output = '
'; document.write(output); } function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) { endstr = document.cookie.length; } return unescape(document.cookie.substring(offset, endstr)); } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) { return getCookieVal (j); } i = document.cookie.indexOf(" ", i) + 1; if (i == 0) { break; } } return null; } function SetCookie (name,value,expires,path,domain,secure) { document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); }