// Metrics tracking for pathing, dwell time and drop off
//failing in IE, we need to pause execution before end
function rules() {
	window.open("index.tbapp?page=rules","rules","menu=no,toolbar=no,width=450,height=400,scrollbars=1,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=88,left=124");
}

// FAQ Pop-Up
function faq(email, session_id) {
  window.open("index.tbapp?page=contact_form","faq","menu=no,toolbar=no,width=450,height=400,scrollbars=1,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=48,left=48");
}

//Forgot password
function forgot(session_id) {
  window.opener.location="index.tbapp?page=forgot_form";
  window.close(); 
}	

// Image Security Information Pop-Up
function img_security() {
	window.open("index.tbapp?page=img_security_info","imgsec","menu=no,toolbar=no,width=450,height=250,scrollbars=0,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=132,left=196");
}

// Digital Millenium Pop-Up
function digital() {
	window.open("index.tbapp?page=digital","digital","menu=no,toolbar=no,width=450,height=400,scrollbars=1,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=88,left=124");
}

// Generic Pop-Up
// ex: <a href="javascript:openThis('http://www.eprize.com');">Click here</a>
function openThis(URL) {
  window.open(URL);
}

// New Window

function openWindow(link) {
  window.open(link, '_blank', 'width=800,height=600,toolbar=yes,status=yes,location=yes,menubar=yes,directories=yes,resizable=yes,scrollbars=yes');
}




// No Cookies Popups

function cookies_faq() {
	window.open("index.tbapp?page=cookies_faq","cookies_faq","menu=no,toolbar=no,width=450,height=400,scrollbars=1,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=88,left=124");
}

function enable_cookies() {
	window.open("index.tbapp?page=enable_cookies","enable_cookies","menu=no,toolbar=no,width=450,height=400,scrollbars=1,resizable=0,directories=no,location=no,screenX=0,screenY=0,top=88,left=124");
}

function trigger_error(message) {
    $('.formtxt_error').each(function() {
            $(this).hover(function(e) {
                $('#hintbox').css({
                    'visibility':'visible',
                    'left':e.clientX + 'px',
                    'top':e.clientY + 'px'
                    });
               
               $('#hintbox').html(message);
            }, function() {
                    $('#hintbox').css({'visibility':'hidden'});
            })
            
    })
}
