var cdIpop_scriptLocation = "http://ktu.sv2.biz/tools/infopop/";

var cdPop;

if (typeof jQuery == 'undefined') {
	document.write("<script type=\"text/javascript\" src=\""+cdIpop_scriptLocation+"jquery-1.6.1.min.js\"></scr"+"ipt>");
	//jQuery.noConflict();
}

function cdInfopop(object) {
	this.object = object;
	this.close = cfInfopopClose;
	this.cookieName = object.cookieName;

	if (!getCookie(this.cookieName)) {
	document.write("<style type=\"text/css\">\
	.cdInfopop {position: absolute; right: 0; bottom: 0, border: 1px solid red; height: 1px; overflow: hidden; vertical-align: bottom} \
	.cdInfopopFixed {/*position: fixed; bottom: 0 !important; right: 0;*/}\
	.cdInfopop a {position: absolute; top: 5px; right: 15px}\
	.cdInfopop a img {border: 0;}\
	</style>");

	document.write("<div class=\"cdInfopop"+(document.all ? "" : " cdInfopopFixed")+"\"><a href=\"javascript:;\" onclick=\"return cdPop.close()\"><img src=\""+cdIpop_scriptLocation+"bar.png\" alt=\"close\" /></a><br />"+this.object.source+"</div>");

	jQuery(document).ready(function () {
		if (typeof yesfkchatinfopop != 'undefined') {
			cdPop = yesfkchatinfopop ;
		}else if (typeof csfkchatinfopop != 'undefined') {
			cdPop = csfkchatinfopop;
		}else if (typeof rhfkchatinfopop != 'undefined') {
			cdPop = rhfkchatinfopop;
		}

		jQuery(".cdInfopop").css("bottom", "-"+jQuery(window).scrollTop() + "px");
		jQuery(".cdInfopop").animate({height: cdPop.object.height+16}, 2000);

		jQuery(window).bind("scroll resize", function() {
			jQuery(".cdInfopop").css("bottom", "-"+jQuery(window).scrollTop() + "px");
		});

	});
	}
}

function cfInfopopClose() {
	jQuery(".cdInfopop").animate({height: 1}, 2000, function() {jQuery(".cdInfopop").hide()});
	setCookie(this.cookieName, 1);
}

function setCookie(c_name,value,exdays) { var exdate=new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString()); document.cookie=c_name + "=" + c_value; }

function getCookie(c_name) { var i,x,y,ARRcookies=document.cookie.split(";"); for (i=0;i<ARRcookies.length;i++) { x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("=")); y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); x=x.replace(/^\s+|\s+$/g,""); if (x==c_name) { return unescape(y); } } }
