
/***********************
*
*
*
*
*
* Get or Set var
*
*
*
*
********/
var miscimgsrc = 'http://media.sexinyourcity.com/ads/msnpopup_sound/';

/*
var param_cookies 	= true;
var param_sound 	= true;
var param_target 	= '_blank';
var param_speed 	= 1000;
var param_link 	    = 'http://www.sexinyourcity.com/ads/per_site/sexinyourcity/fullpage/fuckbook_dating/profile_new.php?nats=&id=';
var param_style 	= 'fuckbook';
*/


if(param_cookies=="undefined")
{
	var param_cookies	= true;
}

if(param_sound=="undefined")
{
	var param_sound	= true;
}

if(param_target=="undefined")
{
	var param_target	= "_blank";
}

if(param_speed=="undefined")
{
	var param_speed	= 1000;
}
/*
if(param_link=="undefined")
{
	var param_link	= 'http://enter.sexinyourcity.com/track/Mzg3OjE1OjI/';
}
*/
/*
if(param_link=="undefined")
{
	var param_link	= 'http://www.sexinyourcity.com/ads/per_site/sexinyourcity/fullpage/fuckbook_dating/profile_new.php?nats=id=&id=';
}
else
{
 	param_link	= 'http://www.sexinyourcity.com/ads/per_site/sexinyourcity/fullpage/fuckbook_dating/profile_new.php?nats=&id=';
}
*/
if(typeof(floater_img)=="undefined"||!floater_img)
{
//todo : need to remove this
	var randProfile 	= (Math.round(Math.random() * 6 ) + 1);
	var profiles 		= new Array();
	profiles[1] = 1185090;
	profiles[2] = 1191891;
	profiles[3] = 1191679;
	profiles[4] = 1192011;
	profiles[5] = 1191762;
	profiles[6] = 1192092;
	profiles[7] = 1191700;
	var profilesId		= profiles[randProfile];
}

if(typeof(param_close_btn)=="undefined")
{
	var param_close_btn 	= true;
}
else
{
}
var profiles_picture_set = new Array();

profiles_picture_set['default'] = new Array();
profiles_picture_set['default']['img'] 		= new Array();
profiles_picture_set['default']['name'] 	= new Array();
profiles_picture_set['default']['id'] 		= new Array();
	profiles_picture_set['default']['img'][1]	= '1-100.jpg';
	profiles_picture_set['default']['name'][1] 	= "BlondBelind";
	profiles_picture_set['default']['img'][2] 	= '6-100.jpg';
	profiles_picture_set['default']['name'][2] 	= 'Naughty_Sar';
	profiles_picture_set['default']['img'][3] 	= '3-100.jpg';
	profiles_picture_set['default']['name'][3] 	= 'Horny69Mari';
	profiles_picture_set['default']['img'][4] 	= '9-100.jpg';
	profiles_picture_set['default']['name'][4] 	= 'Trixie4Fun';
	profiles_picture_set['default']['img'][5] 	= '4-100.jpg';
	profiles_picture_set['default']['name'][5] 	= 'JuicyJen';

	/*profiles_picture_set['default'][6]['img'] = '5-100.jpg';
	profiles_picture_set['default'][6]['name'] 	= 'LucieLick';
	profiles_picture_set['default'][7]['img'] 	= '6-100.jpg';
	profiles_picture_set['default'][7]['name'] 	= 'Naughty_Sar';
	profiles_picture_set['default'][8]['img'] 	= '7-100.jpg';
	profiles_picture_set['default'][8]['name'] 	= 'Blondass_X';*/

profiles_picture_set['fuckbook'] = new Array();
profiles_picture_set['fuckbook']['img'] 	= new Array();
profiles_picture_set['fuckbook']['name'] 	= new Array();
profiles_picture_set['fuckbook']['id'] 		= new Array();
	profiles_picture_set['fuckbook']['img'][1] 	= '1.jpg';
	profiles_picture_set['fuckbook']['name'][1] = 'Blondass_X';
	profiles_picture_set['fuckbook']['id'][1] 	= 1;

	profiles_picture_set['fuckbook']['img'][2]	= '10.jpg';
	profiles_picture_set['fuckbook']['name'][2] = 'Naughty_Sar';
	profiles_picture_set['fuckbook']['id'][2] 	= 10;

	profiles_picture_set['fuckbook']['img'][3] 	= '11.jpg';
	profiles_picture_set['fuckbook']['name'][3] = 'LucieLick';
	profiles_picture_set['fuckbook']['id'][3] 	= 11;

	profiles_picture_set['fuckbook']['img'][4] 	= '14.jpg';
	profiles_picture_set['fuckbook']['name'][4] = 'JuicyJen';
	profiles_picture_set['fuckbook']['id'][4] 	= 14;

	profiles_picture_set['fuckbook']['img'][5] 	= '15.jpg';
	profiles_picture_set['fuckbook']['name'][5] = 'Trixie4Fun';
	profiles_picture_set['fuckbook']['id'][5] 	= 15;

	profiles_picture_set['fuckbook']['img'][6]	= '16.jpg';
	profiles_picture_set['fuckbook']['name'][6] = 'Horny69Mari';
	profiles_picture_set['fuckbook']['id'][6] 	= 16;

	/*profiles_picture_set['fuckbook'][7]['img'] 	= '17.jpg';
	profiles_picture_set['fuckbook'][1]['name'] = 'BlondBelind';
	profiles_picture_set['fuckbook'][8]['img'] 	= '18.jpg';
	profiles_picture_set['fuckbook'][1]['name'] = 'Luv2Ride';
	profiles_picture_set['fuckbook'][9]['img'] 	= '19.jpg';
	profiles_picture_set['fuckbook'][1]['name'] = 'BikerBabe260x';
	profiles_picture_set['fuckbook'][10]['img'] = '20.jpg';
	profiles_picture_set['fuckbook'][1]['name'] = 'RainbowBrite01';
	profiles_picture_set['fuckbook'][11]['img'] = '2.jpg';
	profiles_picture_set['fuckbook'][1]['name'] = 'CuriosCathy';
	profiles_picture_set['fuckbook'][12]['img'] = '21.jpg';
	profiles_picture_set['fuckbook'][1]['name'] = 'krazygirl69';
	profiles_picture_set['fuckbook'][13]['img'] = '22.jpg';
	profiles_picture_set['fuckbook'][1]['name'] = 'SexE85';
	profiles_picture_set['fuckbook'][14]['img'] = '23.jpg';
	profiles_picture_set['fuckbook'][1]['name'] = 'CollegeLuv20';
	profiles_picture_set['fuckbook'][15]['img'] = '24.jpg';
	profiles_picture_set['fuckbook'][1]['name'] = 'FairyTale19';
	profiles_picture_set['fuckbook'][16]['img'] = '25.jpg';
	profiles_picture_set['fuckbook'][1]['name'] = 'Qtcherry89';
	profiles_picture_set['fuckbook'][17]['img'] = '26.jpg';
	profiles_picture_set['fuckbook'][1]['name'] = 'SweetMary99';
	profiles_picture_set['fuckbook'][18]['img'] = '31.jpg';
	profiles_picture_set['fuckbook'][1]['name'] = 'LuciousLaydee';
	profiles_picture_set['fuckbook'][19]['img'] = '27.jpg';
	profiles_picture_set['fuckbook'][1]['name'] = 'Curvy69er';
	profiles_picture_set['fuckbook'][20]['img'] = '28.jpg';
	profiles_picture_set['fuckbook'][1]['name'] = 'TightTina3';
	profiles_picture_set['fuckbook'][21]['img'] = '29.jpg';
	profiles_picture_set['fuckbook'][1]['name'] = 'RawkerChick';
	profiles_picture_set['fuckbook'][22]['img'] = '3.jpg';
	profiles_picture_set['fuckbook'][1]['name'] = '2Kinky4U';*/

