var clicks = 0;
var days = 6004; // days to store links cookie
var page = window.location;
var updInx = 0;
var hlong = 1000*60*60*24*6004; 	
var u = new Date(); u.setTime (u.getTime() + hlong);
var e = new Date(); e.setTime (u.getTime());
var engine = new Array("www.altavista.com/cgi-bin/query?pg=q&what=web&fmt=.&q=","www.ask.com/main/askjeeves.asp?origin=0&site_name=Jeeves&metasearch=yes&ask=","search.msn.com/results.aspx?q=","www.google.com/search?q=","search.findtarget.com/cb/hotsheet.php?q=","www.shopsheet.com/search/index.php?query=","en.wikipedia.org/wiki/Special:Search?search=","search.yahoo.com/bin/search?p=","us.imdb.com/Tsearch?title=","www.youtube.com/results?search_query=","dictionary.reference.com/search?db=all&q=","allrecipes.com/Search/Recipes.aspx?WithTerm=","www.medicinenet.com/script/main/srchcont.asp?op=mm&SRC=","www.download.com/3120-20_4-0.html?tag=srch&tg=dl-20&qt=","wwwa.accuweather.com/us-city-list.asp?partner=tsti&zipcode=","www.mapquest.com/maps/map.adp?address=&CID=lfmapwid&country=US&zipcode=","www.topix.net/hsearch/?q=","tvlistings.zap2it.com/tvlistings/ZCGrid.do?zipcode=","finance.yahoo.com/q?d=v1&s=","us.imdb.com/showtimes/location/");

window.defaultStatus='';
function hidestatus(){
window.status=''
return true
}
if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
document.onmouseover=hidestatus
document.onmouseout=hidestatus

if (document.images){
  image1on = new Image();
  image1on.src = "colorbox2.gif";

  image1off = new Image();
  image1off.src = "colorbox1.gif"; 
}

function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
    }
  }
}

function searchFunc(eIDX){
searchValue = document.superSearch.queryField.value;
goHere = "http://" + engine[eIDX] + searchValue;
chkWww = searchValue.substring(0,2);
moreVal = searchValue.substring(2);
if (chkWww == ".."){
newLoc= "http://www." + moreVal + ".com/";
goHere= newLoc;
eIDX=3;
}
if (chkWww == "./"){
newLoc= "http://www." + moreVal;
goHere= newLoc;
eIDX=3;
}
if (chkWww == "/."){
newLoc= "http://" + moreVal + ".com/";
goHere= newLoc;
eIDX=3;
}
if (chkWww == "//"){
newLoc= "http://" + moreVal;
goHere= newLoc;
eIDX=3;
}
location.href = goHere;
}
function hovImg(dest){
return "<img src=http://open.thumbshots.org/image.pxf?url=" + dest + " border=0>";
}
function get (n1) {
var cn = n1 + "="; var cl = document.cookie.length; var b = 0;
  while (b < cl) {
  var v = b + cn.length;
  if (document.cookie.substring(b, v) == cn) { 
    var vd = document.cookie.indexOf (";", v); if (vd == -1) vd = cl; return unescape(document.cookie.substring(v, vd));
  }
  b = document.cookie.indexOf(" ", b) + 1;
  if (b == 0) break;
  }
return null;
}
function set (n1, n2, n3) {
if (!n3) n3 = hlong;
document.cookie=n1+"="+escape (n2)+"; expires="+n3.toGMTString()+";";
}
function delete_Cookie(name, path, domain) { 
if (get(name)) document.cookie = name + "=" + 
( (path)? ";path=" + path : "") + 
( (domain)? ";domain=" + domain : "") + 
";expires=Thu, 01-Jan-1970 00:00:01 GMT"; 
}
function randomBg(){
clicks = clicks + 1;
var hex1=new Array("9", "A", "B", "C", "D", "E", "F")
var hex2=new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F")
var hex3=new Array("9", "A", "B", "C", "D", "E", "F")
var hex4=new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F")
var hex5=new Array("9", "A", "B", "C", "D", "E", "F")
var hex6=new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F")
var bg="#"+hex1[Math.floor(Math.random()*hex1.length)]+hex2[Math.floor(Math.random()*hex2.length)]+hex3[Math.floor(Math.random()*hex3.length)]+hex4[Math.floor(Math.random()*hex4.length)]+hex5[Math.floor(Math.random()*hex5.length)]+hex6[Math.floor(Math.random()*hex6.length)]
if (clicks == 6){
bg = "#cdd4dd";
delete_Cookie('color2', '', '');
clicks = 0;
}
theRules = new Array();
if (document.styleSheets){
if	(document.styleSheets[0].rules)
{
theRules = document.styleSheets[0].rules;
} else 
if	(document.styleSheets[0].cssRules)
{
theRules = document.styleSheets[0].cssRules;
}
if (bg != "#cdd4dd"){
theRules['4'].style.backgroundColor = bg;
theRules['4'].style.color = "#000";
theRules['5'].style.color = "#8ca0b2";
} else {
theRules['4'].style.backgroundColor = "#acbcca";
theRules['4'].style.color = "#222a34";
theRules['5'].style.color = "#b22222";}
theRules['18'].style.backgroundColor = bg;
}
window.document.bgColor = bg;
if (bg != "#cdd4dd"){
set ("color2", bg, u);
}
}

function BackColor(){
favColor="#cdd4dd";
favColor = get('color2');
if (favColor == null){
favColor="#cdd4dd";
}
theRules = new Array();
if (document.styleSheets){
	if	(document.styleSheets[0].rules){
	theRules = document.styleSheets[0].rules;
	} else if	(document.styleSheets[0].cssRules){
	theRules = document.styleSheets[0].cssRules;
	}
}
if (theRules){
if (favColor != "#cdd4dd"){
theRules['4'].style.backgroundColor = favColor;
theRules['4'].style.color = "#000";
theRules['5'].style.color = "#8ca0b2";}
} else {
theRules['4'].style.backgroundColor = "#acbcca";
theRules['4'].style.color = "#222a34";
theRules['5'].style.color = "#b22222";}
theRules['18'].style.backgroundColor = favColor;
window.document.bgColor=favColor;
loadFontSize();
return;
}

var min=60;
var max=150;
function increaseFontSize() {
   var p = document.getElementsByTagName('div');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("%",""));
      } else {
         var s = 100;
      }
      if(s!=max) {
         s = s + 5;
	        }

	  p[i].style.fontSize = s+"%"
   }
if (s == 100){
delete_Cookie('teXtsize', '', '');
} else {
set ("teXtsize", s, u);
}
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('div');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("%",""));
      } else {
         var s = 100;
      }
      if(s!=min) {
         s -= 5;
      }
	p[i].style.fontSize = s+"%"
   }   
if (s == 100){
delete_Cookie('teXtsize', '', '');
} else {
set ("teXtsize", s, u);
}
}

function loadFontSize() {
    var s = get('teXtsize');
	if (s == null){
	s = 100;
	}
   var p = document.getElementsByTagName('div');
		 for(i=0;i<p.length;i++) {
	p[i].style.fontSize = s+"%"
   }   
}