function v(lang, id, burl)
{
 if (!burl)
 {
 	burl="";
 }
 if (window.votewin)
 {
  if(window.votewin.closed == true)
  {
   votewin = window.open(burl+"?lang="+lang+"&m=vote&sid="+id,"votewin","width=470,height=600,left=200,top=50,scrollbars=yes");
  }
  else
  {
   window.votewin.location.href=burl+"?lang="+lang+"&m=vote&sid="+id;
  }
 }
 else
 {
  votewin = window.open(burl+"?lang="+lang+"&m=vote&sid="+id,"votewin","width=470,height=600,left=200,top=50,scrollbars=yes");
 }
 votewin.focus();
}

function vote(lang, id, burl)
{
 if (!burl)
 {
 	burl="";
 }
 if (window.votewin)
 {
  if(window.votewin.closed == true)
  {
   votewin = window.open(burl+"?lang="+lang+"&m=vote&sid="+id,"votewin","width=470,height=600,left=200,top=50,scrollbars=yes");
  }
  else
  {
   window.votewin.location.href=burl+"?lang="+lang+"&m=vote&sid="+id;
  }
 }
 else
 {
  votewin = window.open(burl+"?lang="+lang+"&m=vote&sid="+id,"votewin","width=470,height=600,left=200,top=50,scrollbars=yes");
 }
 votewin.focus();
}

function n(lang, id)
{
 if (window.notifywin)
 {
  if(window.notifywin.closed == true)
  {
   notifywin = window.open("?lang="+lang+"&m=notify&sid="+id,"votewin","width=470,height=350,left=200,top=50,scrollbars=yes");
  }
  else
  {
   window.notifywin.location.href="?lang="+lang+"&m=notify&sid="+id;
  }
 }
 else
 {
  notifywin = window.open("?lang="+lang+"&m=notify&sid="+id,"votewin","width=470,height=350,left=200,top=50,scrollbars=yes");
 }
 notifywin.focus();
}

function bs(lang, id, burl)
{
 if (!burl)
 {
 	burl="";
 }
 if (window.buyselectwin)
 {
  if(window.buyselectwin.closed == true)
  {
   buyselectwin = window.open(burl+"?lang="+lang+"&m=songinfo&v=bs&sid="+id,"buyselectwin","width=470,height=350,left=200,top=50,scrollbars=yes");
  }
  else
  {
   window.buyselectwin.location.href=burl+"?lang="+lang+"&m=songinfo&v=bs&sid="+id;
  }
 }
 else
 {
  buyselectwin = window.open(burl+"?lang="+lang+"&m=songinfo&v=bs&sid="+id,"buyselectwin","width=470,height=350,left=200,top=50,scrollbars=yes");
 }
 buyselectwin.focus();
}

function p(lang, id, cmd, burl) 
{
 if (!cmd)
 {
 	cmd="songinfo";
 }
 if (!burl)
 {
 	burl="";
 }
 else
 {
	//if (window.infowin && !window.infowin.closed) 
	//{
      //window.infowin.close();
  //}
 }	
 if (window.infowin)
 {
  if(window.infowin.closed == true)
  {
   infowin = window.open(burl+"?lang="+lang+"&m="+cmd+"&v=fs&sid="+id,"infowin","width=640,height="+(screen.height-200)+",left=20,top=100,resizable=yes");
  }
  else
  {
  	if (burl)
 		{
 			//Crossdomain
 			window.infowin.location.href=burl+"?lang="+lang+"&m="+cmd+"&v=fs&sid="+id;
 		}
 		else
 		{
	   window.infowin.pip_content.document.open();
	   window.infowin.pip_content.document.write("<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"/style.css\"><\/head><body class=\"scrollbar\"><b>Loading...<\/b><\/body><\/html>");
	   window.infowin.pip_content.document.close();
	   window.infowin.pip_content.location.href=burl+"?lang="+lang+"&m="+cmd+"&sid="+id;
	  }
  }
 }
 else
 {
  infowin = window.open(burl+"?lang="+lang+"&m="+cmd+"&v=fs&sid="+id,"infowin","width=550,height="+(screen.height-200)+",left=20,top=100,resizable=yes");
 }
 infowin.focus();
}

function bn(lang, cmd, id, burl)
{
 if (!burl)
 {
 	burl="";
 }
	
 if (window.buywin)
 {
  if(window.buywin.closed == true)
  {
   buywin = window.open(burl+"?m=buy&cmd="+cmd+"&lang="+lang+"&sid="+id,"buywin","width=600,height=520,left=50,top=120,scrollbars=yes,resizable=yes");
  }
  else
  {
   window.buywin.location.href=burl+"?m=buy&cmd="+cmd+"&lang="+lang+"&sid="+id;
  }
 }
 else
 {
  buywin = window.open(burl+"?m=buy&cmd="+cmd+"&lang="+lang+"&sid="+id,"buywin","width=600,height=520,left=50,top=120,scrollbars=yes,resizable=yes");
 }
 buywin.focus();
}