var randProfile 			= (Math.round(Math.random() * (profiles_picture_set['fuckbook']['img'].length-1) ));
if(randProfile==0){randProfile=1;}
param_link 					= param_link+'&id='+profiles_picture_set['fuckbook']['id'][randProfile]


var URL_profile_picture 	= 'http://media.sexinyourcity.com/ads/profiles/'+param_style+'/';
var floater_img				= URL_profile_picture+profiles_picture_set['fuckbook']['img'][randProfile];

var username				= profiles_picture_set['fuckbook']['name'][randProfile];

var txtmain 	= '';
var maintext 	= '<a rel="special" href="'+param_link+'" target="'+param_target+'"><div id="maintxt"></div></a>';
var txtimg 		= '<a rel="special" href="'+param_link+'" target="'+param_target+'"><img src="'+floater_img+'" width=47 height=47 border="0"></a>';
txtimg 			+= '<div id="typing" style="padding-top:6px;padding-left:10px;font-family:Arial;font-size:11px;color:green;">&nbsp;</div>';

/**
* SET THE LOOK OF THE POPUP
*/
if(param_style=="undefined")
{
	var param_style	= 'default';
}

var URL_asset_style 	= 'http://media.sexinyourcity.com/ads/popups/custom/style/'+param_style+'/';

var style_asset = new Array();
	/**
	* Default = look like msn popup
	*/
	style_asset['default'] = new Array();
		style_asset['default']['css'] = '<style type="text/css">#floatyContent div{background-color:none;}#floatyContent a:hover{background:none;}#floatyContent{ z-index:15000;right:2px;font-family:arial;font-size:12px;bottom:-2px;position:fixed;padding:0px;width:201px;height:116px;background-color:#fefbf0;background-image:url(\''+miscimgsrc+'bgmsn.gif\');}#floatyContent a{	color:black;text-decoration:none;} #floatyContent #txtmain{position:absolute; padding:5px 13px; text-align:left; width:120px; font-family:verdana;font-size:11px;color:black; top:22px; left:55px;}</style><!--[if lt IE 7]><style>#floatyContent {	position: absolute; top: expression(eval(document.compatMode && document.compatMode==\'CSS1Compat\') ? documentElement.scrollTop+(documentElement.clientHeight-this.clientHeight) : document.body.scrollTop+(document.body.clientHeight-this.clientHeight));}body {	background-image:url('+miscimgsrc+'blank.gif); background-attachment: fixed;}</style><![endif]--><!--[if gte IE 7]><style>#floatyContent {	position: expression(eval(document.compatMode && document.compatMode==\'CSS1Compat\') ? \'fixed\' : \'absolute\');	top: expression(eval(document.compatMode && document.compatMode==\'CSS1Compat\') ? null : document.body.scrollTop+(document.body.clientHeight-this.clientHeight)); </style><![endif]-->';

		style_asset['default']['html'] += '<div id="floatyContent" style="bottom:-200px;display:none;"><div id="im_popupDiv">';
		style_asset['default']['html'] += '<a rel="special" href="'+param_link+'" target="'+param_target+'" style="height:22px; width:185px; display:block;position:absolute; top:0px; left:0;cursor:pointer;"><img width="185" height="22" border="0" src="http://media.sexinyourcity.com/ads/chat/pixel.gif"/></a>';
		style_asset['default']['html'] += '<a rel="special" href="'+param_link+'" target="'+param_target+'" style="height:90px; width:201px; display:block;position:absolute; top:22px; left:0;cursor:pointer"><img width="201" height="90" border="0" src="http://media.sexinyourcity.com/ads/chat/pixel.gif"/></a>';
		style_asset['default']['html'] += '	<div style="position:absolute; top:3px; right:5px;"><a rel="special" id="im_close" style="color:gray;text-decoration:none; cursor:pointer"><b>x</b></a></div>';
		style_asset['default']['html'] += '	<div style="padding:6px; padding-left:25px;text-align:left; font-family:verdana; font-size:10px;color:black;"><b>'+username+'</b></div>';
		style_asset['default']['html'] += '	<div style="float:left; width:60px; position:absolute; left:9px; top:33px; width:47px; height:47px; ">'+txtimg+'</div>';
		style_asset['default']['html'] += '	<div id="txtmain" ></div>';
		style_asset['default']['html'] += '	<div style="clear:both;"></div>';
		style_asset['default']['html'] += '</div></div>';

	/**
	* Fuckbook
	*/
	style_asset['fuckbook'] = new Array();
		style_asset['fuckbook']['css'] = '<style type="text/css">#floatyContent div{background-color:none;}#floatyContent a:hover{background:none;}#floatyContent{ z-index:15000;right:2px;font-family:arial;font-size:12px;bottom:-2px;position:fixed;padding:0px;width:234px;height:161px;background-color:#fefbf0;background-image:url(\''+URL_asset_style+'fuckbook.jpg\');}#floatyContent a{	color:black;text-decoration:none;} #floatyContent #txtmain{position:absolute; padding:5px 13px; text-align:left; width:234px; font-family:verdana;font-size:11px;color:black; top:52px; left:92px;}</style><!--[if lt IE 7]><style>#floatyContent {	position: absolute; top: expression(eval(document.compatMode && document.compatMode==\'CSS1Compat\') ? documentElement.scrollTop+(documentElement.clientHeight-this.clientHeight) : document.body.scrollTop+(document.body.clientHeight-this.clientHeight));}body {	background-image:url('+miscimgsrc+'blank.gif); background-attachment: fixed;}</style><![endif]--><!--[if gte IE 7]><style>#floatyContent {	position: expression(eval(document.compatMode && document.compatMode==\'CSS1Compat\') ? \'fixed\' : \'absolute\');	top: expression(eval(document.compatMode && document.compatMode==\'CSS1Compat\') ? null : document.body.scrollTop+(document.body.clientHeight-this.clientHeight)); </style><![endif]-->';
		style_asset['fuckbook']['html'] = '';
		style_asset['fuckbook']['html'] += '<div id="floatyContent" style="bottom:-220px;display:none;"><div id="im_popupDiv">';

		style_asset['fuckbook']['html'] += '<a rel="special" href="'+param_link+'" target="'+param_target+'" style="height:20px; width:210px; display:block;position:absolute; top:0px; left:0;cursor:pointer;"><img width="210" height="20" border="0" src="http://media.sexinyourcity.com/ads/chat/pixel.gif"/></a>';

		style_asset['fuckbook']['html'] += '<a rel="special" href="'+param_link+'" target="'+param_target+'" style="height:139px; width:234px; display:block;position:absolute; top:20px; left:0;cursor:pointer"><img width="234" height="139" border="0" src="http://media.sexinyourcity.com/ads/chat/pixel.gif"/></a>';

		style_asset['fuckbook']['html'] += '	<div style="position:absolute; top:3px; right:5px;"><a rel="special" id="im_close" style="color:gray;text-decoration:none; cursor:pointer"><b>x</b></a></div>';
		style_asset['fuckbook']['html'] += '	<div style="padding:40px 6px 6px 105px; text-align:left; font-family:verdana; font-size:10px;color:black;"><b>'+username+'</b></div>';
		style_asset['fuckbook']['html'] += '	<div style="float:left; height:88px; left:5px; position:absolute; top:40px; width:93px; "><a rel="special" href="'+param_link+'" target="'+param_target+'"><img src="'+floater_img+'" width="93" height="88" border="0"></a><div id="typing" style="padding-top:10px;padding-left:95px;font-family:Arial;font-size:11px;color:green;">&nbsp;</div></div>';
		style_asset['fuckbook']['html'] += '	<div id="txtmain"></div>';
		style_asset['fuckbook']['html'] += '	<div style="position:absolute; top:108px; left:105px;"><input type="text" style="width:120px;" /></div>';
		style_asset['fuckbook']['html'] += '	<div style="clear:both;"></div>';
		style_asset['fuckbook']['html'] += '</div></div>';


