// JavaScript Document
function tFireBugs(cls,echo) { //v2.6
if (navigator.userAgent.indexOf('Chrome') > -1) { var agent='Chrome';}
else if (navigator.userAgent.indexOf('Safari') > -1) { var agent = 'Safari'; }
else { var agent = (navigator.userAgent.indexOf('Firefox') > -1) ? 'Firefox': navigator.appName; }
var msg1="<p><b style='color:#cd0078'>Bem&aelig;rk</b> at dit system (", cls=cls, lnk="/System/TopLinks/KundeCenter/Sporgsmal-og-svar/Hjalp-til-vores-kunder/", build_string ="<div class="+cls+">"+ msg1 + "" + agent + ") ikke er underst&oslash;ttet af vores online ans&oslash;gnings formular. Du kan i stedet ans&oslash;ge via telefonen, det tager kun f&aring; minutter.</p><a class=SpecialLink2 href=/System/TopLinks/KundeCenter/Sporgsmal-og-svar/Hjalp-til-vores-kunder/>Hj&aelig;lp til vores kunder</a></div>";
if (agent=="Firefox" && echo!="b") { document.write(build_string);document.getElementById('Ploan_Apply_Btn_2').style.display = "none";document.getElementById('Ploan_Apply_Btn_1').style.display = "none";};
if (echo=="b") { document.write(agent)};
}
function Set_Cookie( name, value, expires, path, domain, secure ) 
{
var today = new Date();
today.setTime( today.getTime() );
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}
function Get_Cookie( check_name ) {
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		a_temp_cookie = a_all_cookies[i].split( '=' );
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}
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";
}
function tagbybeh (heroid){
	var numview = Get_Cookie('numview'); 
    if (numview) numview = parseInt(numview) + 1; 
    else numview = 1;
	if (Get_Cookie('revisit') == '1' && Get_Cookie('numview') == null) {
		Set_Cookie('revisit','2','1095');
	} else if (Get_Cookie('revisit')== null) {
		Set_Cookie('revisit','1','1095'); 
	}
	if (Get_Cookie('revisit') == '2') {
		banhref = document.getElementById('fbanner1link');
		banimg = document.getElementById('fbanner1');
		banimg.alt = 'Log paa Min Side her ...';
		banimg.src = '/upload/gfx/Min-Side-Banner-'+heroid+'.gif';
		banhref.href ='/Kundecenter/';
		banhref.title = 'Log paa Min Side her ...';
	}
	Set_Cookie('numview', numview);
}
function tagbybeh_0000 (heroid){
	var numview = Get_Cookie('numview'); 
    if (numview) numview = parseInt(numview) + 1; 
    else numview = 1;
	if (Get_Cookie('revisit') == '1' && Get_Cookie('numview') == null) {
		Set_Cookie('revisit','2','1095');
	} else if (Get_Cookie('revisit')== null) {
		Set_Cookie('revisit','1','1095'); 
	}
	if (Get_Cookie('revisit') == '2') {
			var today = new Date();
			var month = today.getMonth();
			var day = today.getDate();
			var year = today.getFullYear();
			var rv_dt = new Date(year, month, day)
			  if (Get_Cookie('rv_dt')) { 
				  var rv_dt_cv = new Date(Get_Cookie("rv_dt"));
				  rv_dt_cv.setDate(rv_dt_cv.getDate()+1);
				  var has_age = new Boolean((rv_dt_cv < today));
			  }
			  else {Set_Cookie('rv_dt',rv_dt,'1095'); };
			  if (has_age == true) {
				banhref = document.getElementById('flaHeroLink');
				banimg = document.getElementById('flaHeroImg');
				banimg.alt = 'Log paa Min Side her ...';
				banimg.src = '/upload/gfx/'+heroid+'.gif';
				banhref.href ='/Kundecenter/';
				banhref.title = 'Log paa Min Side her ...';
			    swfobject.embedSWF("/upload/fla/"+heroid+".swf" , "flaHero", "670", "400", "9.0.0","/upload/fla/expressInstall.swf", flashvars, params, attributes);
				}
	}
	Set_Cookie('numview', numview);
}
