﻿// JScript File
function SimpleSwap(o, src)
{
    o.src = o.getAttribute(src || "origsrc");
}

function SimpleSwapSetup()
{
    var x = document.getElementsByTagName("input");

    for (var i=0; i<x.length; i++)
    {
        var useover = x[i].getAttribute("useover");
        
        if (!useover) continue;
        
        var imageOverSrc = x[i].src.replace("_norm.png", "_over.png");
        
        x[i].setAttribute("oversrc", imageOverSrc);
        
        x[i].oversrc_img = new Image();
        x[i].oversrc_img.src = imageOverSrc;
     
        // set event handlers
        x[i].onmouseover = new Function("SimpleSwap(this,'oversrc');");
        x[i].onmouseout = new Function("SimpleSwap(this);");
        
        // save original src
        x[i].setAttribute("origsrc",x[i].src);
    }
}

var PreSimpleSwapOnload =(window.onload) ? window.onload : function(){};
window.onload = function(){PreSimpleSwapOnload(); SimpleSwapSetup();}


function openCRoom(url, roomId)
{
    window.open(url + '?chatroom='+roomId, 'WBChat','width=640,height=480,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no');
}