﻿function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

function setCookie_days(c_name,value,expire)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expire);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function setCookie_hours(c_name,value,expire)
{
var exdate=new Date();
exdate.setTime(exdate.getTime()+1000*60*60*expire);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function Delete_Cookie( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}


if (getCookie("_bgtop")=="")
{
document.write('<script>');


document.write('function setCookie_days(name,value,days) {');
document.write(' if (days) {');
document.write(' var date = new Date();');
document.write(' date.setTime(date.getTime()+(days*24*60*60*1000));');
document.write(' expires = "; expires="+date.toGMTString();');
document.write(' }');
document.write(' else var expires = "";');
document.write('document.cookie = name+"="+value+expires+"; path=/";');
document.write('}');

document.write('function setCookie_hours(name,value,hours) {');
document.write(' if (hours) {');
document.write(' var date = new Date();');
document.write(' date.setTime(date.getTime()+(hours*60*60*1000));');
document.write(' expires = "; expires="+date.toGMTString();');
document.write(' }');
document.write(' else var expires = "";');
document.write('document.cookie = name+"="+value+expires+"; path=/";');
document.write('}');

document.write('function doThis()');
document.write('{');
document.write('setCookie_hours("_bgtop","visited",25);');
document.write('window.location.reload( false );');
//document.write('alert("testing");');
document.write('return true');
document.write('}');

document.write('function doThis2()');
document.write('{');
document.write('setCookie_hours("_bgtop","visited",1);');
document.write('window.location.reload( false );');
document.write('return true');
document.write('}');
document.write('</script>	');

document.write('<div style="position: fixed;left: 0px;top: 30%; width: 100%;height: 180px; overflow: auto; display: block;" class="module borderwrap" id="login_popup">');
document.write('	<div style="display: block;" id="login_popup_content">');
document.write(' 			<div id="login_popup_title" class="maintitle">');
document.write(' 				<table border=0 width=100%>');
document.write(' 				<tr>');
document.write(' 				<td><h3>Долна баня </h3></td>');
document.write(' 				<td width=50 align="center"><a target=_self href="javascript:doThis2()" style="text-decoration:none"><font color="red" size="6px"><b>X</b></font></a></td>');
document.write(' 				</tr>');
document.write(' 				</table>');
document.write(' 			</div>');
 			
document.write(' 			<div class="box-content">');
document.write(' 				<div style="margin: auto; text-align: center; width: 100%;">');
document.write('					<br>');
document.write('					<font color="blue"><span style="font-size: 18px; line-height: normal;"><strong>Гласувайте за нас в BGTop.</strong><br></span></font><br>');
document.write(' 					<font color="blue"><span style="font-size: 18px; line-height: normal;"><strong>Веднага щом гласувате това съобщение ще се махне .</strong><br></span></font><br>');
document.write('				<br>');
				
document.write('					<form action="http://bgtop.net/in.php/1233267270" onsubmit="return doThis()" method="post" target="_blank"> ');
document.write('						<input class="button" value="ГЛАСУВАЙ" type="submit">');
//document.write('						<input class="button" value="Регистрирайте се" onclick="parent.location=\'/profile.forum?mode=register\';" type="button">');
document.write('					</form>');
document.write('				</div>');
			
document.write('			</div>');

document.write('	</div>');
document.write('</div>');

}
else
{
if (getCookie("fa_dolnobanci_super-forum_net_sid")=="")
{
	
document.write('<div style="position: fixed;left: 0px;top: 20%; width: 100%;height: 430px; overflow: auto; display: block;" class="module borderwrap" id="login_popup">');
document.write('	<div style="display: block;" id="login_popup_content">');
document.write(' 			<div id="login_popup_title" class="maintitle">');
document.write(' 				<h3>Долна баня </h3>');
document.write(' 			</div>');
 			
document.write('			<div class="box-content">');
document.write(' 				<div style="margin: auto; text-align: center; width: 100%;">');
document.write('					<br>');
document.write('					<font color="blue"><span style="font-size: 18px; line-height: normal;"><strong>Моля преминете към регистрация във Форума</strong><br></span></font><br>');
document.write(' 					<a href="http://dolnobanci.super-forum.net"><img src="http://www.public-republic.com/wp-content/uploads/2008/11/smile.jpg" alt=""></a><br>');
document.write('					<font color="blue"><span style="font-size: 18px; line-height: normal;"><strong>Долна баня - Форум</strong><br></span></font><br>');

//document.write('				<div id="login_popup_buttons">');
document.write('					<form action="/login.forum" method="get" target="_parent">');
document.write('						<input class="button" value="Вход" type="submit">');
document.write('						<input class="button" value="Регистрирайте се" onclick="parent.location=\'/profile.forum?mode=register\';" type="button">');
document.write('					</form>');
document.write('				</div>');
document.write('			</div>');
document.write('	</div>');
document.write('</div>');

}

}

