function getMovie(name, w, h, flash_vars,returnHTML) {
	if(name=="banner.swf") {
		splashScreen();
	}
	if(name=="footer.swf") {
		docReady(1);
	}
	if(name=="/footer.swf") {
		docReady();
	}
   html = ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+w+'" HEIGHT="'+h+'" id="Home" ALIGN="">\n');
   html+= ('<param name="FlashVars" value="'+flash_vars+'">\n');
   html+= ('<PARAM NAME="movie" VALUE="'+name+'">\n');
   html+= ('<PARAM NAME="wmode" VALUE="transparent">\n');
   html+= ('<PARAM NAME="quality" VALUE="high">\n');
   html+= ('<EMBED src="'+name+'" FlashVars="'+flash_vars+'" wmode=transparent quality="high" WIDTH="'+w+'" HEIGHT="'+h+'" NAME="Home" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>\n');
   html+= ('</object>\n');
   if(typeof returnHTML=="undefined") {
	  document.write(html)
   } else {
	   return html;
   }
}
document.write('<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>');

	function changePayMethod(form) {
		if(form==1) {
			document.getElementById("payForm1").style.display = "block";
			document.getElementById("payForm2").style.display = "none";
			document.getElementById("payForm3").style.display = "none";
			document.getElementById("payForm4").style.display = "none";
		} else if (form==2) {
			document.getElementById("payForm1").style.display = "none";
			document.getElementById("payForm2").style.display = "block";
			document.getElementById("payForm3").style.display = "none";
			document.getElementById("payForm4").style.display = "none";
		} else if (form == 3) {
			document.getElementById("payForm1").style.display = "none";
			document.getElementById("payForm2").style.display = "none";
			document.getElementById("payForm3").style.display = "block";
			document.getElementById("payForm4").style.display = "none";
		} else {
			document.getElementById("payForm1").style.display = "none";
			document.getElementById("payForm2").style.display = "none";
			document.getElementById("payForm3").style.display = "none";
			document.getElementById("payForm4").style.display = "block";
		}
	}
function breadcrumbs() {
	var level1 = {
		"index.php":"Начало",
		"who-we-are.html":"Кои сме ние",
		"our-activity.html":"Нашата дейност",
		"how-to-help.html":"Как да помогнете",
		"news-and-publications.php":"Новини и публикации",
		"friends-and-partners.html":"Партньори и приятели",
		"sos-bazar.php":"SOS Базар",
		"contacts.html":"Контакти"
	};
	var level2 = {
		"index.php":"Начало",
		"who-we-are.html":[
			["who_we_are_sos_model.html","Моделът SOS Детски Селища България"],
			["who_we_are_stocks.html","Корени"],
			["who_we_are_vision.html","Визия"],
			["who_we_are_mission.html","Мисия"],
			["who_we_are_values.html","Ценности"]
		],
		"our-activity.html":[
			["our_activity_youth_homes.html","SOS Младежки домове"],
			["our_activity_our_children_tell.html","Подкрепа след SOS грижата"],
			["our_activity_social_programs.html","Програма Подкрепете семейството"],
			["our_activity_projects.html","Проекти"],
			["our_activity_annual_report.html","Годишни отчети"],
			["our_activity_managment.html","Органи на управление"]
		],
		"how-to-help.html":[
			["individual_sponsors.html","Индивидуални дарители"],
			["how-to-help_company.html","Корпоративни дарители"],
			["business_partnership.html","Корпоративни дарители"],
			["how_to_help_family_donors.html","Семейно спонсорство"],
			["vakation_donors_private.php","Онлайн регистрация на дарители"],
			["how_to_help_sms_campaign.html","SMS Кампания"],
			["how_to_help_info.html","Информация за нашите дарители"],
			["how_to_help_our_bills.html","Нашите банкови сметки"]
		],
		"news-and-publications.php":"Новини и публикации",
		"friends-and-partners.html":"Партньори и приятели",
		"sos-bazar.php":"SOS Базар",
		"contacts.html":"Контакти"
	};
	var current = document.location.pathname.replace("/","");
	var crumbs = [];
	for(i in level2) {
		if(typeof level2[i] == "object") {
			for(p in level2[i]) {
				if(level2[i][p[0]][0]==current) {
					crumbs.push(level2[i][p])
					crumbs.push([i,level1[i]])
					crumbs.push(["index.php",level1["index.php"]])
					break;
				}
			}
		}
	}
	if(!crumbs.length) {
		for(i in level1) {
			if(i==current) {
				crumbs.push([i,level1[i]])
				crumbs.push(["index.php",level1["index.php"]])
			}
		}
	}
	// build
	if(crumbs.length) {
		crumbs.reverse()
		var link = "";
		var count = 0;
		var countTotal = crumbs.length-1;
		for(i in crumbs) {
			link+= '<a href="'+crumbs[i][0]+'">'+crumbs[i][1]+'</a> ';
			if(countTotal>count) {
				link+= '&raquo; ';
			}
			count++;
		}
		document.write('<div class=crumbs>'+link+'</div>');
	}
}

