// Page Load
    if (document.location.href.indexOf('PrintPreview') > 0) {
        document.write('<style>');
        document.write('#leftMenu, #leftMenuHome, #menu, #topHeader, #topright, #rightMenu,#pageHeader, #topMenu { display: none; } ');
        document.write('body {background-color:#ffffff;background-image:none;}');
        document.write('#masterTable {background-color:#ffffff;background-image:none;}');
        document.write('#masterTableHome {background-color:#ffffff;background-image:none;}');
		document.write('#PageContent{background-color:#ffffff;background-image:none;position: absolute;top:0px;left:0px;width: 100%;}');
		document.write('#PageContentHome{background-color:#ffffff;background-image:none;position: absolute;top:0px;left:0px;width: 100%;}');
		document.write('#PageContentRegional{background-color:#ffffff;background-image:none;position: absolute;top:0px;left:0px;width: 100%;}');
		document.write('#headerIcons {display: none}');
	    document.write('.headerIcons {display: none}');
		document.write('#footerwrap {display: none}');
		document.write('.WebZoneBgBt {background-color:#ffffff; background-image:none;}');
		document.write('.WebZoneBg {background-color:#ffffff; background-image:none;}');
		document.write('#siteActionMenu {display: none}');
        document.write('</style>');
		window.print();
    }

$(document).ready(parseQuery);
    $(function(){
    	var originalFontSizeP = $('p').css('font-size');
    	var originalFontSizeS = $('span').css('font-size');
	    var originalFontSizeF = $('font').css('font-size');
		
		$('.Increase').click(function(){
			if ($('p').length) {
				var ourText = $('p');
				var currFontSize = ourText.css('fontSize');
				var finalNum = parseFloat(currFontSize, 10);
				var stringEnding = currFontSize.slice(-2);
				if (finalNum < 17) finalNum *=1.2;
				ourText.css('fontSize', finalNum + stringEnding);
			}
			if ($('p font').length) {
				var ourText = $('p font');
				var currFontSize = ourText.css('fontSize');
				var finalNum = parseFloat(currFontSize, 10);
				var stringEnding = currFontSize.slice(-2);
				if (finalNum < 17) finalNum *=1.2;
				ourText.css('fontSize', finalNum + stringEnding);
			}
			if ($('p span').length) {	
				var ourText = $('p span');
				var currFontSize = ourText.css('fontSize');
				var finalNum = parseFloat(currFontSize, 10);
				var stringEnding = currFontSize.slice(-2);
				if (finalNum < 17) finalNum *=1.2;
				ourText.css('fontSize', finalNum + stringEnding);
			}
			
			if ($('p div').length) {	
				var ourText = $('p div');
				var currFontSize = ourText.css('fontSize');
				var finalNum = parseFloat(currFontSize, 10);
				var stringEnding = currFontSize.slice(-2);
				if (finalNum < 17) finalNum *=1.2;
				ourText.css('fontSize', finalNum + stringEnding);
			}


		});
		$('.Decrease').click(function(){
			if ($('p').length) {
				var ourText = $('p');
				var currFontSize = ourText.css('fontSize');
				var finalNum = parseFloat(currFontSize, 10);
				var stringEnding = currFontSize.slice(-2);
				if (finalNum > 8) finalNum /=1.2;
				ourText.css('fontSize', finalNum + stringEnding);
			}
			if ($('p font').length) {
				var ourText = $('p font');
				var currFontSize = ourText.css('fontSize');
				var finalNum = parseFloat(currFontSize, 10);
				var stringEnding = currFontSize.slice(-2);
				if (finalNum > 8) finalNum /=1.2;
				ourText.css('fontSize', finalNum + stringEnding);			}
			if ($('p span').length) {
				var ourText = $('p span');
				var currFontSize = ourText.css('fontSize');
				var finalNum = parseFloat(currFontSize, 10);
				var stringEnding = currFontSize.slice(-2);
				if (finalNum > 8) finalNum /=1.2;
				ourText.css('fontSize', finalNum + stringEnding);
			}
			if ($('p div').length) {
				var ourText = $('p div');
				var currFontSize = ourText.css('fontSize');
				var finalNum = parseFloat(currFontSize, 10);
				var stringEnding = currFontSize.slice(-2);
				if (finalNum > 8) finalNum /=1.2;
				ourText.css('fontSize', finalNum + stringEnding);
			}


		});
		$('.Reset').click(function(){
			if ($('p').length) {
				var ourText = $('p');
				var currFontSize = ourText.css('fontSize');
				var finalNum = parseFloat(currFontSize, 10);
				var stringEnding = currFontSize.slice(-2);
				finalNum =11;
				ourText.css('fontSize', originalFontSizeP);
			}
			if ($('p font').length) {
				var ourText = $('p font');
				var currFontSize = ourText.css('fontSize');
				var finalNum = parseFloat(currFontSize, 10);
				var stringEnding = currFontSize.slice(-2);
				finalNum =11;
				ourText.css('fontSize', originalFontSizeF);

			}
			if ($('p span').length) {
				var ourText = $('p span');
				var currFontSize = ourText.css('fontSize');
				var finalNum = parseFloat(currFontSize, 10);
				var stringEnding = currFontSize.slice(-2);
				finalNum =11;
				ourText.css('fontSize', originalFontSizeS);
			}
			if ($('p div').length) {
				var ourText = $('p div');
				var currFontSize = ourText.css('fontSize');
				var finalNum = parseFloat(currFontSize, 10);
				var stringEnding = currFontSize.slice(-2);
				if (finalNum > 7) finalNum /=1.2;
				ourText.css('fontSize', finalNum + stringEnding);
			}

		});
	});
	
