
/**
* SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
*
* SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
*/
/* This notice must be untouched at all times.
Copyright (c) 2002-2008 Walter Zorn. All rights reserved.

wz_tooltip.js	 v. 5.1

The latest version is available at
http://www.walterzorn.com
or http://www.devira.com
or http://www.walterzorn.de

Created 1.12.2002 by Walter Zorn (Web: http://www.walterzorn.com )
Last modified: 10.4.2008

Easy-to-use cross-browser tooltips.
Just include the script at the beginning of the <body> section, and invoke
Tip('Tooltip text') from the desired HTML onmouseover eventhandlers,
and UnTip(), usually from the onmouseout eventhandlers, to hide the tip.
No container DIV required.
By default, width and height of tooltips are automatically adapted to content.
Is even capable of dynamically converting arbitrary HTML elements to tooltips
by calling TagToTip('ID_of_HTML_element_to_be_converted') instead of Tip(),
which means you can put important, search-engine-relevant stuff into tooltips.
Appearance of tooltips can be individually configured
via commands passed to Tip() or TagToTip().

Tab Width: 4
LICENSE: LGPL

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License (LGPL) as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

For more details on the GNU Lesser General Public License,
see http://www.gnu.org/copyleft/lesser.html
*/

/*  Prototype JavaScript framework, version 1.5.1_rc3
 *  (c) 2005-2007 Sam Stephenson
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://www.prototypejs.org/
 *
/*--------------------------------------------------------------------------*/
				
