

var ws_pwsent='A megadott e-mail címre elküldtem az e-mail címhez tartozó jelszót';
var ws_logi1='Bejelentkezés';
var ws_logi2='E-mail';
var ws_logi3='Jelszó';
var ws_logi4='BEJELENTKEZÉS';
var ws_logi5='Elfelejtett jelszó';
var ws_logi6='Jelszó küldése e-mailben';
var vnobotform_chk='Adatok ellenőrzése';
var vnobotform_m1='Az oldal töltődik';
var vnobotform_m2='Az ellezőrzés nem talált hibát. Kérem várjon, míg az oldal betöltődik';
var vnobotform_m3='&lt;&lt;&lt; vissza a javításhoz';
var ws_regsuccess='------------------------------------------------------------\n\nGRATULÁLOK, ÖN SIKERESEN REGISZTRÁLT!\n\n------------------------------------------------------------\n\nNevét, e-mail címét elmentettem,\nfolytatás a napokban a megadott e-mail címen.\n\n';
var ws_regpromo='\n\n*** Várjon egy kicsit! ***\n\nVajon Ön is kiszolgáltatottan vár a méregdrága marketingesekre,\nhogy végre megtudja: miért nem ad el a honlapja?\n\nEz az ingyenes teszt 10 perc alatt annyi ötletet ad,\namiért a guruk egy vagyont kérnek.\n\nKattinson az OK gombra >>>\n\n\n';

      
    /*
 * jQuery Extension
 * http://www.honlapteszt.hu/
 *
 * Copyright (c) 2009 Verdes János
 *
 */
/** 
 *  Function populateElement
 */
function populateElement(selector, defvalue) {
    jQuery(selector).each(function() {
        if(jQuery.trim(this.value) == "") {
            this.value = defvalue;
        }
    });
    jQuery(selector).focus(function() {
        if(this.value == defvalue) {
            this.value = "";
        }
    });
    jQuery(selector).blur(function() {
        if(jQuery.trim(this.value) == "") {
            this.value = defvalue;
        }
    });
}
/*
 * Document.Ready | Form CAPTCHA
 */
