function adbkpopup(what) { window.open(what, "addressbook", "scrollbars=1,resizable=1,width=350,height=500,left=10,top=10"); }
function avatarspopup(what) { window.open(what, "avatars", "scrollbars=1,resizable=1,width=600,height=600,left=30,top=30"); }
function changeemailpopup(what) { window.open(what, "change email", "scrollbars=1,resizable=1,width=400,height=300,left=100,top=100"); }
function commentspopup(what) { window.open(what, "comments", "scrollbars=1,resizable=1,width=300,height=400,left=10,top=10"); }
function imgingpopup(what) { window.open(what, "imging", "scrollbars=1,resizable=1,width=480,height=600,left=50,top=50"); }
function linkpopup(what) { window.open(what, "link", "scrollbars=1,resizable=1,width=480,height=200,left=50,top=50"); }
function termspopup(what) { window.open(what, "terms", "scrollbars=1,resizable=1,width=660,height=700,left=50,top=50"); }
function onMouseOutMenu(id) { document.getElementById(id).style.display='none'; }
function onMouseOverMenu(id) { document.getElementById(id).style.display='block'; }
function smileyspopup(what) { window.open(what, "smileys", "scrollbars=1,resizable=1,width=550,height=600,left=30,top=30"); }
function vidpopup(what) { window.open(what, "yt", "scrollbars=1,resizable=1,width=480,height=400,left=50,top=50"); }
function limittext(field, n) { if(field.value.length > n) {field.value = field.value.substring(0, n); }};
function cookitformcheck() {if(document.cookitForm.named.value == ""){ alert("Please enter a name for your recipe."); return false;} return true;}
function picksmiley(smiley) {str = " :" + smiley + ": ";window.opener.document.blogform.contents.value += str;self.close();}
function picktuzki(smiley) {str = ":" + smiley + ":";window.opener.document.blogform.contents.value += str;self.close();}
function geolocate() {
   if(window['google']){
	  var cl=google.loader.ClientLocation;
      if(cl){ $.post("/a/_geoloc.xhtml",
	            {latitude: cl.latitude, longitude: cl.longitude,
	             city: cl.address.city, region: cl.address.region,
	             country: cl.address.country,
	             countrycode: cl.address.country_code });
      }
   }
}
function iebugfix() {
	// getelementbyid has a problem in IE.
	if(document.all) { //only override IE
		document.nativeGetElementById = document.getElementById;
		document.getElementById = function(id) {
			var elem = document.nativeGetElementById(id);
			if(elem == null) return null;
			if(elem.id == id) return elem; //make sure that it is a valid match on id					
			for(var i=1;i<document.all[id].length;i++) { //otherwise find the correct element
				if(document.all[id][i].id == id) return document.all[id][i];
			}
		}
	}
}