// JavaScript Document
function openBigPicture(id){
window.open ("common/openPicture.php?id="+id,"_blank",
"top=200,left=200,width=200,height=200,menubar=0,scrollbar=0,status=0");
}

function openPopup(url,width,height){
window.open (url,"_blank","top=200,left=200,width="+width+",height="+height+",menubar=0,scrollbar=1,status=0");		
}

function openPopup2(url,width,height){
window.open (url,"_blank","top=200,left=200,width="+width+",height="+height+",menubar=0,scrollbars=yes,status=0");		
}

function validate_email(field,alerttxt)
{
with (field)
  {
  apos=value.indexOf("@");
  dotpos=value.lastIndexOf(".");
  if (apos<1||dotpos-apos<2) {
	//alert('lathos');
	return false;
  }
  else{
//	alert('swsto');
	  return true;
  }
  }
}

function valmail(nmail)
{
  if (validate_email(nmail)==false) return false;
}

function openEmailToFriend(url){
	var width=300;
	var height=400;
	window.open ('/includes/email_url.php?id='+url,"_blank","top=200,left=200,width="+width+",height="+height+",menubar=0,scrollbars=0,status=0");	
	}
	
function openPrint(url){
	var width=630;
	var height=480;
	window.open ('/includes/printable.php?id='+url,"_blank","top=200,left=200,width="+width+",height="+height+",menubar=0,scrollbars=1,status=0");	
	}	

function textsize(n){
document.getElementById("storyContainer").className="mainarticle"+n;
//alert(n);
}


function bookmark(){
var url=window.document.location;
var title=window.document.title;
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}
