function sendEmailPopup(baseUrl) {
    var currentUrl = window.location.href;
    var sendInEmailUrl = baseUrl+'&tosendurl='+escape(currentUrl);
    return mvhPopup(sendInEmailUrl,'Email_kuldes',385,220);
}

function mvhPopup(url,name,width,height) {
	//var params = '\'height='+height+',width='+width+'\'';	
	var winLeft = (screen.width-width)/2;
	var winTop = (screen.height-(height+110))/2; 
	var params = 'height='+height+',width='+width+',left='+winLeft+',top='+winTop+',location=0,toolbar=0,menubar=0';
	//newwindow=window.open(url,name,'"height='+height+',width='+width+'"');
	newwindow=window.open(url,name,params);
	if (window.focus) {newwindow.focus()}
	return false;
}

function closePopupAndRefreshParent() {
	//window.opener.location.href = window.opener.location.href;	
	window.close();
	window.opener.reload(true);
	return false;
}

function getElementsByClassName(oElm, strTagName, strClassName){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	strClassName = strClassName.replace(/\-/g, "\\-");
	var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
	var oElement;
	for(var i=0; i<arrElements.length; i++){
		oElement = arrElements[i];
		if(oRegExp.test(oElement.className)){
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements)
}

function validateReqs() {    
    reqs = getElementsByClassName(document,"*","req");
    
    var kitoltetlen = new Array();
    
    for(var i=0;i<reqs.length;i++) {
        if(reqs[i].value.length==0) kitoltetlen.push(reqs[i]);
    }    
    if( kitoltetlen.length > 0 ) {
        for(var i=0;i<kitoltetlen.length;i++) kitoltetlen[i].style.backgroundColor="#FFAF7A";
        alert("Kérem töltsön ki minden kötelező mezőt");
    }
    return ( kitoltetlen.length == 0 );
}

