﻿ //=============== popup slide =====================================
var onmouseOverpopup=0;
var popup_height = 0;
var step = 4;
var time = 30;
var frmshow="divpopup";
var htmldiv = "<div style='width:296px;right:0px;border:1px solid #999;background-color:#fff;vertical-align:bottom;padding:2px;' onmouseover='setmouseover()' onmouseout='setmouseout()'><div style='background-color:#F0F1F2;height:95px;'><div style='text-align:center;font-weight:bold;padding:10px 0px 3px 0px;'>Ginger<span class='asia'>Chat</span> Alert!</div><div style='text-align:center;vertical-align:top;padding-bottom:5px;'>|data|</div></div></div>";

function showMSNPopup(visible){
    var objPopup = document.getElementById(frmshow);
    if (objPopup) {
        var height = parseInt(objPopup.style.height);
        if(visible){
            objPopup.style.display = "";
            setTimeout("slide(true)", time);
        }else{
            if(onmouseOverpopup==0){
                setTimeout("slide(false)", time);
            }else{
                setTimeout("showMSNPopup(false)",4000);
            }
        }
    }
}

function slide(isUp){
    var mystep = (!isUp)? -step: step;
    var objPopup = document.getElementById(frmshow);
    //alert(objPopup.style.bottom);
    if(isUp && parseInt(objPopup.style.bottom) >= 0) {
        objPopup.style.bottom = "15px";
        return;
    }else if(!isUp && parseInt(objPopup.style.bottom) <= -parseInt(objPopup.style.height)){
        objPopup.style.display = "none";
        objPopup.style.bottom = "-"+objPopup.style.height;
        return;
    }
    objPopup.style.bottom = (parseInt(objPopup.style.bottom) + mystep)+"px";
    setTimeout("slide("+isUp+")", time);
}

function showballon(n,t){
    frmshow="divpopup";
    var countnewmsn=n;
    var boxsetheight=(85*countnewmsn)+5;
    var objPopup = document.getElementById(frmshow);
    //setdiv()
    objPopup.style.height=boxsetheight+"px";
    objPopup.style.bottom="-"+(boxsetheight)+"px";
    //objPopup.style.bottom = "20px";
    objPopup.innerHTML=t;
    showMSNPopup(true);
    setTimeout("showMSNPopup(false)",20000);
    return false;
}

var stlogin=1;
var mNewOn ="";
var nowmsg =0;
var touser=0;
var timerefreshmsg=1;   // fix delay First evnt refreshmsg in msgbox //*1
var setIntervalId = 0;

function newcontact(){
    
}

function openpopup(x){
    win = window.open("MemberChat/GingerChat.aspx?touser="+x+"",'ginger_chat','height=630,width=570,left='+(screen.width-570)/2+',top='+(screen.height-630)/2+',resizable=yes,scrollbars=no,toolbar=no,status=no'); 
    win.focus();
}

function setmouseover(){
    onmouseOverpopup=1;
}

function setmouseout(){
    onmouseOverpopup=0;
}

function startTimerslide()
{
    setIntervalId =setInterval("newcontact()",30000);
} 

//============= end popup slide ===========================
// getsizePage
/*
var w = 0;
var h = 0;
function getsize(){
    //IE
    if(!window.innerWidth)
    {
	    //strict mode
	    if(!(document.documentElement.clientWidth == 0))
	    {
		    w = document.documentElement.clientWidth;
		    h = document.documentElement.clientHeight;
	    }
	    //quirks mode
	    else
	    {
		    w = document.body.clientWidth;
		    h = document.body.clientHeight;
	    }
    }
    //w3c
    else
    {
	    w = window.innerWidth;
	    h = window.innerHeight;
    }
}
	
function setdiv(){
    getsize();
	var divx=document.getElementById(frmshow);
	if(!window.innerWidth){
	    divx.style.left=w-305+"px";
	}else{
	    divx.style.left=w-323+"px";
	}
}*/