﻿function BookmarkSite()
{
    var url = "http://www.rorrak4u.net/";
    var title = "Rorrak4u.net";
    
    if (document.all)
        window.external.AddFavorite(url, title);
    else if (window.sidebar)
        window.sidebar.addPanel(title, url, "")
}

function ChatCall(myid, fid )
{
    newwindow = window.open('http://www.rorrak4u.net/chatroom/index2.php?myid=' + myid + '&fid=' + fid , 'name', 'height=700, width=850');
    if (window.focus) {newwindow.focus()}
    return false;
}

function UserAct(typ, fid )
{
    newwindow = window.open('http://www.rorrak4u.net/dating/include/components/UserAct.php?typ=' + typ + '&fid=' + fid , 'name', 'height=150, width=400');
    if (window.focus) {newwindow.focus()}
    return false;
}


function VoteMe(typ, fid )
{
    newwindow = window.open('http://www.rorrak4u.net/dating/components/voteme.php?typ=' + typ + '&fid=' + fid , 'name', 'height=150, width=400');
    if (window.focus) {newwindow.focus()}
    return false;
}


function SendProfile(fid)
{
    newwindow = window.open('http://www.rorrak4u.net/dating/components/SendProfile.php?id=' + fid , 'name', 'height=450, width=600');
    if (window.focus) {newwindow.focus()}
    return false;
}

function GiveGift(fid)
{
    newwindow = window.open('http://www.rorrak4u.net/dating/components/GiveGift.php?id=' + fid , 'name', 'height=450, width=600');
    if (window.focus) {newwindow.focus()}
    return false;
}

function SignUp()
{
    window.location = "http://www.rorrak4u.net/dating/login.php?lang=en";
}

function Delay(seconds)
{
    var buttonSend = document.getElementById("ctl00_ContentPlaceHolder1_FormViewUserProfile_ButtonSend");
    buttonSend.value = seconds;
    seconds--;
    if (seconds > 0)
    {
        setTimeout("Delay(" + seconds + ")", 1000);
    }
    else
    {
        var textBoxMessage = document.getElementById("ctl00_ContentPlaceHolder1_FormViewUserProfile_TextBoxMessage");
        textBoxMessage.value = "";
        textBoxMessage.disabled = false;
        buttonSend.value = "Send";
        buttonSend.disabled = false;
        
        var tableCaptcha = document.getElementById("ctl00_ContentPlaceHolder1_FormViewUserProfile_tablecaptcha");
        tableCaptcha.style.visibility = "visible";
    }
}

function Count(text, maxlength)
{
    if (text.value.length > maxlength)
    {
         text.value = text.value.substring(0, maxlength);
         alert("Max length is " + maxlength + " chars");
    }
}

function Send(button)
{
    button.value = "Sending...";
    return true;
    
}

function Upload(button)
{
    button.value = "Uploading...";
    return true;
}

function Search(button)
{
    button.value = "Searching...";
    return true;
}

function Save(button)
{
    if (typeof(Page_ClientValidate) == 'function')
    {
        if (Page_ClientValidate() == true)
        {
            button.value = "Saving...";
        }
        else
        {
            return true;
        }
    }
    else
    {
        button.value = "Saving...";
        return true;
    }
}


