ec=new effectscontrol();

//window.onload = ec.setsession('javascript','on');

function joblivesearch(){
	var searchstring = document.getElementById("jobsearch").value;
	var options = document.getElementById("joblistoptions").value;
	if (searchstring.length >= 2){
		ec.joblivesearch(searchstring,options);
	}
}
function switchjobpage(page){
	var options = document.getElementById("options").value;
	ec.switchjobpage(options,page);
}

function jobfiltersearch() {
	var values = "";
	var valstring = "";
	var options = document.getElementById("options").value;
	for (var i = 1; i < document.jobfilter.elements.length; i++) {
		if (document.jobfilter.elements[i].type == 'checkbox'){
			if (document.jobfilter.elements[i].checked == true){
				values = values + document.jobfilter.elements[i].id;
				values = values + ",";
			}
		}
	}
	if (values != "") {
		valstring = values.substr(0,(values.length - 1));
		//alert("#" + valstring + "#");
	}
	ec.jobfiltersearch(options,valstring);
}

function uncheckjobfilter() {
	for (var i = 0; i < document.jobfilter.elements.length; i++) {
		if (document.jobfilter.elements[i].type == 'checkbox'){
			if (document.jobfilter.elements[i].checked == true){
				document.jobfilter.elements[i].checked = !(document.jobfilter.elements[i].checked);
			}
		}
	}
	var options = document.getElementById("options").value;
	ec.jobfilterunset(options);
}

/*
	JQUERY Interface function-calls:
*/

function interfaceFoldToggle(elementid,duration,heightstop,callback,easing){
	/*
	A combination of BlindUp and BlindLeft. The element is first blinded up and then to the left to simulate a folding effect.
	duration (integer or string - mandatory) = the duration in milliseconds (or using ['slow' | 'normal' | 'fast']) of the effect.
	heightstop (integer - optional) = the minimum height the element can be folded to.
	callback (function - optional) = callback function that will get fired once the effect is completed.
	easing (string - optional) = the name of the easing effect you want to use.
	*/
	if (typeof(heightstop) == "undefined") var heightstop = 7;
	if (typeof(callback) == "undefined") var callback = null;
	if (typeof(easing) == "undefined") var easing = 'bounceout';
	
	$("#" + elementid).FoldToggle(duration, heightstop, callback, easing);
	
	return false;
}
function interfaceSwitchVertically(elementid,duration,callback,easing){
	/*
	The element changes its height or width and its vertical or horizontal position simultaneously due to a pattern.
	duration (integer or string - mandatory) = the duration in milliseconds (or using ['slow' | 'normal' | 'fast']) of the effect.
	callback (function - optional) = callback function that will get fired once the effect is completed.
	easing (string - optional) = the name of the easing effect you want to use.
	*/
	if (typeof(callback) == "undefined") var callback = null;
	if (typeof(easing) == "undefined") var easing = 'bounceout';
	
	$("#" + elementid).SwitchVertically(duration, callback, easing);
	
	return false;
}
function interfaceSlideToggleUp(elementid,duration,callback,easing){
	/*
	The element slides out/in of view into the given direction.
	duration (integer or string - mandatory) = the duration in milliseconds (or using ['slow' | 'normal' | 'fast']) of the effect.
	callback (function - optional) = callback function that will get fired once the effect is completed.
	easing (string - optional) = the name of the easing effect you want to use.
	*/
	if (typeof(callback) == "undefined") var callback = null;
	if (typeof(easing) == "undefined") var easing = 'bounceout';
	
	$("#" + elementid).SlideToggleUp(duration, callback, easing);
	
	return false;
}
function interfaceBlindToggleVertically(elementid,duration,callback,easing){
	/*
	An alternative for the default 'slideDown' fx from jQuery distribution.
	duration (integer or string - mandatory) = the duration in milliseconds (or using ['slow' | 'normal' | 'fast']) of the effect.
	callback (function - optional) = callback function that will get fired once the effect is completed.
	easing (string - optional) = the name of the easing effect you want to use.
	*/
	if (typeof(callback) == "undefined") var callback = null;
	if (typeof(easing) == "undefined") var easing = 'bounceout';
	
	$("#" + elementid).BlindToggleVertically(duration, callback, easing);
	
	return false;
}
function interfaceDropToggleUp(elementid,duration,callback,easing){
	/*
	The element disapears from its place by sliding to a direction and fades out.
	duration (integer or string - mandatory) = the duration in milliseconds (or using ['slow' | 'normal' | 'fast']) of the effect.
	callback (function - optional) = callback function that will get fired once the effect is completed.
	easing (string - optional) = the name of the easing effect you want to use.
	*/
	if (typeof(callback) == "undefined") var callback = null;
	if (typeof(easing) == "undefined") var easing = 'bounceout';
	
	$("#" + elementid).DropToggleUp(duration, callback, easing);
	
	return false;
}
function interfaceGrow(elementid,duration,callback,easing){
	/*
	Resizes the element from the its center to simulate a growing effect.
	duration (integer or string - mandatory) = the duration in milliseconds (or using ['slow' | 'normal' | 'fast']) of the effect.
	callback (function - optional) = callback function that will get fired once the effect is completed.
	easing (string - optional) = the name of the easing effect you want to use.
	*/
	if (typeof(callback) == "undefined") var callback = null;
	if (typeof(easing) == "undefined") var easing = 'bounceout';
	
	$("#" + elementid).Grow(duration, callback, easing);
	
	return false;
}
function interfaceShrink(elementid,duration,callback,easing){
	/*
	Resizes the element from the its center to simulate a shrinking effect.
	duration (integer or string - mandatory) = the duration in milliseconds (or using ['slow' | 'normal' | 'fast']) of the effect.
	callback (function - optional) = callback function that will get fired once the effect is completed.
	easing (string - optional) = the name of the easing effect you want to use.
	*/
	if (typeof(callback) == "undefined") var callback = null;
	if (typeof(easing) == "undefined") var easing = 'bounceout';
	
	$("#" + elementid).Shrink(duration, callback, easing);
	
	return false;
}
function interfacePuff(elementid,duration,callback,easing){
	/*
	A combination effect of 'Grow' and 'FadeOut'.
	duration (integer or string - mandatory) = the duration in milliseconds (or using ['slow' | 'normal' | 'fast']) of the effect.
	callback (function - optional) = callback function that will get fired once the effect is completed.
	easing (string - optional) = the name of the easing effect you want to use.
	*/
	if (typeof(callback) == "undefined") var callback = null;
	if (typeof(easing) == "undefined") var easing = 'bounceout';
	
	$("#" + elementid).Puff(duration, callback, easing);
	
	return false;
}
