// These are the custom settings
// Scrolling type - scroll interval in milliseconds (1000 = 1 second)
var intInterval = 5000;

// Random code addition (in case multiple blocks are on a single page i.e. the config page)
var intRandId = Math.round( 100 * Math.random() );

// Fonts
strHeader1Font 	= 'verdana';
strHeader2Font 	= 'verdana';
strGeneralFont	= 'verdana';

// Fontsizes
strHeader1Size	= '12pt';
strHeader2Size	= '10pt';
strGeneralSize	= '8pt';

// Colors
strBack1Color	= '#FFFFFF';
strBack2Color	= '#FFFFFF';
strBorderColor	= '#FFFFFF';
strHeader1Color	= '#019702';
strHeader2Color	= '#019702';
strGeneralColor = '#777777';
strLinkColor	= '#777777';

// Logo or text?
blnUseLogo = false;
strLogo	= 'images/kpn.gif';
strText = 'Laatste Nieuws';

// The news items to display
arrItems = new Array( 2 );
arrItems[0] = new Array( 'Nieuws', 'KPN verhoogt snelheden Zakelijk Internet', 'ia245/nieuws/313' );
arrItems[1] = new Array( 'Nieuws', 'Als het gras elders niet zo groen blijkt', 'ia245/nieuws/304' );

// Base link
strBaselink = 'http://www.partnernieuws.nl/';

// syndOpenWindow function
// Opens a popup window without all default browser features
function syndOpenWindow( strTarget ) {
	var strOpts = "";
	strOpts = 'left=50,top=50,screenX=50,screenY=50,width=800,height=600,menubar=no,location=no,resizable=no,scrolling=yes,scrollbars=yes,status=0';
	PopUP = window.open( strTarget, 'eMarketing', strOpts);
	PopUP.focus();
}

// renderBlock()
// This function handles the actual display of the syndication block on the site
function renderBlock() {
	// Output the header
	document.write( '<div id="syn_container" style="background-color: ' + strBack1Color + '; width: 200px; border: 1px solid ' + strBorderColor + '; line-height: 100%;">' );
	document.write( ' <div id="syn_header" style="font-family: ' + strHeader1Font + '; font-size: ' + strHeader1Size + '; color: ' + strHeader1Color + '; text-align: center; vertical-align: middle; height: 45px;">' );
	
	// Output either the logo or the custom titletext
	if( blnUseLogo ) {
		document.write( '  <img src="' + strBaselink + strLogo + '" alt="KPN Business Partner" />' );
	} else {
		document.write( '  <h3 style="font-family: ' + strHeader1Font + '; font-size: ' + strHeader1Size + '; color: ' + strHeader1Color + '; text-align: center;">' + strText + '</h3>' );
	}
	
	// End header, start content
	document.write( ' </div>' );
	document.write( ' <div id="syn_content' + intRandId + '" style="font-family: ' + strGeneralFont + '; font-size: ' + strGeneralSize + '; background-color: ' + strBack2Color + '; color: ' + strGeneralColor + '; padding: 3px; border-top: 1px solid ' + strBorderColor + '; text-align: left;">' );
	
	// Output the newsitems
	if( arrItems.length == 0 ) {
		document.write( '<span style="text-align: justify;">Op dit moment geven wij er de voorkeur aan om u persoonlijk te informeren over de lopende aanbiedingen van KPN.<br />Voor persoonlijk advies kunt u ons bellen.</span>' );
	} else {
		for( var intCounter = 0; intCounter < arrItems.length; intCounter++ ) {
			if( arrItems[intCounter][1].length > 26 ) {
				strDisplayTitle = arrItems[intCounter][1].substr( 0, 26 ) + '...';
			} else {
				strDisplayTitle = arrItems[intCounter][1];
			}
					
			if( arrItems[intCounter][2] ) {
				strLink = strBaselink + arrItems[intCounter][2];
			} else {
				strLink = '#';
			}
			
			document.write( '  &bull; <a onclick="syndOpenWindow( \'' + strLink + '\' );" title="' + arrItems[intCounter][0] + ': ' + arrItems[intCounter][1] + '" style="color: ' + strLinkColor + '; cursor: hand;">' + strDisplayTitle + '</a><br />' );
		}
	}
		
	// Output the footer
	document.write( ' </div>' );
	document.write( '</div>' );
}


// Call renderBlock();
renderBlock();