/*\------------------------------------------------------------------------

	>> blogs.sync.gr
	>> 24/01/07				
	>> Kostis Sakkas				
		
------------------------------------------------------------------------\*/


//window.onload	= function() {externalLinks(); allthetooltips();Tabs.Init()}
window.onresize = function() { }
		


/*\------------------------------------------------------------------------
	
	CALL THE TOOLTIPS
	
------------------------------------------------------------------------\*/


allthetooltips	=	function(){
	if($('tip-pop-blogs'))	var popularBlogsTooltip = new Tooltip('tip-pop-blogs', 'tip-pop-blogs-data');
	if($('tip-pop-searches'))	var popSearchesTooltip = new Tooltip('tip-pop-searches', 'tip-pop-searches-data');
	if($('tip-cloud-searches'))	var popSearchesTooltip = new Tooltip('tip-cloud-searches', 'tip-cloud-searches-data');
	if($('tip-podcasts'))	var podcastsTooltip = new Tooltip('tip-podcasts', 'tip-podcasts-data');
	if($('tip-favs'))	var favoritesTooltip = new Tooltip('tip-favs', 'tip-favs-data');
}




/*\------------------------------------------------------------------------
	
	Opens new windows for the minitor widget
	
------------------------------------------------------------------------\*/


minitor = function(host, action, string){
	if(('search' == action) && ('' != string))
		newwindow=window.open('http://'+host+'/minitor/search/'+string+'/', 'minitor', 'resizable=1,toolbar=0,location=0,status=0,menubar=0,scrollbars=0,width=310,height=500');
	else
		newwindow=window.open('http://'+host+'/minitor/'+action+'/', 'minitor', 'resizable=1,toolbar=0,location=0,status=0,menubar=0,scrollbars=0,width=310,height=500');
	newwindow.focus();
}

	
termsofuse = function(){
	newwindow=window.open('http://www.sync.gr/terms.php', 'terms', 'resizable=1,toolbar=0,location=0,status=0,menubar=0,scrollbars=yes,width=700,height=450');
	newwindow.focus();
};
	
privacypolicy = function(){
	newwindow=window.open('http://www.sync.gr/privacy.php', 'privacy', 'resizable=1,toolbar=0,location=0,status=0,menubar=0,scrollbars=yes,width=700,height=450');
	newwindow.focus();
};



/*\------------------------------------------------------------------------
	
	gives focus and redirects the parent window
	
------------------------------------------------------------------------\*/

gotoParent = function(url) { 
	if('' != url){
		window.opener.parent.location = url; 
		window.opener.focus();
	}
	else
		return null;
} 



/*\------------------------------------------------------------------------
	
	Opens new windows via rel="external"
	url : http://www.brucelawson.co.uk/index.php/2005/opening-links-in-new-windows-in-xhtml-strict/
	
------------------------------------------------------------------------\*/

function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors .length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank";
			anchor.title = (anchor.title != "") ? anchor.title+" (Ανοίγει σε νέο παράθυρο)" : "Ανοίγει σε νέο παράθυρο";
			anchor.className = (anchor.className != '') ? anchor.className+' external' : 'external';
		}
	}
}

FastInit.addOnLoad(externalLinks ,allthetooltips ,Tabs.Init);
