function commonOpen(url,width,height,isScroll)
{
	var scroll="no";
	if(width=="0")
	{
		width=window.screen.availWidth;
	}
	if(height=="0")
	{
		height=window.screen.availHeight;
	}
	var toppos=(window.screen.availHeight-height)/2;
	var leftpos=(window.screen.availWidth-width)/2;
	if(isScroll=="1")
	{
		scroll="yes";
	}
	window.open(url,'','width='+width+',height='+height+',scrollbars='+scroll+',top='+toppos+',left='+leftpos+',toolbar=yes,menubar=yes,location=yes,resizable=yes,status=yes');
}
function commonOpenInfo(url,width,height,isScroll)
{
	var scroll="no";
	if(width=="0")
	{
		width=window.screen.availWidth;
	}
	if(height=="0")
	{
		height=window.screen.availHeight;
	}
	var toppos=(window.screen.availHeight-height)/2;
	var leftpos=(window.screen.availWidth-width)/2;
	if(isScroll=="1")
	{
		scroll="yes";
	}
	window.open(url,'','width='+width+',height='+height+',scrollbars='+scroll+',top='+toppos+',left='+leftpos+',toolbar=no,menubar=no,location=no,resizable=no,status=no');
}
var openWin=function(url,width,height,isScroll)
{
  return function()
  {
    commonOpen(url,width,height,isScroll);
  }
}
function rightAdd(ifs,content,othersContent,url,width,height,isScroll)
{
	var con=eval(ifs);
	if(con)
	{
		var randomNum=Math.floor((Math.random()*10000));
		document.write("<a href='#' id='div"+randomNum+"'>"+content+"</a>");
		var me=document.getElementById('div'+randomNum);
		me.attachEvent('onclick',openWin(url,width,height,isScroll));
	}
	else
	{
		document.write(othersContent);			
	}
			
}
