window.onload=function(){
if(!NiftyCheck()) {
    return;
}
Rounded("div.nifty","all","#fff","#eee","smooth");
Rounded("div.nblue","all","#EEF2FB","#3D96D4","smooth");
}

function confirmLink(confirmMsg) {
    var is_confirmed = confirm(confirmMsg);
    return is_confirmed;
}


function confirmThis(q, a) {			
	if (confirm(q)) {
		window.location = a;
	};
}

function loadThumb(src, maxheight, maxwidth, curwidth, curheight) {
	var resized=false;
	var name = "td_" + src;
	
	if ( document.getElementById('active').value != "" ) {
		document.getElementById(document.getElementById('active').value).style.border = "1px solid #ddd";
	}
	
	if ( document.getElementById('orig_width') != null ) {
		document.getElementById('orig_width').value = curwidth;
		document.getElementById('orig_height').value = curheight;
	}
	
	document.getElementById('active').value = name;
	
	document.getElementById(name).style.border = "1px solid #0080FF";

	document.getElementById('gallery_image').width = curwidth;
	document.getElementById('gallery_image').height = curheight;
	document.getElementById('gallery_image').style.visibility = 'visible';
	document.getElementById('gallery_image').src = src;
	
	var width = document.getElementById('gallery_image').width;
	var height = document.getElementById('gallery_image').height;
	
	
	if ( width > maxwidth && width < height ) {
		var newwidth = maxwidth/width;
		document.getElementById('gallery_image').height = document.getElementById('gallery_image').height * newwidth;
		document.getElementById('gallery_image').width = document.getElementById('gallery_image').width * newwidth ;
		resized = true;
	
	}

	if ( resized == false ) {	
		if ( height > maxheight ) {
			var newwidth = maxheight/height;
			document.getElementById('gallery_image').height = document.getElementById('gallery_image').height * newwidth;
			document.getElementById('gallery_image').width = document.getElementById('gallery_image').width * newwidth ;
			var resized = true;
		}
	}


}
