// JavaScript Document

function popUp(URL){
winpops=window.open(URL,"","width=200,height=125,left=100,top=100,status=0,scrollbars=0,resizable=1,menubar=0,location=0,toolbar=0")
}


function popUp2(URL){
winpops=window.open(URL,"","width=200,height =450,left=100,top=100,status=0,scrollbars=0,resizable=1,menubar=0,location=0,toolbar=0")
}


function popUpFavorite(URL){
winpops=window.open(URL,"","width=200,height=100,left=100,top=100,status=0,scrollbars=0,resizable=1,menubar=0,location=0,toolbar=0")
}


function popComments(URL){
winpops=window.open(URL,"","width=440,height=400,left=100,top=100,status=0,scrollbars=1,resizable=1,menubar=0,location=0,toolbar=0")
}


function popRecoverPassword(URL){
winpops=window.open(URL,"","width=440,height=200,left=100,top=100,status=0,scrollbars=0,resizable=1,menubar=0,location=0,toolbar=0")
}

function popReportGame(URL){
winpops=window.open(URL,"","width=630,height=350,left=100,top=100,status=0,scrollbars=0,resizable=1,menubar=0,location=0,toolbar=0")
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


// Nannette Thacker http://www.shiningstar.net
function confirmDeleteMessage()
{
var agree=confirm("Are you sure you wish to delete this message?");
if (agree)
	return true ;
else
	return false ;
}

function mainHeader_Search()
{
        var value = document.getElementById("q").value;
        if(value != "")
        {
                document.getElementById("form_search").submit();
        }
}
function mainHeader_Login()
{
        var value1 = document.getElementById("loginuser").value;
        var value2 = document.getElementById("loginpassword").value;
        if(value2 != "") 
        {
                document.getElementById("form_login").submit();
        }
}
function mainHeader_LoginKeyPress(e)
{
        var keyCode;
        if (window.event) keyCode = window.event.keyCode;
        else if (e) keyCode = e.which;
        switch(keyCode)
        {
                case 13:
                        document.getElementById("loginpassword").blur();
                break;
        }
}

function mainHeader_SearchKeyPress(e)
{
        var keyCode;
        if (window.event) keyCode = window.event.keyCode;
        else if (e) keyCode = e.which;
        switch(keyCode)
        {
                case 13:
                        document.getElementById("q").blur();
                break;
        }
}

/********************** PopUnder **************************/
var Cwidth = 1050;
var Cheight = 770;

var Cleft = (window.screen.width-Cwidth)/2;
var Ctop = (window.screen.height - Cheight)/2;

var winfeatures="scrollbars=0,resizable=0,toolbar=0,location=1,menubar=0,status=0,directories=0,top=" + Ctop + ",left=" + Cleft + ",width=" + Cwidth + ",height=" + Cheight;
var thecookiename="mmotrafficpopunder";

function get_cookie(Name)
{
        var NewName = Name + "=";
        var Cookies = document.cookie.split(';');
        for(var i=0;i < Cookies.length;i++) {
                var TheCookie = Cookies[i];
                while (TheCookie.charAt(0)==' ') TheCookie = TheCookie.substring(1,TheCookie.length);
                if (TheCookie.indexOf(NewName) == 0) return TheCookie.substring(NewName.length,TheCookie.length);
        }
        return false;
}

// function loadornot(baseURL)
function loadornot()
{

        if (!get_cookie(thecookiename))
        {
                // launch ajax request
                // xmlHttp=GetXmlHttpObject();
                // xmlUrl = baseURL + "includes/mmotraffic.php?id=" + popunderurlid;
                // xmlHttp.open("GET", xmlUrl, true);
                // xmlHttp.send(null);

                loadpopunder();
                var d = new Date();
                d.setDate(d.getDate()+1);
                d.toGMTString();
                document.cookie=thecookiename+"=yes; expires=" + d + "; path=/";
        }
}

function loadpopunder()
{
        win2=window.open(popunderurl,"",winfeatures);
        win2.blur();
        window.focus();
}


