var url   = "http://www.golookontheweb.com";
var title = "GO Lookontheweb - Portal for Search, Social Humor";

function makeLink()
{
    if(document.all)
	{
        window.external.AddFavorite(url,title);
	}
}

function popup()
{
    var PopUrl = '/netscape.asp';
//    openTool(PopUrl,300,310, "popup")
}

function openTool(PopUrl,Width,Height)
{
    args      = 'width=' +Width+ ',height=' +Height+ ',toolbar=no,location=no,scrollbars=yes,resizable'
    newWindow = window.open(PopUrl, name, args)
}

function TestForm(form)
{
    var ret_val = true;

	if ( !TestWhois(form) )
	{
	    ret_val = false;
	}

	return ( ret_val );
}

function setHomepage(obj)
{
	obj.setHomePage('http://www.golookontheweb.com');
	return( true );
}
function TestWhois(form)
{
    var ret_val = true;

    str = document.domainForm.domain.value;

    if ( str.indexOf('www.', 0) != -1)
	{
		alert("\nDo not enter the www.\n\n");
		form.domain.value = "";
		document.domainForm.domain.focus();
        ret_val = false;
    }

    if ( str.indexOf('.', 0) != -1)
	{
		alert("\nDo not enter the domain extension.\n\n");
		form.domain.value = "";
		document.domainForm.domain.focus();
	    ret_val = false;
	}

    if ( str == "" )
	{
		alert("\nThe domain field is blank.\n\n");
		document.domainForm.domain.focus();
        ret_val = false;
    }

    for ( var i = 0; i < str.length; i++ )
	{
		var ch = str.substring(i, i + 1);
		if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch) && (ch < "0" || "9" < ch)) && ch != '-')
		{
			alert("The domain has illegal characters! Use only letters and numbers or a '-'");
			form.domain.value = "";
			document.domainForm.domain.focus();
			ret_val = false;
        }
    }

	return ( ret_val );
}

function focusSearch()
{
	document.searchwidget.q.focus();
}

function comment()
{
;
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

var sptDomain = location.host.split('.')
var strDomain = '.'+sptDomain[sptDomain.length-2]+'.'+sptDomain[sptDomain.length-1]
function CookieMonster(name,value,days,type){
 if (type == 'create'){
  if (days) {
   var date = new Date();
   date.setTime(date.getTime()+(days*24*60*60*1000));
   var expires = '; expires='+date.toGMTString();
  }else var expires = '';
  document.cookie = name+'='+value+expires+'; path=/; domain='+strDomain;
 }else if (type == 'read'){
  var nameEQ = name + '=';
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
   var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return '';
 }else if (type == 'delete'){
  CookieMonster(name,'',-1,'create');
 }
}
function bookmarksite(){
 var title = 'GOlookontheweb - wherer Laughter is the Best Medicine'
 var url = location.href
 if(document.all){
  window.external.AddFavorite(url, title);
 } else {
  location.href='bookmarks/index.html';
 }
}
function sHide(sId){
 var obj = document.getElementById(sId)
 if(obj.style.display=='block'){obj.style.display='none'}else{obj.style.display='block'}
}
function hints(mId,mAction){
 var oHints = new Array();
 oHints[0] = ''
 oHints[1] = 'Go Back To Our Homepage.'
 oHints[2] = 'Help Promote Us, We Will Help Promote You.'
 oHints[3] = 'Like What You See? How About Tell A Friend.'
 oHints[4] = 'Bookmark Us To Find Us Faster.'
 oHints[5] = 'Got A Question? Contact Us.'
 var obj = document.getElementById('mHint');
 var bdVersion = navigator.appVersion.split("MSIE")
 var bd2version = parseFloat(bdVersion[1])
 if(mAction==0){
  obj.innerHTML = oHints[0];
  if(bd2version >= 5.5 && bd2version < 7.0 && document.body.filters){
   if(mId==1){
    document.getElementById('hn'+mId).style.backgroundImage = 'url(/image/main/1aa.png)'
   }else{
    document.getElementById('hn'+mId).style.backgroundImage = 'url(/image/main/1a.png)'
   }
  }
 }else{
  obj.innerHTML = oHints[mId];
  if(bd2version >= 5.5 && bd2version < 7.0 && document.body.filters){
   if(mId==1){
    document.getElementById('hn'+mId).style.backgroundImage = 'url(/image/main/1bb.png)'
   }else{
    document.getElementById('hn'+mId).style.backgroundImage = 'url(/image/main/1b.png)'
   }
  }
 }
}
function newItem(){
 if(typeof strItem != 'undefined'){
  if(cItem==strItem.length-1){cItem = -1};
  cItem = cItem + 1; 
  document.getElementById('limit_ex').style.display='none';
  if(strItem[cItem][0]==-1){document.getElementById('limit_ex').style.display='block'}
  document.getElementById('dyn_1').innerHTML = strItem[cItem][1];
  if(document.getElementById('dyn_2')){document.getElementById('dyn_2').innerHTML = strItem[cItem][2]};
 }
}
function prevItem(){
 if(typeof strItem != 'undefined'){
  if(cItem==0){cItem = strItem.length};
  cItem = cItem - 1;
  document.getElementById('limit_ex').style.display='none';
  if(strItem[cItem][0]==-1){document.getElementById('limit_ex').style.display='block'}
  document.getElementById('dyn_1').innerHTML = strItem[cItem][1];
  if(document.getElementById('dyn_2')){document.getElementById('dyn_2').innerHTML = strItem[cItem][2]};
 }
}
function newLoad(){
 document.body.style.display = 'block';
 theObjects = document.getElementsByTagName("object"); 
 for (var i = 0; i < theObjects.length; i++){
  theObjects[i].outerHTML = theObjects[i].outerHTML;
 }
}
window.onload = newLoad
