
function isIE() {
    return (navigator.userAgent.indexOf("MSIE") != -1) && (navigator.userAgent.indexOf("Opera") == -1);
}




if(typeof(floater_link)=="undefined"||!floater_link)
{
	floater_link='http://enter.sexinyourcity.com/track/NDEyOjk6Mg,12/';
}

if(typeof(floater_img)=="undefined"||!floater_img)
{
	var randProfile = (Math.round(Math.random() * 17 ) + 1);

	floater_img='http://media.sexinyourcity.com/ads/profiles/msnpopup/new/'+randProfile+'-100.jpg';
	
	var profiles = new Array()
	var profile_name = new Array();

	profiles[8] = 1184613;
	profile_name[8] = "Tantalizing";

	profiles[1] = 1185090;
	profile_name[1] = "BlondBelind";

	profiles[6] = 1192092;
	profile_name[6] = "Naughty_Sar";

	profiles[9] = 1191679;
	profile_name[9] = "Trixie4Fun";

	profiles[7] = 1191700;
	profile_name[7] = "SunnyBrooke";

	profiles[5] = 1191762;
	profile_name[5] = "LucieLick";

	profiles[2] = 1191824;
	profile_name[2] = "Charlotte69";

	profiles[3] = 1191891;
	profile_name[3] = "Horny69Mari";

	profiles[10] = 1191961;
	profile_name[10] = "WetBrandy";

	profiles[4] = 1192011;
	profile_name[4] = "JuicyJen";

	profiles[11] = 3555394;
	profile_name[11] = "tina1";

	profiles[12] = 3555442;
	profile_name[12] = "JannieMac";

	profiles[13] = 3555487;
	profile_name[13] = "sherry162";

	profiles[14] = 3555624;
	profile_name[14] = "lillie43";

	profiles[15] = 3555720;
	profile_name[15] = "sexy_shindy";

	profiles[16] = 3555781;
	profile_name[16] = "melissa_cd2003";

	profiles[17] = 3555834;
	profile_name[17] = "pam102260";

	profiles[18] = 3555869;
	profile_name[18] = "sonyag333";
	
	
	floater_link = floater_link + '?id='+profiles[randProfile];	

	var floater_title = profile_name[randProfile]+' sent you a message...';


	if(typeof(floater_content)=="undefined"||!floater_content)
	{
		var deftexts=[];
		deftexts[0]='Hi baby<br/>I\'m hot and horny in New York<br/>I\'m ready to fuck tonight!';
		deftexts[1]='Hey neighbor you\'re in New York! Wanna party ? c\'mon!';
		deftexts[2]='Hiya, sex bomb ready for some fucking and sucking? Meet me tonight in New York!';
		deftexts[3]='Look. I\'m hot now and you\'re in New York what are we waiting for?';
		deftexts[4]='looking for action? it\'s what I want and you\'re right here in New York, let\'s play!';
		deftexts[5]='Hi hot stuff! I like to screw for hours and I\'m right next to New York, let\'s fuck!';
		deftexts[6]='Hello? you there? I\'d love a new fuck buddy. I\'m in New York where are you?';
		deftexts[7]='Hey there I can\'t stand it anymore I AM SOOO HORNY!!! you\'ve got to help me right away!';
		deftexts[8]='hi. can you chat? I\'m horny and all alone from New York, can you help me?';
		floater_content=deftexts[(Math.floor(Math.random()*deftexts.length))];
	}
	

}

if(typeof(floater_title)=="undefined"||!floater_title){floater_title='You have (1) new message...';}

if(typeof(floater_layout)=="undefined"||!floater_layout){
	floater_layout='media.sexinyourcity.com/ads/profiles/msnpopup';
}
// start ===================================
if (isIE()) {
    document.write('<style type="text/css">#im_popupFixed a{Arial,Geneva,Arial,Helvetica,sans-serif;font-size:10px;}#im_popupFixed {z-index: 100;position: absolute;bottom: 0px;right: 15px;width: 199px;height: 115px;}#im_popupDiv {position: relative;}</style>');
} else {
    document.write('<style type="text/css">#im_popupFixed a{Arial,Geneva,Arial,Helvetica,sans-serif;font-size:10px;}#im_popupFixed {z-index: 100;position: fixed;*position:absolute;*top: expression(eval(document.compatMode && document.compatMode=="CSS1Compat") ? documentElement.scrollTop+(documentElement.clientHeight-this.clientHeight) : document.body.scrollTop+(document.body.clientHeight-this.clientHeight));bottom: 0px;right: 15px;width: 199px;height: 115px;}#im_popupDiv {position: relative;}</style>');
}
// end =====================================