Type.registerNamespace("GG");
GG.GM=function(childControl){GG.GM.initializeBase(this,[childControl,"grindTrashLinks"]);
this.grindIt=this.getChild("grinds","a");
this.trashIt=this.getChild("trashes","a");
this.trashCount=this.getChild("iconTrashes","span");
this.grindCount=this.getChild("iconGrinds","span");
};
GG.GM.Vote=function (control,contentID,isNoVote){if(!GG.CurrentUser.IsRegistered){GG.sendToLogin();return false;
}if(!GG.CurrentUser.IsVerified){GG.sendToUserVerification();return false;
}if(isNoVote){GG.GM.VoteNo(control,contentID);
}else {GG.GM.VoteYes(control,contentID);
}return false;
};
GG.GM.VoteYes=function(control,contentID){if(!GG.CurrentUser.IsRegistered){GG.sendToLogin();return false;
}if(!GG.CurrentUser.IsVerified){GG.sendToUserVerification();return false;
}var instance=new GG.GM(control);
if( instance.grindIt==null|| instance.trashIt==null)return false;
instance._voteYes(contentID);
return false;
};
GG.GM.VoteNo=function(control,contentID){if(!GG.CurrentUser.IsRegistered){GG.sendToLogin();return false;
}if(!GG.CurrentUser.IsVerified){GG.sendToUserVerification();return false;
}var instance=new GG.GM(control);
if( instance.grindIt==null|| instance.trashIt==null)return false;
instance._voteNo(contentID);
return false;
};
GG.GM.prototype={_voteYes:function(contentID){GG.WS.Vote("I",contentID,false);
var count=parseInt(this.grindCount.innerHTML)+1;
this.grindCount.innerHTML=count.toString();
this.trashIt.childNodes[0].innerHTML="Trashes";
this.trashIt.setAttribute("onclick","return false;");
this.trashIt.removeAttribute("href");
this.grindIt.childNodes[0].innerHTML="Grinds";
this.grindIt.setAttribute("onclick","return false;");
this.grindIt.removeAttribute("href");
this.executePostCommentRendering();
},_voteNo:function(contentID){GG.WS.Vote("I",contentID,true);
var count=parseInt(this.trashCount.innerHTML)+1;
this.trashCount.innerHTML=count.toString();
this.trashIt.firstChild.innerHTML="Trashes";
this.trashIt.setAttribute("onclick","return false;");
this.trashIt.removeAttribute("href");
this.grindIt.firstChild.innerHTML="Grinds";
this.grindIt.setAttribute("onclick","return false;");
this.grindIt.removeAttribute("href");
this.executePostCommentRendering();
},executePostCommentRendering:function(){if(typeof(pnlCommentGrindButtons)!="undefined"){var divCommentGrindButtons=$get(pnlCommentGrindButtons);
divCommentGrindButtons.style.display="none";
}if(typeof(btnSubmit)!="undefined"){var btnSubmitComment=$get(btnSubmit);
btnSubmitComment.style.display="block";
}if(typeof(lblAddComment)!="undefined"){var divAddComment=$get(lblAddComment);
divAddComment.innerHTML="Add Your Comment";
}}};
GG.GM.registerClass("GG.GM",GG.BaseControl);
Type.registerNamespace("GG");
Type.registerNamespace("GG.M");
GG.M.UPL=function(options){GG.M.UPL.initializeBase(this,[options]);
};
GG.M.UPL.Show=function(control,contentItemID,mediaID,modalOptions){if(GG.CurrentUser.IsRegistered==false){GG.sendToLogin();return false;
}if(typeof(modalOptions)=='undefined'){modalOptions={width:350}}new GG.M.UPL(modalOptions).load(contentItemID,mediaID);
return false;
};
GG.M.UPL.OnPLClick=function(plID){var callback=function(){alert("Item Added to Playlist");
};
var instance=GG.M.UPL.instance;
GG.WS.AddToPlaylist(instance.contentItemID, instance.mediaID,plID,true,callback);
instance.close();
};
GG.M.UPL.prototype={load:function(contentItemID,mediaID){var instance=GG.M.UPL.instance=this;
this.contentItemID=contentItemID;
this.mediaID=mediaID;
GG.renderControl("USERPLAYLIST",contentItemID,function(html){instance.body.className="imeemListModal";
instance.body.innerHTML=html;
instance.wrapper=$get("uplModalWrapper");
instance.scrollList= instance.getChild("playListScoller","div");
instance.list= instance.getChild("","ul");
var bounds=Sys.UI.DomElement.getBounds(instance.list);
var maxListHeight=250;
if(bounds.height>maxListHeight)instance.scrollList.style.height=maxListHeight+"px";
});
},okClick:function(){var txtName=$get("txtPlaylistName");
var callback=function(){alert("Item Added to Playlist");
};
GG.WS.CreatePlaylist(this.contentItemID,this.mediaID,txtName.value,callback);
this.close();
},close:function(){this.body.className="detailWrap";
GG.M.UPL.callBaseMethod(this,"close");
}};
GG.M.UPL.registerClass("GG.M.UPL",GG.Modal);
Type.registerNamespace("GG");
GG.SRCH=function(){};
GG.SRCH.Search=function(term){window.location='/Pages/Site/Search.aspx?q='+term+'&cat=all&type=any';
return false;
};
GG.SRCH.GroupSearch=function(term,groupUrl){window.location='/Pages/Site/Search.aspx?q='+term+'&cat=all&type=any&groupUrl='+groupUrl;
return false;
};
GG.SRCH.registerClass("GG.SRCH",null);
Type.registerNamespace("GG");
Type.registerNamespace("GG.M");
GG.M.W=function(options){GG.M.W.initializeBase(this,[options]);
};
GG.M.W.Show=function(control,widgetOptions,modalOptions){if(typeof(modalOptions)=='undefined'){modalOptions={width:350}}new GG.M.W(modalOptions).load(widgetOptions);
return false;
};
GG.M.W.prototype={load:function(widgetOptions){this.widgetOptions=widgetOptions;
var instance=this;
GG.ajax({type:"GET",url:String.format("/services/rendercontrol.ashx"),data:{t:'wm'},dataType:"html",success:function(html){instance.body.innerHTML=html;
instance.renderWidget();
}});
},renderWidget:function(){var opts=this.widgetOptions;
if(opts.xmlUrl){;
}else if(typeof(opts.user)!="undefined"){var action="";
switch(opts.hType){case "Submit":action="submitted";break;
case "Favorite":action="favorites";break;
default:alert("Widget does not support this history type");
}opts.xmlUrl=escape(String.format('http://{0}/rest/user/{1}/{2}',location.host,opts.user,action));
}else if(typeof(opts.cat)!="undefined"){if(opts.cat=="Discovered")opts.xmlUrl=String.format('http://{0}/rest/content/discovered',location.host);
else opts.xmlUrl=String.format('http://{0}/rest/content/discovered/{1}',location.host,opts.cat);
}var pAr=new Array();
for(var p in opts){pAr.push(p+"="+opts[p]);
}var widgetURL="http://"+location.host+"/swf/contentwidget.swf?"+pAr.join("&");
var widgetContainer=this.getChild("widgetWrapper","div");
var embedFormat='<div><object width="251" height="516" id="widgetFlash"><param name="allowScriptAccess" value="always" /><param name="type" value="application/x-shockwave-flash" /><param name="wmode" value="transparent" />'+'<param name="movie" value="{0}" />'+'<embed src="{0}" type="application/x-shockwave-flash"  width="251" height="516" allowScriptAccess="always" wmode="transparent"></embed></object></div>';
var embedCode=String.format(embedFormat,widgetURL);
widgetContainer.innerHTML=embedCode;
},okClick:function(){this.close();
}};
GG.M.W.registerClass("GG.M.W",GG.Modal);
Type.registerNamespace("GG");
GG.TG=function(childControl){GG.TG.initializeBase(this,[childControl,"sidebarRoundWrapper topGrinders"]);
};
GG.TG.Update=function(control,mode,categoryID){var instance=new GG.TG(control);
var container= instance.container;
if(container.parentNode.shouldRemove)container=container.parentNode;
GG.ajax({type:"GET",url:String.format("/services/rendercontrol.ashx"),data:{t:'tg',m:mode,cat:categoryID},dataType:"html",success:function(html){var div=document.createElement("div");
div.shouldRemove=true;
container.parentNode.insertBefore(div,container);
div.innerHTML=html;
container.parentNode.removeChild(container);
GG.parseFBML();
}});
return false;
};
GG.TG.prototype={};
GG.TG.registerClass("GG.TG",GG.BaseControl);
Sys.Application.notifyScriptLoaded();