var vnobotform_load=false
var vnobotformpass=''
function formcaptcha() {                               
    jQuery("form.nobot").submit(function() {                   
            mi2=new Array("ad","ch","ec")
            var mi=88;var dc="hlia";var mas="";mas=parseInt(dc+mi+dc);mas+="";mas=mas.substr(1,1);
            mas=String.fromCharCode(mas.charCodeAt(0)+10)        
            faction=self.location.href
            faction=faction.split('#')
            faction=faction[0]            
            if (faction.charAt(faction.length-1)!='/') {
                faction+='/'
            }
            if (typeof(jQuery(this).attr('antiboturl'))!='undefined') {
                faction=jQuery(this).attr('antiboturl')+'/'
            } 
            faction+='chec'+mas            
            if (vnobotformpass==jQuery(this).attr("id")) {
                jQuery("#jquery-overdiv-nobotform-load p.fc").html(vnobotform_m1)
                jQuery("#jquery-overdiv-nobotform-load div.lbr").hide()
                jQuery("#jquery-overdiv-nobotform-load p.res").html(vnobotform_m2)
                jQuery(this).attr("action",faction.replace(/\/check$/,"/apply"))
                return true
            } else {
                jQuery("#jquery-overdiv-nobotform-load p.res").html('')
                jQuery("#jquery-overdiv-nobotform-load p.res2").html('')
                jQuery("#jquery-overdiv-nobotform-load div.lbr").show()
                nobotform_on()                
                jQuery.post(faction,jQuery(this).serialize(),function(data) {                    
                    data=data.split('[rn]');
                    if (data[0]=='[0]') {
                        jQuery("#jquery-overdiv-nobotform-load div.lbr").hide()
                        jQuery("#jquery-overdiv-nobotform-load").css("height","280px")
                        jQuery("#jquery-overdiv-nobotform-load p.res").html(data[1])
                        jQuery("#jquery-overdiv-nobotform-load p.res2").html('<button onclick="nobotform_off()">'+vnobotform_m3+'</button>')
                    } else {
                        vnobotformpass=data[0]
                        jQuery("form#"+vnobotformpass).submit()
                    }                    
                }) 
                return false;
            }            
    })
}
jQuery(document).ready(function() {
    formcaptcha()
})
function nobotform_on() {
    if (vnobotform_load) {
        var arrPageSizes = ___getPageSize();        
        var arrPageScroll = ___getPageScroll();
        jQuery('#jquery-overdiv-nobotform').show().fadeTo("fast",0.33);        
        jQuery('#jquery-overdiv-nobotform-load').css({
                    top:	            arrPageScroll[1]+75,
        		    left:	            Math.round((arrPageSizes[2]-450)/2)
    			}).show();
    } else {
        vnobotform_load=true
        var arrPageSizes = ___getPageSize();        
        var arrPageScroll = ___getPageScroll(); 
        jQuery('body').append('<div id="jquery-overdiv-nobotform"></div><div id="jquery-overdiv-nobotform-load"><p class="fc">'+vnobotform_chk+'...</p><div class="lbr"><img src="/images/core/loading-bar.gif?'+Math.round(Math.random() * 999999999)+'" /></div><p class="res">&nbsp;</p><p class="res2"></p></div>');        
        jQuery('#jquery-overdiv-nobotform').css({
                    position:           'absolute',
                    top:                '0px',
                    left:               '0px',
                    zIndex:             '9988',
    				backgroundColor:	'#FFF',
    				opacity:			0,
    				width:				arrPageSizes[0],
    				height:				arrPageSizes[1]
    			}).fadeTo("fast",0.33);
    	jQuery('#jquery-overdiv-nobotform-load').css({
                    position:           'absolute',
                    top:	            arrPageScroll[1]+75,
        		    left:	            Math.round((arrPageSizes[2]-450)/2),
                    zIndex:             '9999',
                    width:              '450px',
                    height:             '150px'
    			}).show();
    }    
}
function nobotform_off() {
    jQuery('#jquery-overdiv-nobotform').fadeTo("fast",0).hide();
    jQuery('#jquery-overdiv-nobotform-load').hide();
}
/** 
 *  Function tr_pointer
 */ 
function tr_pointer() {
    jQuery("tr[id=pointer]").hover(function() {
        jQuery(this).find('td').css("backgroundColor","#FFFFCC")
    },function() {
        jQuery(this).find('td').css("backgroundColor","#FFFFFF")
    })
}
/**
 * getPageSize() by quirksmode.com
 *
 * @return Array Return an array with page width, height and window width, height
 */
function ___getPageSize() {
			var xScroll, yScroll;
			if (window.innerHeight && window.scrollMaxY) {	
				xScroll = window.innerWidth + window.scrollMaxX;
				yScroll = window.innerHeight + window.scrollMaxY;
			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
				xScroll = document.body.scrollWidth;
				yScroll = document.body.scrollHeight;
			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
				xScroll = document.body.offsetWidth;
				yScroll = document.body.offsetHeight;
			}
			var windowWidth, windowHeight;
			if (self.innerHeight) {	// all except Explorer
				if(document.documentElement.clientWidth){
					windowWidth = document.documentElement.clientWidth; 
				} else {
					windowWidth = self.innerWidth;
				}
				windowHeight = self.innerHeight;
			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
				windowWidth = document.documentElement.clientWidth;
				windowHeight = document.documentElement.clientHeight;
			} else if (document.body) { // other Explorers
				windowWidth = document.body.clientWidth;
				windowHeight = document.body.clientHeight;
			}	
			// for small pages with total height less then height of the viewport
			if(yScroll < windowHeight){
				pageHeight = windowHeight;
			} else { 
				pageHeight = yScroll;
			}
			// for small pages with total width less then width of the viewport
			if(xScroll < windowWidth){	
				pageWidth = xScroll;		
			} else {
				pageWidth = windowWidth;
			}
			arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
			return arrayPageSize;
};
/**
 * getPageScroll() by quirksmode.com
 *
 * @return Array Return an array with x,y page scroll values.
 */