var gp_popup = {};
gp_popup.cookies = {createCookie:function(name, value, days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime() + (days * 24 * 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() {
    var str = '';
    str += '     <div id="im_blue" style="position:relative;width:201px; height:114px; margin:0; padding:1px; font-size:9px; font-family:Verdana, Arial, Helvetica, sans-serif; background:#fff url(http://media.sexinyourcity.com/ads/profiles/msnpopup/blue-style.png) no-repeat 0 0;">';
    str += '       <div id="im_clickable" style="margin:0; padding:1px; clear:both;">';
    str += '           <a href="' + floater_link + '" target="_blank" style="text-decoration:none;border:0px;z-index:10001;position:absolute;top:0px;left:0px;"><img src="http://media.sexinyourcity.com/ads/profiles/msnpopup/trans.gif" width="180" height="24" border="0" style="border: 0px;"/></a>';
    str += '         <p id="im_header" style="position:absolute;top:5px;left:10px;padding: 0; margin: 0; font-size:9px; color:#000;">' + floater_title + '</p>';
    str += '         </div>';
    str += '        <a style="text-decoration:none; float:right; margin:8px 6px 0 0; width:10px; height:10px;" id="im_close" href="#"></a>';
    str += '       <div id="im_clickable" style="margin:0; padding:1px; clear:both;">';
    str += '          <a href="' + floater_link + '" target="_blank" style="text-decoration:none;border:0px;z-index:100;position:absolute;top:25px;left:0px;"><img src="http://media.sexinyourcity.com/ads/profiles/msnpopup/trans.gif" width="200" height="88" border="0" style="border: 0px;"/></a>';
    str += '          <a id="im_pic" style="text-decoration:none;float:left;padding:0px;background:#fff;border:1px solid #ccc;margin:15px 10px 5px;*margin:10px 5px 0;" href="' + floater_link + '" target="_blank"><img style="border:0;" src="' + floater_img + '" height="50" width="50" /></a>';
    str += '          <p id="im_info" style="margin-top:10px;text-align:left;font-size:10px;"><a style="color:#0088e4;font-weight:bold;text-decoration:none;" href="' + floater_link + '" target="_blank">' + floater_content + '</a></p>';
    str += '          <p id="im_click" style="clear:both;margin:0;text-align:right;padding:0 10px 0px 5px;font-size:10px;"><a style="color:#0088e4;text-decoration:none;" href="' + floater_link + '" target="_blank">click here to reply &raquo;</a>';
    str += '        </div>';
    str += '    </div>';
    var popup = document.createElement('div');
    popup.id = "im_popupDiv";
    popup.name = "popupDiv";
    popup.style.height = "115";
    var newcontent = document.createElement('div');
    newcontent.id = "im_popupFixed";
    newcontent.appendChild(popup);
    popup.innerHTML = str;
    var scr = document.getElementById('popupJS');
    scr.parentNode.insertBefore(newcontent, scr);
};

gp_popup.animatePopup = function() {
    var pos = parseInt(this.myWin.style.top);
    this.myWin.style.display = "block";
    if (pos > (0)) {
        var newpos = pos - 5 > 0 ? pos - 5 : 0;
        this.myWin.style.top = newpos + 'px';
        if (newpos > 0) {
            var w1 = setTimeout('gp_popup.animatePopup()', 30);
        }
    } else {
        clearTimeout(w1);
    }
};

// start ===================================
gp_popup.animatePopupIE = function() {
	if (!this.alreadyStarted) {
	this.myWin.style.display = "block";
	this.alreadyStarted = true;
	}
	var pos = parseInt(this.myWin.style.top);
	var viewHeight = 0;
    if (document.documentElement && document.documentElement.clientHeight) {
        viewHeight = document.documentElement.clientHeight;
    } else if (document.body && document.body.clientHeight) {
        viewHeight = document.body.clientHeight;
    }
    var scroll = 0;
    if (document.body && document.body.scrollTop) {
        scroll = document.body.scrollTop;
    } else if (document.documentElement && document.documentElement.scrollTop) {
        scroll = document.documentElement.scrollTop;
    }

    var popupObj = document.getElementById('im_popupFixed');
    if (popupObj) {
        if (popupObj.offsetHeight + popupObj.offsetTop > viewHeight) {
            popupObj.style.top = (viewHeight - popupObj.offsetHeight) + 'px';
        }
    }

    var step = Math.abs(pos - scroll) / 5;
    var newpos = pos;
    if (pos > scroll) {
        newpos = pos - step > scroll ? pos - step : scroll;
    } else {
        newpos = pos + step < scroll ? pos + step : scroll;
    }
    this.myWin.style.top = newpos + 'px';
    setTimeout('gp_popup.animatePopupIE()', 30);
}
// end =====================================

gp_popup.closePopup = function() {
    var divBG = document.getElementById('im_popupDiv');
    divBG.style.display = 'none';
    gp_popup.cookies.createCookie('flc_1', '1', 1);
    return false;
};

if (!gp_popup.cookies.readCookie('flc_1')) {
    gp_popup.createPopup();
    gp_popup.myWin = document.getElementById('im_popupDiv');
    gp_popup.myWin.style.top = gp_popup.myWin.style.height;
    // start ===================================
    if (isIE()) {
        gp_popup.animatePopupIE();
    } else {
        gp_popup.animatePopup();
    }
    // end =====================================
    var x_close = document.getElementById('im_close');
    x_close.onclick = function() {
        gp_popup.closePopup();
        return false;
    };
}
