﻿
// Scripts per la condivisione sui social network
function facebookShare()
{
	window.open('externalLinkSocial.aspx?url=http://www.facebook.com/sharer.php?u='+location.href,"Condividi","resizable=0,height=400,width=550,scrollbar=0");	
}


function deliciousShare()
{
	window.open('externalLinkSocial.aspx?url=http://delicious.com/post?url='+location.href,"Condividi","resizable=0,height=700,width=900,scrollbar=0");	
}

function okNotizieShare()
{
	window.open('externalLinkSocial.aspx?url=http://oknotizie.alice.it/post?url='+location.href,"Condividi","resizable=0,height=700,width=800,scrollbar=0");	
}

function mySpaceShare()
{
	window.open('externalLinkSocial.aspx?url=http://www.myspace.com/Modules/PostTo/Pages/?u='+location.href,"Condividi","resizable=0,height=700,width=550,scrollbar=0");	
}


function technoratiShare()
{
	window.open('externalLinkSocial.aspx?url=http://technorati.com/faves/?add='+location.href,"Condividi","height=920,width=1024,scrollbar=0");	
}
function diggShare()
{
	window.open('externalLinkSocial.aspx?url=http://digg.com/submit?phase=2&url='+location.href,"Condividi","height=900,width=1024");	
}
http://twitthis.com/twit?url=http%3A%2F%2Fwww.estetica-design-forum.com%2Fgraphic-design-forum-announcements%2F22202-forum-social-bookmarking-twitter-added.html%23199136


function twitterShare()
{
	window.open('externalLinkSocial.aspx?url=http://twitter.com/home/?status='+document.title+" - "+location.href,"Condividi","height=905,width=780");	
}

function Preferiti()
{
    var title = document.title;
    var url = document.location.href;
    if (window.sidebar) // Mozilla Firefox
    {
        window.sidebar.addPanel(title, url, "");
    }
    else if (window.external) // Internet Explorer
    {
        window.external.AddFavorite(url, title);
    }
    else if (window.opera && window.print) // Opera
    {
        var elem = document.createElement('a');
        elem.setAttribute('href', url);
        elem.setAttribute('title', title);
        elem.setAttribute('rel', 'sidebar');
        elem.click();
    }
}
//**************************************************************************
// Script per Pagepeel
//**************************************************************************



/*
 *  Konfiguration / Configuration
 */ 

// URL zum kleinen Bild / URL to small image 
var pagearSmallImg = 'pagePeel/pageear_s.jpg'; 
// URL zu pageear_s.swf / URL to small pageear swf
var pagearSmallSwf = 'pagePeel/pageear_s'; 

// URL zum großen Bild / URL to big image
var pagearBigImg = 'pagePeel/pageear_b.jpg'; 
// URL zu pageear_b.swf / URL to big pageear swf
var pagearBigSwf = 'pagePeel/pageear_b'; 

// Wackelgeschwindigkeit der Ecke 1-4 (2=Standard) 
// Movement speed of small pageear 1-4 (2=Standard)
var speedSmall = 4; 
// Bild spiegelt sich in der aufgeschlagenen Ecke ( true | false )
// Mirror image ( true | false )
var mirror = 'true'; 
// Farbe der aufgeschlagenen Ecke wenn mirror false ist
// Color of pagecorner if mirror is false
var pageearColor = '000000';  
// Zu öffnende URL bei klick auf die geöffnete Ecke
// URL to open on pageear click
var jumpTo = 'Statiche/Compra1gioca7/index.html' 
// Öffnet den link im neuen Fenster (new) oder im selben (self)
// Browser target  (new) or self (self)
var openLink = 'new'; 
// Öffnet das pagepeel automatisch wenn es geladen ist (false:deaktiviert | 0.1 - X Sekunden bis zum öffnen) 
// Opens pageear automaticly (false:deactivated | 0.1 - X seconds to open) 
var openOnLoad = false; 
// Sekunden bis sich das pagepeel wieder schließt, funktioniert nur im Zusammenhang mit der openOnLoad-Funktion 
// Second until pageear close after openOnLoad
var closeOnLoad = 3; 
// Ecke in der das Pagepeel erscheinen soll (lt: linke obere Ecke | rt: rechte obere Ecke )
// Set direction of pageear in left or right top browser corner (lt: left | rt: right )
var setDirection = 'lt'; 
// Weiches einblenden des pageear wenn Bild geladen (0-5: 0=aus, 1=langsam, 5=schnell )
// Fade in pageear if image completly loaded (0-5: 0=off, 1=slow, 5=fast )
var softFadeIn = 1; 
 
 
/*
 *  Ab hier nichts mehr ändern  / Do not change anything after this line
 */ 