if(param_sound==true)
{
	/*
	   SoundManager 2: Javascript Sound for the Web
	   --------------------------------------------
	   http://schillmania.com/projects/soundmanager2/

	   Copyright (c) 2008, Scott Schiller. All rights reserved.
	   Code licensed under the BSD License:
	   http://schillmania.com/projects/soundmanager2/license.txt

	   V2.95a.20090501
	*/
	if (typeof SM2_DEFER == 'undefined' || !SM2_DEFER) {
		var soundManager = null;
	}

	function SoundManager(b,a)
	{
		this.flashVersion=8;
		this.debugMode=true;
		this.useConsole=true;
		this.consoleOnly=false;
		this.waitForWindowLoad=false;
		this.nullURL="null.mp3";
		this.allowPolling=true;
		this.useMovieStar=false;
		this.bgColor="#ffffff";
		this.useHighPerformance=false;
		this.flashLoadTimeout=750;
		this.wmode=null;
		this.allowFullScreen=true;
		this.defaultOptions={autoLoad:false,stream:true,autoPlay:false,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5000,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:true,position:null,pan:0,volume:100};
		this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,ondataerror:null};
		this.movieStarOptions={onmetadata:null,useVideo:false,bufferTime:null};
		var f=null;
		var e=this;
		this.version=null;
		this.versionNumber="V2.95a.20090501";
		this.movieURL=null;
		this.url=null;
		this.altURL=null;
		this.swfLoaded=false;
		this.enabled=false;
		this.o=null;
		this.id=(a||"sm2movie");
		this.oMC=null;
		this.sounds={};
		this.soundIDs=[];
		this.muted=false;
		this.isFullScreen=false;
		this.isIE=(navigator.userAgent.match(/MSIE/i));
		this.isSafari=(navigator.userAgent.match(/safari/i));
		this.isGecko=(navigator.userAgent.match(/gecko/i));
		this.debugID="soundmanager-debug";
		this.specialWmodeCase=false;
		this._debugOpen=true;
		this._didAppend=false;
		this._appendSuccess=false;
		this._didInit=false;
		this._disabled=false;
		this._windowLoaded=false;
		this._hasConsole=(typeof console!="undefined"&&typeof console.log!="undefined");
		this._debugLevels=["log","info","warn","error"];
		this._defaultFlashVersion=8;
		this._oRemoved=null;
		this._oRemovedHTML=null;
	var g=function(h){
		return document.getElementById(h)
	};
	this.filePatterns={
		flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};
	this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];
	this.netStreamPattern=new RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");
	this.filePattern=null;
	this.features={buffering:false,peakData:false,waveformData:false,eqData:false,movieStar:false};
	this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local + internet access)"},description:null,noRemote:null,noLocal:null};

	this._setVersionInfo=function()
	{
		if(e.flashVersion!=8&&e.flashVersion!=9)
		{
			alert('soundManager.flashVersion must be 8 or 9. "'+e.flashVersion+'" is invalid. Reverting to '+e._defaultFlashVersion+".");
			e.flashVersion=e._defaultFlashVersion}e.version=e.versionNumber+(e.flashVersion==9?" (AS3/Flash 9)":" (AS2/Flash 8)");

			if(e.flashVersion>8)
			{
				e.defaultOptions=e._mergeObjects(e.defaultOptions,e.flash9Options);

				e.features.buffering=true;
			}
			if(e.flashVersion>8&&e.useMovieStar)
			{
				e.defaultOptions=e._mergeObjects(e.defaultOptions,e.movieStarOptions);

				e.filePatterns.flash9=new RegExp("\\.(mp3|"+e.netStreamTypes.join("|")+")(\\?.*)?$","i");
				e.features.movieStar=true;
			}
			else
			{
				e.useMovieStar=false;
				e.features.movieStar=false;
			}

			e.filePattern=e.filePatterns[(e.flashVersion!=8?"flash9":"flash8")];
			e.movieURL=(e.flashVersion==8?"soundmanager2.swf":"soundmanager2_flash9.swf");
			e.features.peakData=e.features.waveformData=e.features.eqData=(e.flashVersion>8);
		};

	this._overHTTP=(document.location?document.location.protocol.match(/http/i):null);
	this._waitingforEI=false;
	this._initPending=false;
	this._tryInitOnFocus=(this.isSafari&&typeof document.hasFocus=="undefined");
	this._isFocused=(typeof document.hasFocus!="undefined"?document.hasFocus():null);
	this._okToDisable=!this._tryInitOnFocus;
	this.useAltURL=!this._overHTTP;
	var d="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html";
	this.strings={
		notReady:"Not loaded yet",appXHTML:"appendChild/innerHTML set failed."};
	this.supported=function(){
		return(e._didInit&&!e._disabled)};
	this.getMovie=function(h){
		return e.isIE?window[h]:(e.isSafari?g(h)||document[h]:g(h))};
	this.loadFromXML=function(h){
		try{
		e.o._loadFromXML(h)}catch(i){
		e._failSafely();
	return true}};
	this.createSound=function(i){
		if(arguments.length==2){
		i={
		id:arguments[0],url:arguments[1]}}var j=e._mergeObjects(i);
	var h=j;
	if(e._idCheck(h.id,true)){
		return e.sounds[h.id]}if(e.flashVersion>8&&e.useMovieStar){
		if(h.isMovieStar===null){
		h.isMovieStar=(h.url.match(e.netStreamPattern)?true:false)}if(h.isMovieStar){
		}if(h.isMovieStar&&(h.usePeakData||h.useWaveformData||h.useEQData)){
		h.usePeakData=false;
	h.useWaveformData=false;
	h.useEQData=false}}e.sounds[h.id]=new f(h);
	e.soundIDs[e.soundIDs.length]=h.id;
	if(e.flashVersion==8){
		e.o._createSound(h.id,h.onjustbeforefinishtime)}else{
		e.o._createSound(h.id,h.url,h.onjustbeforefinishtime,h.usePeakData,h.useWaveformData,h.useEQData,h.isMovieStar,(h.isMovieStar?h.useVideo:false),(h.isMovieStar?h.bufferTime:false))}if(h.autoLoad||h.autoPlay){
		if(e.sounds[h.id]){
		e.sounds[h.id].load(h)}}if(h.autoPlay){
		e.sounds[h.id].play()}return e.sounds[h.id]};
	this.createVideo=function(h){
		if(arguments.length==2){
		h={
		id:arguments[0],url:arguments[1]}}if(e.flashVersion>=9){
		h.isMovieStar=true;
	h.useVideo=true}else{
		return false}if(!e.useMovieStar){
		}return e.createSound(h)};
	this.destroySound=function(j,h){
		if(!e._idCheck(j)){
		return false}for(var k=0;
	k<e.soundIDs.length;
	k++){
		if(e.soundIDs[k]==j){
		e.soundIDs.splice(k,1);
	continue}}e.sounds[j].unload();
	if(!h){
		e.sounds[j].destruct()}delete e.sounds[j]};
	this.destroyVideo=this.destroySound;
	this.load=function(h,i){
		if(!e._idCheck(h)){
		return false}e.sounds[h].load(i)};
	this.unload=function(h){
		if(!e._idCheck(h)){
		return false}e.sounds[h].unload()};
	this.play=function(h,i){
		if(!e._idCheck(h)){
		if(typeof i!="Object"){
		i={
		url:i}}if(i&&i.url){
		i.id=h;
	e.createSound(i)}else{
		return false}}e.sounds[h].play(i)};
	this.start=this.play;
	this.setPosition=function(h,i){
		if(!e._idCheck(h)){
		return false}e.sounds[h].setPosition(i)};
	this.stop=function(h){
		if(!e._idCheck(h)){
		return false}e.sounds[h].stop()};
	this.stopAll=function(){
		for(var h in e.sounds){
		if(e.sounds[h] instanceof f){
		e.sounds[h].stop()}}};
	this.pause=function(h){
		if(!e._idCheck(h)){
		return false}e.sounds[h].pause()};
	this.pauseAll=function(){
		for(var h=e.soundIDs.length;
	h--;
	){
		e.sounds[e.soundIDs[h]].pause()}};
	this.resume=function(h){
		if(!e._idCheck(h)){
		return false}e.sounds[h].resume()};
	this.resumeAll=function(){
		for(var h=e.soundIDs.length;
	h--;
	){
		e.sounds[e.soundIDs[h]].resume()}};
	this.togglePause=function(h){
		if(!e._idCheck(h)){
		return false}e.sounds[h].togglePause()};
	this.setPan=function(h,i){
		if(!e._idCheck(h)){
		return false}e.sounds[h].setPan(i)};
	this.setVolume=function(i,h){
		if(!e._idCheck(i)){
		return false}e.sounds[i].setVolume(h)};
	this.mute=function(h){
		if(typeof h!="string"){
		h=null}if(!h){
		for(var j=e.soundIDs.length;
	j--;
	){
		e.sounds[e.soundIDs[j]].mute()}e.muted=true}else{
		if(!e._idCheck(h)){
		return false}e.sounds[h].mute()}};
	this.muteAll=function(){
		e.mute()};
	this.unmute=function(h){
		if(typeof h!="string"){
		h=null}if(!h){
		for(var j=e.soundIDs.length;
	j--;
){
e.sounds[e.soundIDs[j]].unmute()}e.muted=false}else{
if(!e._idCheck(h)){
return false}e.sounds[h].unmute()}};
this.unmuteAll=function(){
e.unmute()};
this.getMemoryUse=function(){
if(e.flashVersion==8){
return 0}if(e.o){
return parseInt(e.o._getMemoryUse(),10)}};
this.setPolling=function(h){
if(!e.o||!e.allowPolling){
return false}e.o._setPolling(h)};
this.disable=function(j){
if(typeof j=="undefined"){
j=false}if(e._disabled){
return false}e._disabled=true;
for(var h=e.soundIDs.length;
h--;
){
e._disableObject(e.sounds[e.soundIDs[h]])}e.initComplete(j)};
this.canPlayURL=function(h){
return(h?(h.match(e.filePattern)?true:false):null)};
this.getSoundById=function(i,j){
		if(!i){
		throw new Error("SoundManager.getSoundById(): sID is null/undefined")}var h=e.sounds[i];
	if(!h&&!j){
		}return h};
	this.onload=function(){
		soundManager._wD("Warning: soundManager.onload() is undefined.",2)};
	this.onerror=function(){
		};
	this._idCheck=this.getSoundById;
	this._complain=function(h,i){
		};
	var c=function(){
		return false};
	c._protected=true;
	this._disableObject=function(i){
		for(var h in i){
		if(typeof i[h]=="function"&&typeof i[h]._protected=="undefined"){
		i[h]=c}}h=null};
	this._failSafely=function(h){
		if(typeof h=="undefined"){
		h=false}if(!e._disabled||h){
		e.disable(h)}};
	this._normalizeMovieURL=function(h){
		var i=null;
	if(h){
		if(h.match(/\.swf(\?.*)?$/i)){
		i=h.substr(h.toLowerCase().lastIndexOf(".swf?")+4);
	if(i){
		return h}}else{
		if(h.lastIndexOf("/")!=h.length-1){
		h=h+"/"}}}return(h&&h.lastIndexOf("/")!=-1?h.substr(0,h.lastIndexOf("/")+1):"./")+e.movieURL};
	this._getDocument=function(){
		return(document.body?document.body:(document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]))};
	this._getDocument._protected=true;
	this._createMovie=function(y,n){
		if(e._didAppend&&e._appendSuccess){
		return false}if(window.location.href.indexOf("debug=1")+1){
		e.debugMode=true}e._didAppend=true;
	e._setVersionInfo();
	var w=(n?n:e.url);
	var r=(e.altURL?e.altURL:w);
	e.url=e._normalizeMovieURL(e._overHTTP?w:r);
	n=e.url;
	var t=null;
	if(e.useHighPerformance&&e.useMovieStar&&e.defaultOptions.useVideo===true){
		t="soundManager note: disabling highPerformance, not applicable with movieStar mode + useVideo";
	e.useHighPerformance=false}e.wmode=(!e.wmode&&e.useHighPerformance&&!e.useMovieStar?"transparent":e.wmode);
	if(e.wmode!==null&&e.flashLoadTimeout!==0&&!e.useHighPerformance&&!e.isIE&&navigator.platform.match(/win32/i)){
		e.specialWmodeCase=true;
	e.wmode=null}if(e.flashVersion==8){
		e.allowFullScreen=false}var A={
		name:y,id:y,src:n,width:"100%",height:"100%",quality:"high",allowScriptAccess:"always",bgcolor:e.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:e.wmode,allowfullscreen:(e.allowFullScreen?"true":"false")};
	if(!e.wmode){
		delete A.wmode}var h={
		id:y,data:n,type:"application/x-shockwave-flash",width:"100%",height:"100%",wmode:e.wmode};
	var o=null;
	var B=null;
	if(e.isIE){
		o=document.createElement("div");
	var u='<object id="'+y+'" data="'+n+'" type="application/x-shockwave-flash" width="100%" height="100%"><param name="movie" value="'+n+'" /><param name="AllowScriptAccess" value="always" /><param name="quality" value="high" />'+(e.wmode?'<param name="wmode" value="'+e.wmode+'" /> ':"")+'<param name="bgcolor" value="'+e.bgColor+'" /><param name="allowFullScreen" value="'+(e.allowFullScreen?"true":"false")+'" /><!-- --></object>'}else{
		o=document.createElement("embed");
	for(B in A){
		if(A.hasOwnProperty(B)){
		o.setAttribute(B,A[B])}}}var j=document.createElement("div");
	j.id=e.debugID+"-toggle";
	var k={
		position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001};
	j.appendChild(document.createTextNode("-"));
	j.onclick=e._toggleDebug;
	j.title="Toggle SM2 debug console";
	if(navigator.userAgent.match(/msie 6/i)){
		j.style.position="absolute";
	j.style.cursor="hand"}for(B in k){
		if(k.hasOwnProperty(B)){
		j.style[B]=k[B]}}var v=e._getDocument();
	if(v){
		e.oMC=g("sm2-container")?g("sm2-container"):document.createElement("div");
	if(!e.oMC.id){
		e.oMC.id="sm2-container";
	e.oMC.className="movieContainer";
	var p=null;
	var q=null;
	if(e.useHighPerformance){
		p={
		position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px"}}else{
		p={
		position:"absolute",width:"1px",height:"1px",top:"-999px",left:"-999px"}}var l=null;
	for(l in p){
		if(p.hasOwnProperty(l)){
		e.oMC.style[l]=p[l]}}try{
		if(!e.isIE){
		e.oMC.appendChild(o)}v.appendChild(e.oMC);
	if(e.isIE){
		q=e.oMC.appendChild(document.createElement("div"));
	q.className="sm2-object-box";
	q.innerHTML=u}e._appendSuccess=true}catch(z){
		throw new Error(e.strings.appXHTML)}}else{
		e.oMC.appendChild(o);
	if(e.isIE){
		q=e.oMC.appendChild(document.createElement("div"));
	q.className="sm2-object-box";
	q.innerHTML=u}e._appendSuccess=true}if(!g(e.debugID)&&((!e._hasConsole||!e.useConsole)||(e.useConsole&&e._hasConsole&&!e.consoleOnly))){
		var m=document.createElement("div");
	m.id=e.debugID;
	m.style.display=(e.debugMode?"block":"none");
	if(e.debugMode&&!g(j.id)){
		try{
		v.appendChild(j)}catch(i){
		throw new Error(e.strings.appXHTML)}v.appendChild(m)}}v=null}if(t){
		}};
	this._writeDebug=function(i,p,k){
		if(!e.debugMode){
		return false}if(typeof k!="undefined"&&k){
		i=i+" | "+new Date().getTime()}if(e._hasConsole&&e.useConsole){
		var h=e._debugLevels[p];
	if(typeof console[h]!="undefined"){
		console[h](i)}else{
		console.log(i)}if(e.useConsoleOnly){
		return true}}var n="soundmanager-debug";
	try{
		var m=g(n);
	if(!m){
		return false}var l=document.createElement("div");
	if(++e._wdCount%2===0){
		l.className="sm2-alt"}if(typeof p=="undefined"){
		p=0}else{
		p=parseInt(p,10)}l.appendChild(document.createTextNode(i));
	if(p){
		if(p>=2){
		l.style.fontWeight="bold"}if(p==3){
		l.style.color="#ff3333"}}m.insertBefore(l,m.firstChild)}catch(j){
		}m=null};
	this._writeDebug._protected=true;
	this._wdCount=0;
	this._wdCount._protected=true;
	this._wD=this._writeDebug;
	this._wDAlert=function(h){
		alert(h)};
	if(window.location.href.indexOf("debug=alert")+1&&e.debugMode){
		e._wD=e._wDAlert}this._toggleDebug=function(){
		var i=g(e.debugID);
	var h=g(e.debugID+"-toggle");
	if(!i){
		return false}if(e._debugOpen){
		h.innerHTML="+";
	i.style.display="none"}else{
		h.innerHTML="-";
	i.style.display="block"}e._debugOpen=!e._debugOpen};
	this._toggleDebug._protected=true;
	this._debug=function(){
		for(var k=0,h=e.soundIDs.length;
	k<h;
	k++){
		e.sounds[e.soundIDs[k]]._debug()}};
	this._debugTS=function(k,h,i){
		if(typeof sm2Debugger!="undefined"){
		try{
		sm2Debugger.handleEvent(k,h,i)}catch(j){
		}}};
	this._debugTS._protected=true;
	this._mergeObjects=function(j,h){
		var m={
		};
	for(var k in j){
		if(j.hasOwnProperty(k)){
		m[k]=j[k]}}var l=(typeof h=="undefined"?e.defaultOptions:h);
	for(var n in l){
		if(l.hasOwnProperty(n)&&typeof m[n]=="undefined"){
		m[n]=l[n]}}return m};
	this.createMovie=function(h){
		if(h){
		e.url=h}e._initMovie()};
	this.go=this.createMovie;
	this._initMovie=function(){
		if(e.o){
		return false}e.o=e.getMovie(e.id);
	if(!e.o){
		if(!e.oRemoved){
		e._createMovie(e.id,e.url)}else{
		if(!e.isIE){
		e.oMC.appendChild(e.oRemoved)}else{
		e.oMC.innerHTML=e.oRemovedHTML}e.oRemoved=null;
	e._didAppend=true}e.o=e.getMovie(e.id)}if(e.o){
		if(e.flashLoadTimeout>0){
		}}};
	this.waitForExternalInterface=function(){
		if(e._waitingForEI){
		return false}e._waitingForEI=true;
	if(e._tryInitOnFocus&&!e._isFocused){
		return false}if(e.flashLoadTimeout>0){if(!e._didInit){}setTimeout(function(){if(!e._didInit){if(!e._overHTTP){}e._debugTS("flashtojs",false,": Timed out"+(e._overHTTP)?" (Check flash security)":" (No plugin/missing SWF?)")}if(!e._didInit&&e._okToDisable){e._failSafely(true)}},e.flashLoadTimeout)}else{if(!e.didInit){}}};this.handleFocus=function(){if(e._isFocused||!e._tryInitOnFocus){return true}e._okToDisable=true;e._isFocused=true;if(e._tryInitOnFocus){window.removeEventListener("mousemove",e.handleFocus,false)}e._waitingForEI=false;setTimeout(e.waitForExternalInterface,500);if(window.removeEventListener){window.removeEventListener("focus",e.handleFocus,false)}else{if(window.detachEvent){window.detachEvent("onfocus",e.handleFocus)}}};this.initComplete=function(h){if(e._didInit){return false}e._didInit=true;if(e._disabled||h){e._debugTS("onload",false);e.onerror.apply(window);return false}else{e._debugTS("onload",true)}if(e.waitForWindowLoad&&!e._windowLoaded){if(window.addEventListener){window.addEventListener("load",e.initUserOnload,false)}else{if(window.attachEvent){window.attachEvent("onload",e.initUserOnload)}}return false}else{if(e.waitForWindowLoad&&e._windowLoaded){}e.initUserOnload()}};this.initUserOnload=function(){e.onload.apply(window)};this.init=function(){e._initMovie();if(e._didInit){return false}if(window.removeEventListener){window.removeEventListener("load",e.beginDelayedInit,false)}else{if(window.detachEvent){window.detachEvent("onload",e.beginDelayedInit)}}try{e.o._externalInterfaceTest(false);if(!e.allowPolling){}e.setPolling(true);if(!e.debugMode){e.o._disableDebug()}e.enabled=true;e._debugTS("jstoflash",true)}catch(h){e._debugTS("jstoflash",false);e._failSafely(true);e.initComplete();return false}e.initComplete()};this.beginDelayedInit=function(){e._windowLoaded=true;setTimeout(e.waitForExternalInterface,500);setTimeout(e.beginInit,20)};this.beginInit=function(){if(e._initPending){return false}e.createMovie();e._initMovie();e._initPending=true;return true};this.domContentLoaded=function(){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",e.domContentLoaded,false)}e.go()};this._externalInterfaceOK=function(){if(e.swfLoaded){return false}e._debugTS("swf",true);e._debugTS("flashtojs",true);e.swfLoaded=true;e._tryInitOnFocus=false;if(e.isIE){setTimeout(e.init,100)}else{e.init()}};this._setSandboxType=function(h){var i=e.sandbox;i.type=h;i.description=i.types[(typeof i.types[h]!="undefined"?h:"unknown")];if(i.type=="localWithFile"){i.noRemote=true;i.noLocal=false}else{if(i.type=="localWithNetwork"){i.noRemote=false;i.noLocal=true}else{if(i.type=="localTrusted"){i.noRemote=false;i.noLocal=false}}}};this.reboot=function(){if(e.soundIDs.length){}for(var h=e.soundIDs.length;h--;){e.sounds[e.soundIDs[h]].destruct()}try{if(e.isIE){e.oRemovedHTML=e.o.innerHTML}e.oRemoved=e.o.parentNode.removeChild(e.o)}catch(j){}e.enabled=false;e._didInit=false;e._waitingForEI=false;e._initPending=false;e._didInit=false;e._didAppend=false;e._appendSuccess=false;e._didInit=false;e._disabled=false;e._waitingforEI=true;e.swfLoaded=false;e.soundIDs={};e.sounds=[];e.o=null;window.setTimeout(function(){soundManager.beginDelayedInit()},20)};this.destruct=function(){e.disable(true)};f=function(h){var i=this;this.sID=h.id;this.url=h.url;this.options=e._mergeObjects(h);this.instanceOptions=this.options;this._iO=this.instanceOptions;this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this._debug=function(){if(e.debugMode){var l=null;var n=[];var k=null;var m=null;var j=64;for(l in i.options){if(i.options[l]!==null){if(i.options[l] instanceof Function){k=i.options[l].toString();k=k.replace(/\s\s+/g," ");m=k.indexOf("{");n[n.length]=" "+l+": {"+k.substr(m+1,(Math.min(Math.max(k.indexOf("\n")-1,j),j))).replace(/\n/g,"")+"... }"}else{n[n.length]=" "+l+": "+i.options[l]}}}}};this._debug();this.id3={};this.resetProperties=function(j){i.bytesLoaded=null;i.bytesTotal=null;i.position=null;i.duration=null;i.durationEstimate=null;i.loaded=false;i.playState=0;i.paused=false;i.readyState=0;i.muted=false;i.didBeforeFinish=false;i.didJustBeforeFinish=false;i.isBuffering=false;i.instanceOptions={};i.instanceCount=0;i.peakData={left:0,right:0};i.waveformData={left:[],right:[]};i.eqData=[]};i.resetProperties();this.load=function(j){if(typeof j!="undefined"){i._iO=e._mergeObjects(j);i.instanceOptions=i._iO}else{j=i.options;i._iO=j;i.instanceOptions=i._iO;if(i._lastURL&&i._lastURL!=i.url){i._iO.url=i.url;i.url=null}}if(typeof i._iO.url=="undefined"){i._iO.url=i.url}if(i._iO.url==i.url&&i.readyState!==0&&i.readyState!=2){return false}i.url=i._iO.url;i._lastURL=i._iO.url;i.loaded=false;i.readyState=1;i.playState=0;try{if(e.flashVersion==8){e.o._load(i.sID,i._iO.url,i._iO.stream,i._iO.autoPlay,(i._iO.whileloading?1:0))}else{e.o._load(i.sID,i._iO.url,i._iO.stream?true:false,i._iO.autoPlay?true:false);if(i._iO.isMovieStar&&i._iO.autoLoad&&!i._iO.autoPlay){i.pause()}}}catch(k){e._debugTS("onload",false);e.onerror();e.disable()}};this.unload=function(){if(i.readyState!==0){if(i.readyState!=2){i.setPosition(0,true)}e.o._unload(i.sID,e.nullURL);i.resetProperties()}};this.destruct=function(){e.o._destroySound(i.sID);e.destroySound(i.sID,true)};this.play=function(k){if(!k){k={}}i._iO=e._mergeObjects(k,i._iO);i._iO=e._mergeObjects(i._iO,i.options);i.instanceOptions=i._iO;if(i.playState==1){var j=i._iO.multiShot;if(!j){return false}else{}}if(!i.loaded){if(i.readyState===0){i._iO.stream=true;i._iO.autoPlay=true;i.load(i._iO)}else{if(i.readyState==2){return false}else{}}}else{}if(i.paused){i.resume()}else{i.playState=1;if(!i.instanceCount||e.flashVersion>8){i.instanceCount++}i.position=(typeof i._iO.position!="undefined"&&!isNaN(i._iO.position)?i._iO.position:0);if(i._iO.onplay){i._iO.onplay.apply(i)}i.setVolume(i._iO.volume,true);i.setPan(i._iO.pan,true);e.o._start(i.sID,i._iO.loop||1,(e.flashVersion==9?i.position:i.position/1000))}};this.start=this.play;this.stop=function(j){if(i.playState==1){i.playState=0;i.paused=false;if(i._iO.onstop){i._iO.onstop.apply(i)}e.o._stop(i.sID,j);i.instanceCount=0;i._iO={}}};this.setPosition=function(k,j){if(typeof k=="undefined"){k=0}var l=Math.min(i.duration,Math.max(k,0));i._iO.position=l;if(!j){}e.o._setPosition(i.sID,(e.flashVersion==9?i._iO.position:i._iO.position/1000),(i.paused||!i.playState))};this.pause=function(){if(i.paused||i.playState===0){return false}i.paused=true;e.o._pause(i.sID);if(i._iO.onpause){i._iO.onpause.apply(i)}};this.resume=function(){if(!i.paused||i.playState===0){return false}i.paused=false;e.o._pause(i.sID);if(i._iO.onresume){i._iO.onresume.apply(i)}};this.togglePause=function(){if(i.playState===0){i.play({position:(e.flashVersion==9?i.position:i.position/1000)});return false}if(i.paused){i.resume()}else{i.pause()}};this.setPan=function(k,j){if(typeof k=="undefined"){k=0}if(typeof j=="undefined"){j=false}e.o._setPan(i.sID,k);i._iO.pan=k;if(!j){i.pan=k}};this.setVolume=function(j,k){if(typeof j=="undefined"){j=100}if(typeof k=="undefined"){k=false}e.o._setVolume(i.sID,(e.muted&&!i.muted)||i.muted?0:j);i._iO.volume=j;if(!k){i.volume=j}};this.mute=function(){i.muted=true;e.o._setVolume(i.sID,0)};this.unmute=function(){i.muted=false;var j=typeof i._iO.volume!="undefined";e.o._setVolume(i.sID,j?i._iO.volume:i.options.volume)};this._whileloading=function(j,k,l){if(!i._iO.isMovieStar){i.bytesLoaded=j;i.bytesTotal=k;i.duration=Math.floor(l);i.durationEstimate=parseInt((i.bytesTotal/i.bytesLoaded)*i.duration,10);if(i.readyState!=3&&i._iO.whileloading){i._iO.whileloading.apply(i)}}else{i.bytesLoaded=j;i.bytesTotal=k;i.duration=Math.floor(l);i.durationEstimate=i.duration;if(i.readyState!=3&&i._iO.whileloading){i._iO.whileloading.apply(i)}}};this._onid3=function(n,k){var o=[];for(var m=0,l=n.length;m<l;m++){o[n[m]]=k[m]}i.id3=e._mergeObjects(i.id3,o);if(i._iO.onid3){i._iO.onid3.apply(i)}};this._whileplaying=function(k,l,n,j,m){if(isNaN(k)||k===null){return false}if(i.playState===0&&k>0){k=0}i.position=k;if(i._iO.usePeakData&&typeof l!="undefined"&&l){i.peakData={left:l.leftPeak,right:l.rightPeak}}if(i._iO.useWaveformData&&typeof n!="undefined"&&n){i.waveformData={left:n.split(","),right:j.split(",")}}if(i._iO.useEQData&&typeof m!="undefined"&&m){i.eqData=m}if(i.playState==1){if(i.isBuffering){i._onbufferchange(0)}if(i._iO.whileplaying){i._iO.whileplaying.apply(i)}if(i.loaded&&i._iO.onbeforefinish&&i._iO.onbeforefinishtime&&!i.didBeforeFinish&&i.duration-i.position<=i._iO.onbeforefinishtime){i._onbeforefinish()}}};this._onload=function(j){j=(j==1?true:false);if(!j){if(e.sandbox.noRemote===true){}if(e.sandbox.noLocal===true){}}i.loaded=j;i.readyState=j?3:2;if(i._iO.onload){i._iO.onload.apply(i)}};this._onbeforefinish=function(){if(!i.didBeforeFinish){i.didBeforeFinish=true;if(i._iO.onbeforefinish){i._iO.onbeforefinish.apply(i)}}};this._onjustbeforefinish=function(j){if(!i.didJustBeforeFinish){i.didJustBeforeFinish=true;if(i._iO.onjustbeforefinish){i._iO.onjustbeforefinish.apply(i)}}};this._onfinish=function(){if(i._iO.onbeforefinishcomplete){i._iO.onbeforefinishcomplete.apply(i)}i.didBeforeFinish=false;i.didJustBeforeFinish=false;if(i.instanceCount){i.instanceCount--;if(!i.instanceCount){i.playState=0;i.paused=false;i.instanceCount=0;i.instanceOptions={};if(i._iO.onfinish){i._iO.onfinish.apply(i)}}}else{if(i.useVideo){}}};this._onmetadata=function(j){if(!j.width&&!j.height){j.width=320;j.height=240}i.metadata=j;i.width=j.width;i.height=j.height;if(i._iO.onmetadata){i._iO.onmetadata.apply(i)}};this._onbufferchange=function(j){if(i.playState===0){return false}if(j==i.isBuffering){return false}i.isBuffering=(j==1?true:false);if(i._iO.onbufferchange){i._iO.onbufferchange.apply(i)}};this._ondataerror=function(j){if(i.playState>0){if(i._iO.ondataerror){i._iO.ondataerror.apply(i)}}else{}}};this._onfullscreenchange=function(h){e.isFullScreen=(h==1?true:false);if(!e.isFullScreen){try{window.focus()}catch(i){}}};if(window.addEventListener){window.addEventListener("focus",e.handleFocus,false);window.addEventListener("load",e.beginDelayedInit,false);window.addEventListener("unload",e.destruct,false);if(e._tryInitOnFocus){window.addEventListener("mousemove",e.handleFocus,false)}}else{if(window.attachEvent){window.attachEvent("onfocus",e.handleFocus);window.attachEvent("onload",e.beginDelayedInit);window.attachEvent("unload",e.destruct)}else{e._debugTS("onload",false);soundManager.onerror();soundManager.disable()}}if(document.addEventListener){document.addEventListener("DOMContentLoaded",e.domContentLoaded,false)}}

}//end if(param_sound==true)


/*******************************************
* POPUP controler
*******************************************/
var gp_popup = {};

gp_popup.putTyping = function()
{
	document.getElementById('typing').innerHTML = 'typing';
}

gp_popup.putMessage = function(msg,clear)
{
	document.getElementById('txtmain').innerHTML = (clear==1?'':document.getElementById('txtmain').innerHTML+'<br>')+msg;

	if(param_sound==true){
		soundManager.play('hai');
	}

	document.getElementById('typing').innerHTML = '';
}

gp_popup.animatePopup = {
	animateThisDiv:function(id,x){

		var divPath = document.getElementById(id);
		var currPos = parseInt(divPath.style.bottom);
		divPath.style.display='block';
		if (currPos < x)
		{
			currPos += 5;
			divPath.style.bottom = currPos + "px";
			setTimeout("gp_popup.animatePopup.animateThisDiv('" + id + "'," + x + ")",15);
		}
	}
};

gp_popup.cookies = {
	createCookie:function(name, value, hours)
	{
	    if (hours)
	    {
	        var date = new Date();
	        date.setTime(date.getTime() + (hours * 60 * 60 * 1000));
	        var expires = "; expires=" + date.toGMTString();
	    }
	    else
	    {
	        var expires = "";
	    }
	    document.cookie = name + "=" + value + expires + "; path=/";
	}
	,readCookie:function(name)
	{
	    var nameEQ = name + "=";
	    var ca = document.cookie.split(';');
	    for (var i = 0; i < ca.length; i++)
	    {
	        var c = ca[i];
	        while (c.charAt(0) == ' ')c = c.substring(1, c.length);
	        if (c.indexOf(nameEQ) == 0)return c.substring(nameEQ.length, c.length);
	    }
	    return null;
	}
	,eraseCookie:function(name)
	{
	    createCookie(name, "", -1);
	}
};

gp_popup.createPopup = function()
{
	if(param_sound==true)
	{
		/*
		* @soundManager setting
		*/
		if(typeof SM2_DEFER=="undefined"||!SM2_DEFER)
		{
			soundManager=new SoundManager()
		};

		// disable debug output
		soundManager.debugMode = false;

		// path to directory containing SoundManager2 .SWF file
		soundManager.url = 'http://media.sexinyourcity.com/ads/msnpopup_sound/swf_v2/';

		soundManager.flashVersion = 8;

		soundManager.onload = function()
		{
		  // SM2 has loaded - now you can create and play sounds!
		  soundManager.createSound('hai','http://media.sexinyourcity.com/ads/msnpopup_sound/msn_sound.mp3');
		}

	}


	/*
	* @Ad setting
	*/


	message_param_speed = param_speed/1000;

	var message=new Array();
	var messageWait=new Array();
	var messageType=new Array();
	var messageClear=new Array();

	message[0] = 'Hey Baby..';
	messageWait[0] = 1.5+message_param_speed;
	messageType[0] = 2;
	messageClear[0] = 1;

	message[1] = 'Im Online Now';
	messageWait[1] = 1.5+message_param_speed;
	messageType[1] = 3;
	messageClear[1] = 0;

	message[2] = 'lets chat.. hit me up';
	messageWait[2] = 1.5+message_param_speed;
	messageType[2] = 3;
	messageClear[2] = 1;

	var increase=messageWait[0]*1000;

	var typingTime;
	var mata;


	// start ===================================
    document.write(style_asset[param_style]['css']);
	// end =====================================

	var str = style_asset[param_style]['html'];
	document.write(str);

	for (k in message)
	{
		typingTime = messageType[k]*900;
		setTimeout('gp_popup.putTyping("'+message[k]+'")',increase);
		setTimeout('gp_popup.putMessage(\''+message[k]+'\','+messageClear[k]+')',increase+typingTime);
		mata = parseFloat(k)+1;
		increase = increase + typingTime + (messageWait[mata]*1000);
	}
}

gp_popup.closePopup = function()
{
	if(param_close_btn == true)
	{
	    var divBG = document.getElementById('floatyContent');
	    divBG.style.display = 'none';
	    gp_popup.cookies.createCookie('flc_1', '1', 12);
		if(param_sound==true){
			soundManager.disable();
		}
	}
	else
	{
		window.open(param_link, '_blank');
	}
    return false;
};


if(param_cookies==true)
{
	if (!gp_popup.cookies.readCookie('flc_1') && param_cookies==true)
	{
	    gp_popup.createPopup();
	    gp_popup.myWin = document.getElementById('im_popupDiv');
	    gp_popup.myWin.style.top = gp_popup.myWin.style.height;

		setTimeout('gp_popup.animatePopup.animateThisDiv(\'floatyContent\',-4)',param_speed);

	    var x_close = document.getElementById('im_close');
		x_close.onclick = function()
		{
		    gp_popup.closePopup();
		    return false;
	    };
	}
}
else
{
	gp_popup.createPopup();
	gp_popup.myWin = document.getElementById('im_popupDiv');
	gp_popup.myWin.style.top = gp_popup.myWin.style.height;

	setTimeout('gp_popup.animatePopup.animateThisDiv(\'floatyContent\',-4)',param_speed);

	var x_close = document.getElementById('im_close');
	x_close.onclick = function()
	{
	    gp_popup.closePopup();
	    return false;
	};
}


