function newwin(w)  {
	var winny;
	winny=window.open(w,'theWindow','toolbar=0,status=0,scrollbars=0,resizable=1,width=400,height=261');      
	winny.focus() 
}

function newwin2(w,wd,h,s) { 
  winny=window.open(w,'theWindow','toolbar=0,status=0,scrollbars='+s+',resizable=0,width='+wd+',height='+h+'');        
  winny.focus() 
}

//  bookmarksite
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}


 function checkemail() {
   if (validate()) { 
     frmnewsletter.submit();
   }
}

function validate(){
  var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
  var returnval=emailfilter.test(document.BoxComment.email.value);

  if (returnval==false){
     alert("Your email address appears to be incorrect")
     document.frmnewsletter.newsletteremail.focus();
     return false;
  }
   return true; 
}

var arrTemp=self.location.href.split("?");
var picUrl = (arrTemp.length>0)?arrTemp[1]:"";
var NS = (navigator.appName=="Netscape")?true:false;

function FitPic() {
   iWidth = (NS)?window.innerWidth:document.body.clientWidth;
   iHeight = (NS)?window.innerHeight:document.body.clientHeight;
   iWidth = document.images[0].width - iWidth;
   iHeight = document.images[0].height - iHeight;
   window.resizeBy(iWidth, iHeight);
   self.focus();
};

function PopupPic(sPicURL) {
  window.open( "/cartoon/index.html?"+sPicURL, "poppis",
    "resizable=1,HEIGHT=200,WIDTH=200,Left=20%,Top=20%");
}

function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}
