


// TVG - SCRIPTICIAN - START



// SET NAMESPACE

// create from scratch when not present
if (typeof TVGS == 'undefined')
{
	TVGS = {time_zero_point:new Date().getTime()};
}
// check for values that created the namespace in the page header
else if (!TVGS.time_zero_point && !TVGS.config)
{
	alert('Scriptician was unable to setup its namespace! This is a global variable named "TVGS". All further Scriptician activity will be aborted.');
}
// else consider TVGS variable valid



// SET CONFIG
// not: this is not in TVGS.start so it is run immediately at page launch, allowing inline adding to the config while the page loads, before start is executed
if (TVGS)
{	

	// set config
	if (!TVGS.config) TVGS.config = {};


	// set event config
	if (!TVGS.config.event) TVGS.config.event = {};
	
	
	// mousemove tracker
	// note: tracked using "mousemove"
	if (!TVGS.config.event.mousemove) TVGS.config.event.mousemove = [];
	
	
	// mouseinside tracker
	// note: tracked using "mousemove"
	if (!TVGS.config.event.mouseinside) TVGS.config.event.mouseinside = [];
	
	
	// mouseoutside tracker
	// note: tracked using "mousemove"
	if (!TVGS.config.event.mouseoutside) TVGS.config.event.mouseoutside = [];
	
	
	// mouseenter tracker
	// note: tracked using "mousemove"
	if (!TVGS.config.event.mouseenter) TVGS.config.event.mouseenter = [];
	
	
	// mouseleave tracker
	// note: tracked using "mousemove"
	if (!TVGS.config.event.mouseleave) TVGS.config.event.mouseleave = [];
	
	
	// mouseclick tracker
	// note: tracked using "mouseclick"
	if (!TVGS.config.event.mouseclick) TVGS.config.event.mouseclick = [];
	
}



