<!--
	
/*
This code is from Dynamic Web Coding 
at http://www.dyn-web.com/
Copyright 2001-3 by Sharon Paine 
See Terms of Use at http://www.dyn-web.com/bus/terms.html
Permission granted to use this code 
as long as this entire notice is included.
*/

// resize fix for ns4
var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

var infoLyr;
function initInfoLyr(aId, imgId, title, tech, price) {
	// call constructor to create write layer
	// arguments: id, width, height
	// be sure to set height large enough or ns4 will clip it off
	infoLyr = new writeObj('imgDiv',316,316);
	showInfo(aId, imgId, title, tech, price);
}

function showInfo(aId, imgId, title, tech, price) {
	if (!infoLyr) return;
	var info = '<div class="info"><img src="img/art/'+aId+'/'+aId+'_'+imgId+'.jpg">';
	if (title != '') {
		info += '</div>';
	}
	info += '<br><br><b>'+title+'</b>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;'+tech+'&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;Pris:&nbsp;'+price+'<br><br><div align="right">» <a href="javascript:;" onclick="javascript:showBigArt(\''+aId+'\', \''+imgId+'\');" class="textMain">Visa högupplöst</a></div>';
	infoLyr.writeLyr(info);
}
		
function initScrollLayer() {
	  // arguments: id of layer containing scrolling layers (clipped layer), id of layer to scroll, 
	  // if horizontal scrolling, id of element containing scrolling content (table?)
	  	var wndo1 = new dw_scrollObj('wn1', 'lyr1', 't1');
	  
	 	// arguments: dragBar id, track id, axis ("v" or "h"), x offset, y offset
	  	// (x/y offsets of dragBar in track)
	  	wndo1.setUpScrollbar("dragBar1", "track1", "h", 1, 1);
	  
	  // Read instructions if your scrolling layers are inside tables 
	}

function wrapContent(e, img, w, h, title, tech, price, txt, wd, offx, offy) {
  var imgStr, cntnt, win, str;
  imgStr = '<img src="' + img + '"' + (w? ' width="' + w + '"': "") + (h? ' height="' + h + '"': "") + '>';
  if ( dragObj.supported && typeof document.body.innerHTML != "undefined" ) {
    cntnt = '<div class="img"><table bgcolor="#FFFFFF" cellspacing="0" cellpadding="5" height="100%"><tr><td class="textMain" style="border: 2px solid #CCCCCC">' + imgStr + '<br><br><b>'+title+'</b>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;'+tech+'&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;Pris:&nbsp;'+price+'<br><br></td></tr></table></div>';
    if (txt) cntnt += '<div class="msg">' + txt + '</div>';  
    if (!wd) wd = w; 
    writeDrag.set(e, cntnt, wd, offx, offy);
  } else { // non-capable browsers will open sub window
    w = w+80 || wd || 250; h = h+80 || 250; // size
    win = window.open('', 'subwin', 'resizable,width='+w+',height='+h+',left=100,top=100');
    if (win && !win.closed) win.resizeTo(w,h); 
    str = '<html><head><title>Image Display</title></head>';
  	str += '<body style="text-align:center">';
    str += imgStr + (txt? '<p><table bgcolor="#FFFFFF" cellspacing="0" cellpadding="5" height="100%"><tr><td class="textMain" style="border: 2px solid #CCCCCC">' + txt + '</td></tr></table></p>':"");
  	str += '</body></html>'
  	win.document.write(str);
  	win.document.close();
    if (win && !win.closed) win.focus(); 
  } 
  return false;
}
	
//-->