// Flash check vars
var requiredMajorVersion = 6;
var requiredMinorVersion = 0;
var requiredRevision = 0;

// Copyright
var copyright = 'Webpicasso Media, www.webpicasso.de';

// Size small peel 
var thumbWidth  = 100;
var thumbHeight = 100;

// Size big peel
var bigWidth  = 500;
var bigHeight = 500;

// Css style default x-position
var xPos = 'right';

// GET - Params
var queryParams = 'pagearSmallImg='+escape(pagearSmallImg); 
queryParams += '&pagearBigImg='+escape(pagearBigImg); 
queryParams += '&pageearColor='+pageearColor; 
queryParams += '&jumpTo='+escape(jumpTo); 
queryParams += '&openLink='+escape(openLink); 
queryParams += '&mirror='+escape(mirror); 
queryParams += '&copyright='+escape(copyright); 
queryParams += '&speedSmall='+escape(speedSmall); 
queryParams += '&openOnLoad='+escape(openOnLoad); 
queryParams += '&closeOnLoad='+escape(closeOnLoad); 
queryParams += '&setDirection='+escape(setDirection); 
queryParams += '&softFadeIn='+escape(softFadeIn); 


function openPeel(){
	document.getElementById('bigDiv').style.top = '0px'; 
	document.getElementById('bigDiv').style[xPos] = '0px';
	document.getElementById('thumbDiv').style.top = '-1000px';
}

function closePeel(){
	document.getElementById("thumbDiv").style.top = "0px";
	document.getElementById("bigDiv").style.top = "-1000px";
}

function writeObjects () { 
    
    // Get installed flashversion
    //var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
    
    // Check direction 
    if(setDirection == 'lt') {
        xPosBig = 'left:-1000px';  
        xPos = 'left';   
    } else {
        xPosBig = 'right:1000px';
        xPos = 'right';              
    }
    
    // Write div layer for big swf
    document.write('<div id="bigDiv" style="position:absolute;width:'+ bigWidth +'px;height:'+ bigHeight +'px;z-index:9999;'+xPosBig+';top:-100px;">');    	
    
    // Check if flash exists/ version matched
    if (true) {    	
    	AC_FL_RunContent(
    				"src", pagearBigSwf+'?'+ queryParams,
    				"width", bigWidth,
    				"height", bigHeight,
    				"align", "middle",
    				"id", "bigSwf",
    				"quality", "high",
    				"bgcolor", "#FFFFFF",
    				"name", "bigSwf",
    				"wmode", "transparent",
    				"allowScriptAccess","always",
    				"type", "application/x-shockwave-flash",
    				'codebase', 'http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab',
    				"pluginspage", "http://www.adobe.com/go/getflashplayer"
    	);
    } else {  // otherwise do nothing or write message ...    	 
    	document.write('no flash installed');  // non-flash content
    } 
    // Close div layer for big swf
    document.write('</div>'); 
    
    // Write div layer for small swf
    document.write('<div id="thumbDiv" style="position:absolute;width:'+ thumbWidth +'px;height:'+ thumbHeight +'px;z-index:9999;'+xPos+':0px;top:0px;">');
    
    // Check if flash exists/ version matched
    if (true) {    	
    	AC_FL_RunContent(
    				"src", pagearSmallSwf+'?'+ queryParams,
    				"width", thumbWidth,
    				"height", thumbHeight,
    				"align", "middle",
    				"id", "bigSwf",
    				"quality", "high",
    				"bgcolor", "#FFFFFF",
    				"name", "bigSwf",
    				"wmode", "transparent",
    				"allowScriptAccess","always",
    				"type", "application/x-shockwave-flash",
    				'codebase', 'http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab',
    				"pluginspage", "http://www.adobe.com/go/getflashplayer"
    	);
    } else {  // otherwise do nothing or write message ...    	 
    	document.write('no flash installed');  // non-flash content
    } 
    document.write('</div>');  
    setTimeout('document.getElementById("bigDiv").style.top = "-1000px";',100);
}

//Cookie management 
function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}


function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

function checkCookie()
{
username=getCookie('username');
if (username!=null && username!="")
  {
  alert('Welcome again '+username+'!');
  }
else
  {
  username=prompt('Please enter your name:',"");
  if (username!=null && username!="")
    {
    setCookie('username',username,365);
    }
  }
}

//Main Function 
//this function allow the use of a cookie to show the pagePeel one time a day, use it if you want to limit the impression of the script.
function writeobjectCookie()
{
	var exists = getCookie('pagePeel');
	if (exists != 'pagePeel')
	{
		writeObjects();
		setCookie('pagePeel','pagePeel',1);
		
	}	
	
	
	
}
//*****************************************************************
// fine pagePeel
//*****************************************************************