// HANDLE DOM LOAD
// waits for all page code, external scripts and inline scripts to be loaded before firing the start function
if (TVGS)
{

	// check if the dom tree is loaded
	// note: the first method that checks out wins
	
	TVGS.dom_loaded = function () 
	{
		if (arguments.callee.done) return;
		
		arguments.callee.done = true;

		// the dom is now fully available
		TVGS.time_dom_loaded = new Date().getTime();
		TVGS.START = new TVGS.start();
	}
	
	if (document.addEventListener)
	{
		document.addEventListener('DOMContentLoaded', TVGS.dom_loaded, false);
	}
	
	(function()
	{
		/*@cc_on
	  if (document.body)
	  {
			try
			{
			document.createElement('div').doScroll('left');
			return TVGS.dom_loaded();
			}
			catch(e)
			{}
	  }
	  /*@if (false) @*/
	  if (/loaded|complete/.test(document.readyState)) return TVGS.dom_loaded();
	  /*@end @*/
	  if (!TVGS.dom_loaded.done) setTimeout(arguments.callee, 50);
	})();
	
	window.onload = TVGS.dom_loaded;
		
}


		
// SYSTEM START
// initializes system components
// note: can also contain any instructions to be executed at page launch
if (TVGS) TVGS.start = function ()
{

	//alert('Starting Scriptician after ' + (TVGS.time_dom_loaded - TVGS.time_zero_point) + 'ms of initial DOM completion time.');
	
	
	
	
	
	
	
	/*
	// CONFIG
	
	// set config
	if (!TVGS.config) TVGS.config = {};


	// set event config
	if (!TVGS.config.event) TVGS.config.event = {};
	
	
	// mousemove tracker
	// note: tracked using "mousemove"
	if (!TVGS.config.event.mousemove) TVGS.config.event.mousemove = [];
	
	
	// mouseinside tracker
	// note: tracked using "mousemove"
	if (!TVGS.config.event.mouseinside) TVGS.config.event.mouseinside = [];
	
	
	// mouseoutside tracker
	// note: tracked using "mousemove"
	if (!TVGS.config.event.mouseoutside) TVGS.config.event.mouseoutside = [];
	
	
	// mouseenter tracker
	// note: tracked using "mousemove"
	if (!TVGS.config.event.mouseenter) TVGS.config.event.mouseenter = [];
	
	
	// mouseleave tracker
	// note: tracked using "mousemove"
	if (!TVGS.config.event.mouseleave) TVGS.config.event.mouseleave = [];
	
	
	// mouseclick tracker
	// note: tracked using "mouseclick"
	if (!TVGS.config.event.mouseclick) TVGS.config.event.mouseclick = [];
	*/
	
	
	
	
	// load external config files
	//alert('Loading external script files.');
	//TVGS.run_script('javascripts/tvgs/site_manager_config.js');
	
	TVGS.include_javascript('javascripts/tvgs/ktwaalre_menu_config.js');
	
	
	//alert('External script files included.');
	
	
	
	// test tracker
	//TVGS.event_info_cursor_tracker();
	
	
	// add actions to mouseinside tracker
	
	/*
	// test config item
	TVGS.config.event.mouseinside[TVGS.config.event.mouseinside.length] = {element_id: 'bgtest1', script: 'document.getElementById("output").innerHTML="bgtest1";'};
	TVGS.config.event.mouseinside[TVGS.config.event.mouseinside.length] = {element_id: 'bgtest2', script: 'document.getElementById("output").innerHTML="bgtest2";'};
	TVGS.config.event.mouseinside[TVGS.config.event.mouseinside.length] = {element_id: 'bgtest3', script: 'document.getElementById("output").innerHTML="bgtest3";'};
	TVGS.config.event.mouseinside[TVGS.config.event.mouseinside.length] = {element_id: 'bgtest4', script: 'document.getElementById("output").innerHTML="bgtest4";'};
	*/

	//alert('Checkpoint 5.');
	
	// add actions to mouseoutside tracker
	
	// test config item
	/*
	TVGS.config.event.mouseoutside[TVGS.config.event.mouseoutside.length] = {element_id: 'bgtest1', script: 'document.getElementById("output").innerHTML="";'};
	TVGS.config.event.mouseoutside[TVGS.config.event.mouseoutside.length] = {element_id: 'bgtest2', script: 'document.getElementById("output").innerHTML="";'};
	TVGS.config.event.mouseoutside[TVGS.config.event.mouseoutside.length] = {element_id: 'bgtest3', script: 'document.getElementById("output").innerHTML="";'};
	TVGS.config.event.mouseoutside[TVGS.config.event.mouseoutside.length] = {element_id: 'bgtest4', script: 'document.getElementById("output").innerHTML="";'};
	*/
	
	//alert('Checkpoint 6.');
	
	// add actions to mouseenter tracker
	
	// contact + info buttons
	//TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'contact_img', script: 'tvgs_element_resize(null, "contact_img", null, 300, null, 71, null, "px", null, 399, null, "px");'};
	//TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'info_img', script: 'tvgs_element_resize(null, "info_img", null, 300, null, 71, null, "px", null, 199, null, "px");'};
	
	// contact form
	//TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'contact_img', script: 'tvgs_element_drop_rise(null, "contact_form", null, 1200, null, null, "drop", "open", 0, null, null, null);'};
	
	// spoon
	// wobble steps
	/*
	var spoon_config_step_4 = {
	relay: 3,
	element_id: 'spoon',
	time_delta: 250,
	x_end: 315,
	y_end: 67,
	rebound: true,
	repeat_total: 1,
	instigate: []
	};
	
	var spoon_config_step_3 = {
	relay: 3,
	element_id: 'spoon',
	time_delta: 200,
	x_end: 285,
	y_end: 97,
	rebound: true,
	repeat_total: 1,
	instigate: [{relay: spoon_config_step_4}]
	};
	
	var spoon_config_step_2 = {
	
	//set relay
	relay: 3, // element resize
	
	// general settings
	element_id: 'spoon',	// the element id
	time_delta: 250,			// the time in which to complete the resize in milliseconds

	// specific settings
	x_end: 330,
	y_end: 52,
	rebound: true,			// adds the reversed action to the end of the original action, effectively restoring the start size, accepts true or false, may be omitted, defaults to false
	
	// chain controls
	repeat_total: 1,				// number of times the action repeats, may be omitted, defaults to 0 (which means repeat forever)
	instigate: [{relay: spoon_config_step_3}]				// array of any actions (as script or relay format) to launch at the end of this chain, these actions will be deleted as normal when the parent chain is smothered
	
	};
	
	
	//alert('Checkpoint 7.');
	
	var spoon_config_step_1 = {};
	
	//set relay
	spoon_config_step_1.relay = 3; // element resize
	
	// general settings
	spoon_config_step_1.element_id		= 'spoon';	// the element id
	spoon_config_step_1.time_delta		= 200;			// the time in which to complete the resize in milliseconds

	// specific settings
	spoon_config_step_1.x_end				= 270;
	spoon_config_step_1.y_end				= 112;
	spoon_config_step_1.rebound			= true;			// adds the reversed action to the end of the original action, effectively restoring the start size, accepts true or false, may be omitted, defaults to false
	
	// chain controls
	//spoon_config_step_1.initial_delay	= 0;				// delay before the action starts in milliseconds, may be omitted, defaults to 0
	spoon_config_step_1.repeat_total	= 1;				// number of times the action repeats, may be omitted, defaults to 0 (which means repeat forever)
	//spoon_config_step_1.repeat_delay	= 250;			// delay before each repeat of the action in milliseconds, may be omitted, defaults to 0
	spoon_config_step_1.instigate		= [{relay: spoon_config_step_2}];				// array of any actions (as script or relay format) to launch at the end of this chain, these actions will be deleted as normal when the parent chain is smothered
	
	
	//TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'testpic1', script: 'tvgs_element_resize(null, "testpic1", null, 500, 150, -40, "px", 150, 40, "px", true);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'spoon', relay: spoon_config_step_1};
	
	// clean up
	spoon_config_step_4 = null;
	spoon_config_step_3 = null;
	spoon_config_step_2 = null;
	spoon_config_step_1 = null;
	
	*/
	
	
	/*
	// photoslide
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_class: 'photo_1', script: 'tvgs_element_resize(null, "photo_1", null, 500, null, 200, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_class: 'photo_2', script: 'tvgs_element_resize(null, "photo_2", null, 500, null, 200, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_class: 'photo_3', script: 'tvgs_element_resize(null, "photo_3", null, 500, null, 200, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_class: 'photo_4', script: 'tvgs_element_resize(null, "photo_4", null, 500, null, 200, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_class: 'photo_5', script: 'tvgs_element_resize(null, "photo_5", null, 500, null, 200, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_class: 'photo_6', script: 'tvgs_element_resize(null, "photo_6", null, 500, null, 200, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_class: 'photo_7', script: 'tvgs_element_resize(null, "photo_7", null, 500, null, 200, null, "px", null, null, null, null, false);'};
	
	//TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_class: 'photo_5', script: 'alert("photo5");'};
	*/
	
	
	/*
	// robot menu robots
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'robot_menu_1_trigger', script: 'tvgs_element_drop_rise(null, "robot_menu_1", null, 500, null, null, "rise", "open", 0, 0.25, null, null);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'robot_menu_2_trigger', script: 'tvgs_element_drop_rise(null, "robot_menu_2", null, 500, null, null, "rise", "open", 0, 0.25, null, null);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'robot_menu_3_trigger', script: 'tvgs_element_drop_rise(null, "robot_menu_3", null, 500, null, null, "rise", "open", 0, 0.25, null, null);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'robot_menu_4_trigger', script: 'tvgs_element_drop_rise(null, "robot_menu_4", null, 500, null, null, "rise", "open", 0, 0.25, null, null);'};
	
	// robot menu background
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'robot_menu_1_trigger', script: 'tvgs_element_move_background_image("robotmenutable", -390, -90, 750);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'robot_menu_2_trigger', script: 'tvgs_element_move_background_image("robotmenutable", -170, -90, 750);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'robot_menu_3_trigger', script: 'tvgs_element_move_background_image("robotmenutable", 50, -90, 750);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'robot_menu_4_trigger', script: 'tvgs_element_move_background_image("robotmenutable", 270, -90, 750);'};
	
	
	// pokemon slides
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'pokemon_1', script: 'tvgs_element_resize(null, "pokemon_1", null, 500, 50, null, 400, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'pokemon_2', script: 'tvgs_element_resize(null, "pokemon_2", null, 500, 50, null, 400, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'pokemon_3', script: 'tvgs_element_resize(null, "pokemon_3", null, 500, 50, null, 400, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'pokemon_4', script: 'tvgs_element_resize(null, "pokemon_4", null, 500, 50, null, 400, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'pokemon_5', script: 'tvgs_element_resize(null, "pokemon_5", null, 500, 50, null, 400, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'pokemon_6', script: 'tvgs_element_resize(null, "pokemon_6", null, 500, 50, null, 400, "px", null, null, null, null, false);'};
	*/
	
	/*
	// portal menu bar
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'menu_inspiratie_trigger', script: 'tvgs_element_drop_rise(null, "menu_inspiratie_2", null, 400, null, null, "rise", "open", 0, null, null, null); tvgs_element_drop_rise(null, "menu_inspiratie_3", null, 400, null, null, "rise", "open", 0, null, null, null); tvgs_element_resize(null, "menu_inspiratie_3_img_1", null, 400, null, 120, null, "px", null, 110, null, "px", false, 300); tvgs_element_resize(null, "menu_inspiratie_3_img_2", null, 400, null, 120, null, "px", null, 110, null, "px", false, 450); tvgs_element_resize(null, "menu_inspiratie_3_img_3", null, 400, null, 120, null, "px", null, 110, null, "px", false, 600);'};
	

	// create config object
	var logo_menu_config_open = {
	
	//set relay
	relay: 4,
	
	// general settings
	element_id: 'menu_inspiratie_1',	// the element id
	
	// animation setup
	time_delta: 400,			// the time in which to complete the effect in milliseconds
	
	// specific settings
	effect: 'rise',		// determines wether the element appears above or below the starting point, accepts 'drop' for below and 'rise' for above
	action: 'open',		// makes the element disappear when visible and appear when invisible, when the element is already in the target state, no visible effect will occur, accepts 'open' to appear and 'close' to disappear
	//y_offset: 0,				// the vertical offset in pixels from of the starting point, may be omitted, defaults to 0
	y_noclip: 104,				// the vertical portion in pixels from the top or bottom of the element (depending on effect setting) that is always visible, may be omitted, defaults to 0
	//opacity: null,			// the start value of the opacity when transitioning from invisible to visible, accepts a number from 0, for fully transparent, to 1, for fully opaque, may be omitted, defaults to 1
	
	// chain controls
	//initial_delay: 500,			// delay before the action starts in milliseconds, may be omitted, defaults to 0
	//repeat_total: 3,				// number of times the action is run consecutively, may be omitted, defaults to 1 (setting this to 0 means repeat forever)
	//repeat_delay: 250,			// delay before each repeat of the action in milliseconds, may be omitted, defaults to 0
	instigate: [],				// array of any actions (as script or relay format) to launch at the end of this chain, these actions will be deleted as normal when the parent chain is smothered
	
	end : null }; // a meaningless value to prevent copy-paste and escape errors with omitting the last comma
	
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'menu_inspiratie_trigger', relay: logo_menu_config_open};
	
	
	logo_menu_config_open = null;
	
	
	
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'menu_inspiratie_3_link_1', script: 'tvgs_element_resize(null, "menu_inspiratie_3_img_1", null, 150, null, 130, null, "px", null, 120, null, "px", false); document.getElementById("menu_inspiratie_3_link_1").style.backgroundImage = "url(img/bg_beam.png)";'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'menu_inspiratie_3_link_2', script: 'tvgs_element_resize(null, "menu_inspiratie_3_img_2", null, 150, null, 130, null, "px", null, 120, null, "px", false); document.getElementById("menu_inspiratie_3_link_2").style.backgroundImage = "url(img/bg_beam.png)";'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'menu_inspiratie_3_link_3', script: 'tvgs_element_resize(null, "menu_inspiratie_3_img_3", null, 150, null, 130, null, "px", null, 120, null, "px", false); document.getElementById("menu_inspiratie_3_link_3").style.backgroundImage = "url(img/bg_beam.png)";'};
	*/
	
	
	/*
	// resize test
	var test_chain_config = {};
	
	//set relay
	test_chain_config.relay = 3;
	
	// general settings
	test_chain_config.element_id		= 'testpic1';	// the element id
	//test_chain_config.interval		= 1000;			// the time between each frame in milliseconds, may be omitted, defaults to timeline frame interval
	test_chain_config.time_delta		= 500;			// the time in which to complete the resize in milliseconds
	//test_chain_config.step_size		= 5;				// the size of each resize step
	//test_chain_config.step_unit		= 'px';			// the unit applied to the step_size, may be omitted, defaults to 'px'
	//test_chain_config.step_total		= 10;				// the total number of resize steps
	
	// specific settings
	test_chain_config.x_start			= 150;			// the start width
	test_chain_config.x_distance		= -40;			// the number of units to increase or decrease the width from the starting point
	test_chain_config.x_unit			= 'px';			// the unit applied to the start and end value of the x axis, accepts 'px' for pixels or '%' for percentage of the original image width (when the image has its width defined by a style before the resize is applied, the value of the style will be interpreted as the original width, for example: <img style="width: 200px;" src="image.jpg"> means that regardless of the real image dimensions, 200 pixels is now treated as the original width)
	test_chain_config.y_start			= 150;			// the start height
	test_chain_config.y_distance		= 40;				// the number of units to increase or decrease the height from the starting point
	test_chain_config.y_unit			= 'px';			// the unit applied to the start and end value of the y axis, accepts 'px' for pixels or '%' for percentage of the original image height (when the image has its height defined by a style before the resize is applied, the value of the style will be interpreted as the original height, for example: <img style="height: 200px;" src="image.jpg"> means that regardless of the real image dimensions, 200 pixels is now treated as the original height)
	test_chain_config.rebound			= true;			// adds the reversed action to the end of the original action, effectively restoring the start size, accepts true or false, may be omitted, defaults to false
	
	// chain controls
	test_chain_config.initial_delay	= 0;				// delay before the action starts in milliseconds, may be omitted, defaults to 0
	test_chain_config.repeat_total	= 3;				// number of times the action repeats, may be omitted, defaults to 0 (which means repeat forever)
	test_chain_config.repeat_delay	= 250;			// delay before each repeat of the action in milliseconds, may be omitted, defaults to 0
	test_chain_config.instigate		= [];				// array of any actions (as script or relay format) to launch at the end of this chain, these actions will be deleted as normal when the parent chain is smothered
	
	// pass config object into function
	//tvgs_element_resize(test_chain_config);				// that's it, the config object now provides all the arguments to the function
	
	//TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'testpic1', script: 'tvgs_element_resize(null, "testpic1", null, 500, 150, -40, "px", 150, 40, "px", true);'};
	TVGS.config.event.mouseenter[TVGS.config.event.mouseenter.length] = {element_id: 'testpic1', relay: test_chain_config};
	test_chain_config = null;
	*/
	
	
	//alert('Checkpoint 8.');
	/*
	// add actions to mouseleave tracker
	
	// contact + info buttons
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'contact_img', script: 'if (document.getElementById("contact_form").style.display == "none") tvgs_element_resize(null, "contact_img", null, 300, null, null, null, "px", null, null, null, "px");'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'info_img', script: 'tvgs_element_resize(null, "info_img", null, 300, null, null, null, "px", null, null, null, "px");'};
	
	// contact form
	//TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'contact_img', script: 'tvgs_element_drop_rise(null, "contact_form", null, 300, null, null, "drop", "close", 0, null, null, null);'};
	
	// photoslide
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_class: 'photo_1', script: 'tvgs_element_resize(null, "photo_1", null, 500, null, null, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_class: 'photo_2', script: 'tvgs_element_resize(null, "photo_2", null, 500, null, null, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_class: 'photo_3', script: 'tvgs_element_resize(null, "photo_3", null, 500, null, null, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_class: 'photo_4', script: 'tvgs_element_resize(null, "photo_4", null, 500, null, null, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_class: 'photo_5', script: 'tvgs_element_resize(null, "photo_5", null, 500, null, null, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_class: 'photo_6', script: 'tvgs_element_resize(null, "photo_6", null, 500, null, null, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_class: 'photo_7', script: 'tvgs_element_resize(null, "photo_7", null, 500, null, null, null, "px", null, null, null, null, false);'};
	
	
	*/
	
	
	
	/*
	// create config object
	var logo_menu_config_close = {
	
	//set relay
	relay: 4,
	
	// general settings
	element_id: 'menu_inspiratie_1',	// the element id
	
	// animation setup
	time_delta: 400,			// the time in which to complete the effect in milliseconds
	
	// specific settings
	effect: 'rise',		// determines wether the element appears above or below the starting point, accepts 'drop' for below and 'rise' for above
	action: 'close',		// makes the element disappear when visible and appear when invisible, when the element is already in the target state, no visible effect will occur, accepts 'open' to appear and 'close' to disappear
	//y_offset: 0,				// the vertical offset in pixels from of the starting point, may be omitted, defaults to 0
	y_noclip: 104,				// the vertical portion in pixels from the top or bottom of the element (depending on effect setting) that is always visible, may be omitted, defaults to 0
	//opacity: null,			// the start value of the opacity when transitioning from invisible to visible, accepts a number from 0, for fully transparent, to 1, for fully opaque, may be omitted, defaults to 1
	
	// chain controls
	//initial_delay: 500,			// delay before the action starts in milliseconds, may be omitted, defaults to 0
	//repeat_total: 3,				// number of times the action is run consecutively, may be omitted, defaults to 1 (setting this to 0 means repeat forever)
	//repeat_delay: 250,			// delay before each repeat of the action in milliseconds, may be omitted, defaults to 0
	instigate: [],				// array of any actions (as script or relay format) to launch at the end of this chain, these actions will be deleted as normal when the parent chain is smothered
	
	end : null }; // a meaningless value to prevent copy-paste and escape errors with omitting the last comma
	
	
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'menu_inspiratie_trigger', relay: logo_menu_config_close};
	
	
	logo_menu_config_open = null;
	*/
	
	/*
	// robot menu robots
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'robot_menu_1_trigger', script: 'tvgs_element_drop_rise(null, "robot_menu_1", null, 4000, null, null, "rise", "close", 0, 0.75, null, null);'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'robot_menu_2_trigger', script: 'tvgs_element_drop_rise(null, "robot_menu_2", null, 4000, null, null, "rise", "close", 0, 0.75, null, null);'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'robot_menu_3_trigger', script: 'tvgs_element_drop_rise(null, "robot_menu_3", null, 4000, null, null, "rise", "close", 0, 0.75, null, null);'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'robot_menu_4_trigger', script: 'tvgs_element_drop_rise(null, "robot_menu_4", null, 4000, null, null, "rise", "close", 0, 0.75, null, null);'};
	
	// robot menu background
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'robotmenutable', script: 'tvgs_element_move_background_image("robotmenutable", -60, 90, 2250);'};
	
	// resize test
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'testpic1', script: 'tvgs_element_resize(null, "testpic1", null, 500, 150, 40, "px", 150, -40, "px", true);'};
	
	
	// pokemon slides
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'pokemon_1', script: 'tvgs_element_resize(null, "pokemon_1", null, 500, null, null, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'pokemon_2', script: 'tvgs_element_resize(null, "pokemon_2", null, 500, null, null, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'pokemon_3', script: 'tvgs_element_resize(null, "pokemon_3", null, 500, null, null, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'pokemon_4', script: 'tvgs_element_resize(null, "pokemon_4", null, 500, null, null, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'pokemon_5', script: 'tvgs_element_resize(null, "pokemon_5", null, 500, null, null, null, "px", null, null, null, null, false);'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'pokemon_6', script: 'tvgs_element_resize(null, "pokemon_6", null, 500, null, null, null, "px", null, null, null, null, false);'};
	
	*/
	
	/*
	// portal menu bar
	//TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'menu_inspiratie_trigger', script: 'tvgs_element_drop_rise(null, "menu_inspiratie_1", null, 500, null, null, "rise", "close", 0, 0.25, null, null); tvgs_element_drop_rise(null, "menu_inspiratie_2", null, 500, null, null, "rise", "close", 0, 0.25, null, null); tvgs_element_drop_rise(null, "menu_inspiratie_3", null, 500, null, null, "rise", "close", 0, 0.25, null, null); tvgs_element_resize(null, "menu_inspiratie_3_img_1", null, 400, null, 1, null, "px", null, 1, null, "px", false); tvgs_element_resize(null, "menu_inspiratie_3_img_2", null, 400, null, 1, null, "px", null, 1, null, "px", false); tvgs_element_resize(null, "menu_inspiratie_3_img_3", null, 400, null, 1, null, "px", null, 1, null, "px", false);'};

	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'menu_inspiratie_3_link_1', script: 'tvgs_element_resize(null, "menu_inspiratie_3_img_1", null, 150, null, 120, null, "px", null, 110, null, "px", false); document.getElementById("menu_inspiratie_3_link_1").style.backgroundImage = "";'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'menu_inspiratie_3_link_2', script: 'tvgs_element_resize(null, "menu_inspiratie_3_img_2", null, 150, null, 120, null, "px", null, 110, null, "px", false); document.getElementById("menu_inspiratie_3_link_2").style.backgroundImage = "";'};
	TVGS.config.event.mouseleave[TVGS.config.event.mouseleave.length] = {element_id: 'menu_inspiratie_3_link_3', script: 'tvgs_element_resize(null, "menu_inspiratie_3_img_3", null, 150, null, 120, null, "px", null, 110, null, "px", false); document.getElementById("menu_inspiratie_3_link_3").style.backgroundImage = "";'};
	*/
	
	
	//alert(TVGS.config.event.mouseleave.length);
	
	// add actions to mouseclick tracker
	
	// contact form
	/*
	var close_form_config = {
	
	//set relay
	relay: 4, // element resize
	
	// general settings
	element_id: 'contact_form',	// the element id
	time_delta: 300,			// the time in which to complete the resize in milliseconds

	// specific settings
	effect: 'drop',
	action: 'close',
	y_offset: 0,
	
	// chain controls
	//spoon_config_step_1.initial_delay	= 0;				// delay before the action starts in milliseconds, may be omitted, defaults to 0
	//repeat_total	= 1;				// number of times the action repeats, may be omitted, defaults to 0 (which means repeat forever)
	//spoon_config_step_1.repeat_delay	= 250;			// delay before each repeat of the action in milliseconds, may be omitted, defaults to 0
	instigate: [{script: 'document.getElementById("contact_form_fields").style.display = ""; document.getElementById("contact_form_success").style.display = "none"; document.getElementById("contact_submit").style.display = ""; if (!TVGS.nil(document.getElementById("contact_form").tvgs_original_height)) document.getElementById("contact_form").tvgs_original_height = null;'}],				// array of any actions (as script or relay format) to launch at the end of this chain, these actions will be deleted as normal when the parent chain is smothered
	
	end: null};
	
	//TVGS.config.event.mouseclick[TVGS.config.event.mouseclick.length] = {element_id: 'contact_close', script: 'tvgs_element_drop_rise(null, "contact_form", null, 300, null, null, "drop", "close", 0, null, null, null); document.getElementById("contact_form_fields").style.display = ""; document.getElementById("contact_form_success").style.display = "none"; document.getElementById("contact_submit").style.display = ""; if (!TVGS.nil(document.getElementById("contact_form").tvgs_original_height)) document.getElementById("contact_form").tvgs_original_height = null;'};
	TVGS.config.event.mouseclick[TVGS.config.event.mouseclick.length] = {element_id: 'contact_close', relay: close_form_config};
	
	
	// clean up
	close_form_config = null;
	
	
	//TVGS.config.event.mouseclick[TVGS.config.event.mouseclick.length] = {element_id: 'contact_close', script: 'tvgs_element_drop_rise(null, "contact_form", null, 300, null, null, "drop", "close", 0, null, null, null); document.getElementById("contact_form_fields").style.display = ""; document.getElementById("contact_form_success").style.display = "none"; document.getElementById("contact_submit").style.display = ""; if (!TVGS.nil(document.getElementById("contact_form").tvgs_original_height)) document.getElementById("contact_form").tvgs_original_height = null;'};
	TVGS.config.event.mouseclick[TVGS.config.event.mouseclick.length] = {element_id: 'contact_close', script: 'tvgs_element_resize(null, "contact_img", null, 300, null, null, null, "px", null, null, null, "px");'};
	
	TVGS.config.event.mouseclick[TVGS.config.event.mouseclick.length] = {element_id: 'contact_submit', script: 'document.forms["contact_form"].submit();'};
	
	TVGS.config.event.mouseclick[TVGS.config.event.mouseclick.length] = {element_id: 'contact_img', script: 'tvgs_element_drop_rise(null, "contact_form", null, 1200, null, null, "drop", "open", 0, null, null, null);'};
	
	
	// youtube movie
	//TVGS.config.event.mouseclick[TVGS.config.event.mouseclick.length] = {element_id: 'youtube_movie_menuitem', script: 'tvgs_element_drop_rise(null, "youtube_movie", null, 1200, null, null, "drop", "open", 0, null, null, null);'};
	*/
	/*
	var youtube_movie_config = {
	relay: 4,
	element_id: 'youtube_movie',
	time_delta: 800,
	effect: 'drop',
	action: 'open',
	instigate: [{script: 'tvgs_element_display_switch_by_id("youtube_movie_spacer", "youtube_movie_object");'}]
	};
	
	TVGS.config.event.mouseclick[TVGS.config.event.mouseclick.length] = {element_id: 'youtube_movie_menuitem', relay: youtube_movie_config};
	
	youtube_movie_config = null;
	*/
	
	/*
	TVGS.config.event.mouseclick[TVGS.config.event.mouseclick.length] = {element_id: 'youtube_movie_menuitem', script: 'document.getElementById("youtube_movie").style.display = "";'};
	TVGS.config.event.mouseclick[TVGS.config.event.mouseclick.length] = {element_id: 'youtube_movie_closebutton', script: 'document.getElementById("youtube_movie").style.display = "none";'};
	
	TVGS.config.event.mouseclick[TVGS.config.event.mouseclick.length] = {element_id: 'photo_big_closebutton', script: 'document.getElementById("photo_big").style.display = "none";'};
	
	TVGS.config.event.mouseclick[TVGS.config.event.mouseclick.length] = {element_id: 'info_big_closebutton', script: 'document.getElementById("info_big").style.display = "none";'};
	TVGS.config.event.mouseclick[TVGS.config.event.mouseclick.length] = {element_id: 'info_img', script: 'document.getElementById("info_big").style.display = "";'};
	*/
	//TVGS.config.event.mouseclick[TVGS.config.event.mouseclick.length] = {element_id: ['menu_inspiratie_trigger', 'clicktest_logo'], element_class: ['voorbeelden', 'poiupoi'], script: 'alert("mouseclick!!!!");', bridge: 'boo!'};
	
	
	//alert('Checkpoint 9.');
	
	
	// start EVENT
	TVGS.EVENT = new TVGS.event_switcher();
//alert ('start 2');

	// start CHRON
	TVGS.CHRON = new chron_timeline(40, null, true);
	
	//alert('Checkpoint 9.');
	
	// "chronfig"
	
	// set chron config
	if (!TVGS.config.chron) TVGS.config.chron = {};
	
	
	// imagepool resource
	if (!TVGS.config.chron.imagepool) TVGS.config.chron.imagepool = [];
	
	// moon phase animation
	TVGS.config.chron.imagepool[TVGS.config.chron.imagepool.length] = {
	name : 'moonphase',
	directory : 'moonphase/',
	image : ['200.png','201.png','202.png','203.png','204.png','205.png','206.png','207.png','208.png','209.png','211.png','212.png','213.png','214.png','215.png','210.png','216.png','217.png','218.png','219.png','220.png','221.png','222.png'],
	end : null }; // a meaningless value to prevent copy-paste and escape errors with omitting the last comma
	
	
	// earth spin animation
	TVGS.config.chron.imagepool[TVGS.config.chron.imagepool.length] = {
	name : 'earthspin',
	directory : 'earthmap/',
	image : ['01.png','02.png','03.png','04.png','05.png','06.png','07.png','08.png','09.png','10.png','11.png','12.png','13.png','14.png','15.png','16.png','17.png','18.png','19.png','20.png','21.png','22.png','23.png','24.png','25.png','26.png','27.png','28.png','29.png','30.png','30b.png','31.png','32.png','33.png','34.png','35.png'],
	end : null }; // a meaningless value to prevent copy-paste and escape errors with omitting the last comma
	
	
	

	//alert('Checkpoint 10.');
	
	/*
	// timeline test chains, these start immediately on page load
	// devnote: move to config in page header
	tvgs_element_waver_by_id('testpic1', 5, 25, 2000, 3, 1000);
	tvgs_element_waver_by_id('testpic2', 4, 20, 5000, 0, 800);
	tvgs_element_waver_by_id('testpic3', 3, 15, 4500, 0, 750);
	//tvgs_element_waver_by_id('testpic4', 5, 25, 3000, 0, 1250);
	tvgs_element_waver_by_id('testpic5', 5, 25, 4000, 0, 600);
	tvgs_element_waver_by_id('testpic6', 8, 5, 1200, 0, 400);
	tvgs_element_waver_by_id('testpic7', 5, 8, 0, 0, 300);
	
	tvgs_element_waver_by_id('testpic8', 2, 40, 5500, 0, 200);
	
	tvgs_element_waver_by_id('sign_1', 2, 30, 0, 0, 0);
	
	
	// make the moon spin
	tvgs_image_swap('moon1', 'moonphase', false, false);
	
	// make the earth spin
	tvgs_image_swap('earth1', 'earthspin', false, false);
	tvgs_image_swap('earth2', 'earthspin', false, false, 80, 0, 0, 0);
	tvgs_element_waver_by_id('earth2', 5, 15, 0, 0, 0);
	
	
	tvgs_image_swap('earth3', 'earthspin', false, false, 20, 0, 0, 0);

	
	// show console for a few secs to confirm running engine
	tvgs_element_drop_rise(null, "console_flip", null, 1500, null, null, "drop", "close", 0, 0, 0, null);

	// chron chains tied to event handler, these are stored instigate commands
	*/

	

			// this is obsolete??
			// run load timers
			// note: the timer is started in the header of the page
			document_timer(window.document_start_time);
			//allImagesLoaded(window.document_start_time);
			
			
			//var sizes = ['1px','2px','3px','4px','5px','6px','7px','8px','9px','10px','11px','12px','13px','14px','15px','16px','17px','18px','19px','20px'];
			
			
			//color_pulse(sizes, document.getElementById('flippenzeg'), 'height', 75)
			
			
			// preload selected images
			// hardcoded and specific for in2lifestyle.nl
			var preload_image_src_list = [
			'projects/6/styles/templates/projects/in2lifestyle/interfaces/0/file/top_menu_main_button_1_over.jpg',
			'projects/6/styles/templates/projects/in2lifestyle/interfaces/0/file/top_menu_main_button_2_over.jpg',
			'projects/6/styles/templates/projects/in2lifestyle/interfaces/0/file/top_menu_main_button_3_over.jpg',
			'projects/6/styles/templates/projects/in2lifestyle/interfaces/0/file/top_menu_main_button_4_over.jpg',
			'projects/6/styles/templates/projects/in2lifestyle/interfaces/0/file/top_menu_main_button_5_over.jpg',
			'projects/6/styles/templates/projects/in2lifestyle/interfaces/0/file/top_menu_main_button_6_over.jpg'
			];
			
			var preload_image = [];
			
			for (var i in preload_image_src_list)
			{
				
				if (is_numeric(i))
				{
					
					// must be here so for instance firefox doesn't keep only the last image
					preload_image[i] = new Image();
					
					preload_image[i].src = preload_image_src_list[i];

				}			
			
			}
			
			
			
			// read config
			tvg_read_suite_config();
			
			
			
			
			// ieks fill lists
			if (window.tvg_ieks_index && window.tvg_suite_config[window.tvg_ieks_index][2])
			{
			
				for (var i in window.tvg_suite_config[window.tvg_ieks_index][2])
				{
				
					update_list(window.tvg_suite_config[window.tvg_ieks_index][2][i][2], '');

				}
			
			}
			
			
			
			// inserts the default text into the search field
			setFieldValues();
			
			
			// sets display of a block set
			setMultiToggleDisplay('sm_sitebox_template_options','sm_sitebox_template_options','interface');
			setMultiToggleDisplay('sm_sitebox_record_options','sm_sitebox_record_options','interface');
			setMultiToggleDisplay('sm_sitebox_interface_options','sm_sitebox_interface_options','interface');
			setMultiToggleDisplay('sm_sitebox_block_options','sm_sitebox_block_options','interface');
			
			
			

			// keep session alive
			tvgs_keep_alive('content.php?keep_alive_ticker=1', 1);
			
			// start clock
			tvgs_clock('top_menu_time_image', false);
			
			
			
			

			
			
			
			//alert ('start ok');
} // end function TVGS.start



