Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 534745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:38:41+00:00 2026-05-13T09:38:41+00:00

Why oh why oh why… I can’t figure out why I keep getting this

  • 0

Why oh why oh why… I can’t figure out why I keep getting this error. I think I might cry.

/*** common functions  */
function GE(id) { return document.getElementById(id); }

function changePage(newLoc) {
   nextPage = newLoc.options[newLoc.selectedIndex].value

   if (nextPage != "")
   {
      document.location.href = nextPage
   }
 }

function isHorizO(){
  if (navigator.userAgent.indexOf('iPod')>-1)
    return (window.orientation == 90 || window.orientation==-90)? 1 : 0;
   else   return 1;

}

function ShowHideE(el, act){
    if (GE(el)) GE(el).style.display = act;
}

function KeepTop(){
    window.scrollTo(0, 1);
}

/* end of common function */

var f = window.onload; 
if (typeof f == 'function'){
    window.onload = function() {
        f();
        init();
    }
}else window.onload = init;

function init(){
    if (GE('frontpage')) init_FP();
    else {
        if (GE('image')) init_Image();
        setTimeout('window.scrollTo(0, 1)', 100); 
     }

    AddExtLink();
}

function AddExtLink(){
    var z = GE('extLink');
    if (z){
        z = z.getElementsByTagName('a');
        if (z.length>0){
            z = z[0];
            var e_name = z.innerHTML;
            var e_link = z.href;

            var newOption, oSe;
            if (GE('PSel')) oSe = new Array(GE('PSel'));
            else
                oSe = getObjectsByClassName('PSel', 'select')

            for(i=0; i<oSe.length; i++){
                newOption = new Option(e_name, e_link);
                oSe[i].options[oSe[i].options.length] = newOption;
            }
        }
    }
}

/* fp */
function FP_OrientChanged() {
    init_FP();
}

function init_FP() {
  //  GE('orientMsg').style.visibility = (!isHorizO())? 'visible' : 'hidden';
}

/* gallery */
function GAL_OrientChanged(link){
    if (!isHorizO()){
        ShowHideE('vertCover', 'block');
        GoG(link);
    }
    setTimeout('window.scrollTo(0, 1)', 500);
}
function init_Portfolio() {
 //   if (!isHorizO())
 //       ShowHideE('vertCover', 'block');
}
function ShowPortfolios(){
    if (isHorizO()) ShowHideE('vertCover', 'none');
}

var CurPos_G = 1
function MoveG(dir) {
    MoveItem('G',CurPos_G, dir);
}

/* image */
function init_Image(){
    // check for alone vertical images
    PlaceAloneVertImages();
}
function Img_OrtChanged(){
    //CompareOrientation(arImgOrt[CurPos_I]);
    //setTimeout('window.scrollTo(0, 1)', 500);
}

var CurPos_I = 1
function MoveI(dir) {
    CompareOrientation(arImgOrt[CurPos_I+dir]);
    MoveItem('I',CurPos_I, dir);
}

var arImgOrt = new Array(); // orientation: 1-horizontal, 0-vertical
var aModeName = new Array('Horizontal' , 'Vertical');
var arHs = new Array();

function getDims(obj, ind){
    var arT = new Array(2);

    arT[0] = obj.height; 
    arT[1] = obj.width;


     //arWs[ind-1] = arT;
    arHs[ind] = arT[0];

     //**** (arT[0] > arT[1]) = (vertical image=0)
     arImgOrt[ind] = (arT[0] > arT[1])? 0 : 1;

    // todor debug
    if(DebugMode) {
        //alert("["+obj.width+","+obj.height+"] mode="+((arT[0] > arT[1])? 'verical' : 'hoziontal'))
        writeLog("["+obj.width+","+obj.height+"] mode="+((arT[0] > arT[1])? 'verical' : 'hoziontal')+' src='+obj.src)
    }        
     if (arImgOrt[ind]) {
        GE('mi'+ind).className = 'mImageH';
     }

}
function CompareOrientation(imgOrt){
    var iPhoneOrt = aModeName[isHorizO()];
    GE('omode').innerHTML = iPhoneOrt;
    //alert(imgOrt == isHorizO())
    var sSH = (imgOrt == isHorizO())? 'none' : 'block';
    ShowHideE('vertCover', sSH); 

    var sL = imgOrt? 'H' : 'V';
    if (GE('navig')) GE('navig').className = 'navig'+ sL ;
    if (GE('mainimage')) GE('mainimage').className = 'mainimage'+sL;
    var sPfL = imgOrt? 'Port-<br>folios' : 'Portfolios' ;
    if (GE('PortLnk')) GE('PortLnk').innerHTML = sPfL;

}

