
function enlargePopUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=400,left = 362,top = 184');");
    //newurl="http://www.web-ideas.com";    
    //window.open(URL, id, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=400,left = 362,top = 184');
}


function showBasketLayer(layerName)
{        
	if(navigator.userAgent.indexOf('Netscape/7.0') != -1) var ns7 = true;
	document.getElementById(layerName).style.display = 'block';
	PositionLayer(layerName);
}

function ShowConfirmLayer(sDestination, sMessage)
{
	PositionLayer('ConfirmLayer');
	document.getElementById('confirmMessage').innerHTML = sMessage;
	document.getElementById('destinationLink').href = sDestination;
	document.getElementById('ConfirmLayer').style.display = 'block';
	PositionLayer('ConfirmLayer');
	//ShowErrFrame('ConfirmLayer');
}


function PositionLayer(layerName){

    layer = document.getElementById(layerName);    

    xyScroll=getScrollXY();
    xScroll=xyScroll[0];
    yScroll=xyScroll[1];

    whSize=getWindowSize();
    width=whSize[0];
    height=whSize[1];

    topOffset=100;
    layerwidth=230;

    newTop = yScroll+topOffset;
    newLeft = xScroll+width/2-layerwidth/2;;
	
	newTop += 'px';
	newLeft += 'px';

    layer.style.top = newTop;
	layer.style.left = newLeft;
}



function hideLayer(layerName)
{
	document.getElementById(layerName).style.display = 'none';
	if(document.getElementById('errorFrame')) document.getElementById('errorFrame').style.display = 'none';
}


function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}


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