/*Send mail*/	
function SendMail(Title) {
        var sURL = document.location.href;
        if (Title=='Page') {
        	window.open("/Test/Pages/SendEmail.aspx?Title=" + document.getElementById('PageTitle').innerText +  "&Link=" + sURL, "_blank");}
        else
        {
	        window.open("/Test/Pages/SendEmail.aspx?Title=" + Title +  "&Link=" + sURL, "_blank");
        }
    }

/*Printing function*/

function PrintPreview() {
        var sURL = document.location.href;
        if (sURL.indexOf('?') > 0) {
            sURL = document.location + "&PrintPreview";
        }
        else {
            sURL = document.location + "?PrintPreview";
        }
        window.open(sURL);
    }
    
    
function PrintItem() {
	var tagid = $(this).attr("id");
	if (tagid) {
		    
		//build html for print page
		var html = "<HTML>\n<HEAD>\n"+
		$("head").html()+
		"\n</HEAD>\n<BODY>\n"+
		$("#"+tagid).html()+
		"\n</BODY>\n</HTML>";
		//open new window
		var printWP = window.open("","_blank");
		printWP.document.open();
		//insert content
		printWP.document.write(html);
		printWP.document.close();
		//open print dialog
		printWP.print();
	}
}

function parseQuery() {
	var regexS = "[\\?&]Country=([^&#]*)";  
	var regex = new RegExp( regexS );  
	var results = regex.exec( window.location.href );  
	if( results != null )
	TextDiv(results[1],results[1],'main');
}


