$(document).ready(function(){
var php_nev = location.pathname;
php_nev = php_nev.substring(php_nev.lastIndexOf("/")+1);
if(php_nev=="products.php"){
$("#betolto").css("display","block");
$(this).oneTime(1000, function() {
betolt('products_abc_szerint.php', 'prod');});
  }
if(php_nev=="categories.php"){
$("#betolto").css("display","block");
$(this).oneTime(1000, function() {
betolt('categories_abc_szerint.php', 'cat');});
  }  
});

var visszaszamol_mentes = 3;
function sorrend_mentese(){
  $(this).stopTime();
    $(this).oneTime(2000, function() {
      $(this).everyTime(1000, function(i) {
      $("#cursorMessageDiv").css({"borderColor":"#FF0000","backgroundColor":"rgb(255,195,207)","color":"#FF0000"});
      $.cursorMessage('<img src="loading.gif"> The sort will be save in ' + ((visszaszamol_mentes+1)-i) + ' ...');
        if(i>=(visszaszamol_mentes+1)){
        $(this).stopTime();
        var childek = document.getElementById('childeket').childNodes;   
        var darab = childek.length;  
        var sorrend_leker = "";
        var db = 0;
              for(var i=0; i<darab;i++){
               var child = childek.item(i);                 
                if(child.tagName == "tr" || child.tagName == "TR" || child.tagName == "Tr" || child.tagName == "tR") { 
                db++;       
                
                var ertek = child.innerHTML;
                var ert=ertek.substring(ertek.indexOf("</td>")-10,ertek.indexOf("</td>"));    
                ert = ert.substring(ert.lastIndexOf(">")+1);                      
                 sorrend_leker += db+"="+ert+";";
                }
                            
              }                  
                
        $.cursorMessage('<img src="loading.gif"> Saving... ');
        $.get("sorrend_mento.php",{sorrend:sorrend_leker},function(data){        
        var visszateresi = data.substring(data.lastIndexOf(" ")+1);      
        if(visszateresi=="1"){
          $("#cursorMessageDiv").css({"borderColor":"#309000","backgroundColor":"#7FF0A0","color":"#309000"});
          $.cursorMessage('<img src="ok.png"> Sort successfully saved!');
        }
        else
        {
          $("#cursorMessageDiv").css({"borderColor":"#FF0000","backgroundColor":"rgb(255,195,207)","color":"#FF0000"});
          $.cursorMessage('<img src="error.png"> Unable to save, sort please contact ADMINISTRATOR'
          );
        } bindThickBoxEvents();
        });         
        }
      });
   });
}

var visszaszamol_mentesbol = 3;
function sorrend_mentese_cat(){
  $(this).stopTime();
    $(this).oneTime(2000, function() {
      $(this).everyTime(1000, function(i) {
      $("#cursorMessageDiv").css({"borderColor":"#FF0000","backgroundColor":"rgb(255,195,207)","color":"#FF0000"});
      $.cursorMessage('<img src="loading.gif"> The sort will be save in ' + ((visszaszamol_mentesbol+1)-i) + ' ...');
        if(i>=(visszaszamol_mentesbol+1)){
        $(this).stopTime();
        var childek = document.getElementById('childeket').childNodes;   
        var darab = childek.length;
        var sorrend_leker = "";
        var db = 0;
              for(var i=0; i<darab;i++){
               var child = childek.item(i);                 
                if(child.tagName == "tr" || child.tagName == "TR" || child.tagName == "Tr" || child.tagName == "tR") { 
                db++;       
                
                var ertek = child.innerHTML;
                var ert=ertek.substring(ertek.indexOf("</td>")-10,ertek.indexOf("</td>"));    
                ert = ert.substring(ert.lastIndexOf(">")+1);                      
                 sorrend_leker += db+"="+ert+";";
                }
                            
              }                  
                
        $.cursorMessage('<img src="loading.gif"> Saving... ');
        $.get("sorrend_mento_cat.php",{sorrend:sorrend_leker},function(data){
        var visszateresi = data.substring(data.lastIndexOf(" ")+1);
        if(visszateresi=="1"){
          $("#cursorMessageDiv").css({"borderColor":"#309000","backgroundColor":"#7FF0A0","color":"#309000"});
          $.cursorMessage('<img src="ok.png"> Sort successfully saved!');
        }
        else
        {
          $("#cursorMessageDiv").css({"borderColor":"#FF0000","backgroundColor":"rgb(255,195,207)","color":"#FF0000"});
          $.cursorMessage('<img src="error.png"> Unable to save, sort please contact ADMINISTRATOR'
          );
        } bindThickBoxEvents();
        });      
        }
      });
   });
}

