// JavaScript Document


function changePicture( _sFile, _sCaption, _Id ) {

	if ( document.getElementById( 'picture' + _Id ) ) {
		var _oImage = new Image() ;
		var _sParameter = '' ;
		
//		_oImage.src = _sFile ;
//
//		var _iNewHeight = 180 / ( _oImage.width / _oImage.height ) ;
//		var _iNewWidth  = 120 / ( _oImage.height / _oImage.width ) ;
//		 	
//		if ( _oImage.width > 180 || _oImage.height > 120 ) {
//			if ( _oImage.width > _oImage.height && _iNewHeight < 120 ) {
				_sParameter = '&width=500' ;
//			}
//			else {
//				_sParameter = '&height=268' ;
//			}  
//		}
	
		document.getElementById( 'picture' + _Id ).innerHTML = '<img alt="" border="0" name="image' + _Id + '" src="img.resize.php?path=' + _sFile + _sParameter + '" title="" />' ;
		
	}
	
	if ( document.getElementById( 'caption' + _Id ) ) {
		document.getElementById( 'caption' + _Id ).innerHTML = _sCaption.length == 0 ? '&nbsp;<br/>' : _sCaption ;
	}
}

function changePicturesmall( _sFile, _sCaption, _Id ) {

	if ( document.getElementById( 'picture' + _Id ) ) {
		var _oImage = new Image() ;
		var _sParameter = '' ;
		
//		_oImage.src = _sFile ;
//
//		var _iNewHeight = 180 / ( _oImage.width / _oImage.height ) ;
//		var _iNewWidth  = 120 / ( _oImage.height / _oImage.width ) ;
//		 	
//		if ( _oImage.width > 180 || _oImage.height > 120 ) {
//			if ( _oImage.width > _oImage.height && _iNewHeight < 120 ) {
				_sParameter = '&width=230' ;
//			}
//			else {
//				_sParameter = '&height=268' ;
//			}  
//		}
	
		document.getElementById( 'picture' + _Id ).innerHTML = '<img alt="" border="0" name="image' + _Id + '" src="img.resize.php?path=' + _sFile + _sParameter + '" title="" />' ;
		
	}
	
	if ( document.getElementById( 'caption' + _Id ) ) {
		document.getElementById( 'caption' + _Id ).innerHTML = _sCaption.length == 0 ? '&nbsp;<br/>' : _sCaption ;
	}
}


function changePicturemedium( _sFile, _sCaption, _Id ) {

	if ( document.getElementById( 'picture' + _Id ) ) {
		var _oImage = new Image() ;
		var _sParameter = '' ;
		
//		_oImage.src = _sFile ;
//
//		var _iNewHeight = 180 / ( _oImage.width / _oImage.height ) ;
//		var _iNewWidth  = 120 / ( _oImage.height / _oImage.width ) ;
//		 	
//		if ( _oImage.width > 180 || _oImage.height > 120 ) {
//			if ( _oImage.width > _oImage.height && _iNewHeight < 120 ) {
				_sParameter = '&width=250' ;
//			}
//			else {
//				_sParameter = '&height=268' ;
//			}  
//		}
	
		document.getElementById( 'picture' + _Id ).innerHTML = '<img alt="" border="0" name="image' + _Id + '" src="img.resize.php?path=' + _sFile + _sParameter + '" title="" />' ;
		
	}
	
	if ( document.getElementById( 'caption' + _Id ) ) {
		document.getElementById( 'caption' + _Id ).innerHTML = _sCaption.length == 0 ? '&nbsp;<br/>' : _sCaption ;
	}
}

