<!--
// image functies
function doOver (img) {
	img.setAttribute("src",img.getAttribute("src").replace(/.gif/g,"_o.gif"));
}
function doOut (img) {
	img.setAttribute("src",img.getAttribute("src").replace(/_[od]\./g,"."));
}
function doDown (img) {
	img.setAttribute("src",img.getAttribute("src").replace(/_o.gif/g,"_d.gif"));
}
function doUp (img) {
	img.setAttribute("src",img.getAttribute("src").replace(/_[od]\./g,"."));
}

function popup (url, fullscreen) {
	if(!fullscreen) {
		var new_win = window.open(url, 'popup', 'menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0,directories=0,height=535,width=744,left=0,top=0');
		new_win.moveTo( (screen.width/2) - (744/2), (screen.height/2) - (535/2) );
	} else {
		if(document.all) {
			//var new_win = window.open("sketch_flash_fs.html", 'popup', 'menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0,directories=0, fullscreen=yes,left=0,top=0');
			var new_win = window.open(url, 'popup', 'menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0,directories=0,height=' + screen.height + ',width=' + screen.width + ',left=0,top=0');
		} else {
			var new_win = window.open(url, 'popup', 'menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0,directories=0,height=' + screen.height + ',width=' + screen.width + ',left=0,top=0');
		}
		// IE needs resizeTo
		new_win.resizeTo(screen.width,screen.height);
	}
	new_win.focus();
}

function openViewer(inID) {
	// Set URL
	var url = "viewer.cfm?session_id=" + inID;
	
	// Check if flash 7 is installed
	if(!detectFlash()) {
		url = "sketch_flash_alt.html";
	}
	
	// Open window
	var new_win = window.open(url, "viewer", "menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0,directories=0,height=535,width=744,left=0,top=0");
	
	// Move and focus popup window
	new_win.moveTo( (screen.width/2) - (744/2), (screen.height/2) - (535/2) );
	new_win.focus();
}

function openEditor(inID, inVersion, isNieuw) {
	// Set URL
	var url = "editor.cfm?session_id=" + inID + "&version=" + inVersion;
	if (isNieuw == "JA") {
		url = "editor.cfm?version=" + inVersion;
	} 
	
	// Check if flash 7 is installed
	if(!detectFlash()) {
		url = "sketch_flash_alt.html";
	}

	// Open window IE or MOZ
	if(document.all) {
		var new_win = window.open(url, "editor", "menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0,directories=0,height=" + screen.height + ",width=" + screen.width + ",left=0,top=0");
	} else {
		var new_win = window.open(url, "editor", "menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0,directories=0,height=" + screen.height + ",width=" + screen.width + ",left=0,top=0");
	}
	
	// Resize (fullscreen) and focus popup window
	new_win.resizeTo(screen.width, screen.height);
	new_win.focus();
}


// Next comes the standard javascript detection that uses the 
// navigator.plugins array. We pack the detector into a function so that 
// it preloads before being run.

function detectFlash() {
	// If navigator.plugins exists...
	if (navigator.plugins) {
		// ...then check for flash 2 or flash 3+.
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
		
			// Some version of Flash was found. Time to figure out which.
			
			// Set convenient references to flash 2 and the plugin description.
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			
			// DEBUGGING: uncomment next line to see the actual description.
			// alert("Flash plugin description: " + flashDescription);
			
			// A flash plugin-description looks like this: Shockwave Flash 4.0 r5
			// We can get the major version by grabbing the character before the period
			// note that we don't bother with minor version detection. 
			// Do that in your movie with $version or getVersion().
			var flashVersion = parseInt(flashDescription.substring(16));
			
			// We found the version, now set appropriate version flags. Make sure
			// to use >= on the highest version so we don't prevent future version
			// users from entering the site.
			flash2Installed = flashVersion == 2;    
			flash3Installed = flashVersion == 3;
			flash4Installed = flashVersion == 4;
			flash5Installed = flashVersion == 5;
			flash6Installed = flashVersion == 6;
			flash7Installed = flashVersion == 7;
			flash8Installed = flashVersion == 8;
			flash9Installed = flashVersion >= 9;
		}
	}
	
	// Loop through all versions we're checking, and
	// set actualVersion to highest detected version.
	for (var i = 2; i <= maxVersion; i++) {  
		if (eval("flash" + i + "Installed") == true) {
			actualVersion = i;
		}
	}
	
	// If we're on msntv (formerly webtv), the version supported is 4 (as of
	// January 1, 2004). Note that we don't bother sniffing varieties
	// of msntv. You could if you were sadistic...
	if(navigator.userAgent.indexOf("WebTV") != -1) {
		actualVersion = 4;
	}
	
	if (actualVersion >= requiredVersion) {
		hasRightVersion = true;                
	} else {  
		hasRightVersion = false;   
	}
	
	// Return true of false 
	return hasRightVersion;
}

function HandleOnClose () {
   if (event.clientY < 0) {
      event.returnValue = '>> Vergeet niet je sketch te bewaren! <<';
   }
}

function confirmClose () {
	input_box = confirm(">> Vergeet niet je sketch te bewaren! <<");
	if (input_box == true) { 
		window.close();
	}
}

//-->