function td_ezust(childek){
                var db=0;
                  for(var i=0; i<childek.length;i++){
                    var child = childek.item(i);
                    if(child.tagName == "td" || child.tagName == "TD") {
                      child.setAttribute('style', 'background-color:silver');
                      
                      }              
                  }                  
                }
                
function td_feher(childek){
var db=0;
  for(var i=0; i<childek.length;i++){
    var child = childek.item(i);
    if(child.tagName == "td" || child.tagName == "TD") {
      child.setAttribute('style', 'background-color:white');
      
      }              
  }                  
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}
function sort_ize(form,mit,ide){
$("#betolto").css("display","block");
var form_elemei = form.elements;
var parameterek = "?";
for(var i=0; i<form_elemei.length;i++){
if(form_elemei[i].type=="radio" && form_elemei[i].checked){
parameterek += form_elemei[i].name + "=" + form_elemei[i].value + "&";
}
else if(form_elemei[i].type!="radio")
parameterek += form_elemei[i].name + "=" + form_elemei[i].value + "&";
}
parameterek = parameterek.substring(0,parameterek.lastIndexOf("&"));
$.get(mit + parameterek,{},function(data){$('#' + ide).html(data); $("#betolto").css("display","none"); bindThickBoxEvents(); $("#table-1").tableDnD();});
}
function removeThickBoxEvents() {
        $('.thickbox').each(function(i) {
            $(this).unbind('click');
        });
    }

function bindThickBoxEvents() {
        removeThickBoxEvents();
        tb_init('a.thickbox, area.thickbox, input.thickbox');
    }



function betolt(mit, hova)
{
$("#betolto").css("display","block");
$(this).oneTime(1000, function() {
    $.get(mit,{},function(data){$('#' + hova).html(data);bindThickBoxEvents();$("#betolto").css("display","none"); $("#table-1").tableDnD()}); 
      
  });
}

if(jQuery) {
	( function($) {
	$.cursorMessageData = {}; 

	$(window).ready(function(e) {
		if ($('#cursorMessageDiv').length==0) {
			  $('body').append('<div id="cursorMessageDiv">&nbsp;</div>');	
			  $('#cursorMessageDiv').hide();
		}

		$('body').mousemove(function(e) {
			$.cursorMessageData.mouseX = e.pageX;
			$.cursorMessageData.mouseY = e.pageY;
			if ($.cursorMessageData.options != undefined) $._showCursorMessage();
		});
	});	
	$.extend({
		cursorMessage: function(message, options) {
			if( options == undefined ) options = {};
			if( options.offsetX == undefined ) options.offsetX = 5;
			if( options.offsetY == undefined ) options.offsetY = 5;
			if( options.hideTimeout == undefined ) options.hideTimeout = 3000;
			
			var hideCursorMessage = function() {
				$('#cursorMessageDiv').html(message).fadeOut('slow');
			};
			
			$('#cursorMessageDiv').html(message).fadeIn('slow');
			if (jQuery.cursorMessageData.hideTimoutId != undefined)  clearTimeout(jQuery.cursorMessageData.hideTimoutId);
			jQuery.cursorMessageData.hideTimoutId = setTimeout(hideCursorMessage,options.hideTimeout);
			jQuery.cursorMessageData.options = options;
			$._showCursorMessage();
		},
		
		_showCursorMessage: function() {
			$('#cursorMessageDiv').css({ top: ($.cursorMessageData.mouseY + $.cursorMessageData.options.offsetY)+'px', left: ($.cursorMessageData.mouseX + $.cursorMessageData.options.offsetX) })
		}
	});
})(jQuery);
}


