// javascript
function delete_record(module,id) {
    var answer = confirm ("Are you sure you want to delete ID: " + id);
    if (answer) {
	window.location = "index.php?action=" + module + "_delete&id=" + id;
    }
}

function delete_member(module,id) {
	var msg = "Warning: This will also remove all underlying payment history that are associated with this member.";
    var answer = confirm ("Are you sure you want to delete ID: " + id + "\n" + msg);
    if (answer) {
	window.location = "index.php?action=" + module + "_delete&mid=" + id;
    }
}

function delete_member_item(module,id,mid) {
    var answer = confirm ("Are you sure you want to delete member subitem ID: " + id + "\n");
    if (answer) {
	window.location = "index.php?action=" + module + "_item_delete&id=" + id + "&mid=" + mid;
    }
}


function undelete_record(id) {
    var answer = confirm ("Are you sure you want to undelete ID: " + id);
    if (answer) {
	window.location=module+"_undelete.php?id="+id;
    }
}

function delete_group(module,id,sector) {
	var msg = "Warning: This will remove all symbols that are under this sector.";
    var answer = confirm ("Are you sure you want to delete ID: " + id + "\n" + msg);
    if (answer) {
			window.location = "index.php?action=" + module + "_delete&id=" + id + "&sector=" + sector;
	}
}

function delete_stockpick(module,id) {
	var msg = "Warning: This will also remove all 200 symbols that are under this stockpick.";
    var answer = confirm ("Are you sure you want to delete ID: " + id + "\n" + msg);
    if (answer) {
			window.location = "index.php?action=" + module + "_delete&id=" + id;
	}
}

function delete_stock_pick_portfolio_summary(module, id) {
	var msg = "Warning: This will remove all items that are under this portfolio summary.";
	var answer = confirm ("Are you sure you want to delete SUMMARYID: " + id + "\n" + msg);
    if (answer) {
		window.location = "index.php?action=" + module + "_delete&id=" + id;
    }
}

function delete_stock_pick_portfolio_summary_items(module, spid, id) {
	
	var answer = confirm ("Are you sure you want to delete ID: " + id);
    if (answer) {
		window.location = "index.php?action=" + module + "_items_delete&id=" + id + "&spid=" + spid;
    }
}

function delete_stockalert(module,id) {
	var msg = "Warning: This will also remove all underlying symbols that are under this stockalert.";
    var answer = confirm ("Are you sure you want to delete ID: " + id + "\n" + msg);
    if (answer) {
			window.location = "index.php?action=" + module + "_delete&id=" + id;
	}
}

function delete_stockalert_item(module,id,sa_id) {
    var answer = confirm ("Are you sure you want to delete sector report item ID: " + id + "\n");
    if (answer) {
			window.location = "index.php?action=" + module + "_item_delete&id=" + id + "&sa_id=" + sa_id;
	}
}


function delete_newsletter(module,id) {
	var msg = "Warning: This will also remove all underlying items that are under this sector report.";
    var answer = confirm ("Are you sure you want to delete ID: " + id + "\n" + msg);
    if (answer) {
			window.location = "index.php?action=" + module + "_delete&id=" + id;
	}
}



function delete_report(module,id) {
	var msg = "Warning: This will also remove all underlying items that are under this sector report.";
    var answer = confirm ("Are you sure you want to delete ID: " + id + "\n" + msg);
    if (answer) {
			window.location = "index.php?action=" + module + "_delete&id=" + id;
	}
}

function delete_sector_report_item(module,id,srid) {
    var answer = confirm ("Are you sure you want to delete sector report item ID: " + id + "\n");
    if (answer) {
			window.location = "index.php?action=" + module + "_item_delete&id=" + id + "&srid=" + srid;
	}
}

var win=null;
function openWindow(mypage,myname,w,h,scroll){
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	var settings ='height='+h+',';
	settings +='width='+w+',';
	settings +='top='+wint+',';
	settings +='left='+winl+',';
	settings +='scrollbars='+scroll+',';
	settings +='resizable=no';
	win=window.open(mypage,myname,settings);
	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function update_stockpick_history(id) {
	window.location = "index.php?action=update&id=" + id;
}

function update_stockpick_portfolio(id) {
	window.location = "index.php?action=update&id=" + id;
}

function calc_stockpick_portfolio(id) {
	window.location = "index.php?action=calc&id=" + id;
}


function delete_stockpick_portfolio(id) {
	if(confirm("Delete this Stock Pick Portfolio?"))
	{
		window.location = "index.php?action=delete&id=" + id;
	}
}




function delete_stockpick_history(id) {
	if(confirm("Delete this Stock Pick?"))
	{
		window.location = "index.php?action=delete&id=" + id;
	}
}


function update_change_value(id) {
	window.location = "index.php?action=update&id=" + id;
}

function delete_change_value(id) {
	if(confirm("Delete this Value?"))
	{
		window.location = "index.php?action=delete&id=" + id;
	}
}