/********************************************************************************************
* PageEar advertising CornerAd by Webpicasso Media
* Leave copyright notice.  
*
* Lizenzvereinbarung / License agreement
* http://www.webpicasso.de/blog/lizenzvereinbarungen-license-agreements/
*
* @copyright www.webpicasso.de
* @author    christian harz <pagepeel-at-webpicasso.de>
*********************************************************************************************/
  

/*
 *  Konfiguration / Configuration
 */ 

// URL zum kleinen Bild / URL to small image 
var pagearSmallImg = '/typo3conf/ext/nb_pageear/inc/img/pageear_s.jpg'; 
// URL zu pageear_s.swf / URL to small pageear swf
var pagearSmallSwf = '/typo3conf/ext/nb_pageear/inc/swf/pageear_s.swf'; 

// URL zum gro�en Bild / URL to big image
var pagearBigImg = '/typo3conf/ext/nb_pageear/inc/img/pageear_b.jpg'; 
// URL zu pageear_b.swf / URL to big pageear swf
var pagearBigSwf = '/typo3conf/ext/nb_pageear/inc/swf/pageear_b.swf'; 

// 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 = 'false'; 
// Farbe der aufgeschlagenen Ecke wenn mirror false ist
// Color of pagecorner if mirror is false
var pageearColor = 'E1E200';  
// Zu �ffnende URL bei klick auf die ge�ffnete Ecke
// URL to open on pageear click
var jumpTo = 'javascript:showBookOrderLayer()'; 
// �ffnet den link im neuen Fenster (new) oder im selben (self)
// Browser target  (new) or self (self)
var openLink = 'self'; 
// �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 = true; 
// Sekunden bis sich das pagepeel wieder schlie�t, funktioniert nur im Zusammenhang mit der openOnLoad-Funktion 
// Second until pageear close after openOnLoad
var closeOnLoad = 5; 
// 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 = 'rt'; 
// 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  = 200;
var bigHeight = 200;

// 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 () 
{ 
    if(setDirection == 'lt') 
    {
        xPosBig = 'left:-1000px';  
        xPos = 'left';   
    } 
    else
    {
        xPosBig = 'right:1000px';
        xPos = 'right';              
    }
    
    $('bigDiv').setStyle('width',bigWidth);
    $('bigDiv').setStyle('height',bigHeight);
    $('thumbDiv').setStyle('width',thumbWidth);
    $('thumbDiv').setStyle('height',thumbHeight);
    $('thumbDiv').setStyle('right',0);
    
	var params = {};
	params.quality = "high";
	params.wmode = "transparent";
	params.allowscriptaccess = "always";
	
	var attributes = {};
	attributes.name = "bigSwf";
	attributes.align = "middle";
	
	swfobject.embedSWF(pagearBigSwf+'?'+ queryParams, "bigDiv-inner", bigWidth, bigHeight, "9.0.0", false, false, params, attributes);
	swfobject.embedSWF(pagearSmallSwf+'?'+ queryParams, "thumbDiv-inner", thumbWidth, thumbHeight, "9.0.0", false, false, params, attributes);
}