﻿// JScript File
var dom = (document.getElementById) ? true : false;
var ns5 = (!document.all && dom || window.opera) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ie4 && !ie5 && !dom) ? true : false;
var isIE = ie4 || ie5;
var isNS = ns5;
		    
var standardbody = (document.compatMode=="CSS1Compat")? document.documentElement : document.body;
var _docWidth = function() { return (document.body.clientWidth)? document.body.clientWidth : 0; }
var _docHeight = function() { return (document.body.clientHeight)? document.body.clientHeight: standardbody.offsetHeight; }
var _winWidth = function() { var n =  (document.documentElement)? document.documentElement.clientWidth : 0; return n; }
var _winHeight = function() { var n =  (document.documentElement)? document.documentElement.clientHeight: 0; return n; }
var _scrollX = function() { var n = typeof(window.pageXOffset)=='number' ?  window.pageXOffset : document.documentElement.scrollLeft; return n; }
var _scrollY = function() { var n = typeof(window.pageYOffset)=='number' ?  window.pageYOffset : document.documentElement.scrollTop; return n; }
var _scrollWidth = function() { var n =  (document.body.scrollWidth)? document.body.scrollWidth: 0; return n; }
var _scrollHeight = function() { var n =  (document.body.scrollHeight)? document.body.scrollHeight: 0; return n; }
var _mouseX = function(evt) { return isIE? window.event.clientX + standardbody.scrollLeft : evt.pageX; }
var _mouseY = function(evt) { return isIE? window.event.clientY + standardbody.scrollTop : evt.pageY; }

function mouseOver(elm)
{
    elm.style.border = 'outset 1px #FFCEEE';
    //elm.style.border = 'outset 1px #888888';
    elm.style.backgroundColor = '#FFCECE';
}
function mouseLeave(elm)
{
    elm.style.border = 'outset 1px #FFCECE';
    //elm.style.border = 'outset 1px #666666';
    elm.style.backgroundColor = '#FFEAEA';
} 

function getElement(id)
{
    return (ie4)? document.all[id]: (ie5||ns5)? document.getElementById(id): null;
}

function openDetails(vno)
{
    window.open('ItemDetails.aspx?vno=' + vno,'','left=100,top=20,width=1110px,height=680px,toolbar=0,menubar=0,scrollbars=1,status=1');
}

function openInquiry(itype, vno)
{
    window.open('EmailComm.aspx?type=' + itype + '&vno=' + vno,'','left=100,top=20,width=620px,height=400px,toolbar=0,menubar=0,scrollbars=1,status=1');
}
//var _winHeight = function() 
//{ 
//  if( typeof( window.innerWidth ) == 'number' ) {
//    //Non-IE
//    return window.innerHeight;
//  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//    //IE 6+ in 'standards compliant mode'
//    return document.documentElement.clientHeight;
//  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//    //IE 4 compatible
//    return document.body.clientHeight;
//  }
//}

//var _winWidth = function()
//{
//  if( typeof( window.innerWidth ) == 'number' ) {
//    //Non-IE
//    return window.innerWidth;
//  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//    //IE 6+ in 'standards compliant mode'
//    return document.documentElement.clientWidth;
//  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//    //IE 4 compatible
//    return document.body.clientWidth;
//  }
//}