function ef(lang, id, burl)
{
 if (!burl)
 {
 	burl="";
 }
	
 mywidth=screen.width;
 if (mywidth>1024)
 {
 	mywidth=1024;
 }
	
 if (window.efwin)
 {
  if(window.efwin.closed == true)
  {
   efwin = window.open(burl+"/cgi-bin/pip/html.cgi?m=entity&lang="+lang+"&sid="+id,"efwin","width="+mywidth+",height="+screen.height+",left=0,top=0,scrollbars=yes,resizable=yes");
  }
  else
  {
   window.efwin.location.href=burl+"/cgi-bin/pip/html.cgi?m=entity&lang="+lang+"&sid="+id;
  }
 }
 else
 {
  efwin = window.open(burl+"/cgi-bin/pip/html.cgi?m=entity&lang="+lang+"&sid="+id,"efwin","width="+mywidth+",height="+screen.height+",left=0,top=0,scrollbars=yes,resizable=yes");
 }
 efwin.focus();
}


function tick_win(turl, lang)
{
 if (window.twin)
 {
  if(window.twin.closed == true)
  {
   twin = window.open(turl+"?lang="+lang,"twin","width=450,height=320,left=100,top=100,scrollbars=no,resizable=yes");
  }
  else
  {
   window.twin.location.href=turl+"?lang="+lang;
  }
 }
 else
 {
  twin = window.open(turl+"?lang="+lang,"twin","width=450,height=320,left=100,top=100,scrollbars=no,resizable=yes");
 }
 twin.focus();
}

function play_win(purl,lang)
{
 if (window.playwin)
 {
  if(window.playwin.closed == true)
  {
   playwin = window.open(purl+"?lang="+lang,"playwin","width=340,height=475,left=100,top=100,scrollbars=no,resizable=no");
  }
  else
  {
   window.playwin.location.href=purl+"?lang="+lang;
  }
 }
 else
 {
  playwin = window.open(purl+"?lang="+lang,"playwin","width=340,height=475,left=100,top=100,scrollbars=no,resizable=no");
 }
 playwin.focus();
}

// Old function;
function e(lang, id, burl) 
{
	if (!burl)
	{
		burl="";
	}
	
  if (window.eventwin)
  {
   if(window.eventwin.closed == true)
   {
    eventwin = window.open(burl+"/cgi-bin/events/html.cgi?lang="+lang+"&id="+id,"eventwin","width=550,height=550,left=20,top=100,resizable=yes");
   }
   else
   {
   	if (burl)
 		{
 			//Crossdomain
 			window.eventwin.location.href=burl+"/cgi-bin/events/html.cgi?lang="+lang+"&id="+id;
 		}
 		else
 		{
	   window.eventwin.ei_content.document.open();
	   window.eventwin.ei_content.document.write("<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"/style.css\"><\/head><body class=\"scrollbar\"><b>Loading...<\/b><\/body><\/html>");
	   window.eventwin.ei_content.document.close();
	   window.eventwin.ei_content.location.href="/cgi-bin/events/html.cgi?lang="+lang+"&id="+id+"&v=d";
	  }
   }
  }
  else
  {
    eventwin = window.open(burl+"/cgi-bin/events/html.cgi?lang="+lang+"&id="+id,"eventwin","width=550,height=550,left=20,top=100,resizable=yes");
  }
  eventwin.focus();
}

function ev(lang, id, burl) 
{
	if (!burl)
	{
		burl="";
	}
	
  if (window.eventwin)
  {
   if(window.eventwin.closed == true)
   {
    eventwin = window.open(burl+"/cgi-bin/events/html.cgi?lang="+lang+"&id="+id,"eventwin","width=550,height=550,left=20,top=100,resizable=yes");
   }
   else
   {
   	if (burl)
 		{
 			//Crossdomain
 			window.eventwin.location.href=burl+"/cgi-bin/events/html.cgi?lang="+lang+"&id="+id;
 		}
 		else
 		{
	   window.eventwin.ei_content.document.open();
	   window.eventwin.ei_content.document.write("<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"/style.css\"><\/head><body class=\"scrollbar\"><b>Loading...<\/b><\/body><\/html>");
	   window.eventwin.ei_content.document.close();
	   window.eventwin.ei_content.location.href="/cgi-bin/events/html.cgi?lang="+lang+"&id="+id+"&v=d";
	  }
   }
  }
  else
  {
    eventwin = window.open(burl+"/cgi-bin/events/html.cgi?lang="+lang+"&id="+id,"eventwin","width=550,height=550,left=20,top=100,resizable=yes");
  }
  eventwin.focus();
}

function g(lang, id) 
{
  if (window.geowin)
  {
   if(window.geowin.closed == true)
   {
    geowin = window.open("/cgi-bin/events/html.cgi?lang="+lang+"&v=g&id="+id,"geowin","width=790,height=620,left=20,top=100,resizable=no");
   }
   else
   {
   window.geowin.document.open();
   window.geowin.document.write("<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"/style.css\"><\/head><body class=\"scrollbar\"><b>Loading...<\/b><\/body><\/html>");
   window.geowin.document.close();
   window.geowin.location.href="/cgi-bin/events/html.cgi?lang="+lang+"&v=g&id="+id;
   }
  }
  else
  {
    geowin = window.open("/cgi-bin/events/html.cgi?lang="+lang+"&v=g&id="+id,"geowin","width=790,height=620,left=20,top=100,resizable=yes");
  }
  geowin.focus();
  return false;
}