// creates an xmlhttprequest object
if (TVGS) TVGS.create_xmlhttprequest = function ()
{

	// default method
	if( typeof XMLHttpRequest != 'undefined') return new XMLHttpRequest();
	
	// older methods
	var axO = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.4.0', 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP'], i;
	for(i = 0; i < axO.length; i++)
	{
		try
		{
			return new ActiveXObject(axO[i]);
		}
		catch (e) {}
	}
	
	// no success
	return null;

}



// includes and evaluates a javascript file
// note: the javascript file cannot be on another server
// note: the javascript file is evaluated with the include_javascript function scope
if (TVGS) TVGS.include_javascript = function (file_path)
{

	// create xmlhttprequest
	var xmlhttprequest = TVGS.create_xmlhttprequest();
	
	// check xmlhttprequest
	if (TVGS.nil(xmlhttprequest))
	{
		// Error: could not generate xmlhttprequest. Function: TVGS.include.
		return null;
	}
	
	// false pauses all javascripts execution until the file is loaded
	xmlhttprequest.open('GET', file_path, false);
	xmlhttprequest.send('');
	
	// execute the loaded code
	eval(xmlhttprequest.responseText);

}



// load and run an external javascript file
// note: the script file is executed after any other actions finish, not immediately at the location where this function is called
// note: a link to the script is added to the dom, then when the browser re-renders the dom, the script is loaded/executed
if (TVGS) TVGS.run_script = function (file)
{
	
	// get head tag
	//var head_tag = document.getElementsByTagName('head')[0];
	
	
	
	// try another one
	//head_tag.innerHTML = head_tag.innerHTML + '<script type="text/javascript" src="' + file + '"></scr' + 'ipt>';
	
	//alert(head_tag.innerHTML);
	
	
	//return;
	
	
	//alert('Loading external JS file.');
	
	// create script tag
	var scriptnode = document.createElement('script');
	//alert('Script tag created.');
	
	// set attributes
	scriptnode.setAttribute('type', 'text/javascript');
	scriptnode.setAttribute('src', file);
	//alert('Script tag attributes set.');
	
	// get head tag
	var head_tag = document.getElementsByTagName('head')[0];
	
	// place inside head tag
	head_tag.appendChild(scriptnode);
	//alert('Script tag added to DOM.');
	
	
	// try to force a re-render
	//head_tag.innerHTML = head_tag.innerHTML + ' ';
	
	//alert(head_tag.innerHTML);
}



