<!--
	var sThemeUrl 	= "http://www.projectweightloss.com/themes/projectweightloss_com";
	var sAjaxUrl 	= "http://www.projectweightloss.com/index.php";
	var NotiTimer 	= new Array;
	var BlindIDCount = 0;	
	function MM_preloadImages() { //v3.0
		var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}//MM_preloadImages
	function HS_LaunchIM(){
		url = MainURL+"modules/instant_messenger.php?action=launch";   
		imwin = window.open(url, "HSIM_CONSOLE", "width=250,height=350,scrollbars=no,menubar=no,resizable=no,location=no");
		imwin.focus();
	}//HS_LaunchIM
	function HS_LaunchChat(per_id){
		url = MainURL+"modules/instant_messenger.php?action=chat&per_id="+per_id;
		var newwin = window.open(url, per_id, "width=500,height=350,scrollbars=no,menubar=no,resizable=no,location=no");
		newwin.focus();
	}//HS_LaunchChat
	function HS_BuildBlind(){		
		BlindIDCount++;
		var BlindID = "BLIND_"+BlindIDCount;
		var BlindTemplate = document.getElementById("BLIND").innerHTML;
		var Temp = new Array;
		Temp = BlindTemplate.split("BLIND");
		BlindTemplate = Temp.join(BlindID);
		var BlindContent = "<table cellpadding='0' cellspacing='0' border='0'><tr><td style='padding-top:2px;'><div class='blind' id='"+BlindID+"'>"+BlindTemplate+"</div></td></tr></table>";
		var BlindsHandler = document.getElementById("blinds_panel");
		if(BlindsHandler.offsetHeight >= 117){
			BlindsHandler.style.top = parseInt(BlindsHandler.style.top) - 117;
		}//if
		else{
			BlindsHandler.style.top = parseInt(BlindsHandler.style.top) - 117 + BlindsHandler.offsetHeight;
		}//else
		BlindsHandler.innerHTML+= BlindContent;
		return BlindID;
	}//HS_BuildBlind
	function HS_BuildNotification(NotiType,NotiMessage){
		BlindID = HS_BuildBlind();
		switch(NotiType){
			case 'im':
				var IconImage   = sThemeUrl+"/gfx/icons/notifications/im.gif";
				var HeaderImage = sThemeUrl+"/gfx/sectionheaders/notifications/im.gif";
				var Link = "<a href=\"javascript:HS_LaunchIM();\">"+NotiMessage+"</a>";
				break;
			case 'calendar':
				var IconImage   = sThemeUrl+"/gfx/icons/notifications/calendar.gif";
				var HeaderImage = sThemeUrl+"/gfx/sectionheaders/notifications/calendar.gif";				
				var Link = "<a href=\"http://www.projectweightloss.com/index.php?page=calendar\" target=\"_blank\">"+NotiMessage+"</a>";
				break;
			case 'mailbox':
				var IconImage   = sThemeUrl+"/gfx/icons/notifications/mailbox.gif";
				var HeaderImage = sThemeUrl+"/gfx/sectionheaders/notifications/mailbox.gif";
				var Link = "<a href=\"http://www.projectweightloss.com/index.php?page=mailbox&section=inbox\" target=\"_blank\">"+NotiMessage+"</a>";
				break;
			case 'view':
				var IconImage   = sThemeUrl+"/gfx/icons/notifications/eye.gif";
				var HeaderImage = sThemeUrl+"/gfx/sectionheaders/notifications/profile.gif";
				var Link = "<a href=\"http://www.projectweightloss.com/index.php?page=views\" target=\"_blank\">"+NotiMessage+"</a>";
				break;
		}//switch
		var MessageHandler = document.getElementById("notification_message_"+BlindID);
		MessageHandler.innerHTML = Link;
		var IconHandler = document.getElementById("notification_icon_"+BlindID);
		IconHandler.src= IconImage;
		var HeaderHandler = document.getElementById("notification_header_"+BlindID);
		HeaderHandler.src = HeaderImage;		
		HS_FadeBlind(BlindID,"in");
		NotiTimer[BlindID] = setTimeout("HS_FadeBlind('"+BlindID+"','out')",10000);
	}//HS_BuildNotification
	function HS_FadeBlind(BlindID,Direction){		
		var Timer = 0;
		var Speed = 50;		
		if(Direction == "in"){
			HS_ChangeAlign('blinds_panel',3);
			for(var i=10;i<=100;i=i+10){
				setTimeout("HS_ChangeOpacity(" + i + ",'" + BlindID + "')",(Timer * Speed)); 
            	Timer++;
			}//for
		}//if
		else if(Direction == "out"){			
			for(var i=90;i>=0;i=i-10){
				setTimeout("HS_ChangeOpacity(" + i + ",'" + BlindID + "')",(Timer * Speed)); 				
            	Timer++;
			}//for
			setTimeout("HS_ChangeAlign('blinds_panel',1)",Timer * Speed);
			setTimeout("HS_RemoveBlind('"+BlindID+"')",Timer * Speed);
		}//else if
	}//HS_FadeBlind
	function HS_ChangeOpacity(OpacityValue,BlindID){		
		var BlindObjStyle = document.getElementById(BlindID).style;
    	BlindObjStyle.opacity = (OpacityValue / 100); 
    	BlindObjStyle.MozOpacity = (OpacityValue / 100); 
    	BlindObjStyle.KhtmlOpacity = (OpacityValue / 100); 
    	BlindObjStyle.filter = "alpha(opacity=" + OpacityValue + ")"; 
	}//HS_ChangeOpacity
	function HS_PosBlinds(){
		var ns = (document.layers)?1:0;
		var Position = new Array;		
		if(ns){
			Position['Left'] = window.innerWidth + window.pageXOffset - 5;
			Position['Top']  = window.innerHeight + window.pageYOffset - 5;
		}//if
		else{
			Position['Left'] = document.body.clientWidth + document.body.scrollLeft - 5;
			Position['Top']  = document.body.clientHeight + document.body.scrollTop - 5;
		}//else
		var BlindsPanel = document.getElementById("blinds_panel");
		BlindsPanel.style.top = Position['Top'] - BlindsPanel.offsetHeight;
		BlindsPanel.style.left = Position['Left'] - 180;
		setTimeout("HS_PosBlinds()",500);
	}//HS_PosBlinds
	function HS_ChangeAlign(BlindID,Pos){	
		var BlindObjStyle = document.getElementById(BlindID).style;
		BlindObjStyle.zIndex = Pos;
	}//HS_ChangeAlign
	function HS_RemoveBlind(BlindID){
		var BlindObj = document.getElementById(BlindID);
		BlindObj.innerHTML = "";
	}//HS_RemoveBlind
	function HS_CloseNotification(BlindID){
		clearTimeout(NotiTimer[BlindID]);
		HS_FadeBlind(BlindID,'out');
	}//HS_CloseNotification
//-->
