 var indexadengineui = Math.round(Math.random()*10000000);
 var same = indexadengineui;

function Is() { //browser leválogatás
  agent = navigator.userAgent.toLowerCase();
  this.agent = navigator.userAgent.toLowerCase();
  this.major = parseInt(navigator.appVersion);
  this.minor = parseFloat(navigator.appVersion);
  this.ns = ((agent.indexOf('mozilla') != -1) && ((agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1)));
  this.ns4 = (this.ns && (this.major <= 4) && (this.minor < 5));
  this.ns6 = (this.ns && (this.major >= 5));
  this.ie = (agent.indexOf("msie") != -1);
  this.ie4 = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") == -1));
  this.ie5 = (this.ie && (this.major == 4) && (agent.indexOf("msie 5") != -1));
  this.ie6 = (this.ie && (this.major == 4) && (agent.indexOf("msie 6") != -1));
  this.iframe = (this.ie || this.ns6) ;
}
var is = new Is();

function OWP(Title, URL, wWidth, wHeight, wScroll)
{
  try {
  if (document.all) 
  {
    screenWidth = document.body.offsetWidth;
    screenHeight = document.body.offsetHeight;
  }
  else 
  {
    screenWidth = window.innerWidth;
    screenHeight = window.innerHeight;
  } 
  var wLeft = (window.screenLeft * 2 + screenWidth - wWidth)/2;
  var wTop = (window.screenTop * 2 + screenHeight - wHeight)/2;
  try {
    Win = window.open(URL,Title,'toolbar=no,location=no,directories=no,menubar=no,status=no,left='+wLeft+',top='+wTop+',width='+wWidth+',height='+wHeight+',scrollbars='+wScroll); Win.focus(); return void(0); 
  }
  catch (ex)
  {
    window.showModalDialog(URL,'','center=no;toolbar=no;location=no;directories=no;menubar=no;status=no;dialogLeft='+wLeft+'px;dialogTop='+wTop+'px;dialogWidth='+wWidth+'px;dialogHeight='+wHeight+'px;resizable=no;help=no;scroll=no'); return void(0); 
  }
  }
  catch(exception) {};

}

function OWU(Title, URL, wWidth, wHeight, wScroll)
{
  try {
  if (document.all) 
  {
    screenWidth = document.body.offsetWidth;
    screenHeight = document.body.offsetHeight;
  }
  else 
  {
    screenWidth = window.innerWidth;
    screenHeight = window.innerHeight;
  } 
  var wLeft = (window.screenLeft * 2 + screenWidth - wWidth)/2;
  var wTop = (window.screenTop * 2 + screenHeight - wHeight)/2;
  Win = window.open(URL,Title,'toolbar=no,location=no,directories=no,menubar=no,status=no,left='+wLeft+',top='+wTop+',width='+wWidth+',height='+wHeight+',scrollbars='+wScroll); window.focus(); return void(0); 
  }
  catch(exception) {};
}

function OWPF(Title, URL)
{
    try {
    var screenWidth;
    var screenHeight;
    var wHeight;
    var wWidth;
    var wLeft;
    var wTop;
    var Win;
    if (document.all)
    {
      screenWidth = document.body.offsetWidth;
      screenHeight = document.body.offsetHeight;
    }
    else 
    {
        screenWidth = window.innerWidth;
        screenHeight = window.innerHeight;
    }
    wHeight = screen.Height;
    wWidth = screen.Width;
    wLeft = 0;
    wTop = 0;
    try {
	Win = window.open(URL,Title,'toolbar=yes,location=yes,directories=yes,menubar=yes,status=yes,left='+wLeft+',top='+wTop+',width='+wWidth+',height='+wHeight+',scrollbars=yes');
	if (Win!=null) Win.focus();
    }
    catch (ex)
    {
	window.showModalDialog(URL,'','center=no;toolbar=no;location=no;directories=no;menubar=no;status=no;dialogLeft='+wLeft+'px;dialogTop='+wTop+'px;dialogWidth='+wWidth+'px;dialogHeight='+wHeight+'px;resizable=no;help=no;scroll=no'); return void(0); 
    }
    }
    catch(exception) {}
    return void(0);
}
							
    
function RollOver(Window, wWidth, wHeight)
{
    Window.width=wWidth;
    Window.height=wHeight;
}

function getObj(dname)
{
    if (ppcIE)
    {
	d=document.all[dname];
    }
    else if (ppcNN)
    {
	d=document.layers[dname];
    }
    else
    {
	d=document.getElementById(dname);
    }
    return d;
}

function DivFlip(dname)
{
    if (ppcIE)
    {
	d=document.all[dname];
    }
    else if (ppcNN)
    {
	d=document.layers[dname];
    }
    else
    {
	d=document.getElementById(dname);
    }
    d.style.display=d.style.display=="none"?"":"none";
    var name=d.id;
    name=name.substring(name.indexOf("_O_")+3);
    var id=parseInt(name);
    if (isNaN(id))
    {
    }
    else
    {
	if (d.style.display!="none")
	{
	    setCookie("Container_"+id+"_Closed","0");
	}
	else
	{
	    setCookie("Container_"+id+"_Closed","1");
	}
    }
    
}

function DivShow(dname)
{
    if (ppcIE)
    {
	d=document.all[dname];
    }
    else if (ppcNN)
    {
	d=document.layers[dname];
    }
    else
    {
	d=document.getElementById(dname);
    }
    if (d!=null)
    {
        d.style.display="";
    }
}

function DivHide(dname)
{
    if (ppcIE)
    {
	d=document.all[dname];
    }
    else if (ppcNN)
    {
	d=document.layers[dname];
    }
    else
    {
	d=document.getElementById(dname);
    }
    if (d!=null)
    {
	d.style.display="none";
    }
}

function showTab( tab, formName, link )
{
    
	form=document.getElementById(formName);
	formlen=form.childNodes.length;

	for (i=0;i<formlen;i++)
	{
	    list=form.childNodes;
	    inp=list[i];
	    if ((inp.tagName=="DIV")&&(inp.className=="tabContent"))
	    {
		inp.style.display="none";
	    }
	}

    var obj = document.getElementById(tab);
    obj.style.display = "block";

    formlen=obj.getElementsByTagName('div').length;
    for (i=0;i<formlen;i++)
    {
	list=obj.getElementsByTagName('div');
	inp=list[i];
	if (inp.className=="cps_htmled_val")
	{
	    fieldName=inp.id.replace("_val","");
	    parent=inp.parentNode;
	    while (parent.tagName!="FORM")
	    {
		parent=parent.parentNode;	    
	    }
	    InitHtmlEditor(parent.name,fieldName);
	}
	
    }

    formlen=link.parentNode.getElementsByTagName('a').length;
    for (i=0;i<formlen;i++)
    {
	list=link.parentNode.getElementsByTagName('a');
	inp=list[i];
	inp.className="tab";
    }


    link.className="activeTab";
}

