﻿count=0;var picOff=new Array();var picOn=new Array();
function TurnOn1(num){eval("picV"+num+"=new Image()");eval("picV"+num+".src='"+picOn[num]+"'");eval("document.pic"+num+"a.src=picV"+num+".src");};
function TurnOff1(num1){eval("picZ"+num1+"=new Image()");eval("picZ"+num1+".src='"+picOff[num1]+"'");eval("document.pic"+num1+"a.src=picZ"+num1+".src");};
function rollover(picoff1,picon1,url,extra){picOff[count]=picoff1;picOn[count]=picon1;document.write("<a href='"+url+"' onmouseover='TurnOn1("+count+")' onmouseout='TurnOff1("+count+")' "+extra+"><img src='"+picoff1+"' border=0 name='pic"+count+"a'></a>");TurnOn1(count);TurnOff1(count);count++;};


context = {
    uid: 0,
    dic: new fodDictionary(),
    
    createID: function(e)
    {
        this.uid++;
        this.dic.add('uid_' + this.uid, e);
         return this.uid;
    },
    
    removeID: function(id)
    {
        this.dic.remove('uid_' + id);
    },
    
    getElement: function(id)
    {
        return this.dic.lookup('uid_' + id);
    }
}



//fodDictionary//////////////////////////////////
function fodDictionary()
{
}
fodDictionary.prototype.lookup = function(key)
{
	return(this[key]);
	//return mLookup(key);
}
fodDictionary.prototype.add = function(key, item)
{
	this[key] = item;
	//mAdd(key,item);
}
fodDictionary.prototype.remove = function(key)
{
	this[key] = null;
	//mDelete(key);
}
fodDictionary.prototype.exists = function(key)
{
	return this[key] != null;
	//return mExists(key);
}
/////////////////////////////////////////////////



function mLookup(strKeyName) {
		return(this[strKeyName]);
}

// The meta Add method:
function mAdd() {
	for (c=0; c<mAdd.arguments.length; c+=2) {
		this[mAdd.arguments[c]] = mAdd.arguments[c+1];
	}
}

// The Delete method
function mDelete(strKeyName) {
	for (c=0; c<mDelete.arguments.length; c++) {
			this[mDelete.arguments[c]] = null;
	}
}

// The Exists method
function mExists(strKeyName) {
	for (c=0; c<mExists.arguments.length; c++) {
			return this[mExists.arguments[c]] != null;
	}
}


// A dictionary object of Cities and States/Countries:
function cRolly() {
	this.Add = mAdd;
	this.Lookup = mLookup;
	this.Delete = mDelete;
	this.Exists = mExists;
}

var o = new cRolly();

function rollon(elem, url)
{
	o.Add(elem, elem.src);
	elem.src = url;
}

function rolloff(elem)
{
	if(o.Exists(elem))
		elem.src = o.Lookup(elem);
}


function openPopupWindow(url, name, width, height)  
{  
    var myPopupWindow = '';  
    //Remove special characters from name  
    name = name.replace(/\/|\-|\./gi, "");  

    //Remove whitespaces from name  
    var whitespace = new RegExp("\\s","g");  
    name = name.replace(whitespace,"");  

    //If it is already open  
    if (!myPopupWindow.closed && myPopupWindow.location)  
    {  
        myPopupWindow.location.href = encodeUrl(url);  
    }  
    else  
    {  
        myPopupWindow= window.open(encodeUrl(url),name, "location=no, scrollbars=yes, resizable=yes, toolbar=no, menubar=no, width=" + width + ", height=" + height );  
        if (!myPopupWindow.opener) myPopupWindow.opener = self;  
    }  

    //If my main window has focus - set it to the popup  
    if (window.focus) {myPopupWindow.focus()}  
}  

function encodeUrl(url)  
{  
    if (url.indexOf("?")>0)  
    {  
        encodedParams = "?";  
        parts = url.split("?");  
        params = parts[1].split("&");  
        for(i = 0; i < params.length; i++)  
        {  
           if (i > 0)  
           {  
               encodedParams += "&";  
           }  
           if (params[i].indexOf("=")>0) //Avoid null values  
           {  
               p = params[i].split("=");  
               encodedParams += (p[0] + "=" + escape(encodeURI(p[1])));  
           }  
           else  
           {  
               encodedParams += params[i];  
           }  
       }  
       url = parts[0] + encodedParams;  
   }  
   return url;  
}  

function aimg()
{
    var a = document.getElementsByTagName("a");
    for(var i = 0; i < a.length; i++)
    {
		if(a[i].getElementsByTagName("img").length > 0)
		{
			if(a[i].className == "")
				a[i].className = 'img';
		}
    }
}

function clearText(id,clearifthis)
{
    if($(id).value == clearifthis)
        $(id).value = "";
}    

    //If antispam email converter

            function noSpam(user,domain) {
                        locationstring = "mailto:" + user + "@" + domain;
                                    window.location = locationstring;
                                            }

        function MM_openBrWindow(theURL,winName,features) { //v2.0
                        window.open(theURL,winName,features);
                                }
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->