jQuery.tableDnD = {
    /** Keep hold of the current table being dragged */
    currentTable : null,
    /** Keep hold of the current drag object if any */
    dragObject: null,
    /** The current mouse offset */
    mouseOffset: null,
    /** Remember the old value of Y so that we don't do too much processing */
    oldY: 0,

    /** Actually build the structure */
    build: function(options) {
        // Set up the defaults if any

        this.each(function() {
            // This is bound to each matching table, set up the defaults and override with user options
            this.tableDnDConfig = jQuery.extend({
                onDragStyle: null,
                onDropStyle: null,
				// Add in the default class for whileDragging
				onDragClass: "tDnD_whileDrag",
                onDrop: null,
                onDragStart: null,
                scrollAmount: 5,
				serializeRegexp: /[^\-]*$/, // The regular expression to use to trim row IDs
				serializeParamName: null, // If you want to specify another parameter name instead of the table ID
                dragHandle: null // If you give the name of a class here, then only Cells with this class will be draggable
            }, options || {});
            // Now make the rows draggable
            jQuery.tableDnD.makeDraggable(this);
        });

        // Now we need to capture the mouse up and mouse move event
        // We can use bind so that we don't interfere with other event handlers
        jQuery(document)
            .bind('mousemove', jQuery.tableDnD.mousemove)
            .bind('mouseup', jQuery.tableDnD.mouseup);

        // Don't break the chain
        return this;
    },

    /** This function makes all the rows on the table draggable apart from those marked as "NoDrag" */
    makeDraggable: function(table) {
        var config = table.tableDnDConfig;
		if (table.tableDnDConfig.dragHandle) {
			// We only need to add the event to the specified cells
			var cells = jQuery("td."+table.tableDnDConfig.dragHandle, table);
			cells.each(function() {
				// The cell is bound to "this"
                jQuery(this).mousedown(function(ev) {
                    jQuery.tableDnD.dragObject = this.parentNode;
                    jQuery.tableDnD.currentTable = table;
                    jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev);
                    if (config.onDragStart) {
                        // Call the onDrop method if there is one
                        config.onDragStart(table, this);
                    }
                    return false;
                });
			})
		} else {
			// For backwards compatibility, we add the event to the whole row
	        var rows = jQuery("tr", table); // get all the rows as a wrapped set
	        rows.each(function() {
				// Iterate through each row, the row is bound to "this"
				var row = jQuery(this);
				if (! row.hasClass("nodrag")) {
	                row.mousedown(function(ev) {
	                    if (ev.target.tagName == "TD") {
	                        jQuery.tableDnD.dragObject = this;
	                        jQuery.tableDnD.currentTable = table;
	                        jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev);
	                        if (config.onDragStart) {
	                            // Call the onDrop method if there is one
	                            config.onDragStart(table, this);
	                        }
	                        return false;
	                    }
	                }).css("cursor", "move"); // Store the tableDnD object
				}
			});
		}
	},

	updateTables: function() {
		this.each(function() {
			// this is now bound to each matching table
			if (this.tableDnDConfig) {
				jQuery.tableDnD.makeDraggable(this);
			}
		})
	},

    /** Get the mouse coordinates from the event (allowing for browser differences) */
    mouseCoords: function(ev){
        if(ev.pageX || ev.pageY){
            return {x:ev.pageX, y:ev.pageY};
        }
        return {
            x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
            y:ev.clientY + document.body.scrollTop  - document.body.clientTop
        };
    },

    /** Given a target element and a mouse event, get the mouse offset from that element.
        To do this we need the element's position and the mouse position */
    getMouseOffset: function(target, ev) {
        ev = ev || window.event;

        var docPos    = this.getPosition(target);
        var mousePos  = this.mouseCoords(ev);
        return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};
    },

    /** Get the position of an element by going up the DOM tree and adding up all the offsets */
    getPosition: function(e){
        var left = 0;
        var top  = 0;
        /** Safari fix -- thanks to Luis Chato for this! */
        if (e.offsetHeight == 0) {
            /** Safari 2 doesn't correctly grab the offsetTop of a table row
            this is detailed here:
            http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-safari/
            the solution is likewise noted there, grab the offset of a table cell in the row - the firstChild.
            note that firefox will return a text node as a first child, so designing a more thorough
            solution may need to take that into account, for now this seems to work in firefox, safari, ie */
            e = e.firstChild; // a table cell
        }

        while (e.offsetParent){
            left += e.offsetLeft;
            top  += e.offsetTop;
            e     = e.offsetParent;
        }

        left += e.offsetLeft;
        top  += e.offsetTop;

        return {x:left, y:top};
    },

    mousemove: function(ev) {
        if (jQuery.tableDnD.dragObject == null) {
            return;
        }

        var dragObj = jQuery(jQuery.tableDnD.dragObject);
        var config = jQuery.tableDnD.currentTable.tableDnDConfig;
        var mousePos = jQuery.tableDnD.mouseCoords(ev);
        var y = mousePos.y - jQuery.tableDnD.mouseOffset.y;
        //auto scroll the window
	    var yOffset = window.pageYOffset;
	 	if (document.all) {
	        // Windows version
	        //yOffset=document.body.scrollTop;
	        if (typeof document.compatMode != 'undefined' &&
	             document.compatMode != 'BackCompat') {
	           yOffset = document.documentElement.scrollTop;
	        }
	        else if (typeof document.body != 'undefined') {
	           yOffset=document.body.scrollTop;
	        }

	    }
		    
		if (mousePos.y-yOffset < config.scrollAmount) {
	    	window.scrollBy(0, -config.scrollAmount);
	    } else {
            var windowHeight = window.innerHeight ? window.innerHeight
                    : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
            if (windowHeight-(mousePos.y-yOffset) < config.scrollAmount) {
                window.scrollBy(0, config.scrollAmount);
            }
        }


        if (y != jQuery.tableDnD.oldY) {
            // work out if we're going up or down...
            var movingDown = y > jQuery.tableDnD.oldY;
            // update the old value
            jQuery.tableDnD.oldY = y;
            // update the style to show we're dragging
			if (config.onDragClass) {
				dragObj.addClass(config.onDragClass);
			} else {
	            dragObj.css(config.onDragStyle);
			}
            // If we're over a row then move the dragged row to there so that the user sees the
            // effect dynamically
            var currentRow = jQuery.tableDnD.findDropTargetRow(dragObj, y);
            if (currentRow) {
                // TODO worry about what happens when there are multiple TBODIES
                if (movingDown && jQuery.tableDnD.dragObject != currentRow) {
                    jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow.nextSibling);
                } else if (! movingDown && jQuery.tableDnD.dragObject != currentRow) {
                    jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow);
                }
            }
        }

        return false;
    },

    /** We're only worried about the y position really, because we can only move rows up and down */
    findDropTargetRow: function(draggedRow, y) {
        var rows = jQuery.tableDnD.currentTable.rows;
        for (var i=0; i<rows.length; i++) {
            var row = rows[i];
            var rowY    = this.getPosition(row).y;
            var rowHeight = parseInt(row.offsetHeight)/2;
            if (row.offsetHeight == 0) {
                rowY = this.getPosition(row.firstChild).y;
                rowHeight = parseInt(row.firstChild.offsetHeight)/2;
            }
            // Because we always have to insert before, we need to offset the height a bit
            if ((y > rowY - rowHeight) && (y < (rowY + rowHeight))) {
                // that's the row we're over
				// If it's the same as the current row, ignore it
				if (row == draggedRow) {return null;}
                var config = jQuery.tableDnD.currentTable.tableDnDConfig;
                if (config.onAllowDrop) {
                    if (config.onAllowDrop(draggedRow, row)) {
                        return row;
                    } else {
                        return null;
                    }
                } else {
					// If a row has nodrop class, then don't allow dropping (inspired by John Tarr and Famic)
                    var nodrop = jQuery(row).hasClass("nodrop");
                    if (! nodrop) {
                        return row;
                    } else {
                        return null;
                    }
                }
                return row;
            }
        }
        return null;
    },

    mouseup: function(e) {
        if (jQuery.tableDnD.currentTable && jQuery.tableDnD.dragObject) {
            var droppedRow = jQuery.tableDnD.dragObject;
            var config = jQuery.tableDnD.currentTable.tableDnDConfig;
            // If we have a dragObject, then we need to release it,
            // The row will already have been moved to the right place so we just reset stuff
			if (config.onDragClass) {
	            jQuery(droppedRow).removeClass(config.onDragClass);
			} else {
	            jQuery(droppedRow).css(config.onDropStyle);
			}
            jQuery.tableDnD.dragObject   = null;
            if (config.onDrop) {
                // Call the onDrop method if there is one
                config.onDrop(jQuery.tableDnD.currentTable, droppedRow);
            }
            jQuery.tableDnD.currentTable = null; // let go of the table too
        }
    },

    serialize: function() {
        if (jQuery.tableDnD.currentTable) {
            return jQuery.tableDnD.serializeTable(jQuery.tableDnD.currentTable);
        } else {
            return "Error: No Table id set, you need to set an id on your table and every row";
        }
    },

	serializeTable: function(table) {
        var result = "";
        var tableId = table.id;
        var rows = table.rows;
        for (var i=0; i<rows.length; i++) {
            if (result.length > 0) result += "&";
            var rowId = rows[i].id;
            if (rowId && rowId && table.tableDnDConfig && table.tableDnDConfig.serializeRegexp) {
                rowId = rowId.match(table.tableDnDConfig.serializeRegexp)[0];
            }

            result += tableId + '[]=' + rowId;
        }
        return result;
	},

	serializeTables: function() {
        var result = "";
        this.each(function() {
			// this is now bound to each matching table
			result += jQuery.tableDnD.serializeTable(this);
		});
        return result;
    }

}

