function antispam(name,domain, subject) {
	document.location = "mailto:" + name + "@" + domain + "?subject=" + subject;
}	
//<a href='mypage' onClick="NewWindow(this.href,'gallerypopup',640,640);return false">
function showOverDiv(w,h,t,l,htmlmarkup){
	var overdiv=document.getElementById("overDiv");
	if(overdiv!=null){
		overdiv.style.width=w;
		overdiv.style.height=h;
		overdiv.style.top=t;
		overdiv.style.left=l;
		overdiv.innerHTML="<div style=\"width:"+w+";text-align:right;\"><span style=\"background-color:#fff;height:16px;width:16px;border:1px solid black;text-align:center;\" onClick=\"hideOverDiv();\">X</span></div>"+
				htmlmarkup;
		overdiv.style.visibility="visible";
	}
}
function hideOverDiv(){
	var overdiv=document.getElementById("overDiv");
	if(overdiv!=null){
		overdiv.style.visibility="hidden";
	}
}
function ClickOverDiv(w,h,t,l,htmlmarkup){
	var overdiv=document.getElementById("overDiv");
	if(overdiv!=null){
		if(overdiv.style.visibility=="hidden")
			showOverDiv(w,h,t,l,htmlmarkup);
		else 
			overdiv.style.visibility="hidden";
	}
}

var tao_win= null;

function CenterWindow(mypage,myname,w,h,htmlmarkup){
	if(tao_win)
		tao_win.close();
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	var settings  ="height="+h+",";
	    settings +="width="+w+",";
	    settings +="top="+wint+",";
	    settings +="left="+winl+",";
	    settings +="scrollbars=1,toolbar=0,location=0,directories=0,status=0,resizable=1";
	 
	tao_win=window.open(mypage,myname,settings);
	if(htmlmarkup)
		tao_win.document.write(htmlmarkup);		
//	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function PanWindow(mypage,myname,w,h){
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	var settings  ="height="+h+",";
	    settings +="width="+w+",";
	    settings +="top="+wint+",";
	    settings +="left="+winl+",";
	    settings +="scrollbars=0,toolbar=0,location=0,directories=0,status=0,resizable=0";
	 
	win=window.open(mypage,myname,settings);
	win.window.focus();
}

function myDialog(mypage,myname,w,h){
  win=showModalDialog(mypage,myname,"resizable:0;help:0;status:0; scroll:0;center:1;dialogWidth:"+w+"px;dialogHeight:"+h+"px;");
}

function LeftTopWindow(mypage,myname,w,h,htmlMarkup){
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top=0,';
      settings +='left=0,';
      settings +='scrollbars=1,toolbar=0,location=0,directories=0,status=0,resizable=0';
	  
  win=window.open(mypage,myname,settings);
  if(htmlMarkup)
  	win.document.write(htmlMarkup);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function RightTopWindow(mypage,myname,w,h){
  var winl = screen.width-w;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top=0,';
      settings +='left='+winl+',';
      settings +='scrollbars=1,toolbar=0,location=0,directories=0,status=0,resizable=0';
	  
  win=window.open(mypage,myname,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */
function setCookie(name, value, expires, path, domain, secure) {
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

