_ge = function(id) {
	if(document.getElementById) {
		var elem = document.getElementById(id);
	} else if (document.all){
		var elem = document.all[id];
	}
	return elem;
};

/*-- zoom.js -----------------------------------------------------------------*/
// Some default settings
var actualWidth = 0;
var actualHeight = 0;
var startWidth = 0;
var startHeight = 0;
var ratio = 1.1;

/**
 * Zooms in and out "flashobj" layer (flashobject should have set width=height=100%)
 * 
 * @param int inout
 */
zoom = function(inout) {
	var obj = _ge('flashobj');
	if( actualWidth == 0 || actualHeight == 0 ) {
		actualWidth = obj.style.width.replace(/px/i,'');
		actualHeight = obj.style.height.replace(/px/i,'');
		startWidth = actualWidth;
		startHeight = actualHeight;
	}
	switch (inout) {
		case 1:
			var temp = actualWidth;
			actualWidth = Math.ceil(ratio*actualWidth);	
			actualHeight = Math.ceil((actualHeight*actualWidth)/temp);
		break;
		case -1:
			var temp = actualWidth;
			actualWidth = Math.ceil(actualWidth/ratio);	
			actualHeight = Math.ceil((actualHeight*actualWidth)/temp);		
		break;
	}
	obj.style.width = actualWidth+'px';
	obj.style.height = actualHeight+'px';
};

/**
 * Restores flashobjects start size
 */
resetZoom = function() {
	if( startWidth>0 && startHeight>0 ) {
		var obj = _ge('flashobj');
		actualWidth = 0;
		actualHeight = 0;
		obj.style.width = startWidth+'px';
		obj.style.height = startHeight+'px';		
	}
};

String.prototype.isEmpty = function() {
    if( this == "" || this == null || this == "undefined" ) {
        return true;
    }
    return false;
};

function isArray(obj) {
    if( typeof(obj) != "undefined" && obj != "" ) {
        return(typeof(obj.length)=="undefined")?false:true;
    }
    return false;
};
/**
 * Loads zoom navigation (if javascript enabled)
 */
/*
function loadZoomNavigation(zoom_images ) {

    var zn = '';
    zn = '<div id="zoom_toolbar" style="width: 50px !important; text-align: center;">' +
                '<div class="lupa">' +
                    '<a href="javascript:zoom(1);"><img src="'+zoom_images['data'][0].img+'" border="0" width="17" height="18" /><br />'+zoom_images['data'][0].text+'</a>' +
                '</div>' +
				'<div class="lupa">' +
					'<a href="javascript:zoom(-1);"><img src="'+zoom_images['data'][1].img+'" border="0" width="17" height="18" /><br />'+zoom_images['data'][1].text+'</a>' +
                '</div>' +
                '<div class="lupa">' +
                    '<a href="javascript:resetZoom();"><img src="'+zoom_images['data'][2].img+'" border="0" width="17" height="18" /><br />'+zoom_images['data'][2].text+'</a>' +
                '</div>' +
        '</div>';
    
    document.write(zn);
};*/
/*-- end zoom.js -------------------------------------------------------------*/
