

// referenced by tasks/index.php

popUpWidth = 600;
popUpHeight = 400;

function showComments(comments_url){
	popup = window.open(comments_url,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, width=425, height=335");
	popup.focus();
	popup.moveTo(10,10);	

}

function openWindow(caller, type){
	if(type=='category'){
		popup = window.open("createProject.php?caller=" +caller,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+popUpWidth+", height="+popUpHeight+"");
		popup.focus();
		popup.moveTo(tempX-200,tempY-50);	
		
	}
	else if(type=='project'){
		popup = window.open("modifyProject.php?caller="+caller,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+popUpWidth+", height="+popUpHeight+"");
		popup.focus();
		popup.moveTo(tempX-200,tempY-50);	
		
	}
	else{
		popup = window.open("modifyTask.php?caller="+caller,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+popUpWidth+", height="+popUpHeight+"");	
		popup.focus();
		popup.moveTo(tempX-200,tempY-50);			
	}
}

function add_reminder(){
	popup = window.open("input.php","popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=425, height=335");
	popup.focus();
	popup.moveTo(tempX-200,tempY-50);	
}

function add_reminder_from_cal(hour,minutes,date){
	popup = window.open("../reminders/input.php?hour="+hour+"&minutes="+minutes+"&date="+date,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=425, height=335");
	popup.focus();
	popup.moveTo(tempX-200,tempY-50);	
}

function edit_reminder(id){
	popup = window.open("edit.php?id="+id,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=425, height=335");
	popup.focus();
	popup.moveTo(tempX-200,tempY-50);	
}

function edit_reminder_from_cal(id){
	popup = window.open("../reminders/edit.php?id="+id,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=425, height=335");
	popup.focus();
	popup.moveTo(tempX-200,tempY-50);	
}

function add_reminder_for_date(whichDate){
	popup = window.open("../reminders/input.php?createfor="+whichDate,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=425, height=335");
	popup.focus();
	popup.moveTo(tempX-200,tempY-50);	
}


function launchUploadWindow(){
	popup = window.open("upload.php","popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+popUpWidth+", height="+popUpHeight+"");
	popup.focus();
	popup.moveTo(tempX-200,tempY-50);	
}


function showFileVaultHelp(width, height){
	popup = window.open("file_help.php","popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+width+", height="+height+"");
	popup.focus();
	popup.moveTo(tempX-200,tempY-50);	
}


function editLinkCategory(caller, type){
	if(type=='category'){
		popup = window.open("createLink.php?caller=" +caller,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+popUpWidth+", height="+popUpHeight+"");
		popup.focus();
		popup.moveTo(tempX-200,tempY-50);	
		
	}
	else if(type=='project'){
		popup = window.open("modifyProject.php?caller="+caller,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+popUpWidth+", height="+popUpHeight+"");
		popup.focus();
		popup.moveTo(tempX-200,tempY-50);	
	}
	else{
		popup = window.open("modifyTask.php?caller="+caller,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+popUpWidth+", height="+popUpHeight+"");	
		popup.focus();
		popup.moveTo(tempX-200,tempY-50);	
	}
}


function addLinkCategory(){
	popup = window.open("createCategory.php","popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+popUpWidth+", height="+popUpHeight+"");
	popup.focus();
	popup.moveTo(tempX-200,tempY-50);	
	
}



function modifyLink(caller){
	popup = window.open("modifyLink.php?caller="+caller,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+popUpWidth+", height="+popUpHeight+"");
	popup.focus();
	popup.moveTo(tempX-200,tempY-50);		
}




function getExtLink(extLink, winName){
	window.open(extLink,winName,"toolbar=yes, location=yes directories=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes, width=700, height=500");
//	window.open(extLink,winName,"copyhistory=yes, width=700, height=500");
}


/******** start TASKS functions ********/


function editTaskCategory(caller, type){
	if(type=='category'){
		popup = window.open("createTask.php?caller=" +caller,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=500, height=307");
		popup.focus();
		popup.moveTo(tempX-200,tempY-50);	
	}
	else if(type=='project'){
		popup = window.open("modifyProject.php?caller="+caller,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=500, height=307");
		popup.focus();
		popup.moveTo(tempX-200,tempY-50);	
	}
	else{
		popup = window.open("modifyTask.php?caller="+caller,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=500, height=307");	
		popup.focus();
		popup.moveTo(tempX-200,tempY-50);	
	}
}


function addTaskCategory(){
	popup = window.open("createCategory.php","popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=500, height=255");
	popup.focus();
	popup.moveTo(tempX-200,tempY-50);

}



function modifyTask(caller){
	popup = window.open("createSubTask.php?caller="+caller,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+popUpWidth+", height="+popUpHeight+"");
	popup.focus();
	popup.moveTo(tempX-200,tempY-50);
	
}

function modifySubTask(caller){
	popup = window.open("modifySubTask.php?caller="+caller,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+popUpWidth+", height="+popUpHeight+"");	
	popup.focus();
	popup.moveTo(tempX-200,tempY-50);
	
}

function markTaskComplete(id){
	popup = window.open("markTaskComplete.php?id="+id,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+popUpWidth+", height="+popUpHeight+"");	
	popup.focus();
	popup.moveTo(tempX-200,tempY-50);	
}

function markSubTaskComplete(id){
	popup = window.open("markSubTaskComplete.php?id="+id,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+popUpWidth+", height="+popUpHeight+"");	
	popup.focus();
	popup.moveTo(tempX-200,tempY-50);		
}


function deleteSubTask(id){
	popup = window.open("preDeleteSubTask.php?id="+id,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+popUpWidth+", height="+popUpHeight+"");
	popup.focus();
	popup.moveTo(tempX-200,tempY-50);
	
}

function deleteTask(id){
	popup = window.open("preDeleteTask.php?id="+id,"popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+popUpWidth+", height="+popUpHeight+"");
	popup.focus();
	popup.moveTo(tempX-200,tempY-50);
	
}






/********* end TASK functions *********/


// MM image swap functions


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/****************Find Mouse Coordinates**********************************/

//	<script language="JavaScript1.2">
<!-- Original:  CodeLifter.com (support@codelifter.com) -->
<!-- Web Site:  http://www.codelifter.com -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

var IE = document.all?true:false;

if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;

var tempX = 0;
var tempY = 0;

function getMouseXY(e) {

if (IE) { 
	tempX = event.clientX + document.body.scrollLeft;
	tempY = event.clientY + document.body.scrollTop;
}else {  
	tempX = e.pageX;
	tempY = e.pageY;
}  
if (tempX < 0){
	tempX = 0;
}
if (tempY < 0){
	tempY = 0;
}  

// document.Show.MouseX.value = tempX;
// document.Show.MouseY.value = tempY;
// return true;
}