function TextDiv(country, countryName, page)
	{
		if(page !='main') {
			document.getElementById('divAlbania').style.display = 'none';
			document.getElementById('divBosna').style.display = 'none';
			document.getElementById('divBulgaria').style.display = 'none';
			document.getElementById('divCroatia').style.display = 'none';
			document.getElementById('divMacedonia').style.display = 'none';
			document.getElementById('divMoldova').style.display = 'none';
			document.getElementById('divMontenegro').style.display = 'none';
			document.getElementById('divRomania').style.display = 'none';
			document.getElementById('divSerbia').style.display = 'none';
			document.getElementById('divKosovo').style.display = 'none';
			document.getElementById('divSlovenia').style.display = 'none';
			document.getElementById('divHungary').style.display = 'none';
			document.getElementById('divAustria').style.display = 'none';
			document.getElementById('divGreece').style.display = 'none';
			document.getElementById('divTurkey').style.display = 'none';
		}
			
			document.getElementById('imgAlbania').className = 'Albania';
			document.getElementById('imgBosna').className = 'Bosna';
			document.getElementById('imgBulgaria').className = 'Bulgaria';
			document.getElementById('imgCroatia').className = 'Croatia';
			document.getElementById('imgMacedonia').className = 'Macedonia';
			document.getElementById('imgMoldova').className = 'Moldova';
			document.getElementById('imgMontenegro').className = 'Montenegro';
			document.getElementById('imgRomania').className = 'Romania';
			document.getElementById('imgSerbia').className = 'Serbia';
			document.getElementById('imgKosovo').className = 'Kosovo';
			document.getElementById('imgSlovenia').className = 'Slovenia';
			document.getElementById('imgHungary').className = 'Hungary';
			document.getElementById('imgAustria').className = 'Austria';
			document.getElementById('imgGreece').className = 'Greece';
			document.getElementById('imgTurkey').className = 'Turkey';
			
			document.getElementById('lblAlbania').style.color='#647383';
			document.getElementById('lblBosna').style.color='#647383';
			document.getElementById('lblBulgaria').style.color='#647383';
			document.getElementById('lblCroatia').style.color='#647383';
			document.getElementById('lblMacedonia').style.color='#647383';
			document.getElementById('lblMoldova').style.color='#647383';
			document.getElementById('lblMontenegro').style.color='#647383';
			document.getElementById('lblRomania').style.color='#647383';
			document.getElementById('lblSerbia').style.color='#647383';
			document.getElementById('lblKosovo').style.color='#647383';
			document.getElementById('lblSlovenia').style.color='#647383';
			document.getElementById('lblHungary').style.color='#647383';
			document.getElementById('lblAustria').style.color='#647383';
			document.getElementById('lblGreece').style.color='#647383';
			document.getElementById('lblTurkey').style.color='#647383';

		
		if (page=='EU')
			{
            document.getElementById('imgAlbania').src = '/_layouts/images/cegd/countries/AlbaniaG.png';
			document.getElementById('imgBosna').src = '/_layouts/images/cegd/countries/BosnaG.png';
			document.getElementById('imgBulgaria').src = '/_layouts/images/cegd/countries/BulgariaG.png';
			document.getElementById('imgCroatia').src = '/_layouts/images/cegd/countries/CroatiaG.png';
			document.getElementById('imgMacedonia').src = '/_layouts/images/cegd/countries/MacedoniaG.png';
			document.getElementById('imgMoldova').src = '/_layouts/images/cegd/countries/MoldovaG.png';
			document.getElementById('imgMontenegro').src = '/_layouts/images/cegd/countries/MontenegroG.png';
			document.getElementById('imgRomania').src = '/_layouts/images/cegd/countries/RomaniaG.png';
			document.getElementById('imgSerbia').src = '/_layouts/images/cegd/countries/SerbiaG.png';
			document.getElementById('imgKosovo').src = '/_layouts/images/cegd/countries/KosovoG.png';
			document.getElementById('imgSlovenia').src = '/_layouts/images/cegd/countries/Slovenia.png';
			document.getElementById('imgHungary').src = '/_layouts/images/cegd/countries/Hungary.png';
			document.getElementById('imgAustria').src = '/_layouts/images/cegd/countries/Austria.png';
			document.getElementById('imgGreece').src = '/_layouts/images/cegd/countries/Greece.png';
			document.getElementById('imgTurkey').src = '/_layouts/images/cegd/countries/Turkey.png';
		}
		if (page=='WB')
		{
			document.getElementById('imgAlbania').src = '/_layouts/images/cegd/countries/Albania.png';
			document.getElementById('imgBosna').src = '/_layouts/images/cegd/countries/Bosna.png';
			document.getElementById('imgBulgaria').src = '/_layouts/images/cegd/countries/BulgariaG.png';
			document.getElementById('imgCroatia').src = '/_layouts/images/cegd/countries/Croatia.png';
			document.getElementById('imgMacedonia').src = '/_layouts/images/cegd/countries/Macedonia.png';
			document.getElementById('imgMoldova').src = '/_layouts/images/cegd/countries/MoldovaG.png';
			document.getElementById('imgMontenegro').src = '/_layouts/images/cegd/countries/Montenegro.png';
			document.getElementById('imgRomania').src = '/_layouts/images/cegd/countries/RomaniaG.png';
			document.getElementById('imgSerbia').src = '/_layouts/images/cegd/countries/Serbia.png';
			document.getElementById('imgKosovo').src = '/_layouts/images/cegd/countries/Kosovo.png';
			document.getElementById('imgSlovenia').src = '/_layouts/images/cegd/countries/SloveniaG.png';
			document.getElementById('imgHungary').src = '/_layouts/images/cegd/countries/HungaryG.png';
			document.getElementById('imgAustria').src = '/_layouts/images/cegd/countries/AustriaG.png';
			document.getElementById('imgGreece').src = '/_layouts/images/cegd/countries/GreeceG.png';
			document.getElementById('imgTurkey').src = '/_layouts/images/cegd/countries/TurkeyG.png';

		}
		
		if (page=='SEE' || page=='main')
		{
			document.getElementById('imgAlbania').src = '/_layouts/images/cegd/countries/Albania.png';
			document.getElementById('imgBosna').src = '/_layouts/images/cegd/countries/Bosna.png';
			document.getElementById('imgBulgaria').src = '/_layouts/images/cegd/countries/Bulgaria.png';
			document.getElementById('imgCroatia').src = '/_layouts/images/cegd/countries/Croatia.png';
			document.getElementById('imgMacedonia').src = '/_layouts/images/cegd/countries/Macedonia.png';
			document.getElementById('imgMoldova').src = '/_layouts/images/cegd/countries/Moldova.png';
			document.getElementById('imgMontenegro').src = '/_layouts/images/cegd/countries/Montenegro.png';
			document.getElementById('imgRomania').src = '/_layouts/images/cegd/countries/Romania.png';
			document.getElementById('imgSerbia').src = '/_layouts/images/cegd/countries/Serbia.png';
			document.getElementById('imgKosovo').src = '/_layouts/images/cegd/countries/Kosovo.png';
			document.getElementById('imgSlovenia').src = '/_layouts/images/cegd/countries/SloveniaG.png';
			document.getElementById('imgHungary').src = '/_layouts/images/cegd/countries/HungaryG.png';
			document.getElementById('imgAustria').src = '/_layouts/images/cegd/countries/AustriaG.png';
			document.getElementById('imgGreece').src = '/_layouts/images/cegd/countries/GreeceG.png';
			document.getElementById('imgTurkey').src = '/_layouts/images/cegd/countries/TurkeyG.png';
		}
		
		document.getElementById('img' + country).src = '/_layouts/images/cegd/countries/' + country + '_.png';
		document.getElementById('img' + country).className = country + 'S';
		if (page !='main') {
		document.getElementById('div' + country).style.display = 'block';
		document.getElementById('CountryName').innerText = countryName;}
		
		
		document.getElementById('lbl' + country).style.color='#16232F';
}

