/********************************************************************************************
* 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
 */ 


var image = new Array(); 
image[0] = new Array("oas","http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=920217&PA=1725424&HTML=http://www.onlyallsites.com"); 
image[1] = new Array("os","http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=920217&PA=1725433&HTML=http://www.only-secretaries.com");  
image[2] = new Array("oo","http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=920217&PA=1725430&HTML=http://www.only-opaques.com");  
image[3] = new Array("oas2","http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=920217&PA=1725424&HTML=http://www.onlyallsites.com"); 
image[4] = new Array("oas3","http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=920217&PA=1725424&HTML=http://www.onlyallsites.com"); 
image[5] = new Array("pr1","http://www.porn-rewards.com?ref=otppads"); 
image[6] = new Array("pr2","http://www.porn-rewards.com?ref=otppads"); 
image[7] = new Array("pr3","http://www.porn-rewards.com?ref=otppads"); 
image[8] = new Array("otcams1","https://www.otcams.com"); 
image[9] = new Array("otcams2","https://www.otcams.com"); 
image[10] = new Array("bs","http://www.babespotting.tv/?crid=2170849");
image[11] = new Array("oss","http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=920217&PA=1725424&HTML=http://www.onlysilkandsatin.com"); 
image[12] = new Array("oss2","http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=920217&PA=1725424&HTML=http://www.onlysilkandsatin.com"); 
image[13] = new Array("al1","http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=920217&PA=1725424&HTML=http://www.art-lingerie.com"); 
image[14] = new Array("al2","http://refer.ccbill.com/cgi-bin/clicks.cgi?CA=920217&PA=1725424&HTML=http://www.art-lingerie.com");
image[15] = new Array("bs2","http://www.babespotting.tv/?crid=2170849");
var im = image.length;


function pickRandom(range) 
{	
	if (Math.random) return Math.round(Math.random() * (range-1)); 
	else { 
		var now = new Date(); 
		return (now.getTime() / 1000) % range; 
	} 
} // Write out an IMG tag, using a randomly-chosen image name. 
var choice = pickRandom(im);


// URL zum kleinen Bild / URL to small image 
var pagearSmallImg = '/v2/pagepeel/'+image[choice][0]+'_s.jpg'; 
// URL zu pageear_s.swf / URL to small pageear swf
var pagearSmallSwf = '/v2/pagepeel/oas_s.swf'; 

// URL zum großen Bild / URL to big image
var pagearBigImg = '/v2/pagepeel/'+image[choice][0]+'_b.jpg'; 
// URL zu pageear_b.swf / URL to big pageear swf
var pagearBigSwf = '/v2/pagepeel/oas_b.swf'; 

// Wackelgeschwindigkeit der Ecke 1-4 (2=Standard) 
// Movement speed of small pageear 1-4 (2=Standard)
var speedSmall = 1; 
// 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 = 'ffffff';  
// Zu öffnende URL bei klick auf die geöffnete Ecke
// URL to open on pageear click
var jumpTo = image[choice][1];
// Ö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 = 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 = 20; 
// 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  = 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('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);
    var output = '';
	
	if (hasReqestedVersion) {  
		// Check direction 
		if(setDirection == 'lt') {
			xPosBig = 'left:-1000px';  
			xPos = 'left';      
		} else {
			xPosBig = 'right:1000px';
			xPos = 'right';              
		}
		
		// Write div layer for big swf
		output = output+'<div id="bigDiv" style="position:absolute;width:'+ bigWidth +'px;height:'+ bigHeight +'px;'+xPos+':0px;top:-1000px; display:block;">';    	
		
		// Check if flash exists/ version matched  	
		output = output+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"
		);
			
		// Close div layer for big swf
		output = output+'</div>'; 
		
		// Write div layer for small swf
		output = output+'<div id="thumbDiv" style="position:absolute;width:'+ thumbWidth +'px;height:'+ thumbHeight +'px;'+xPos+':0px;top:0px;">';
		
		// Check if flash exists/ version matched	
		output = output+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"
		);
		output = output+'</div>';  
		/*
		setTimeout('document.getElementById("bigDiv").style.top = "-1000px";',100);
		*/
	}
	if (document.getElementById('pageEar_frame')) {
		document.getElementById('pageEar_frame').innerHTML = output;
	}
}


