﻿function doPassVar(VarName, VarValue) {
   document.getElementById("Banner").SetVariable(VarName, VarValue);
}
function doPassVar2(VarName, VarValue) {
   document.getElementById("Banner").SetVariable(VarName, VarValue);

}
function doPassVar3(VarName, VarValue) {
    //alert(VarName);
    document.getElementById("Chat_Base").SetVariable(VarName, VarValue);
}
function doPassVar4(VarName, VarValue) {
    document.getElementById("Adsi").SetVariable(VarName, VarValue);
}

function ShowWaiting() {
    //alert(window.scrollTop);
    //alert(document.body.scrollTop);
    document.getElementById("WaitDiv").style.top = document.body.scrollTop;
    document.getElementById("WaitDiv").style.visibility = "visible";
}

function HideWaiting() {
    document.getElementById("WaitDiv").style.visibility = "hidden";
}

function AddSmily(argval) {
    var tmparr = argval.split(",");
    ImgStr = "<img src='" + "http://www.farsnameh.com/Assets/Images/Emotion1/" + tmparr[0] + "' width='" + tmparr[1] + "' height='" + tmparr[2] + "'>";
    //style='margin: 5px;float:" + document.getElementById("FloatHF").value + ";'>";
    //alert(ImgStr);
    AddImage(ImgStr);
    HideSmilyWin();
}


//----------------------------------------------------------------------------
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
function Banner_DoFSCommand(command, args) {
    var BannerObj = InternetExplorer ? Banner : document.Banner;
    if (command == "TestAlert") { alert(args); }
    if (command == "TellAlert1") { alert(". ابتدا به چت وارد شوید تا حساب کاربری شما مشخص شود"); }
    //if (command == "OpenMyPage") { MyPageWin = window.open("MYCP.aspx", "MyPage", 'channelmode=yes,directories=yes,fullscreen=no,location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=yes,width=' + window.screen.availWidth + ',height=' + window.screen.availHeight + ',left=200,top=30', true); }
    if (command == "OpenMyPage") { MyPageWin = window.open("MYCP.aspx", "MyPage", '', true);MyPageWin.focus(); }
    if (command == "Back2Opener") {window.opener.focus();window.blur();}
   

}
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
    document.write('<SCRIPT LANGUAGE=VBScript\> \n');
    document.write('On Error Resume Next \n');
    document.write('Sub Banner_FSCommand(ByVal command, ByVal args)\n');
    document.write(' call Banner_DoFSCommand(command, args)\n');
    document.write('end sub\n');
    document.write('</SCRIPT\> \n');
}
//----------------------------------------------------------------------------------------
function Chat_Base_DoFSCommand(command, args) {
    var Chat_BaseObj = InternetExplorer ? Chat_Base : document.Chat_Base;
    if (command == "TestAlert") { alert(args); }
    if(command=="OpenChatBase"){OpenChatBase(args);}
    if (command == "OpenInlineDiv") {
        switch (parseInt(args)) {
            case 1:
                CallServer4CheckFRequests(1);
                break;
            case 2:
                CallServer4CheckOffPMs(1);
                break;
            default:
                ShowDiv("InlineDiv" + args);
                break;
        }
    }
    if(command=="ScrollFList"){alert(args);}
}
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
    document.write('<SCRIPT LANGUAGE=VBScript\> \n');
    document.write('On Error Resume Next \n');
    document.write('Sub Chat_Base_FSCommand(ByVal command, ByVal args)\n');
    document.write(' call Chat_Base_DoFSCommand(command, args)\n');
    document.write('end sub\n');
    document.write('</SCRIPT\> \n');
}
//---------------------------------------------------------------------------------------
function Home_DoFSCommand(command, args) {
    var HomeObj = InternetExplorer ? Home : document.Home;
    //alert(command);
    if (command == "TestAlert") { alert(args); }
    if (command == "DoReg") { DoReg(); }
    if (command == "DoLogin") { DoLogin(args); }
    if (command == "DoRetPass") {Go4RetPass(args);}
}
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
    document.write('<SCRIPT LANGUAGE=VBScript\> \n');
    document.write('On Error Resume Next \n');
    document.write('Sub Home_FSCommand(ByVal command, ByVal args)\n');
    document.write(' call Home_DoFSCommand(command, args)\n');
    document.write('end sub\n');
    document.write('</SCRIPT\> \n');
}


//---------------------------------------------------------------------------------------
function SmilyCap_DoFSCommand(command, args) {
    var SmilyCapObj = InternetExplorer ? SmilyCap : document.SmilyCap;
    //alert(command);
    if (command == "TestAlert") { alert(args); }
    if (command == "AddSmily") { AddSmily(args); }
    //if (command == "DoLogin") { DoLogin(args); }
    //if (command == "DoRetPass") { Go4RetPass(args); }
}
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
    document.write('<SCRIPT LANGUAGE=VBScript\> \n');
    document.write('On Error Resume Next \n');
    document.write('Sub SmilyCap_FSCommand(ByVal command, ByVal args)\n');
    document.write(' call SmilyCap_DoFSCommand(command, args)\n');
    document.write('end sub\n');
    document.write('</SCRIPT\> \n');
}

//---------------------------------------------------------------------------------------
function MyPage_DoFSCommand(command, args) {
    var MyPageObj = InternetExplorer ? MyPage : document.MyPage;
    //alert(command);
    if (command == "TestAlert") { alert(args); }
    if (command == "ChatWhitMe") { ChatWhitMe(); }
    if (command == "OpenPage") { document.getElementById("ContentIF").src = args; }
    //if (command == "DoRetPass") { Go4RetPass(args); }
}
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
    document.write('<SCRIPT LANGUAGE=VBScript\> \n');
    document.write('On Error Resume Next \n');
    document.write('Sub MyPage_FSCommand(ByVal command, ByVal args)\n');
    document.write(' call MyPage_DoFSCommand(command, args)\n');
    document.write('end sub\n');
    document.write('</SCRIPT\> \n');
}
//---------------------------------------------------------------------------------------
function SinglePages_DoFSCommand(command, args) {
    var SinglePagesObj = InternetExplorer ? SinglePages : document.SinglePages;
    //alert(command);
    if (command == "TestAlert") { alert(args); }
    if (command == "GoBack") {window.history.go(-1); }
    //if (command == "OpenPage") { document.getElementById("ContentIF").src = args; }
    //if (command == "DoRetPass") { Go4RetPass(args); }
}
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
    document.write('<SCRIPT LANGUAGE=VBScript\> \n');
    document.write('On Error Resume Next \n');
    document.write('Sub SinglePages_FSCommand(ByVal command, ByVal args)\n');
    document.write(' call SinglePages_DoFSCommand(command, args)\n');
    document.write('end sub\n');
    document.write('</SCRIPT\> \n');
}
