//<![CDATA[
var G={
    base:'http://<Computed Value>',
    gecko:navigator.product=='Gecko',
    ie6:(!!document.all && !(typeof window.XMLHttpRequest=='object')),
    init:function(){
        for(var n in G)if(G[n].init)G[n].init()
    },
    set:function(a,b){
        for(var o in b)a[o]=b[o];return a
    },
    create:function(a,b,c,d){
        var o=(d||document).createElement(a);G.set(o,b);G.set(o.style,c);return o
    },
    append:function(a,b,c,d){
        var o=b.tagName?b:G.create(b,c,d);a.appendChild(o);return o
    }
}
function $(a){
    return document.getElementById(a)
}
function $$(a,b){
    return (b||document).getElementsByTagName(a)
}
window.onload=G.init

G.pop={
    init:function(){
        var m=this,o=$$('area'),i
        for(i=0;i<o.length;i++){
            if(o[i].className=='popup')G.set(o[i],{
                onmouseover:m.over,
                onmouseout:m.out
            })
        }
        m.win=$('pop-win')
        G.set(m.win,{
            onmouseover:m.over2,
            onmouseout:m.out2
        })
    },
    over:function(e){
        
        var curleft = curtop = 0;
        obj=document.getElementById('imagemap');
       
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
                        
		}
	}
       x= curleft;
	y=curtop;
          
        var m=G.pop,p=m.pos(this,x,y)
        G.set(m.win.style,{
            left:p.x1+'px',
            top:p.y1+10+'px',
            visibility:'visible'
        })

    },
    out:function(){
        var m=G.pop;m.timer=setTimeout(m.close,200)
    },
    over2:function(e){
        
        clearTimeout(G.pop.timer)
    },
    out2:function(e){
        var m=G.pop;if(m.outside(e,m.win))m.close()
    },
    close:function(){
        G.pop.win.style.visibility='hidden'
    },
    pos:function(a,x,y){
        
        var el = document.getElementById('pop-test');

  
       


        if(a.id=="sandiego")
        {
           
            x=x+220;
            y=y+295;
    
   
          document.getElementById('pop-test').innerHTML="<a href='javascript:showPopup(\"sandiego\")' id='univerhref'><img id='univer' alt='' src='images/atlanta.png'></img></a>";
             
           
            document.getElementById('pop-test').style.width="268px";
            document.getElementById('pop-test').style.height="86px";


        }
        else if(a.id=="geogia")
        {
            x=x+240;
            y=y+295;
             document.getElementById('pop-test').innerHTML="<a href='javascript:showPopup(\"geogia\")' id='univerhref'><img id='univer' alt='' src='images/athens.png'></img></a>";
            
           
            document.getElementById('pop-test').style.width="268px";
            document.getElementById('pop-test').style.height="86px";
           
        }
        else if(a.id=="miami")
        {
           x=x+218;
            y=y+220;
             document.getElementById('pop-test').innerHTML="<a href='javascript:showPopup(\"miami\")' id='univerhref'><img id='univer' alt='' src='images/oxford.png'></img></a>";
           
            document.getElementById('pop-test').style.width="268px";
            document.getElementById('pop-test').style.height="86px";
        }
        else if(a.id=="wisconsin")
        {
            x=x+165;
            y=y+175;
             document.getElementById('pop-test').innerHTML="<a href='javascript:showPopup(\"wisconsin\")' id='univerhref'><img id='univer' alt='' src='images/maddison.png'></img></a>";   
            document.getElementById('pop-test').style.width="268px";
            document.getElementById('pop-test').style.height="86px";
           
        }
		 else if(a.id=="auraria")
        {
            x=x+30;
            y=y+220;
             document.getElementById('pop-test').innerHTML="<a href='javascript:showPopup(\"auraria\")' id='univerhref'><img id='univer' alt='' src='images/auraria_student_lofts.png'></img></a>";   
            document.getElementById('pop-test').style.width="268px";
            document.getElementById('pop-test').style.height="86px";
           
        }
        //var x=a.offsetLeft,y=a.offsetTop
        //while(a.offsetParent){a=a.offsetParent;x+=a.offsetLeft,y+=a.offsetTop}
        
        return{
            x1:x,
            y1:y
        }
    },
    outside:function(e,a){
        var ee=e||window.event,o=(ee.toElement)?ee.toElement:ee.relatedTarget
        while(o!=a && o.nodeName!='BODY')o=o.parentNode
        return o!=a
    }
}
//]]>
