function setSelectedDate(strDate){	strDate = new String(strDate);		var today = new Date();	if(strDate != "" && strDate != "-1-"){								arrDateParts = strDate.split("-",strDate);		intDay = arrDateParts[2];									intMonth = arrDateParts[1];								intYear = arrDateParts[0];			}else{		intDay = today.getUTCDate();		intMonth = (today.getUTCMonth() + 1);		intYear = today.getFullYear();		}						document.getElementById('intYear').value = intYear;			document.getElementById('intMonth').value = (parseInt(intMonth) - 1);		document.getElementById('intDay').value = intDay;								document.getElementById('due_date').value = strDate;}function deleteTrashedBlok(f){	// Make sure atleast 1 checkbox is checked.	var oDelete = document.getElementsByName("delete_id[]");		if(oDelete.length){		var oneChecked = false;				for(var i = 0; i < oDelete.length; i++){			if(oDelete[i].checked == true){				oneChecked = true;			}		}	}else{		oneChecked = oDelete.checked;	}		if(oneChecked == false){		alert("Please check atleast one Block for deletion before submitting.");		return;	}	if(confirm("Are you sure you want to PERMANENTLY delete the selected Block(s) from the trash?\nThis cannot be undone!")){		f.g_do.value = 'deleteSelectedTrashBloks';		f.submit();	}}function emptyTrash(appendToUrl){	if(confirm("Are you sure you want to PERMANENTLY empty the trash can?\nThis cannot be undone.")){		window.location.href = "/index.php?req_work_type=chooseblok&g_do=emptyTrash&" +  appendToUrl;	}}function restoreBlok(id, numReferences, appendToUrl){	if(numReferences > 0){		if(confirm("Are you sure you want to restore this Block from the trash?\nThis Block is a referenced Block.\nBy restoring this Block you will actually be restoring a total of " + numReferences + " Blocks throughout the site!\nAll Bloks in place where this Blok restores to will be moved to the trash.")){			window.location.href = "/index.php?req_work_type=chooseblok&g_do=restore_blok&restore_id=" + id + appendToUrl;		}	}else{		if(confirm("Are you sure you want to restore this Block from the trash?\nThe Blok in place where this Blok restores to will be moved to the trash.")){			window.location.href = "/index.php?req_work_type=chooseblok&g_do=restore_blok&restore_id=" + id + "&" +  appendToUrl;		}	}}	function showFloater(strFloaterId){	floater = document.getElementById(strFloaterId);		if(floater){		if(document.body && document.body.scrollHeight){			floater.style.top = document.body.scrollTop + 75			floater.style.left = document.body.scrollLeft + (261 / 2);	// 261 is the width of the floater.						floater.style.top = parseInt(floater.style.top) < 0 ? 0 : floater.style.top;			floater.style.left = parseInt(floater.style.left) < 0 ? 0 : floater.style.left;		}				floater.style.display="block";	}}function trashBlok(f, numReferences){	if(numReferences > 0){		if(confirm("Are you sure you want to delete this Block?\nThis Block is a referenced Block.\nBy deleting this Block you will actually be deleting a total of " + numReferences + " Blocks throughout the site!")){			f.g_do.value = 'moveBlokToTrash';			f.submit();		}	}else{		if(confirm("Are you sure you want to delete this Block?")){			f.g_do.value = 'moveBlokToTrash';			f.submit();		}	}}	function passBackBrowserItem(intBrowseItemId, strHiddenFieldId, strDisplayFieldId, strPath){	// This function is used with the library browser. Do not delete.		// Set the value of the hidden field.	window.opener.document.getElementById(strHiddenFieldId).value = intBrowseItemId;		// Set the value of the display field:	window.opener.document.getElementById(strDisplayFieldId).innerHTML = strPath + "&nbsp;&nbsp;<a href=\"#\" onclick=\"clearLibBrowserData('" + strHiddenFieldId + "','" + strDisplayFieldId + "')\">[Cancel]</a>";}function clearLibBrowserData(strHiddenFieldId, strDisplayFieldId){	// This function is used with the library browser. Do not delete.		document.getElementById(strHiddenFieldId).value = "";	document.getElementById(strDisplayFieldId).innerHTML = "";}function swapImage(use_image, over){	if(document.images){		var oImg = document.images[use_image];		var suffix = "";				if(String(oImg) != "undefined"){			if(swapImage.arguments.length > 2){				 new_src = swapImage.arguments[2];			}else{				new_src = String(oImg.src);												if(over){					path = new_src.slice(0, -4);					ext = new_src.slice(path.length);					new_src = path + "_over" + ext;				}else{					path = new_src.slice(0, -9);					ext = new_src.slice(path.length + 5);					new_src = path + ext;				}										}						oImg.src = new_src;		}	}}	// end swapImagefunction toggleVis(id){	var element = document.getElementById(id);	if(element.style.display == "none"){		element.style.display = "block";	} else {		element.style.display = "none"	}}	// end toggleVisfunction toggledateblock(enable) {	if(String(document.f.rel_year) != "undefined"){		if(enable) {			document.f.rel_year.disabled = false;			document.f.rel_day.disabled = false;			document.f.rel_month.disabled = false;			document.f.rel_time_hour.disabled = false;			document.f.rel_time_min.disabled = false;			toggled = false;		}else{			document.f.rel_year.disabled = true;			document.f.rel_day.disabled = true;			document.f.rel_month.disabled = true;			document.f.rel_time_hour.disabled = true;			document.f.rel_time_min.disabled = true;			toggled = true;		}		}}	// end toggledateblock// -------------------------------------// MM Functions// -------------------------------------function MM_preloadImages() { //v3.0  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}// Drag functionsvar ie=document.all;var ns6=document.getElementById&&!document.all;var dragapproved=false;var z,x,y;function move(e){ 	if (dragapproved) { 		newX = ns6? temp1+e.clientX-x: temp1+(event.clientX-x);		newY = ns6? temp2+e.clientY-y : temp2+(event.clientY-y);		z.style.left = newX;		z.style.top = newY;		return false;	}}function drags(e){ 	if (!ie&&!ns6) {		return;	}		var firedobj=ns6? e.target : event.srcElement;	var topelement=ns6? "HTML" : "BODY";	while (firedobj.tagName != topelement && firedobj.className != "drag" && firedobj.className != "nodrag"){ 		firedobj=ns6? firedobj.parentNode : firedobj.parentElement;	}	if (firedobj.className == "drag") { 		// jason's edit for zindex		draglist = document.getElementsByTagName("div");		draglistsize = draglist.length;				for (i=0; i < draglistsize; i++) {			if (draglist[i].className == "drag") {				draglist[i].style.zIndex = '5';			}		}		firedobj.style.zIndex = '10';		// end edit				dragapproved = true;		z = firedobj; 		temp1 = parseInt(z.style.left);		temp2 = parseInt(z.style.top);		x = ns6? e.clientX: event.clientX;		y = ns6? e.clientY: event.clientY;		document.onmousemove=move;		return false;	}}function elRelease() {	dragapproved = false;	//alert(temp1);	//alert(windowWidth + "x" + windowHeight)	//alert("The DIV's current location " + z.style.left + ' left, ' + z.style.top + ' top')}document.onmousedown=drags;//document.onmouseup=new Function("dragapproved=false");document.onmouseup=elRelease;