//******************************************************************************//
//*                                                                            *//
//*        COPYRIGHT(C)2008 LEVELTEN WEBSITES(R), ALL RIGHTS RESERVED.         *//
//*                                                                            *//
//*  The contents of this file may not be copied, modified or distributed (in  *//
//*  whole or in part) without the express prior written permission of         *//
//*  LevelTen Websites. Violation of this copyright may lead to prosecution    *//
//*  to the fullest extent of local and international law.                     *//
//*                                                                            *//
//*  To clarify whether your usage of this file may violate its copyright, or  *//
//*  for licencing enquiries, please contact LevelTen Websites.                *//
//*                                                                            *//
//*     MMX:.dXMMMMNk.'0MMMM                                                   *//
//*     NlckWMMMMMMMMWx.oMMM   LevelTen Websites(R)                            *//
//*     ;KMMMMMMMMMMMMMc KMM   Mijnsherenlaan 112c                             *//
//*     NMMMMOllWMMMMMMWxWMM   3081 CH Rotterdam                               *//
//*     MMMW,  xMMMMMMMMMMMM   Phone: +31(0)10 48 66 291                       *//
//*     MMMk ckWMMMMMMMKWMMM   Fax: +31(0)84 73 86 205                         *//
//*     MMMK 0MMMMMMMMNk:.',   Website: http://www.levelten.nl                 *//
//*     MMMM0lKMMMMMMMMMNXNM   E-mail: info@levelten.nl                        *//
//*     MMMMMMOKMMMMMMMMMMMM                                                   *//
//*                                                                            *//
//*               WE THANK YOU FOR CHOOSING LEVELTEN WEBSITES!                 *//
//*                                                                            *//
//******************************************************************************//

var XclientWidth=0, XclientHeight=0, XscrollLeft=0, XscrollTop=0, XbodyWidth=0, XbodyHeight=0;

//Browser detection variables
var os, browser, version, tmpstr, detect = navigator.userAgent.toLowerCase(); 
function CheckBrowser(string){ place = detect.indexOf(string) + 1; tmpstr = string; return place; } if(CheckBrowser('konqueror')){ browser = "Konqueror"; os = "Linux"; }else if (CheckBrowser('safari')){ browser = "Safari"; }else if (CheckBrowser('omniweb')){ browser = "OmniWeb"; }else if (CheckBrowser('opera')){ browser = "Opera"; }else if (CheckBrowser('webtv')){ browser = "WebTV"; }else if (CheckBrowser('icab')){ browser = "iCab"; }else if (CheckBrowser('msie')){ browser = "Internet Explorer"; }else if (!CheckBrowser('compatible')){browser = "Mozilla"; version = detect.charAt(8); }else{ browser = "Unknown browser"; }if (!version) version = detect.charAt(place + tmpstr.length); if (!os){ if (CheckBrowser('linux')) os = "Linux"; else if (CheckBrowser('x11')) os = "Unix"; else if (CheckBrowser('mac')) os = "Mac"; else if (CheckBrowser('win')) os = "Windows"; else os = "Unknown operating system"; }

function XgetDimensions(){
	XclientWidth=0, XclientHeight=0, XscrollLeft=0, XscrollTop=0, XbodyWidth=0, XbodyHeight=0;
	XbodyWidth = document.body.offsetWidth;
	XbodyHeight = document.body.offsetHeight; 
	
	if(typeof(window.innerWidth)=='number'){
		XclientWidth = window.innerWidth;
		XclientHeight = window.innerHeight;
	}else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight )){
		XclientWidth = document.documentElement.clientWidth;
		XclientHeight = document.documentElement.clientHeight;
	}else if(document.body && (document.body.clientWidth || document.body.clientHeight )){
		XclientWidth = document.body.clientWidth;
		XclientHeight = document.body.clientHeight;
	}
	if(typeof(window.pageYOffset)=='number'){
		XscrollTop = window.pageYOffset;
		XscrollLeft = window.pageXOffset;
	}else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)){
		XscrollTop = document.documentElement.scrollTop;
		XscrollLeft = document.documentElement.scrollLeft;
	}else if(document.body && (document.body.scrollLeft || document.body.scrollTop)){
		XscrollTop = document.body.scrollTop;
		XscrollLeft = document.body.scrollLeft;
	}
}

function resizeIframe(frameid){
	XgetDimensions();
	parent.document.getElementById(frameid).height = XbodyHeight+'px';
}

function ajax(url,f){
	var aboj = new sack();
	aboj.requestFile = url
	aboj.onCompletion = function(){ 
		var result=aboj.response; 
		eval(f);
	};
	aboj.runAjax();
}

function getlist(lst){
	var str ="";
	for(var i=0;i<lst.options.length;i++){
		if(lst.options[i].selected)
			str+=lst.options[i].value+",";
	}
	return str.substr(0,str.length-1);
}

function setlist(lst, selected){
	selected = selected.split(",");
	for(var l=0;l<lst.options.length;l++)
		lst.options[l].selected=false;
	for(var i=0;i<selected.length;i++){
		for(var l=0;l<lst.options.length;l++){
			if(lst.options[l].value==selected[i])
				lst.options[l].selected=true;
		}
	}
}

function positionIFrame(divid, frmid){
	if(browser=="Internet Explorer"){
		var div = document.getElementById(divid);
		var frm = document.getElementById(frmid);
		frm.style.left = div.style.left;
		frm.style.top = div.style.top;
		frm.style.height = div.offsetHeight;
		frm.style.width = div.offsetWidth;
		frm.style.display = "block";	
	}
}

function el(id){
	return document.getElementById(id);
}

function job_details(id, state){
	trvisable("job_btn_"+id+"A", !state);
	trvisable("job_btn_"+id+"B", state);
	trvisable("job_desc_"+id, state)
}

function trvisable(id, state){
	if(state){
		if(parseFloat(navigator.appVersion.split("MSIE")[1]))
			document.getElementById(id).style.display="inline";
		else
			document.getElementById(id).style.display="table-row";
	}else{
		document.getElementById(id).style.display="none";
	}
}

