function pop(some_url, wname, width, height){
    window.open(some_url, "catalog_" + wname, "width=" + width + ",height=" + height + ",left=0,top=0,status=0")
    //window.open(some_url, "catalog_" + wname, "fullscreen=yes,left=0,top=0,status=no")
}

function getWindowInnerSize() {
  var myWidth = 0, myHeight = 0;
  ret = new Array();
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    ret['width'] = window.innerWidth;
    ret['height'] = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    ret['width'] = document.documentElement.clientWidth;
    ret['height'] = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    ret['width'] = document.body.clientWidth;
    ret['height'] = document.body.clientHeight;
  }
  return ret;
}

/*
function getRes()
{
    some_res = new Array();
    some_res[0] = '1024x768';
    some_res[1] = '1280x1024';
    some_res[2] = '800x600';
    some_res[3] = '1280x800';
    some_res[4] = '1152x864';
    some_res[5] = '1400x1050';
    gigi = new Array();
    gigi['width'] = screen.width;
    gigi['height'] = screen.height;
    the_res = gigi['width'] + 'x' + gigi['height'];
    for (i = 0; i < some_res.length; i++) {
        if (some_res[i] == the_res) {
            return gigi;
        }
    }
    the_def = new Array();
    the_def['width'] = 1024;
    the_def['height'] = 768;
    return the_def;
}
*/

function getRes()
{
    some_res = new Array();
    
    some_res[0] = new Array();
    some_res[0]['width'] = 1024;
    some_res[0]['height'] = 768;
    
    some_res[1] = new Array();
    some_res[1]['width'] = 1280;
    some_res[1]['height'] = 1024;
    
    some_res[2] = new Array();
    some_res[2]['width'] = 800;
    some_res[2]['height'] = 600;
    
    some_res[3] = new Array();
    some_res[3]['width'] = 1280;
    some_res[3]['height'] = 800;
    
    some_res[4] = new Array();
    some_res[4]['width'] = 1152;
    some_res[4]['height'] = 864;
    
    some_res[5] = new Array();
    some_res[5]['width'] = 1400;
    some_res[5]['height'] = 1050;

    myRes = new Array();
    myRes['width'] = screen.width;
    myRes['height'] = screen.height;
    //myRes['width'] = '1400';
    //myRes['height'] = '1050';
    myRes['width'] = parseInt(myRes['width']);
    myRes['height'] = parseInt(myRes['height']);
    
    the_ret = new Array();
    the_ret = some_res[2];
    for (i = 0; i < some_res.length; i++) {
        if ((some_res[i]['width']== myRes['width']) && (some_res[i]['height']== myRes['height'])) {
            the_ret = myRes;
            i = some_res.length;
        } else {
            if ((some_res[i]['width'] >= the_ret['width'])
                    && (some_res[i]['width'] <= myRes['width'])
                    && (some_res[i]['height'] >= the_ret['height'])
                    && (some_res[i]['height'] <= myRes['height'])) {
                the_ret = some_res[i];
            }
        }
        //alert(i);
    }
    return the_ret;
}

function hackIt(some_str)
{
    document.write(some_str);
}
