var myko_lg = 'en';
if (typeof mykotools_url == "undefined") var mykotools_url = 'http://media.mykodial.com/';
if (typeof mykoDesign == "undefined") var mykoDesign = 1;
if (typeof mykoSound == "undefined") var mykoSound = 0;
if (typeof mykoSoundLoop == "undefined") { var mykoSoundLoop = (mykoSound>0) ? true : false; } 
else { mykoSoundLoop = (mykoSound>0 && mykoSoundLoop==1) ? true : false; }
if (typeof mykoMove == "undefined") var mykoMove = 'right-bottom-top';
if (typeof mykoBanSize == 'undefined') var mykoBanSize = '300x150';
if (typeof targetType == 'undefined') var targetType = '_blank';
if (typeof mykoCross == 'undefined') var mykoCross = 0;

// document.write('<link href="'+mykotools_url+'message/'+mykoDesign+'/styles.css" rel="stylesheet" type="text/css" /> ');
document.write('<link href="'+mykotools_url+'message/'+mykoBanSize+'/'+mykoDesign+'/styles.css" rel="stylesheet" type="text/css" /> ');

var apopParam = new Array;
apopParam['size'] = mykoBanSize;
apopParam['path'] = mykotools_url;
apopParam['sound'] = mykoSound;
apopParam['loop'] = mykoSoundLoop;
apopParam['alpha'] = 100; // no alpha on this tool

if (typeof mykoNoCookie != "undefined") apopParam['nocookie']=true;

switch (mykoMove)
{
	case 'right-bottom-left':
		apopParam['position']='right';
		apopParam['direction']='left';
	break;
	case 'right-top-left':
		apopParam['position']='up';
		apopParam['direction']='left';
	break;
	case 'right-top-bottom':
		apopParam['position']='right';
		apopParam['direction']='down';
	break;
	case 'left-bottom-right':
		apopParam['position']='left';
		apopParam['direction']='right';
	break;
	case 'left-bottom-top':
		apopParam['position']='left';
		apopParam['direction']='up';
	break;
	case 'left-top-right':
		apopParam['position']='up';
		apopParam['direction']='right';
	break;
	case 'left-top-bottom':
		apopParam['position']='up';
		apopParam['direction']='down';
	break;
	default:
		// right-bottom-top
		apopParam['position']='right';
		apopParam['direction']='up';
	break;
}

//data arrays
var allGayNames = ['marseillais41','julien28','ignace2','oladavid','philoube','graychris','bigtony','alexchewme','bonobosam','benmetzger','bigben','robloschonsky','shahman','pinoq','elboubito','ducduko','sadmoon','point','sebmarcos','misterclaz','patg6','runthedunck','hottime','dersodomizer','cuntlord','inyourslit','superconst','theritter','cidrixxx','misteryves','hinouar','magalus','youren','malok','sexyguy4','agood-looker','rathercute','veryheftym','agreatfuck','niceandgentle','juliocmoi','augusto2','nakedjohn','nextpix','littleperv','nastyhunk','casanova219','yourknobis','thearsehole'];

var allGaySentences = [
	"hi :) ASL ?", 
	"hi, wanna join my room?", 
	"Hi, guy,  HRU?", 
	"RU gonna turn on yr cam or w@?", 
	"hi : ), HRU?", 
	"Im dyinN 4 a guy, cum 2C me", 
	"hi nice guy :)", 
	"hi, wanna ch@?", 
	"wanna ch@ with me?", 
	"NterestD ina cam session?", 
	"hi, RU online?", 
	"hi, RU avail 4 a cam ch@?", 
	"avail?", 
	"online?", 
	"I hope ur hot :p", 
	"hi hws fings goin?", 
	"sry, i wz rong bout d guy :)", 
	"feel lk ch@iN?", 
	"hi, DY hav a moment?", 
	"hi, DY hav a cam? ", 
	"Wanna C me cummin?", 
	"wanna get a gud wank?", 
	"wanna C my dik?", 
	"wd u lk 2 get yr butt pounded 2nite?", 
	"i'm cravin 4 a fuk 2nite and you?", 
	"cum, my wife aint here now :)", 
	"DY lk 2 get a deep B/J?", 
	"feel lk Fkng me 2nite?", 
	"hmmmmm, I need sex w@ abtU...?", 
	"heeeey, dnt ignore me like dat!", 
	"hi, NterestD in a webcam ch@?", 
	"hi, Rnt u gonna turn on yr cam?", 
	"comN, dnt u wanna get fukD 2nite?", 
	"I'm cravin 4 a guy", 
	"dnt B shy, tak out yr dik!", 
	"hi, m8, DY hav a webcam ?", 
	"hi, wanna C my cok?", 
	"hi, RU well-hung?", 
	"u know that I lov guys like u?", 
	"hi cute guy :p"
];

var newMessage = "YOU HAVE A MESSAGE!";

var de_txt = "de";
if (myko_lg=='it') de_txt = '';
if (myko_lg=='us' || myko_lg=='en') de_txt = 'from';

function url(go)
{
	if (go!==false) go=true;
	apopCloseMe('myko_cookie');
	if (!go) return;
	if (targetType == '_blank') { window.open(targetUrl); } 
	else { window.location = targetUrl; }
} 

