window.name = "pomborealestate";

/*#########################################################

    BROWSER SNIFFER

###########################################################*/

function Is() {
    var agent = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns   = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
    this.ns2  = (this.ns && (this.major == 2));
    this.ns3  = (this.ns && (this.major == 3));
    this.ns4b = (this.ns && (this.minor < 4.04));
    this.ns4  = (this.ns && (this.major == 4));
    this.ns6  = (this.ns && (this.major >= 5));
    this.ie   = (agent.indexOf("msie") != -1);
    this.ie3  = (this.ie && (this.major == 2));
    this.ie4  = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") == -1));
    this.ie45 = (this.ie && (this.major >= 4));
    this.ie5  = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") != -1));
    this.ie55 = (this.ie && !this.ie3 && !this.ie4);
    this.op3  = (agent.indexOf("opera") != -1);
}

var is = new Is();
var doc = "document.GetElementById()";
var sty = ".style";
var htm = ""
var xpos = "event.x";
var ypos = "event.y";

/*#########################################################

    PRESENT FAILURES

###########################################################*/

function onError() {
    document.location.href = "javascript:";
}

/*#########################################################

    BUILD OBJECTS

###########################################################*/

function layerObject (name,position,left,top,width,height,visibility,overflowX,overflowY,zindex) {
    this.obj = eval("document.getElementById(name).style")
    this.obj.position = position;
    this.obj.left = left;
    this.obj.top = top;
    this.obj.width = width;
    this.obj.height = height;
    this.obj.visibility = visibility;
    this.obj.overflowX = overflowX;
    this.obj.overflowY = overflowY;
    this.obj.zindex = zindex;
    return this.obj;
}

function htmlObject (name) {
    this.obj = eval("document.getElementById(name)");
    return this.obj;
}

/*#########################################################

    CRON

###########################################################*/

function cron() {
    arg = cron.arguments;
    switch(arg[0]) {
        case 'report' :
            count++;
            if(count == 12) {
                cron('layerSetup');
            }
    
        break;

/*#########################################################

    LAYER SETUP

###########################################################*/

        case 'layerSetup' :
            masterLyr = new layerObject('masterLayer','absolute',0,0,778,602,'hidden','','',1);
            workboxLyr = new layerObject('workboxLayer','absolute',0,0,778,602,'hidden','','',1);
            logoLyr = new layerObject('logoLayer','absolute',175,0,600,200,'hidden','','',2);
            menubgLyr = new layerObject('menubgLayer','absolute',0,0,200,600,'hidden','','',2);
            menu1Lyr = new layerObject('menu1Layer','absolute',10,200,130,340,'hidden','','',3);
            menu2Lyr = new layerObject('menu2Layer','absolute',52,70,130,340,'hidden','','',3);
            menu3Lyr = new layerObject('menu3Layer','absolute',204,150,200,20,'hidden','','',3);
            contentLyr = new layerObject('contentLayer','absolute',185,178,590,420,'hidden','auto','auto',3);
            content2Lyr = new layerObject('content2Layer','absolute',187,503,563,64,'hidden','hidden','auto',3);
            tagsLyr = new layerObject('tagsLayer','absolute',15,500,65,35,'hidden','auto','hidden',3);
            creditsLyr = new layerObject('creditsLayer','absolute',10,507,200,30,'hidden','','',3);

    cron('htmlSetup');
        break;

/*#########################################################

    HTML OBJECT SETUP

###########################################################*/

        case 'htmlSetup' :
            menu1HTML = new htmlObject('menu1Layer');
            menu2HTML = new htmlObject('menu2Layer');
            menu3HTML = new htmlObject('menu3Layer');
            contentHTML = new htmlObject('contentLayer');
            content2HTML = new htmlObject('content2Layer');
            tagsHTML = new htmlObject('tagsLayer');
            creditsHTML = new htmlObject('htmlLayer');

    cron('visSetup');
        break;

/*#########################################################

    OBJECT VISIBILITY SETUP

###########################################################*/

        case 'visSetup' :
            masterLyr.visibility = 'visible';
            workboxLyr.visibility = 'visible';
            logoLyr.visibility = 'visible';
            menubgLyr.visibility = 'visible';
            menu1Lyr.visibility = 'hidden';
            menu2Lyr.visibility = 'hidden';
            menu3Lyr.visibility = 'hidden';
            contentLyr.visibility = 'visible';
            content2Lyr.visibility = 'hidden';
            tagsLyr.visibility = 'visible';
            creditsLyr.visibility = 'hidden';

    cron('setStage');
        break;

/*#########################################################

    DYNAMICALLY LOAD SPECIAL PAGE ELEMENTS

###########################################################*/

        case 'setStage' :
//            self.setTimeout('menubgLyr.visibility = "visible"',1000);
            self.setTimeout('menu2Lyr.visibility = "visible"',2300);
            self.setTimeout('menu1Lyr.visibility = "visible"',2400);
            self.setTimeout('menu3Lyr.visibility = "visible"',2400);
            self.setTimeout('loadPage("contentLayer",null,"content/pre_cont1.php?mopt=1")',2500);
//            self.setTimeout('creditsLyr.visibility = "visible"',3000);
//            self.setTimeout('content2Lyr.visibility = "visible"',3100);

    recenterMaster('masterLayer');
        break;
    }
}

