function sluiten()
{
	self.close()
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

function CreateQuicktimeControl(DivID, CLSID, ObjectID, WIDTH, HEIGHT, SRC, AUTOSTART)
{
 	var d = document.getElementById(DivID);
  	d.innerHTML = 
   '<object classid=' + CLSID + ' id=' + ObjectID + ' width=' + WIDTH + ' height=' + HEIGHT +' CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab#version=7,0,4,0"><param name="SRC" value=' + SRC + '><PARAM NAME="controller" VALUE="TRUE"><PARAM NAME="type" VALUE="video/quicktime"><param name="autoStart" value=' + AUTOSTART + '><EMBED WIDTH=' + WIDTH + ' HEIGHT=' + HEIGHT + ' CONTROLLER="TRUE" TARGET="myself" SRC=' + SRC + ' type="video/quicktime" BGCOLOR="#000000" BORDER="0" PLUGINSPAGE="http://www.apple.com/quicktime/download/indext.html"></object>';
}

function CreateWindowsMediaControl(DivID, CLSID, ObjectID, WIDTH, HEIGHT, URL, AUTOSTART)
{
  var d = document.getElementById(DivID);
  d.innerHTML = 
    '<object classid=' + CLSID + ' id=' + ObjectID + ' width=' + WIDTH + ' height=' + HEIGHT +' type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"><param name="uiMode" value="None"><param name="DisplaySize" value="0"><param name="TransparentAtStart" value="false"><param name="ShowControls" value="True"><param name="ShowStatusBar" value="True"><param name="Mute" value="False"><PARAM name="Volume" value="600"><param name="FileName" value=' + URL + '><param name="autoStart" value=' + AUTOSTART + '><embed src=' + URL + ' width=' + WIDTH + ' height=' + HEIGHT +' type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" AutoStart=' + AUTOSTART + ' ShowStatusBar="1" ShowTracker="1" ShowControls="1" ShowAudioControls="1" ShowPositionControls="1" EnableTracker="1" Mute="0"></object>';
}

function clearText(thefield) {
        if (thefield.defaultValue == thefield.value)
                thefield.value = ""
        else thefield.value = thefield.defaultValue
} 

// JQUERY FUNCTIONS

$(function() {
/*		   
	$("#twitter").getTwitter({
		userName: "glaswerkt",
		numTweets: 3,
		loaderText: "Loading tweets...",
		slideIn: true,
		slideDuration: 750,
		showHeading: true,
		headingText: "Helios Tweets",
		showProfileLink: true,
		showTimestamp: true
	});   		   
*/
	// VALIDATE REACTIEFORM
	$("#ReactieForm").validate({
		rules: {
			naam: {
				required: true,
				minlength: 2
			},
			bericht: {
				required: true,
				minlength: 2
			},
			email: {
				required: true,
				email: true
			}
		},
		messages: {
			naam: "Vul aub uw naam in",
			bericht: "Vul aub uw reactie in",
			email: "Vul een geldig e-mailadres in"	
		}
	});	
	
	$("#Controller").jFlow({
			controller: ".jFlowControl", // must be class, use . sign
			slideWrapper : "#jFlowSlider", // must be id, use # sign
			slides: "#Slides",  // the div where all your sliding divs are nested in
			selectedWrapper: "jFlowSelected",  // just pure text, no sign
			width: "582px",  // this is the width for the content-slider
			height: "374px",  // this is the height for the content-slider
			duration: 200,  // time in miliseconds to transition one slide
			prev: ".jFlowPrev", // must be class, use . sign
			next: ".jFlowNext", // must be class, use . sign
			auto: true	
    });	
	
});