jQuery.fn.extend(
	{
		tableDnD : jQuery.tableDnD.build,
		tableDnDUpdate : jQuery.tableDnD.updateTables,
		tableDnDSerialize: jQuery.tableDnD.serializeTables
	}
);

jQuery.fn.extend({
	everyTime: function(interval, label, fn, times, belay) {
		return this.each(function() {
			jQuery.timer.add(this, interval, label, fn, times, belay);
		});
	},
	oneTime: function(interval, label, fn) {
		return this.each(function() {
			jQuery.timer.add(this, interval, label, fn, 1);
		});
	},
	stopTime: function(label, fn) {
		return this.each(function() {
			jQuery.timer.remove(this, label, fn);
		});
	}
});

jQuery.event.special

jQuery.extend({
	timer: {
		global: [],
		guid: 1,
		dataKey: "jQuery.timer",
		regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
		powers: {
			// Yeah this is major overkill...
			'ms': 1,
			'cs': 10,
			'ds': 100,
			's': 1000,
			'das': 10000,
			'hs': 100000,
			'ks': 1000000
		},
		timeParse: function(value) {
			if (value == undefined || value == null)
				return null;
			var result = this.regex.exec(jQuery.trim(value.toString()));
			if (result[2]) {
				var num = parseFloat(result[1]);
				var mult = this.powers[result[2]] || 1;
				return num * mult;
			} else {
				return value;
			}
		},
		add: function(element, interval, label, fn, times, belay) {
			var counter = 0;
			
			if (jQuery.isFunction(label)) {
				if (!times) 
					times = fn;
				fn = label;
				label = interval;
			}
			
			interval = jQuery.timer.timeParse(interval);

			if (typeof interval != 'number' || isNaN(interval) || interval <= 0)
				return;

			if (times && times.constructor != Number) {
				belay = !!times;
				times = 0;
			}
			
			times = times || 0;
			belay = belay || false;
			
			var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {});
			
			if (!timers[label])
				timers[label] = {};
			
			fn.timerID = fn.timerID || this.guid++;
			
			var handler = function() {
				if (belay && this.inProgress) 
					return;
				this.inProgress = true;
				if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
					jQuery.timer.remove(element, label, fn);
				this.inProgress = false;
			};
			
			handler.timerID = fn.timerID;
			
			if (!timers[label][fn.timerID])
				timers[label][fn.timerID] = window.setInterval(handler,interval);
			
			this.global.push( element );
			
		},
		remove: function(element, label, fn) {
			var timers = jQuery.data(element, this.dataKey), ret;
			
			if ( timers ) {
				
				if (!label) {
					for ( label in timers )
						this.remove(element, label, fn);
				} else if ( timers[label] ) {
					if ( fn ) {
						if ( fn.timerID ) {
							window.clearInterval(timers[label][fn.timerID]);
							delete timers[label][fn.timerID];
						}
					} else {
						for ( var fn in timers[label] ) {
							window.clearInterval(timers[label][fn]);
							delete timers[label][fn];
						}
					}
					
					for ( ret in timers[label] ) break;
					if ( !ret ) {
						ret = null;
						delete timers[label];
					}
				}
				
				for ( ret in timers ) break;
				if ( !ret ) 
					jQuery.removeData(element, this.dataKey);
			}
		}
	}
});