/*#########################################################

    DOCUMENT CENTER - CENTER CONTENT INSIDE BROWSER

###########################################################*/

function recenterMaster(id) {
    if (document.body.clientHeight >= 602 && document.body.clientWidth >= 778) {
        document.getElementById(id).style.left = parseInt((document.body.clientWidth/2)-389);
        document.getElementById(id).style.top = parseInt((document.body.clientHeight/2)-301);
    } else {
        document.getElementById(id).style.left = 5;
        document.getElementById(id).style.top = 5;
    }
}

/*#########################################################

    PAGE LOADER - LOAD CONTENT INTO LAYERS

###########################################################*/

function loadPage(id,nestref,url) {
    content_width = 572;
    document.getElementById('contentFRM').src = url;
}

function showPage(id) {
    document.getElementById(id).innerHTML = window.frames['contentFRM'].document.getElementById('theBody').innerHTML;
    this.status=("PomboRealEstate.com");
}

/*#########################################################

    LAYER SWAP - CLIENT INFO

###########################################################*/

function swapClientInfo1(id) {
var mnum=106;
var x=101;
var id=id;
var border_active="#FFFFFF";
var border_inactive="#003399";
var background_active="#FFFFFF";
var background_inactive="#F7F9FD";
var visibility_active="visible";
var visibility_inactive="hidden";

    while (x<=mnum) {
        document.getElementById(x).style.borderBottomColor = border_inactive;
        document.getElementById(x).style.backgroundColor = background_inactive;
        document.getElementById("info"+x+"Layer").style.visibility = visibility_inactive;
        x++;
    }
    document.getElementById(id).style.borderBottomColor = border_active;
    document.getElementById(id).style.backgroundColor = background_active;
    document.getElementById("info"+id+"Layer").style.visibility = visibility_active;
}

/*#########################################################

    POP-UP WINDOW

###########################################################*/

var viewpopup = null;

function displayPopup(id,width,height,url,scroll,resize,menu,title,status) {
    var id = id;
    var display_width = width;
    var display_height = height;
    var scroll = scroll;
    var resize = resize;
    var menu = menu;
    var title = title;
    var status = status;
    var display_top = (screen.height-display_height)/2;
    var display_left = (screen.width-display_width)/2;

    viewpopup = window.open(''+ url + '',''+id+'','scrollbars='+scroll+',resizable='+resize+',menubar='+menu+',titlebar='+title+',statusbar='+status+',width=' + display_width + ',height=' + display_height + ',top=' + display_top + ',left=' + display_left + '');
    viewpopup.focus();
}

/*#########################################################

    LINK EFFECTS

###########################################################*/

function swapBullet(state,id,color) {
var state=state;
var id=id;
var color=color;

    if (state = 1) {
        document.getElementById(id).style.color = color;
    } else {
        document.getElementById(id).style.color = color;
    }
}
