function onBtn(obj) {
	obj.style.backgroundColor = '#ffffff';
}

function ofBtn(obj) {
	obj.style.backgroundColor = '#8cc540';
}

function openWin(ur, w, h, id) {
	try { window.img_opened.focus(); if (window.prof_opened.closed) throw 'â€¦' }
	catch(e) { window.img_opened = window.open(ur+'', id,'width='+w+',height='+h+',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0,resizable=0, left='+((self.screen.availWidth-w)/2)+', top='+((self.screen.availHeight-h)/2)); } 

	
	return false;
}



function changeToImage(xsrc, xdest) {
	document[xdest].src = xsrc;
	return false;
}

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function getBorderedImage(yimg, sourcediv, width, height) {
	var w = parseInt(width);
	var h = parseInt(height);
	var vertq = 700 - w;
	vertq = (vertq/700);
	
	var vert_new = parseInt(20-(20*vertq));
	
	var horq = (500 - h);
	horq = (horq/500);
	
	var hor_new = parseInt(24-(24*horq));
	
	
	if ($.browser.msie) {
		jQuery('#'+yimg).attr('style', 'z-index: -2; margin-bottom:-'+(h+vert_new)+'px; margin-left: -'+hor_new+'px;');
		jQuery('#'+sourcediv).attr('style', 'position: static; width: '+w+'px; padding-left: '+hor_new+'px; padding-bottom: '+vert_new+'px;');
		jQuery('#'+sourcediv).width(w+'px');
	} else {
		jQuery('#'+yimg).attr('style', 'z-index: -2; position: absolute; margin-top: -'+vert_new+'px; margin-left: -'+hor_new+'px');
		jQuery('#'+sourcediv).attr('style', 'position: relative');
		jQuery('#'+sourcediv).width(w+'px');
	}
	jQuery('#'+yimg).width(w+(hor_new*2)+'px');
	jQuery('#'+yimg).height(h+(vert_new*2)+'px');
	
	
}