jQuery(window).bind("unload", function() {
	jQuery.each(jQuery.timer.global, function(index, item) {
		jQuery.timer.remove(item);
	});
});

function piros_zold_gombot_ment(atallitani,products_id){
$("#betolto").css("display","block");
if(location.search.length>0)
elvalaszto = "&";
else
elvalaszto = "?";
var mezot = atallitani.substring(0,atallitani.lastIndexOf("="));
var ide_kuldi = "piros_zold_gomb_atvalt.php" + location.search + elvalaszto + atallitani + "&mezo_neve="+mezot + "&products_id="+products_id;
$.get(ide_kuldi,{},function(data){
$("#"+mezot+"_"+products_id).html(data);
$("#betolto").css("display","none"); 
})
}

function nev_szerkeszt(Id,mit){
$(this).oneTime(1000, function() {
$.get(mit,{id:Id},function(data){
$("#" + Id).html("<input type=\"text\" id=\"nev_szerkeszt_" + Id + "\" value=\"" + data + "\"> <a href=\"javascript:void(0)\" onClick=\"nev_ment('"+Id+"','products_abc_szerint.php?nev_ment')\">S</a> | <a href=\"javascript:void(0)\" onClick=\"nev_ment('"+Id+"','products_abc_szerint.php?gyors_szerkeszt')\">C</a>");
});});}

