/*Onload functions
The functions that load after page load
*/
loadNifty=function(){

if(!NiftyCheck())
return;
/*Nifty corners
The round the corners of the panels
*/
//Rounded("div#container_div","all","transparent","#8AC7EF","smooth border #ccc");
//Rounded("div.subnav_title","tl","transparent","#AAEFB1","smooth border #ccc");
//Rounded("div.panel_title","tl","transparent","#CDCDCD","smooth border #ccc");

}

setAjaxResponders = function() {
	Ajax.Responders.register({
	onCreate : function(request) {
		if(!/panel_update/.test(request.options.parameters) && !/table_update/.test(request.options.parameters) && !/timer_update/.test(request.options.parameters) && !/tables=zIndex/.test(request.options.parameters)) { //&& !/generic_update/.test(request.options.parameters
		layoutFunctions.freezePage();
		}
	}
	});
}

//Flash fix
flashfix = function() {
	objects = document.getElementsByTagName("embed");
	for (var i = 0; i < objects.length; i++)
	{
	objects[i].outerHTML = objects[i].outerHTML;
	}
}

/*Include functions
Include all the Javascript classes
*/
var Includes = {
	path: '/app/control/js/',
	require: function(libraryName) {
		// inserting via DOM fails in Safari 2.0, so brute force approach
		document.write('<script type="text/javascript" src="'+libraryName+'"></script>');
	  }
}



/*
Include all libraries
*/
Includes.require('/acidWerk/control/js/lib.global.utilityFunctions.js');
Includes.require('/libs/js/selector_addon/selector-addon-v1.js');
Includes.require('/libs/js/scriptaculous-js-1.6.1/lib/patch.scriptaculousPatches.js');
Includes.require('/libs/js/growImg/growImg.js');
Includes.require('/libs/js/popup/popup.js');
Includes.require('/libs/js/newsticker/newsticker.js');

/*
Set global variables
*/
ajaxUpdateUrl = '/app/model/php/model.ajax.crud.php';

//var errorHandler = function(msg, url, linenumber) { alert("Error: " + msg + " for " + url + " at " + linenumber);};
//window.onerror = errorHandler;

var debug = function(v,type) {
	if(type == "+=" || !type) {
	$('print_text').innerHTML += v;	
	} else if (type == "=") {
	$('print_text').innerHTML = v;			
	}
}

var full_footer_names_array = new Array();
var footer_names_array = footer_nav_names.split("|");
footer_names_array.each(function(e) {
full_footer_names_array[full_footer_names_array.length] = '/app/view/images/nav/nav_'+e+'_bg.png';								 
});
new imagePreloader({images:full_footer_names_array});

new FastInit(setAjaxResponders,
			 function() { new newsTicker($('ul_vacancies_ticker'),{wait:5000});},
			 runSIFR,
			 flashfix);