function get_random_number(min, max)
{
	var rand = min + Math.floor(Math.random()*(max-min+1));
	return rand;
}
function getRandomFlash()
{
	var flashFiles = Array();
	//can be optimized if different sizes use almost the same file names for the flashes
	if (mykoBanSize == '300x300' || mykoBanSize == '200x300') {
		flashFiles = [
			"Armandoxxl.swf",
			"BogossPourToi.swf",
			"Cristiano83.swf",
			"Cristifitt.swf",
			"DannyDoc.swf",
			"Doido.swf",
			"Ethan.swf",
			"HiddenDesire.swf",
			"HotGymLover.swf",
			"Machosexboy.swf",
			"PleasureOnly.swf",
			"Sano.swf"
		];
	} else { //default
		flashFiles = [
			"2meccho.swf",
			"AngelBoy.swf",
			"Armandoxxl.swf",
			"BogossPourToi.swf",
			"Cristiano83.swf",
			"Cristifitt.swf",
			"DannyDoc.swf",
			"Doido.swf",
			"Ethan.swf",
			"HiddenDesire.swf",
			"HotGymLover.swf",
			"Machosexboy.swf",
			"PleasureOnly.swf",
			"Sano.swf",
			"Smirnoffe.swf"
		];
	}
	var flashPath = mykotools_url+"message/"+mykoBanSize+"/vids/";
	var randomFlash = flashFiles[get_random_number(0,flashFiles.length-1)]; 
	randomFlash = flashPath + randomFlash;
	return randomFlash;
}

function get_prenom2path(path)
{
	var regex = new RegExp("([^/])+.swf");
	var match = regex.exec(path);
	var file = match[0];
	return file.replace(/.swf/g,'');
}
var backup_func = apopParam['newcontent']=function(winName) 
{
	var randomName = allGayNames[get_random_number(0,allGayNames.length-1)];
	var randomText = allGaySentences[get_random_number(0,allGaySentences.length-1)];
	flashPathTmp = (flashPath == 'random') ? getRandomFlash() : flashPath;
	var swf_prenom = get_prenom2path(flashPathTmp);
	randomName = swf_prenom;
	if (mykoBanSize == '300x300')
	{
		flashWidth = 260;
		flashHeight = 180;
		lev2_width = 300; // I may split mykoBanSize here
		lev2_height = 291;
	} 
	else if(mykoBanSize == '200x300')
	{
		flashWidth = 160;
		flashHeight = 120;
		lev2_width = 200;
		lev2_height = 297;
	}
	else
	{ // 300x150 frame
		flashWidth = 120;
		flashHeight = 90;
		lev2_width = 300;
		lev2_height = 150;
	}
	myko_content = '';
	myko_content += ('<div class="mykopop"> \n');
	var cross_jsfunction = (mykoCross) ? 'url(false)' : 'url()';
	myko_content += ('<a href="javascript:void(0);" onclick="'+cross_jsfunction+'" class="close"');
	if (mykoBanSize == '200x300') myko_content += (' style="width:23px;"');
	myko_content += ('><span>Close</span></a>\n');
	myko_content += ('<h1');
	if (mykoBanSize == '200x300'){
		myko_content += (" style=\"margin-left:10px;\" "); // move title to the right
		newMessage = newMessage.replace(/\s+/g,"&nbsp;"); 
	}
	myko_content += ('>'+newMessage+'</h1>\n');
	if (mykoBanSize == '200x300') myko_content += ('<table width="184" border="0" cellspacing="0" cellpadding="0" align="center" style="margin:5px auto 3px auto;">');
	else myko_content += ('<table width="284" border="0" cellspacing="0" cellpadding="0" align="center" style="margin:5px auto 3px auto;">\n');
	myko_content += ('      <tr>\n');
	if (mykoBanSize == '300x150') myko_content += ('<td style="padding-right:5px;">\n');
	else if(mykoBanSize == '200x300') myko_content += ('<td style="padding-right:0px;">\n');
	else if(mykoBanSize == '300x300') myko_content += ('<td style="padding-right:10px;">\n');
	myko_content += ('<iframe src="'+mykotools_url+'message/iframeSWF.html?go=1&w='+flashWidth+'&h='+flashHeight+'&prenom='+swf_prenom+'&url='+escape(targetUrl)+'&target='+targetType+'" frameborder="0" scrolling="no" width="'+flashWidth+'" height="'+flashHeight+'"></iframe>');
	myko_content += ('        </td>\n');
	if (mykoBanSize != '300x150'){
		myko_content += ('      </tr>\n');
		myko_content += ('      <tr>\n');
	}
	if (mykoBanSize == '200x300') myko_content += ('<td>\n');
	else myko_content += ('        <td style="padding-right:5px;">\n');
	myko_content += ('<p class="username">'+de_txt+' <b>'+randomName+'</b><br />\n');
	myko_content += ('              <span>'+geoip_city+'</span></p>\n');
	myko_content += ('            <p class="message">'+randomText); 
	if (mykoBanSize == '200x300' && randomText.length < 29) myko_content += ('<br>&nbsp;');
	if (winName=='init') {
		myko_content += ('<img src="http://pub.sv2.biz/stats.php" width="1" height="1" border="0">');
	}
	myko_content += ('</p></td>\n      </tr>\n');
	myko_content += ('    </table>\n');
	myko_content += ('  <p class="gif"><a href="javascript:void(0);" onclick="url()"><img src="http://media.mykodial.com/message/'+mykoBanSize+'/'+mykoDesign+'/'+myko_lg+'/bottom.gif" alt="" border="0" /></a></p>\n');
	myko_content += ('</div>\n');
	
	var apopWin = document.getElementById('apopWin_'+winName);
	if (!apopWin) return myko_content;
	apopWin.innerHTML = myko_content;
}
apopParam['content']=apopParam['newcontent']('init');