function nev_ment(Id,mit){
$.get(mit,{id:Id,szoveg:$("#nev_szerkeszt_" + Id).attr("value")},function(data){
$("#" + Id).html("<a ondblclick=\"window.location='products_edit.php?products_id=" + Id + "'\" onclick=\"nev_szerkeszt('" + Id + "','products_abc_szerint.php?gyors_szerkeszt')\" style=\"text-decoration:none;cursor: pointer;\">" + data + "</a>")});
}
function thickbox_megnyit(cime,tartalom,szeles,magas) {
return tb_show(cime,tartalom + 'keepThis=true&TB_iframe=true&height=' + magas + '&width=' + szeles);
}

function delete_product(id){
$.get("ajax.php",{torol:id},function(data){
if(data=="1"){
$("#betolto").css("display","block");
betolt('products_abc_szerint.php', 'prod');
alert("Successfully deleted!");
}
else{
alert("Unable to delete! Error: " + data);
}
});
}

function email_ellenorzes(cim)
{
	ellenoriz = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$/;
	return cim.search(ellenoriz) == 0;
}
function letolt(nev_id,email_id,_form){
    var db=0;
    var hiba = "Download failed!\n\nReason(s):";
    var nev = document.getElementById(nev_id).value;
    var email = document.getElementById(email_id).value;
    
    if(nev.length==0 || nev=="Your Name"){
        db++;
        hiba+="\n - Inputfield Name is blank!";
    }
    else if(nev.length<5){
        db++;
        hiba+="\n - Name is too short!";
    }
    if(email.length==0 || email=="Your Email Address"){
        db++;
        hiba+="\n - Inputfield E-mail is blank!";    
    }
    else if(!email_ellenorzes(email)){
        db++;
        hiba+="\n - The E-mail address is not valid!";
    }
    if(db>0){
        alert(hiba);
    }
    else 
        _form.submit();
    
}
