﻿var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
rX = self.pageXOffset;
rY = self.pageYOffset;
}
else if(document.documentElement && document.documentElement.scrollTop) {
rX = document.documentElement.scrollLeft;
rY = document.documentElement.scrollTop;
}
else if(document.body) {
rX = document.body.scrollLeft;
rY = document.body.scrollTop;
}
if(document.all) {
cX += rX;
cY += rY;
}
d.style.left = (185) + "px";
d.style.top = (140) + "px";
}
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
dd.style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}

function Wait(d) {
    setTimeout("Showtab('PromoPopUp')", 4000);
    setTimeout("Hidetab('PromoPopUp')", 30000);
}

function GetBrowserName () {
    var browserName = "";

    var ua = navigator.userAgent.toLowerCase();
    if (ua.indexOf("opera") != -1) {
        browserName = "opera";
    } else if (ua.indexOf("msie") != -1) {
        browserName = "msie";
    } else if (ua.indexOf("safari") != -1) {
        browserName = "safari";
    } else if (ua.indexOf("mozilla") != -1) {
        if (ua.indexOf("firefox") != -1) {
            browserName = "firefox";
        } else {
            browserName = "mozilla";
        }
    }

    return browserName;
};

function tellmemybrowser() {
    alert(navigator.appName);
}

var tabID = "";
function Showtab(d) {
    if (navigator.appName != "Microsoft Internet Explorer") {
        document.getElementById(d).style.display = "block";
    }
    else {
        document.getElementById(d).style.display = "none";
    }
}
function Hidetab(d) {
    if (d.length < 1) { return; }
    document.getElementById(d).style.display = "none";
}


function Showtab2(d) {
    if (navigator.appName != "Microsoft Internet Explorer") {
        tabID = document.getElementById(d.id);
        //tabID.getElementById('<%=dropdown.ClientID%>').childNodes[0].style.display = "block";
        var tb = tabID.getElementsByTagName("div");
        var list = tb[0];
        list.style.display = "block";
        //document.getElementById(d.id).style.display = "block";
    }
    else {
        d.getElementById('<%=dropdown.ClientID%>').childNodes[0].style.display = "none";
    }
}
function Hidetab2(d) {
    if (d.length < 1) { return; }
    var tabID2 = document.getElementById(d.id);
    var tb2 = tabID2.getElementsByTagName("div");
    var list2 = tb2[0];
    list2.style.display = "none";
    //document.getElementById(d).style.display = "none";
}

function Showtab3(d) {
    if (navigator.appName != "Microsoft Internet Explorer") {
        document.getElementById(d.id).style.display = "block";
    }
    else {
        document.getElementById(d.id).style.display = "none";
    }
}
function Hidetab3(d) {
    if (d.length < 1) { return; }
    document.getElementById(d.id).style.display = "none";
}

function tabOn(d) {
    if (d.length < 1) { return; }
    document.getElementById(d).style.backgroundColor = "#004B7F";
}

function tabOff(d) {
    if (d.length < 1) { return; }
    document.getElementById(d).style.backgroundColor = "Transparent";
}


function tabOn2(d) {
    if (d.length < 1) { return; }
    var tabID = document.getElementById(d.id);
    document.getElementById(d.id).style.backgroundColor = "#004B7F";
}


function tabOff2(d) {
    if (d.length < 1) { return; }
    document.getElementById(d.id).style.backgroundColor = "Transparent";
}

function showMiniPic() {
    document.getElementsByName('mainImage').src = "http://www.olejostores.com/images/sim7236_m.jpg";
}    

function UpdateCursorPosition2(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll2(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll2; }
else { document.onmousemove = UpdateCursorPosition2; }
function AssignPosition2(d) {
if(self.pageYOffset) {
rX = self.pageXOffset;
rY = self.pageYOffset;
}
else if(document.documentElement && document.documentElement.scrollTop) {
rX = document.documentElement.scrollLeft;
rY = document.documentElement.scrollTop;
}
else if(document.body) {
rX = document.body.scrollLeft;
rY = document.body.scrollTop;
}
if(document.all) {
cX += rX;
cY += rY;
}
d.style.left = (185 + 179) + "px";
d.style.top = (155) + "px";
}
function HideContent2(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent2(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition2(dd);
dd.style.display = "block";
}
function ReverseContentDisplay2(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition2(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}


var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition3(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll3(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll3; }
else { document.onmousemove = UpdateCursorPosition3; }
function AssignPosition3(d) {
if(self.pageYOffset) {
rX = self.pageXOffset;
rY = self.pageYOffset;
}
else if(document.documentElement && document.documentElement.scrollTop) {
rX = document.documentElement.scrollLeft;
rY = document.documentElement.scrollTop;
}
else if(document.body) {
rX = document.body.scrollLeft;
rY = document.body.scrollTop;
}
if(document.all) {
cX += rX;
cY += rY;
}
var winl = (screen.width-800)/2;
var wint = (screen.height-500)/2;
d.style.left = (winl) + "px";
d.style.top = (wint) + "px";
}
function HideContent3(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent3(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition3(dd);
dd.style.display = "block";
}
function ReverseContentDisplay3(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition3(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}

var win = null;
function NewWindow(mypage, myname, w, h, scroll, pos) {
    if (pos == "random") { LeftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width - w)) : 100; TopPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height - h) - 75)) : 100; }
    if (pos == "center") { LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100; TopPosition = (screen.height) ? (screen.height - h) / 2 : 100; }
    else if ((pos != "center" && pos != "random") || pos == null) { LeftPosition = 0; TopPosition = 20 }
    settings = 'width=' + w + ',height=' + h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
    win = window.open(mypage, myname, settings);
}


