// All script (C)1998-2006 Digital Photography Review
// Author: Phil Askey
// No code may be used elsewhere without permission
//

function findObj(n) {
	var x;
	
	d=document;
	if(!(x=d[n])&&d.all) x=d.all[n];
	if(!x && d.getElementById) x=d.getElementById(n);
	return x;
}

function addmerchantsshow() {
	if(navname == "Microsoft Internet Explorer") {
		findObj("hiddenmerch").style.display='block';
	} else {
		findObj("hiddenmerch").style.display='table-row-group';
	}
	findObj("hiddenmerchclick").style.display='none';
}

function reviewjump(obj) {
	var selected;
	
	selected=obj.options[obj.selectedIndex].value;
	window.location=selected;
}

function colswap(obj,id) {
	var lastobj,i;
	
	if(document.collastsel) {
		lastobj=document.collastsel;
	} else {
		lastobj=findObj("col_b1");
	}
	if(obj!=lastobj) {
		obj.className='tdcontentsm';
		lastobj.className='tdlabelsimpsm';
		document.collastsel=obj;
	}
	
	for(var x=1; x<=24; x++) {
		patchobj=findObj('col_p'+x);
		patchobj.style.background='#'+coldata[id-1][x];
	}
}

function coljump(obj) {
	var selected,curlocation;
	
	selected=obj.options[obj.selectedIndex].value;
	curlocation=location.href;
	if(curlocation.indexOf('?')!=-1) {
		curlocation=curlocation.substring(0,curlocation.indexOf('?'));
	}
	if(selected!=''){ 
		window.location=curlocation+'?color_compare='+selected;
	} else {
		if(curlocation!=location.href)
			window.location=curlocation;
	}
}

function imagePopup(obj,url) {
	x=AnchorPosition_getPageOffsetLeft(obj);
	y=AnchorPosition_getPageOffsetTop(obj);
	  
	popobj=findObj("imagepopdiv");
	imgobj=findObj("imagepopimg");
	
	imgobj.src='/images/one.gif';
	
	imgobj.src=url;
	popobj.style.left=x-120;
	popobj.style.top=y-90;
	
	popobj.style.visibility='visible';
}

function imagePopuphide() {
	popobj=findObj("imagepopdiv");
	popobj.style.visibility='hidden';
}

function imagePopupInit() {
	document.write ('<div style="position: absolute; z-index: 20; visibility: hidden; background: #333333; border: 1px solid #000000;" id="imagepopdiv" name="imagepopdiv">');
	document.write ('<img src="/images/one.gif" name="imagepopimg" id="imagepopimg" onClick="imagePopuphide()" onMouseOut="imagePopuphide()" class="img-border" style="cursor: pointer" title="Click to hide">');
	document.write ('</div>');
}