function SetGetDim( iMInd){
    var dv = GE('IImg'+iMInd);

    if (dv)   {
        var arI = dv.getElementsByTagName('img');
        if (arI.length>0){
            var oImg =  arI[0];
            oImg.id = 'Img'+iMInd;
            oImg.className = 'imageStyle';
             //YAHOO.util.Event.removeListener('Img'+iMInd,'load');
             YAHOO.util.Event.on('Img'+iMInd, 'load', function(){GetDims(oImg,iMInd);}, true, true);
           //oImg.addEventListener('load',GetDims(oImg,iMInd),true);
        }
    }
}
var occ = new Array();
function PlaceAloneVertImages(){
    var iBLim, iELim;
    iBLim = 0;
    iELim = arImgOrt.length;
    occ[0] = true;
    //occ[iELim]=true;

    for (i=1; i<iELim; i++){
        if ( arImgOrt[i]){//horizontal image
            occ[i]=true;
            continue;
        }else { // current is vertical
            if (!occ[i-1]){//previous is free-alone. this happens only the first time width i=1
                occ[i] = true;
                continue;
            }else {
                if (i+1 == iELim){//this is the last image, it is alone and vertical
                    GE('mi'+i).className = 'mImageV_a'; //***** expand the image container
                }else {
                    if ( arImgOrt[i+1] ){
                        GE('mi'+i).className = 'mImageV_a';//*****expland image container
                        occ[i] = true;
                        occ[i+1] = true;
                        i++;
                        continue;
                    }else { // second vertical image
                        occ[i] = true;
                        occ[i+1] = true;
                        if (arHs[i]>arHs[i+1]) GE('mi'+(i+1)).style.height =  arHs[i]+'px';
                        i++;
                        continue;
                    }
                }
            }

        }


    }
    //arImgOrt

}

function AdjustWebSiteTitle(){

    //if (GE('wstitle')) if (GE('wstitle').offsetWidth > GE('wsholder').offsetWidth) {
    if (GE('wstitle')) if (GE('wstitle').offsetWidth > 325) {
        ShowHideE('dots1','block');
        ShowHideE('dots2','block');
    }
}

function getObjectsByClassName(className, eLTag, parent){
    var oParent;
    var arr = new Array();
    if (parent) oParent = GE(parent); else oParent=document;
    var elems = oParent.getElementsByTagName(eLTag);
    for(var i = 0; i < elems.length; i++)
    {
        var elem = elems[i];
        var cls = elem.className
        if(cls == className){
            arr[arr.length] = elem;
        }
    }
    return arr;
}



////////////////////////////////
///
// todor debug 
var DebugMode = (getQueryVariable("debug")=="1")
function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  var sRet = ""
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
        sRet = pair[1];
    }
  }
  return sRet
  //alert('Query Variable ' + variable + ' not found');
} 
var oLogDiv=''
function writeLog(sMes){
    if(!oLogDiv) oLogDiv=document.getElementById('oLogDiv')
    if(!oLogDiv) {
        oLogDiv = document.createElement("div");
        oLogDiv.style.border="1px solid red"
        var o = document.getElementsByTagName("body")
        if(o.length>0) {
            o[0].appendChild(oLogDiv)
        }
    }        
    if(oLogDiv) {
        oLogDiv.innerHTML = sMes+"<br>"+oLogDiv.innerHTML
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:38:41+00:00Added an answer on May 13, 2026 at 9:38 am

    First, Firebug is your friend, get used to it. Second, if you paste each function and some supporting lines, one by one, you will eventually get to the following.

    var DebugMode = (getQueryVariable("debug")=="1")
    function getQueryVariable(variable)

    You can’t execute getQueryVariable before it is defined, you can create a handle to a future reference though, there is a difference.

    There are several other potential issues in your code, but putting the var DebugMode line after the close of the getQueryVariable method should work fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 275k
  • Answers 275k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can use lookahead and lookbehind, which are features of… May 13, 2026 at 2:38 pm
  • Editorial Team
    Editorial Team added an answer Add this to the end of your script: if @Result… May 13, 2026 at 2:38 pm
  • Editorial Team
    Editorial Team added an answer You can bind a List to a DataGridView control so… May 13, 2026 at 2:38 pm

Related Questions

After countless tries I got my animation animating right (Why oh why is the
shutil.rmtree will not delete read-only files on Windows. Is there a python equivalent of
So I knocked up some test code to see how the multiprocessing module would
I'm rewriting an old program to do some new stuff, and suddenly I get
Question in title... In short - I have a WCF service exposing operations that

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.