function ___getPageScroll() {
			var xScroll, yScroll;
			if (self.pageYOffset) {
				yScroll = self.pageYOffset;
				xScroll = self.pageXOffset;
			} else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
				yScroll = document.documentElement.scrollTop;
				xScroll = document.documentElement.scrollLeft;
			} else if (document.body) {// all other Explorers
				yScroll = document.body.scrollTop;
				xScroll = document.body.scrollLeft;	
			}
			arrayPageScroll = new Array(xScroll,yScroll);
			return arrayPageScroll;
};
/**
 * getPosition() by quirksmode.com
 *
 * @return Array Return an array with x,y cursor coords values.
 */		
function ___getPosition(e) {
    e = e || window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    } 
    else {
        var de = document.documentElement;
        var b = document.body;
        cursor.x = e.clientX + 
            (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY + 
            (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
    return cursor;
}
/**
 * addOverlay() function
 */
var addOverlay_bool=false
function addOverlay() {
    if (addOverlay_bool) {
        jQuery('#jquery-overdiv').hide().fadeIn();
    } else {
        addOverlay_bool=true
        jQuery('body').append('<div id="jquery-overdiv"></div>');
        var arrPageSizes = ___getPageSize();
        jQuery('#jquery-overdiv').css({
                    position:           'absolute',
                    top:                '0px',
                    left:               '0px',
                    zIndex:             '90',
                    width:              '100%',
                    height:             '500px',
    				backgroundColor:	'#000',
    				opacity:			0.8,
    				width:				arrPageSizes[0],
    				height:				arrPageSizes[1]
    			}).hide().fadeIn();
    }
}
function closeOverlay() {
    jQuery('#jquery-overdiv').fadeOut();
}
/**
 * POPunder message div
 */		
function addMessage(text,xwidth,xheight) {
    text='<div style="width:'+xwidth+'px;height:'+xheight+'px;padding:6px 20px 20px 20px">'+text+'</div>'
    if (!addOverlay_bool) {
        jQuery('body').append('<div id="jquery-overdiv-msg"></div>');        
        jQuery('#jquery-overdiv-msg').css({
                    position:           'absolute',
                    top:                '-1000px',
                    left:               '-1000px',
                    zIndex:             '120',
                    width:              xwidth+'px',
                    height:             xheight+'px',
                    border:             '2px solid #CCC',
    				backgroundColor:	'#FFF'
    			}).html('<div onclick="removeMessage()" class="ws_removemessage"></div>'+text).hide();
    } else {
        jQuery('#jquery-overdiv-msg').html('<div onclick="removeMessage()" class="ws_removemessage"></div>'+text)
    }
    addOverlay()
    var arrPageSizes = ___getPageSize();
    var arrPageScroll = ___getPageScroll(); 
    jQuery('#jquery-overdiv-msg').css({
            top:	arrPageScroll[1]+Math.round((arrPageSizes[3]-xheight)/2),
    		left:	Math.round((arrPageSizes[2]-xwidth)/2)
        }).hide().show("slow");    
}
function removeMessage() {
    jQuery('#jquery-overdiv-msg').hide("slow");
    closeOverlay()
}
function mw(cimzett,hoszt) {
var t1='a';
var t2='hr';
var t3='ef';
var t4='ma';
var t5='ilto';
var i=Math.round(193/3);
var s=String
var v1=eval('s.fromCh'+t1+'rCode(i)')
document.write('<'+t1+' '+t2 +t3+'="'+t4+t5+':'+cimzett+v1+hoszt +'">'+cimzett+v1+hoszt+'<'+'/' +t1+'>')
}
/**
 * login
 */
function login() {    
    addMessage('<form id="doform_login" action="http://nobot/" class="nobot" method="post" antiboturl="/login">'
    +'<input type="hidden" name="doformid" value="doform_login" />'
    +'<input type="hidden" name="referer" value="'+self.location.href+'" />'
    +'<b style="font-size:22px">'+ws_logi1+'</b><br /><br /><table class="p10" width="100%"><tr>'
    +'<td width="120">'+ws_logi2+':</td><td><input name="seows_email" style="width:200px" /></td></tr><tr>'
    +'<td>'+ws_logi3+'</td><td><input type="password" name="seows_password" style="width:200px" /></td></tr><tr><td>&nbsp;</td>'
    +'<td><input type="submit" value="'+ws_logi4+'..." class="loginbutton" /></td></tr></table></form>'
    +'<p>&nbsp;</p><form id="doform2_login" class="nobot" action="http://nobot/" method="post" antiboturl="/my-account/lost-password"><b style="font-size:22px">'+ws_logi5+'</b><br /><br /><table class="p10" width="100%"><tr><td width="120">'+ws_logi2+':</td><td><input name="email" style="width:200px" /></td></tr><tr><td>&nbsp;</td><td><input type="submit" value="'+ws_logi6+'..." class="loginbutton" /></td></tr></table><input type="hidden" name="doformid" value="doform2_login" /></form></td><td>'
    ,493,370)
    formcaptcha()
}
jQuery(function() {
    if (self.location.hash.indexOf("password-email-sent")!=-1) {
            alert(ws_pwsent)
    }
})
function apply_news() {
    $(".hirlink").click(function() {
        window.open($(this).attr("title"))
    })
}
/**
 * thumbsup
 */
jQuery(document).ready(function() {
    jQuery("p.thumbsup span.a").click(function() {
        jQuery.post("/ajax.php",{thumbsup: top.location.href},function(data) {
            if(data!='') {
                jQuery("p.thumbsup span.b").html(data)
            }
        })
    })
}) 
/**
 * unloadalert
 */
function set_unload_promo() {
    function unload_promo() {
        if (vnobotformpass=='' && self.location.hash.indexOf("sent")==-1) {
            top.location.href='/'
            return '\n\n--------------------------\n'+
                   'Várjon egy kicsit!\n'+
                   '--------------------------\n\n'+
                   'Vajon Ön is kiszolgáltatottan vár a méregdrága marketingesekre,\n'+
                   'hogy végre megtudja: miért nem ad el a honlapja?\n\n'+
                   'Ez az ingyenes teszt 10 perc alatt annyi ötletet ad,\n'+
                   'amiért a guruk egy vagyont kérnek.\n\n'+
                   'Kattinson a MÉGSE gombra, ha ki akarja tölteni a tesztet >>>\n\n\n';
        } else {
            return;
        }
    }
    window.onbeforeunload=unload_promo
}

/**
 * loadvideo
 */
function loadvideo(src) {
    $(function() {
        	flowplayer(
        		"videoplayer", 
        		"http://www.honlapteszt.hu/videos/flowplayer.swf", {		
            	clip: {  
            	    url: 'http://www.honlapteszt.hu/videos/'+src+'.flv',
            		autoPlay: false, 
            		autoBuffering: true,
            		onFinish: function(){this.getPlugin("play").css({opacity:0})}
            	},
                canvas: {backgroundColor: "transparent"}, 
                plugins: {
        		  controls: {
        			url: '/videos/flowplayer.controls.swf',
        			backgroundGradient: 'none',
        			backgroundColor: 'transparent',
        			all:false,
        			volume: true,
        			play: true,
        			scrubber:true
        		}
        	   }
            }
        	);
    })
}

var _openeddiv=0
var _opentimer=false
function dd_i(id) {
    if (_opentimer!=false) {
        clearTimeout(_opentimer)
    }
    if (_openeddiv!=0) {
        document.getElementById("dd_"+_openeddiv).style.display='none'
    }
    _openeddiv=id
    document.getElementById("dd_"+_openeddiv).style.display='block'
}
function dd_o() {    
    _opentimer=setTimeout('dd_o2()',200)
}
function dd_o2() {    
    document.getElementById("dd_"+_openeddiv).style.display='none'
    _openeddiv=0
}
