function effectPic(id,f){
	switch (f){
		case "over":
			$(id).fadeTo("slow", 0.66);
			//$(id).width($(id).width()*1.05);
		break;
		case "out":
			$(id).fadeTo("slow", 1);
			//$(id).width($(id).width()/1.05);
		break;
		default:
	}//end switch
	
}
function dragEff(id,action){
	if(action=="dragAndClone"){
			$(id).draggable({
				helper: 'clone',
				effect: ['fade', 'fade']
			});
	}else if(action=="dragAndComeBack"){
			$(id).draggable({
				revert: true,
				drag: function(e, ui) {
					var centerx = 291, centery = 100;
					var angle = Math.atan((centery-ui.position.top)/(centerx-ui.position.left));
					if((centerx-ui.position.left)>=0)
						angle += Math.PI;
					var radius = 160;
					return {
						left: radius * Math.cos(angle) + centerx, 
						top: radius * Math.sin(angle) + centery
					}
				}
			});
	}
}
function ___getPageSize() {
			var xScroll, yScroll;
			if (window.innerHeight && window.scrollMaxY) {	
				xScroll = window.innerWidth + window.scrollMaxX;
				yScroll = window.innerHeight + window.scrollMaxY;
			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
				xScroll = document.body.scrollWidth;
				yScroll = document.body.scrollHeight;
			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
				xScroll = document.body.offsetWidth;
				yScroll = document.body.offsetHeight;
			}
			var windowWidth, windowHeight;
			if (self.innerHeight) {	// all except Explorer
				if(document.documentElement.clientWidth){
					windowWidth = document.documentElement.clientWidth; 
				} else {
					windowWidth = self.innerWidth;
				}
				windowHeight = self.innerHeight;
			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
				windowWidth = document.documentElement.clientWidth;
				windowHeight = document.documentElement.clientHeight;
			} else if (document.body) { // other Explorers
				windowWidth = document.body.clientWidth;
				windowHeight = document.body.clientHeight;
			}	
			// for small pages with total height less then height of the viewport
			if(yScroll < windowHeight){
				pageHeight = windowHeight;
			} else { 
				pageHeight = yScroll;
			}
			// for small pages with total width less then width of the viewport
			if(xScroll < windowWidth){	
				pageWidth = xScroll;		
			} else {
				pageWidth = windowWidth;
			}
			arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
			return arrayPageSize;
		};
		
function showMOV(p,t){
	var imageBtnClose='images/lightbox-btn-close.gif';
	$('embed, object, select').hide();
		$('#footerText').hide();
		$('body').append('<div id="overlay"></div><div id="lightbox"><object id="movShow"  name="movShow" width="650" height="350" type="video/quicktime" data="'+p+'"wmod="transparent" controller="true"  scale="tofit"  ></object><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + imageBtnClose + '"></a></div></div>');
		 var arrPageSizes = ___getPageSize();
		 $('#overlay').css({
			backgroundColor:	'#CBE6EA',
			opacity:0.5,
			width:arrPageSizes[0],
			height:arrPageSizes[1]
		}).fadeIn();
		 $('#lightbox-image-details-caption').html("<p>Please, wait about 30sec.</p><p>These 360 virtual tours are interactive, you can use your mouse to view in any direction.</p><p>Ctrl = Zoom Out, Shift = Zoom In</p>");
		 $('#lightbox').css({top:"20%",left:"20%",width:($.browser.msie)?650:630,height:"20%"});
		 $('#lightbox-secNav-btnClose').click(function() {
				_finish();
				return false;
			});
		 scrollTo(0,0);
		 $(window).resize(function() {
				var arrPageSizes = ___getPageSize();
				$('#overlay').css({
					width:arrPageSizes[0],
					height:arrPageSizes[1]
				});
			});
	}
function _finish() {
			$('#lightbox').remove();
			$('#movShow').remove();
			$('#overlay').fadeOut(function() { $('#overlay').remove(); });
			$('embed, object, select').show();
			$('#footerText').show();
		}
function g(a){  
     if (document.getElementById) {
         return document.getElementById(a);  
     }else if (document.all) {
         return document.all[a];  
     }else  {
         return null;  
	}
 }  
 