function cFocus(theRow, theRowColor, theText, theTextColor){
    if (theRowColor == '' || typeof(theRow.style) == 'undefined') {
        return false;    }
    if (theTextColor == '') {
        theTextColor=theRowColor;    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = theRow.getElementsByTagName('td');    }
    else if (typeof(theRow.cells) != 'undefined') {
        var theCells = theRow.cells;    }    else {
        return false;    }
    var rowCellsCnt  = theCells.length;
    if (theCells.length == 0) {
        theRow.style.backgroundColor = theRowColor;    }
    else {    for (var c = 0; c < rowCellsCnt; c++) {
        theCells[c].style.backgroundColor = theRowColor;
    }
    }
    theText.style.color = theTextColor;
    return true;
}

function iFocus(theRow, theRowImage, theText, theTextColor){
    if (theRowImage == '' || typeof(theRow.style) == 'undefined') {
        return false;    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = theRow.getElementsByTagName('td');    }
    else if (typeof(theRow.cells) != 'undefined') {
        var theCells = theRow.cells;
    }    else {
        return false;
    }
    var rowCellsCnt  = theCells.length;
    if (theCells.length == 0) {
        //theRow.style.backgroundImage = "../../img/bg-row-on-hosting.gif";
    }    else {
    for (var c = 0; c < rowCellsCnt; c++) {
        theCells[c].style.backgroundImage = "../../img/bg-row-on-hosting.gif";
    }
    }
    theText.style.color = theTextColor;
    return true;
}

function sFocus(theRows, theLoop, theClass){
    for (var c = 1; c <= theLoop; c++) {
        var theRow=eval(theRows+c);
		theRow.className = theClass;
    }
    return true;
}

function wPopup(tURL,wNAME,wOPTIONS){
	window.open(tURL,wNAME,wOPTIONS);
}

function check_step(){
	var step=document.subscribe.step.value;
	if(step==2){
		if(document.subscribe.hosting_domain.value==""){
			alert("Kérjük, válassza ki, hogy domain nevet vagy csak azonosítót kíván használni a tárhelyhez.");
		}else if(document.subscribe.hosting_domain.value=="Kérjük, itt megadni..."){
			alert("Kérjük, adja meg a használni kívánt domain nevet vagy azonosítót.");
		}else{
			document.subscribe.submit();
		}
	}else if(step==3){
		var type=document.subscribe.hosting_type;
		if(type[0].checked||type[1].checked||type[2].checked||type[3].checked){
			document.subscribe.submit();
		}else{
			alert("Kérjük, válassza ki a kívánt tárhely csomagot.");
		}
	}else if(step=="final"){
		if(document.subscribe.subscriber_name.value=="Megrendelő neve"){
			alert("Kérjük, adja meg a megrendelő nevét.");
		}else if(document.subscribe.subscriber_email.value=="E-mail címe"){
			alert("Kérjük, adja meg a megrendelő e-mail címét.");
		}else{
			document.subscribe.submit();
		}
	}else{
		document.subscribe.submit();
	}

}

var menuSteps = 15;
var menuStepHeight = 10;
var menuDefault = '';

var menuCounter = 0;
var menuSpeed = 1;
var menuLeft = 0;
var menuOnScreen = false;
var menuTimerID = null;

function findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function toggleMenu()
{
	if (menuOnScreen == false)
		displayMenu();
	else
		hideMenu();
}

function setMenu(item)
{
	var menuContents = findObj("menuContents");

	if (menuOnScreen == true)
	{
		if (item != null)
			menuContents.innerHTML = '';
		else
			menuContents.innerHTML = menuDefault;			
	}
}

function displayMenu()
{
	var menuLayer = findObj("menuLayer");
	if (menuLayer.style) menuLayer = menuLayer.style;
	
	if (document.all && !window.innerHeight) { 
		menuLayer.pixelWidth = document.body.clientWidth - menuLeft;
		menuLayer.pixelHeight = menuStepHeight;
		menuLayer.pixelTop = document.body.clientHeight + document.body.scrollTop - menuStepHeight;
	} else 	{
		menuLayer.width = document.width - menuLeft;
		menuLayer.height = menuStepHeight;
		menuLayer.top = window.innerHeight + window.pageYOffset - menuStepHeight;
	}
	menuLayer.visibility = 'visible';

	menuCounter = 1;
	setTimeout('growMenu()', menuSpeed);
	
	var menuContents = findObj("menuContents");
	menuDefault = menuContents.innerHTML;
}

function growMenu()
{
	menuCounter++;

	var menuLayer = findObj("menuLayer");
	if (menuLayer.style) menuLayer = menuLayer.style;

	if (document.all && !window.innerHeight) {
		menuLayer.pixelHeight = menuCounter * menuStepHeight;
		menuLayer.pixelTop = document.body.clientHeight + document.body.scrollTop - (menuCounter * menuStepHeight);
	} else {
		menuLayer.height = menuCounter * menuStepHeight;
		menuLayer.top = window.innerHeight + window.pageYOffset - (menuCounter * menuStepHeight);
		if (menuTimerID == null) menuTimerID = setInterval('resizeMenu()', 100);
	}
	
	if (menuCounter < menuSteps)
		setTimeout('growMenu()', menuSpeed);
	else
		menuOnScreen = true;
}

function hideMenu()
{
	menuOnScreen = false;
	menuCounter = menuSteps;		
	setTimeout('menuShrink()', menuSpeed);
}

function menuShrink()
{
	var menuLayer = findObj("menuLayer");
	if (menuLayer.style) menuLayer = menuLayer.style;

	menuCounter--;
	
	if (menuCounter >= 0) 
	{
		if (document.all && !window.innerHeight) {
			menuLayer.pixelHeight = menuCounter * menuStepHeight;
			menuLayer.pixelTop = document.body.clientHeight + document.body.scrollTop - (menuCounter * menuStepHeight);
		} else {
			menuLayer.height = menuCounter * menuStepHeight;
			menuLayer.top = window.innerHeight + window.pageYOffset - (menuCounter * menuStepHeight);
		}
		setTimeout('menuShrink()', menuSpeed);
	} 
	else 
	{
		if (document.all && !window.innerHeight) {
			menuLayer.pixelHeight = 1;
			menuLayer.pixelTop = document.body.clientHeight + document.body.scrollTop - 1;
		} else {
			menuLayer.height = 1;
			menuLayer.top = window.innerHeight + window.pageYOffset - 1;
		}
		menuLayer.visibility = 'hidden';
		
		var menuContents = findObj("menuContents");
		menuContents.innerHTML = menuDefault;
	}
}

function resizeMenu()
{	
	if (menuOnScreen == true) 
	{
		var menuLayer = findObj("menuLayer");
		if (menuLayer.style) menuLayer = menuLayer.style;

		if (document.all && !window.innerHeight) {
			menuLayer.pixelHeight = menuSteps * menuStepHeight;
			menuLayer.pixelWidth = document.body.clientWidth - menuLeft;
			menuLayer.pixelTop = document.body.clientHeight + document.body.scrollTop - (menuSteps * menuStepHeight);
		} else {
			menuLayer.height = menuSteps * menuStepHeight;
			menuLayer.width = document.width - menuLeft;
			menuLayer.top = window.innerHeight + window.pageYOffset - (menuSteps * menuStepHeight);
		}
	}
}