// convert a value to a number
// note: returns 0 on failure
if (TVGS) TVGS.convert_to_float = function (value)
{
	// return numbers immediately
	if (!isNaN(value)) return value;
	
	// try to parse the value
	value = parseFloat(value);
	
	// set to 0 when parsing fails
	if (isNaN(value)) value = 0;

	return value;
}


	
// read the config on page load
function tvg_read_suite_config()
{
	
	if (window.tvg_suite_config)
	{
		
		for (var i in window.tvg_suite_config)
		{
			
			if (window.tvg_suite_config[i][1] == 'rollover_index')
			{
				
				window.tvg_rollover_index = i;
				
				if (document.getElementById('sm_js_console')) document.getElementById('sm_js_console').innerHTML += 'Config: rollover config set.<br>';	
				//alert('rollover_index = ' + i);
				
			}
			
			if (window.tvg_suite_config[i][1] == 'popup_index')
			{
				
				window.tvg_popup_index = i;
				
				if (document.getElementById('sm_js_console')) document.getElementById('sm_js_console').innerHTML += 'Config: popup config set.<br>';
				//alert('popup_index = ' + i);
				
			}
			
			if (window.tvg_suite_config[i][1] == 'ieks_index')
			{
				
				window.tvg_ieks_index = i;
				
				if (document.getElementById('sm_js_console')) document.getElementById('sm_js_console').innerHTML += 'Config: ieks config set.<br>';
				//alert('ieks_index = ' + i);
				
			}
			
		}
		
		
		
		
	
		
		
	}
	
}
		

		



function document_timer(document_start_time)
{
	
	var document_dom_loaded_time = get_millitime();
	
	var document_dom_completion_delta = document_dom_loaded_time - document_start_time;
	
	window.timer_info_dom = document_dom_completion_delta;
	
	if (document.getElementById('sm_js_console')) document.getElementById('sm_js_console').innerHTML += 'DOM completion time: ' + window.timer_info_dom + 'ms.<br>';
	
}

function get_millitime()
{
	
	var time = new Date();
 return time.getTime();

}


//alert ('start ok 2');