function initLoading() {
	var html = '<div id="loading" class="loading-visible"><p>Зареждане ...</p></div>';
	document.write(html);
	var hideDiv = function(){document.getElementById("loading").className = "loading-invisible";};
	var oldLoad = window.onload;
	var newLoad = oldLoad ? function(){hideDiv.call(this);oldLoad.call(this);} : hideDiv;
	window.onload = newLoad;
} 

function splashScreen() {
	if(!getCookie("splashScreen")) {
		setCookie("splashScreen",1);
var html="";
html += "<div style=\"position:absolute;top:0;left:0;width:100%;height:100%;background:url(/bg-semi-dark.png);\" id=\"splashScreenObj\">";
html += "<table style=\"width:100%;height:100%;\">";
html += "	<tr><td>";
html += "		<center>";
html += "			<span style=\"width:700px;margin:0 auto;height:200px;display:block;;\"><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"700\" height=\"200\" >";
html += "		<param name=\"movie\" value=\"http:\/\/www.sosbg.org\/donate\/banners\/700x200.swf?1\" \/>";
html += "		<param name=\"quality\" value=\"high\" \/>";
html += "		<param name=\"menu\" value=\"false\" \/>";
html += "		<param name=\"devicefont\" value=\"false\" \/>";
html += "		<param name=\"salign\" value=\"\" \/>";
html += "		<param name=\"allowScriptAccess\" value=\"always\" \/>";
html += "		<!--[if !IE]>-->";
html += "		<object type=\"application\/x-shockwave-flash\" data=\"http:\/\/www.sosbg.org\/donate\/banners\/700x200.swf?1\" width=\"700\" height=\"200\">";
html += "			<param name=\"movie\" value=\"http:\/\/www.sosbg.org\/donate\/banners\/700x200.swf?1\" \/>";
html += "			<param name=\"quality\" value=\"high\" \/>";
html += "			<param name=\"menu\" value=\"false\" \/>";
html += "			<param name=\"devicefont\" value=\"false\" \/>";
html += "			<param name=\"salign\" value=\"\" \/>";
html += "			<param name=\"allowScriptAccess\" value=\"always\" \/>";
html += "		<!--<![endif]-->";
html += "			<script src=\"http:\/\/sosbg.org\/donate\/a.js\"><\/script>";
html += "			<a href=\"http:\/\/www.adobe.com\/go\/getflash\">";
html += "				<img src=\"http:\/\/www.adobe.com\/images\/shared\/download_buttons\/get_flash_player.gif\" alt=\"Get Adobe Flash player\" \/>";
html += "			<\/a>";
html += "		<!--[if !IE]>-->";
html += "		<\/object>";
html += "		<!--<![endif]-->";
html += "	<\/object><div class=close><a  href=\"#\"onclick=\"document.getElementById('splashScreenObj').style.display='none'\" href=\"\">Close</a></div></span></center>";
html += "";
html += "	<\/td><\/tr>";
html += "<\/table>";
html += "<\/div>";
html += "";		
document.write(html);
	}
}

function docReady(titles) {
	html = getMovie("/donate/banners/300x250.swf","222","186","",1);
	$("<br><center>"+html+"</center>").insertAfter('#sidebar-menu');
	$('<div class="logoLink"><a href="http://sosbg.org">SOS Детски селища България</a></div>').insertBefore("div.body");
}

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);
    }
  }
}

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;
}
