
function scrollTo(selector) {
    var targetOffset = $(selector).offset().top;
    $('html,body').animate({scrollTop: targetOffset}, 1500);
}


$(document).ready(function(){

	$(".panelContents").after("<div class='panelContentsBack'></div>");
	
	var a = $("#homeProfilePanel").height();
	var b = $("#homeClientsPanel").height();
	if(b > a){
		$("#homeProfilePanel").height(b-50);	
	}

    $("#emailFriendClose").click(function () { 
      $(this).parent().parent().fadeOut(); 
    });
	
    $("#emailFriendLink").click(function () { 
      $("#emailToFriendDiv").fadeIn(); 
		loadAjaxData('email-to-friend.php', '#emailToFriendContents');
    });



	
}); 



function loadAjaxData(fileName, target){
	$(target).html("<img src='"+siteURL+"images/ajax-loader.gif' />");
	 $.ajax({
	   type: "POST",
	   url: siteURL+"ajax/"+fileName,
	   cache: false,
	   success: function(msg){
			$(target).html(msg);
	   }
	 });
}

if(direction == "ltr"){
	$(function () {
		$.sifr({path:siteURL+'fonts'});
		$('h1').sifr({font:'zahaffont-bold', color: '#026c6f', link: '#026c6f', hover: '#026c6f', textAlign: 'left', offsetLeft: 0, offsetTop: 0});	
		$('h2').sifr({font:'zahaffont-bold', color: '#fff', link: '#fff', hover: '#fff', textAlign: 'left', offsetLeft: 0, offsetTop: 0});
	});
}

function addToFavorites(urlAddress, pageName) { 
 title = pageName; 
 url = urlAddress;

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
} 




